-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI_methodsExamples.py
More file actions
85 lines (70 loc) · 2.26 KB
/
API_methodsExamples.py
File metadata and controls
85 lines (70 loc) · 2.26 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
from __future__ import print_function
import time
from usersData import apiGetUsers
import swagger_client
import requests
from swagger_client.rest import ApiException
from pprint import pprint
from requests.auth import HTTPBasicAuth
# Getting the access token
url = 'https://wso2-gw.ua.pt/token?grant_type=client_credentials&state=123&scope=openid'
header = {'Content-Type': 'application/x-www-form-urlencoded'}
x = requests.post(url,headers=header,auth=HTTPBasicAuth('XXXXXXX','XXXXXXXXX'))
resp = x.json()
# Configure OAuth2 access token for authorization
swagger_client.configuration.access_token = resp["access_token"]
# create an instance of the API class
api_instance = swagger_client.DefaultApi()
try:
#
# **GET** /AccessPoint
#
#api_response = api_instance.access_point_get(first_result=0)
#pprint(api_response)
#
# **GET** /AccessPoint/Count
#
#api_response = api_instance.access_point_count_get()
#pprint(api_response)
#
# **GET** /AccessPoint/{id}
#
#api_response = api_instance.access_point_id_get(10055296)
#pprint(api_response)
#
# **GET** /AccessPoint/{name}/DeviceTypeCount
#
api_response = api_instance.access_point_name_device_type_count_get("biblioteca-ap11")
pprint(api_response)
#
# **GET** /AccessPoint/{name}/TotalUsernames
#
#api_response = api_instance.access_point_name_total_usernames_get("estga-sap14.core.ua.pt")
#pprint(api_response)
#
# **GET** /Building
#
#api_response = api_instance.building_get()
#pprint(api_response)
#
# **GET** /NetworkMetric/{building}
#
#api_response = api_instance.network_metric_building_get("IT", "rx")
#pprint(api_response)
#
# **GET** /RogueAccessPointAlarm/Count
#
#api_response = api_instance.rogue_access_point_alarm_count_get()
#pprint(api_response)
#
# **GET** /RogueAccessPointAlarm
#
#api_response = api_instance.rogue_access_point_alarm_get()
#pprint(api_response)
#
# **GET** /RogueAccessPointAlarm/{id}
#
#api_response = api_instance.rogue_access_point_alarm_id_get(2909414704)
#pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->access_point_count_get: %s\n" % e)