Scope-Independent Labels
These labels are not tied to a particular root scope and apply to all scopes on the appliance.
Get Inventory Label
These endpoints return scope independent labels for an IPv4/IPv6 address or subnet on the Secure Workload appliance. The address or subnet that is used to query this endpoint must exactly match the one used for uploading labels.
GET /openapi/v1/si_inventory/tags?ip={IPorSubnet}
Parameters: The request URL contains the following parameters.
Name |
Type |
Description |
---|---|---|
IPorSubnet |
string |
IPv4/IPv6 address or subnet. |
Response object:
Name |
Type |
Description |
---|---|---|
attributes |
JSON |
Key or value map for labeling matching flows and inventory items |
Sample python code
restclient.get('/si_inventory/tags', params={'ip': '10.1.1.1/24'})
Search Inventory Label
This endpoint allows for searching labels for an IPv4/IPv6 address or subnet on the Secure Workload appliance.
GET /openapi/v1/si_inventory/tags/search?ip={IPorSubnet}
Parameters: The request URL contains the following parameters
Name |
Type |
Description |
---|---|---|
IPorSubnet |
string |
IPv4/IPv6 address or subnet. |
Response object: This API returns a list of objects of the following format
Name |
Type |
Description |
---|---|---|
key |
string |
IPv4/IPv6 address or subnet. |
updatedAt |
integer |
Unix timestamp of when the labels were updated. |
value |
JSON |
Key or value map of attributes for the key. |
Sample python code
restclient.get('/si_inventory/tags/search', params={'ip': '10.1.1.1/24'})
Set Inventory Label
This endpoint is used to set labels for labeling flows and inventory items on the Secure Workload appliance.
POST /openapi/v1/si_inventory/tags
Parameters: The JSON query body contains the following keys
Name |
Type |
Description |
---|---|---|
ip |
string |
IPv4/IPv6 address or subnet. |
attributes |
JSON |
Key or value map for labeling matching flows and inventory items. |
Response object:
Name |
Type |
Description |
---|---|---|
warnings |
JSON |
Key or value map containing warnings that are encountered while setting labels. |
Sample python code
req_payload = {'ip': '10.1.1.1/24', 'attributes': {'datacenter': 'SJC', 'location': 'CA'}}
restclient.post('/si_inventory/tags', json_body=json.dumps(req_payload))
Delete Inventory Label
This endpoint deletes labels for an IPv4/IPv6 address or subnet on the Secure Workload appliance.
DELETE /openapi/v1/si_inventory/tags
Parameters: The JSON query body contains the following keys
Name |
Type |
Description |
---|---|---|
ip |
string |
IPv4/IPv6 address or subnet |
Sample python code
req_payload = {'ip': '10.1.1.1/24'}
restclient.delete('/si_inventory/tags, json_body=json.dumps(req_payload))
Get List of Labeled Facets
This endpoint returns a list of scope-independent labeled facets on the Secure Workload appliance. Labeled facets are a subset of column headers that are used for annotating flows and inventory items across all scopes.
|
Exclude the scope name from the request url to view and update the list of annotated scope-independent facets. |
GET /openapi/v1/assets/cmdb/annotations
Response object: An array of scope-independent labeled facets.
Sample python code
resp = restclient.get('/assets/cmdb/annotations')
Update List of Labeled Facets
This endpoint updates list of scope-independent facets that are used for annotating flows and inventory items on the Secure Workload appliance.
PUT /openapi/v1/assets/cmdb/annotations
Response object: None
Sample python code
# the following list is a subset of column headers in the
# uploaded CSV file
req_payload = ['location', 'region', 'detail']
restclient.put('/assets/cmdb/annotations',
json_body=json.dumps(req_payload))