This repository was archived by the owner on Aug 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathexample.py
More file actions
45 lines (36 loc) · 1.35 KB
/
example.py
File metadata and controls
45 lines (36 loc) · 1.35 KB
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
35
36
37
38
39
40
41
42
43
44
45
# from sunrise6g_opensdk import Sdk as sdkclient # For PyPI users
from sunrise6g_opensdk.common.sdk import Sdk as sdkclient # For developers
def main():
# The module that imports the SDK package, must specify which adapters will be used:
adapter_specs = {
"edgecloud": {
"client_name": "kubernetes",
"base_url": "http://IP:PORT",
},
"network": {
"client_name": "open5gs",
"base_url": "http://IP:PORT",
"scs_as_id": "id_example",
},
}
adapters = sdkclient.create_adapters_from(adapter_specs)
edgecloud_client = adapters.get("edgecloud")
network_client = adapters.get("network")
print("EdgeCloud client ready to be used:", edgecloud_client)
print("Network client ready to be used:", network_client)
# Examples:
# EdgeCloud
# print("Testing edgecloud client function: get_edge_cloud_zones:")
# zones_list = edgecloud_client.get_edge_cloud_zones()
# print(zones_list)
# print(zones_list.status_code)
# print(zones_list.json())
# Pretty print:
# import json
# zones = zones.json()
# print(json.dumps(zones, indent=2))
# Network
# print("Testing network client function: 'get_qod_session'")
# network_client.get_qod_session(session_id="example_session_id")
if __name__ == "__main__":
main()