-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.py
32 lines (26 loc) · 1.27 KB
/
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
import pxcloud_api_client
from pprint import pprint
from pxcloud_api_client.api import compliance_api
from auth import Env
# Configuring the environment to either prod or sandbox along with the appropriate Client ID and client Secret
env_info = Env('sandbox', 'YOUR_CLIENT_ID', 'YOUR_CLIENT_SECRET')
configuration = pxcloud_api_client.Configuration(
host = env_info.host
)
configuration.access_token = env_info.get_token()
# Enter a context with an instance of the API client
with pxcloud_api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = compliance_api.ComplianceApi(api_client)
success_track_id = "successTrackId_example" # str |
source_system_id = "sourceSystemId_example" # str |
customer_id = "customerId_example" # str |
asset_id = "assetId_example" # str |
offset = 1 # int | (optional) (default to 1)
max = 10 # int | (optional) (default to 10)
try:
# Get the violations of the asset
api_response = api_instance.asset_violations(success_track_id, source_system_id, customer_id, asset_id, offset=offset, max=max)
pprint(api_response)
except pxcloud_api_client.ApiException as e:
print("Exception when calling ComplianceApi->asset_violations: %s\n" % e)