SysOrb Network Monitoring System Administrator's Guide: For version 4.6.0 | ||
---|---|---|
Prev | Chapter 14. WebAPI |
In general, requests that require authentication can be authenticated simply by providing the username, password and domain using Basic HTTP authentication. Since the publicly available protocol is provided only over HTTPS the username/password combination is never transmitted in clear text.
All requests against the WebAPI must be authenticated (either by means of an access token or a real username/password/domain).
Creates a new valid access token.
User name, password and domain name separated by a single colon (":") should be encoded in Base64 and provided in the 'authorization' header
Reply
If user authenticated successfully return status code 200 Ok and a document with user domain, user id and access token.
Returns a list of domains under the given domain.
Reply
The reply is a document with the list of domains including object id, version and tree label.
Returns a list of domains under the given domain with their statusInfo objects.
Reply
Return a list of objects in alert/warning/downtime state.
Reply
Example 14-32. Reply body schema
element alertlist { element alerts { element domain { element id { text } & element label { text } & element comment { text } ? & element infourl { text } ? & element node { element id { text } & element label { text } & element comment { text } ? & element infourl { text } ? & element status { text } ? & element check { element id { text } & element label { text } & element comment { text } ? & element infourl { text } ? & element status { text } }* }* }* } & element warnings { element domain { element id { text } & element label { text } & element comment { text } ? & element infourl { text } ? & element node { element id { text } & element label { text } & element comment { text } ? & element infourl { text } ? & element status { text } ? & element check { element id { text } & element label { text } & element comment { text } ? & element infourl { text } ? & element status { text } }* }* }* } & element downtime { element domain { element id { text } & element label { text } & element comment { text } ? & element infourl { text } ? & element node { element id { text } & element label { text } & element comment { text } ? & element infourl { text } ? & element status { text } ? & element check { element id { text } & element label { text } & element comment { text } ? & element infourl { text } ? & element status { text } }* }* }* } }
Create a domain under the given domain.
Request
Example 14-34. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The URI to the created domain is returned in the location header and version in the content-version header of a successful 201 response.
Update properties of a given domain.
Request
Version of the domain to update should be provided in the content-version header of a request.
Example 14-35. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The new version of the updated domain is returned in the content-version header of a successful 200 response.
Delete domain with given id.
Request
Version of the domain should be provided in the content-version header.
Reply
Returns 200 OK on success.
Returns a list of nodes under the given domain with their <class_name> object.
Possible values are: statusinfo, scoreinfo, summary.
Reply
Example 14-37. Reply body schema
element nodes { element object { element class { test } & element id { text } & element version { text } & element treelabel { text } & element infourl { text } & element object { element class { text } & element property { element name { text } & element value { text } }* } }* }
Create a node under the given domain.
Request
Example 14-39. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The URI to the created node is returned in the location header and version in the content-version header of a successful 201 response.
Update properties of a given node.
Request
Version of the node to update should be provided in the content-version header of a request.
Example 14-40. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The new version of the updated node is returned in the content-version header of a successful 200 response.
Delete node with given id.
Request
Version of the node should be provided in the content-version header.
Reply
Returns 200 OK on success.
Returns a list of parent objects of the given object beginning from the root.
Reply
Returns a list of properties of the scoreInfo object.
Note: request is applicable for node and check objects.
Reply
Returns a list of properties of the statusInfo object.
Note: request is applicable for domain and node objects.
Reply
Returns a list of properties of the nodeSummary object.
Note: request is applicable for node objects.
Reply
Each node has a tree of CheckGroup and Check objects, and Checks are the leafs of the tree.
To request properties of any object use GET /object/ API call, to navigate through the tree use the following method.
Returns a list of children checkgroup/check/check template objects under the given object (node or checkgroup).
Reply
Example 14-46. Reply body schema
element objects { element object { element class { text } & element id { text } & element version { text} & element treelabel { text } & element siblingname { text } ? & element active { bool } ? }* }
Note 2: Optional element <siblingName> valid only for check templates.
In case of check template element class will be CheckTemplate.
Returns a properties of checkSummary object of the given check.
Reply
Returns a number of timeseries of a given check for a period of time.
Request
Example 14-48. Request body schema
element timeseries { element timestart { timestamp } & element timeend { timestamp } & element limit { integer } & element offset { integer } }
Depends on check type.
Example 14-49. Reply body schema for Uptime, Accumulation, Continuous
element timeseries { element type { text } & element datainterval { element timestart { timestamp } & element timeend { timestamp } & element ngood { integer } & element nbad { integer } & element min { float } & element avg { float } & element max { float } }* }
Returns a list of active checks for a given node, filtered by <filter>
Filter:
filter = "type=" type ["&status=" status]
type = "all" | "netchecks" | "agentchecks" | "snmpchecks" | "esxichecks"
status = "alert" | "warn"
If <status> is not present, return all active checks with checksummary object, otherwise return all active checks with <status> and their scoreinfo objects.
Reply
Example 14-52. Reply body schema
element checks { element object { element class { text } & element id { text } & element version { text } & element treelabel { text } & element group { text } & element checksummary { element class { text } & element property { element name { text } & element value { text } }* } }* }
Return all active netchecks for node 1.123456:
GET /checks/1.123456/type=netchecks
Example 14-53. Reply body schema
element checks { element object { element class { text } & element id { text } & element version { text } & element treelabel { text } & element group { text } & element checksummary { element class { text } & element property { element name { text } & element value { text } }* } }* }
Return all active netchecks for node 1.123456 that is in the alert status:
GET /checks/1.123456/type=netchecks&status=alert
Example 14-54. Reply body schema
element checks { element object { element class { text } & element id { text } & element version { text } & element treelabel { text } & element group { text } & element scoreinfo { element class { text } & element property { element name { text } & element value { text } }* } }* }
Returns a list of properties that can be filled in order to create/update check.
If parameter <siblingname> is not present, return editable properties of the check.
Otherwise return editable properties of the check template with given siblingName.
Reply
Create a new check under given parent id using template <siblingname>.
Valid only for objects of class CheckTemplate (see method GET /subtree)
Request
Example 14-56. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The URI to the created check is returned in the location header and version in the content-version header of a successful 201 response.
Update a check with given properties
Request
Version of the check should be provided in the content-version header.
Example 14-57. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The new version of the updated check is returned in the content-version header of a successful 200 response.
Delete the check with given id (for netchecks) or make it inactive (for others).
Request
Version of the check should be provided in the content-version header.
Reply
If the check was made inactive the new version is returned in the content-version header of a successful 202 response.
Create a new user under given domain.
Request
Example 14-60. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The URI to the created user is returned in the location header and version in the content-version header of a successful 201 response.
Update a user with given properties
Request
Version of the user should be provided in the content-version header.
Example 14-61. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The new version of the updated user is returned in the content-version header of a successful 200 response.
Delete the user with given id.
Request
Version of the user should be provided in the content-version header.
Reply
Returns 200 OK on success.
Create a new alertpath under the given user.
Request
Example 14-65. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The URI to the created alertpath is returned in the location header and version in the content-version header of a successful 201 response.
Update alertpath with given properties
Request
Version of the alertpath should be provided in the content-version header.
Example 14-66. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The new version of the updated alertpath is returned in the content-version header of a successful 200 response.
Delete the alertpath with given id.
Request
Version of the user should be provided in the content-version header.
Reply
Returns 200 OK on success.
Returns a list of alertgroups under the given domain.
Reply
Create a new alertgroup under given domain.
Request
Example 14-69. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The URI to the created alertgroup is returned in the location header and version in the content-version header of a successful 201 response.
Update a alertgroup with given properties
Request
Version of the alertgroup should be provided in the content-version header.
Example 14-70. Request body schema
element class { text } & element property { element name { text } & element value { text } }*
The new version of the updated alertgroup is returned in the content-version header of a successful 200 response.
Delete the alertgroup with given id.
Request
Version of the alertgroup should be provided in the content-version header.
Reply
Returns 200 OK on success.