Metadata as included in the network list (INVENTORY/NETWORKS/List) can be retrieved via the REST API using the networks resource.
Retrieving the full network list
GET ot-base/api/v1/networks
retrieves all entries in the network list.
Data sample:
Note that the output is paged in order to prevent client overflow. The info element at the end of the output will inform you about the total number of entries, and the offset for the next page:
You can then use the offset value for the next call, which is specified as follows:
GET ot-base/api/v1/networks/?offset=300
Retrieving metadata for a particular network
GET ot-base/api/v1/networks/{networkId}
retrieves metadata for the network that is identified as a sub-resource.
Note that network IDs are auto-generated by OT-BASE and cannot be changed by the user.
Updating network metadata
You can update metadata for a particular network by using a POST request that references the network by its network ID. For example, if the network name of a network with the network ID of "NW.55" shall be set to "My new network name", use the following POST command:
POST ot-base/api/v1/networks/NW.55
with the following content in the body:
{"name": "My new network name"}
Note that the network ID always starts with "NW." and is case sensitive.
The following metadata can be updated via the REST API:
- name
- group
- description.
Comments
0 comments
Please sign in to leave a comment.