-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
34 lines (27 loc) · 952 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
""" Example for the usage of the UII python API package """
import uiipythonapi as uii
api = uii.Client("token here")
packageList, err = api.read_package_list("debian", "10", "x86_64")
print("Number of known packages for Debian 10: " + str(len(packageList)))
def dhcp_network():
""" Example of how to define a dynamic network """
return {
"dhcp": True,
"nointernet": False,
}
def static_network(domain: str = "",
ip_net: str = "",
gateway: str = "",
dns: str = "",
no_internet: bool = False):
""" Example of how to define a static network """
return {
"dhcp": False,
"domain": domain,
"ipnet": ip_net,
"gateway": gateway,
"dns": dns,
"nointernet": no_internet,
}
ERROR = api.build("debian10.iso", "debian", "10", "x86_64", "horst", [dhcp_network()])
print("Errors: " + str(ERROR))