The Foglight REST API is an application programming interface (API) that uses HTTP requests to GET, PUT, POST, and DELETE data.
This section is intended for users who have been assigned the API Access and the Administrator roles and who need programmatic access to easily create professional services and better integrate with third-party systems.
This section covers the following key areas:
The following table explains the token that protects the access to REST APIs and is used as the request header for REST APIs.
Glossary
| Glossary | Description |
|---|---|
| Auth-Token | An authentication token used as a request header for REST APIs, which protects the access to the REST APIs. An Auth-Token can be created for a user in the ‘Users & Security’ dashboard. |
| Access-Token | A short lived token to authenticate a user that is created by invoking the ‘Security - Login’ API. |
REST APIs are protected by authentications, which means you need retrieve an access token before using REST APIs. The authentications protecting REST APIs include the following two approaches:
Use the Security - Login API to retrieve an access token through user credentials or an authToken, then include this access token in an HTTP request header to operate with REST APIs.
The following table lists the registry variables available after installing the Forge-RestAPI cartridge:
Available registry variables
| Registry variable name | Type | Description |
|---|---|---|
| REST_Audit_Enable | Boolean | Specifies whether the audit feature is enabled in the REST API. Enable is set by default. The audit logs can be found in the Audit dashboard. |
| REST_Audit_Filter | String | If the resource name is specified using this variable, audit logs of specified resources cannot be found in the Audit dashboard and the audit feature is disabled. - Separate multiple resource names with a comma. - Regular expression is also supported. The resource name is the part following “api” in the URL address. For example, for the URL address is https://<server>:<port>/api/v1/topology/query, the resource name is “v1/topology/query”. |
| REST_DisabledAPI | String | Specifies the REST API that is disabled by default. “Run Script” is set by default, which means Script - Run Script will be disabled after the installation. |
| REST_MaxDepth | Integer | Specifies the expansion depth of a global object. This value starts from 0, and the default value is 1. Take the Host object as an example: - If the max depth is 0, the Host name and Host unique ID are returned. - If the max depth is 1, the first-level properties of the Host are returned. |
| REST_MaxObjectCount | Integer | Specifies how many objects are invoked through a response. An object is one instance that contains multiple properties. |
| REST_RetrieveMetricCurrentValue | Boolean | Specifies whether to retrieve the metric current value of a topology object in a response. False is set by default. Note: If this registry variable is set to True, the Management Server will retrieve the metric current value only, while latest, period, and history values of this topology object will not be retrieved. |
| REST_RetrieveObservationValue | Boolean | Specifies whether to retrieve the observation current value of a topology object in a response. False is set by default. |
| REST_ShowLinks | Boolean | Specifies whether to show the link field through a response. False is set by default. The link field includes the following two types: - Link pointing to the object type - Link pointing to the object |
| REST_TokenExpirationTime | Integer | Specifies the token expiration time (in seconds). This variable takes effect when the token is accessed, when a login attempt using a new API or an API request is received on the server side, for example. |
| REST_CrossOriginResourceAllowedDomain | String | Specifies whether the request from the third-party integration site can be allowed. This variable has no default value. |
| REST_AccessControlAllowCredentials | Boolean | Specifies whether the response to a request can be exposed to the page. If the returned value is: - True: the response to a request can be exposed. - False: the response cannot be exposed. |
| REST_ShowTopologyTypeLocalProperties | Boolean | Specifies whether to show the property of Topology Object type in an instance. False is set by default. |
| REST_AgentSubmitInfoObservationDuration | Integer | Specifies the observation duration of the agents property in the RestAPIInfo type. The default value is 300, which is identical to 5 minutes. |
| REST_AgentSubmitInfoQueueSize | Integer | Specifies the cache size that stores the detailed information of submitted data. The default value is 100. |
| REST_AuthToken_AutoLogin | Boolean | Specifies whether the Auth-Token HTTP header can be used to authenticate users, or whether users must invoke the ‘Security - Login’ API to obtain an access token. |
Most of registry variables listed in the URL parameters table can be overwritten by the following URL parameters per request.
URL parameters
| URL parameter name | Description |
|---|---|
| maxObjectCount | Specifies how many objects are invoked through a response. An object is one instance that contains multiple properties. |
| maxDepth | Specifies the expansion depth of the global object. This value starts from 0, and the default value is 1. Take the Host object as an example: - If the max depth is 0, the Host name and Host unique ID are returned. - If the max depth is 1, the first-level properties of the Host are returned. |
| durationMS | Specifies the time duration, including startTimeMS and endTime. If startTimeMS is not set, the endTime value is used as the current time, and the startTime value is calculated as endTime minus the specified duration. Note: This parameter does not impact the Topology - Observations query and Topology - TopologyObject query API. |
| startTimeMS | Specifies the startTime. The endTime is the sum of startTime and durationMS. Note: This parameter does not impact the Topology - Observations query and Topology - TopologyObject query API. |
| retrieveMetricValue | Specifies whether to retrieve the metric current value of a Topology object in a response. |
| retrieveObservationValue | Specifies whether to retrieve the observation current value of a Topology object in a response. |
| showLinks | Specifies whether to show the link field through a response. False is set by default. The link field includes the following types: - Link pointing to the object type - Link pointing to the object |
| excludePropertyPatterns | Excludes the properties in a Topology object. Take https://<server>:<port>/api/v1/type/Host/instances?excludePropertyPatterns=.Alarm.,.State. as an example, this URL address excludes the properties which name contains “Alarm” and “State”. |
| includePropertyPatterns | Includes the properties in a Topology object. Take https://<server>:<port>/api/v1/type/Host/instances?includePropertyPatterns=.Alarm.,.State. as an example, this URL address includes the properties which name contains “Alarm” and “State”. Note: If excludePropertyPatterns and includePropertyPatterns are set to the same value, the value set in excludePropertyPatterns is ignored. |
| showTopologyTypeLocalProperties | Specifies whether to show the property of the Topology type in an instance. |
This section provides you with essential information about available Foglight REST APIs. For more information, see the following topics:
The App related API includes the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
The Security related APIs include the following:
The associated user account should be granted with the API Access role.
Header:
| Field | Type | Description |
|---|---|---|
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| username | String | User account. |
| pwd | String | Password associated with the user account. |
| authToken | String | The token is generated from the User Management dashboard or Foglight command line. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status |
| data | String | Either the response data format data (JSON/XML) or exception message |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
After setting a token for the specified user, the old token (if exists) is expired. This causes the login status of this user is also expired, if this user has logged in to REST service. This user should log in to the REST service again using the new authToken or credentials.
Header:
| Field | Type | Description |
|---|---|---|
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| username | String | User account which Auth Token is to be set. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
After deleting a token for the specified user, the old token (if exists) is expired. This causes the login status of this user is also expired, if this user has logged in to REST service.
Header:
| Field | Type | Description |
|---|---|---|
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| username | String | User account which Auth Token is to be deleted. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
After setting a token for the current user, the old token (if exists) is expired. This causes the login status of current user is also expired. The current user should log in to the REST service again using the new authToken or credentials.
Header:
| Field | Type | Description |
|---|---|---|
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
After deleting a token for the current user, the old token (if exists) is expired. This causes the login status of current user is also expired. The current user should log in to the REST service again using user credentials.
Header:
| Field | Type | Description |
|---|---|---|
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
The Agent related APIs include the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token you get after you login successfully. |
| Accept | String | Should be application/json or application/xml, to define the response data format, default is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token you get after you login successfully. |
| Accept | String | Should be application/json or application/xml, to define the response data format, default is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token you get after you login successfully. |
| Accept | String | Should be application/json or application/xml, to define the response data format, default is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
The Alarm related APIs include the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Sample usage: When using the pushAlarm API, note the following:
def ruleName = <RULE_NAME>
def rule = server.RuleService.getAllRules().find{ it.name == ruleName }
if(rule){
return rule.id;
}else{
return "Rule not found."
}
The following illustrates the sample code of request body in XML and JSON separately.
Request body in XML:
<externalAlarmParamBean>
<alarmMessage>title of alarm dialog. alarm message</alarmMessage>
<severity>3</severity>
<topologyObjectId>94e27d92-08a5-4c28-9a90-8856a7689105</topologyObjectId>
<ruleId>c83632ae-3468-4ac1-bd69-523595e18750</ruleId>
</externalAlarmParamBean>
Request body in JSON:
{"alarmMessage":"title of alarm dialog. alarm message", "severity":"2", "topologyObjectId":"94e27d92-08a5-4c28-9a90-8856a7689105"}
Severity value:
| Value | Description |
|---|---|
| 2 | Warning |
| 3 | Critical |
| 4 | Fatal |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
| Content-Type | String | - Data format = JSON, this value is application/json". - Data format = XML, this value is “application/xml”. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Sample usage: The following illustrates the sample code of request body in XML and JSON separately.
Request body in XML:
<externalAlarmParamBean>
<alarmMessage>Test Alarm.This is a test alarm message from postman</alarmMessage>
<severity>3</severity>
<type>Host</type>
<properties>
<entry>
<key>name</key>
<value>nameofHost</value>
</entry>
</properties>
</externalAlarmParamBean>
Request body in JSON:
{"alarmMessage":"This is a test alarm message from postman. asdfasdf", "severity":"2", "type":"Host", "properties":{"name":"nameofHost"}, "ruleId":"72b73d98-8c6c-4ee1-b5ba-fd7c14645280"}
Sample usage: The following illustrates the sample code of request body in XML and JSON separately.
Request body in XML:
<externalAlarmParamBean>
<alarmMessage>Test Alarm.This is a test alarm message from postman</alarmMessage>
<severity>3</severity>
<query>!Host:name="nameofHost"</query>
</externalAlarmParamBean>
Request body in JSON:
{"alarmMessage":"This is a test alarm message from postman. asdfasdf", "severity":"2", "query":"!Host:name='nameofHost'"}
The Alarm Template API related operations include the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| id | String | The unique identifier of the alarm template. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
| Content-Type | String | - Data format = JSON, this value is application/json". - Data format = XML, this value is “application/xml”. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
| Content-Type | String | - Data format = JSON, this value is application/json". - Data format = XML, this value is “application/xml”. |
Parameter:
| Field | Type | Description |
|---|---|---|
| id | String | The unique identifier of the alarm template to update. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| id | String | The unique identifier of the alarm template to delete. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
The Audit Log API related operations include the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
| Content-Type | String | - Data format = JSON, this value is application/json". - Data format = XML, this value is “application/xml”. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| record-id | String | The unique identifier of the audit log record. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
The Open Telemetry API related operation includes the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
The Performance Investigator (PI) API provides comprehensive database performance monitoring capabilities that help identify performance bottlenecks and optimize query execution. These APIs allow you to retrieve detailed performance statistics, execution plans, dimension trees, and monitoring metrics for supported database platforms including SQL Server, Oracle, Azure SQL, MySQL, and PostgreSQL.
The Performance Investigator API supports the following database domains: SQL_SERVER, ORACLE, SSAS, AZURE, MYSQL, POSTGRES.
The Performance Investigator API related operations include the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
| piWaitStatisticsObjectId | String | PI Wait Statistics object identifier. |
| aggregationType | String | Aggregation method: “sum”, “average”, “min”, “max”, “standardDeviation”. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
| agentTopologyObjectId | String | Unique identifier for the agent topology object. |
| aggregationType | String | Aggregation method: “sum”, “average”, “min”, “max”, “standardDeviation”. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
| agentTopologyObjectId | String | Unique identifier for the agent topology object. |
| getHistory | Boolean | Whether to include historical data points. If true, adds *_Rate matrices to response for metrics with “isRate”: true. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
| piAgentId | Integer | PI Agent identifier. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
| instanceKeys | Array | Array of instance keys. |
| agentTopologyObjectId | String | Agent topology object identifier. |
| piRepoProfile | String | PI repository profile identifier. |
| waitCategory | String | Wait category (optional, defaults to “WORKLOAD”). |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| smaAgentId | Integer | SMA Agent identifier. |
| piAgentId | Integer | PI Agent identifier. |
| dbName | String | Database name for execution plan analysis. |
| requestType | String | Type of request: “EXPLAIN”, “ANALYZE”, or “ANALYZE_WITH_ROLLBACK”. |
| statementText | String | SQL statement text for execution plan generation. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
| totalActiveTime | Number | Total active time for percentage calculations. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
| queryText | String | Text snippet to search for in SQL statements. |
| agentTopologyObjectId | String | Agent topology object identifier for filtering. |
| isRemoveLiteralsEnabled | Boolean | Whether to remove literals from SQL statements for pattern matching. |
| agentName | String | Name of the monitoring agent. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
| queryText | String | Text snippet to search for in SQL statements. |
| agentTopologyObjectId | String | Agent topology object identifier for filtering. |
| isRemoveLiteralsEnabled | Boolean | Whether to remove literals from SQL statements for pattern matching. |
| agentName | String | Name of the monitoring agent. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
| top | Integer | Number of top results to return. |
| instanceKeys | Array | Array of instance keys. |
| piRepoProfile | String | PI repository profile identifier. |
| dimensions | Array | Array of dimension filters with dimensionName and dimensionValues. |
| agentTopologyObjectId | String | Agent topology object identifier. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| domainName | String | Name of the database domain. Currently available domains: SQL_SERVER, POSTGRES. |
| startTime | Long | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | End time for the query in Unix timestamp format (milliseconds). |
| piWaitStatisticsObjectId | String | PI Wait Statistics object identifier. |
| sqlId | String | SQL identifier. |
| sqlText | String | SQL statement text. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
| Content-Type | String | - Data format = JSON, this value is application/json". - Data format = XML, this value is “application/xml”. |
Request body (JSON):
{
"data": "hashvalue"
}
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
| Content-Type | String | - Data format = JSON, this value is application/json". - Data format = XML, this value is “application/xml”. |
Request body (JSON):
{
"data": "sqlQuery"
}
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
The Query Insights APIs provide access to TopSQL performance data, allowing you to retrieve and analyze the top-performing SQL queries across your database environment. These APIs enable you to identify performance bottlenecks and optimize query performance.
The Query Insights related APIs include the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
| Content-Type | String | Data format = JSON, this value is “application/json”. Data format = XML, this value is “application/xml”. |
Request body (JSON):
{
"domains": ["mssql", "oracle"],
"startTime": 1640995200000,
"endTime": 1641002400000,
"rows": 50,
"textFilter": "SELECT",
"targetName": "MyServer",
"sortColumn": "IMPACT",
"sortOrder": "DESC",
"impactMin": 1.0,
"impactMax": 100.0,
"responseTimeMin": 100.0,
"responseTimeMax": 5000.0,
"elapsedTimeMin": 50.0,
"elapsedTimeMax": 10000.0,
"executionsMin": 1,
"executionsMax": 1000
}
Parameter:
| Field | Type | Required | Description |
|---|---|---|---|
| domains | Array[String] | No | Database domain names (“mssql”, “oracle”, “azuresqldatabase”, “mysql”, “dbtwo”, “postgresql”, “mongodb”). If not specified, returns data for all domains. |
| startTime | Long | Yes | Start time for the query in Unix timestamp format (milliseconds). |
| endTime | Long | Yes | End time for the query in Unix timestamp format (milliseconds). |
| rows | Integer | No | Number of results to return. Default is 50. |
| textFilter | String | No | Filter SQL statements containing this text. Minimum 3 characters required. |
| targetName | String | No | Filter by specific database instance/target name. |
| sortColumn | String | No | Sort column: IMPACT, RESPONSE_TIME, ELAPSED_TIME, EXECUTIONS. Default is IMPACT. |
| sortOrder | String | No | Sort order: ASC or DESC. Default is DESC. |
| impactMin | Double | No | Minimum impact percentage (0-100). |
| impactMax | Double | No | Maximum impact percentage (0-100). |
| responseTimeMin | Double | No | Minimum response time in milliseconds. |
| responseTimeMax | Double | No | Maximum response time in milliseconds. |
| elapsedTimeMin | Double | No | Minimum elapsed time in milliseconds. |
| elapsedTimeMax | Double | No | Maximum elapsed time in milliseconds. |
| executionsMin | Long | No | Minimum number of executions. |
| executionsMax | Long | No | Maximum number of executions. |
Returned value:
| Field | Type | Description |
|---|---|---|
| availableDomains | Array[String] | List of available database domains. |
| topSqlResults | Array[Object] | Array of top SQL query results. |
TopSQL Result Object:
| Field | Type | Description |
|---|---|---|
| sqlText | String | SQL query statement text. |
| sqlId | String | Unique identifier for the SQL statement. |
| sqlIDDisplayName | String | Display name for the SQL ID. |
| domainName | String | Database domain name (SQL_SERVER, ORACLE, etc.). |
| targetName | String | Database instance/target name. |
| overviewURL | String | URL to overview dashboard for this query. |
| performanceURL | String | URL to performance analysis dashboard. |
| impact | String | Performance impact percentage. |
| elapsedTime | String | Total elapsed time in milliseconds. |
| executions | String | Number of query executions. |
| responseTime | String | Average response time in milliseconds. |
| objectId | String | Topology object identifier. |
| isFullTextApiAvailable | Boolean | Whether full text API is available for this query. |
Example Response:
{
"availableDomains": ["SQL_SERVER", "ORACLE", "MYSQL"],
"topSqlResults": [
{
"sqlText": "SELECT * FROM users WHERE id = ?",
"sqlId": "abc123",
"sqlIDDisplayName": "User Query",
"domainName": "SQL_SERVER",
"targetName": "ProductionDB",
"overviewURL": "/aui/wcf?name=SQL_SERVER_Instance_Overview&objectid=12345",
"performanceURL": "/aui/wcf?name=SQL_SERVER_Performance&objectid=12345",
"impact": "15.5",
"elapsedTime": "2500.0",
"executions": "1250",
"responseTime": "2.0",
"objectId": "obj_12345",
"isFullTextApiAvailable": true
}
]
}
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
| Content-Type | String | Data format = JSON, this value is “application/json”. Data format = XML, this value is “application/xml”. |
Request body (JSON):
{
"objectId": "obj_12345",
"sqlId": "abc123",
"domainName": "mssql"
}
Parameter:
| Field | Type | Required | Description |
|---|---|---|---|
| objectId | String | Yes | Topology object identifier from TopSQL results. |
| sqlId | String | Yes | SQL statement identifier from TopSQL results. |
| domainName | String | Yes | Database domain name. Value should be taken from the TopSQL response. Available values: “mssql”, “oracle”, “azuresqldatabase”, “mysql”, “dbtwo”, “postgresql”, “mongodb”. |
Returned value:
| Field | Type | Description |
|---|---|---|
| result | String | Complete SQL statement text. |
Example Response:
{
"result": "SELECT u.id, u.username, u.email, p.profile_data FROM users u LEFT JOIN profiles p ON u.id = p.user_id WHERE u.id = ? AND u.active = 1"
}
Error Responses:
| HTTP Status | Description |
|---|---|
| 400 Bad Request | Invalid request parameters (e.g., invalid domain, missing required fields, invalid time range). |
| 500 Internal Server Error | Server error occurred while processing the request (e.g., script not found for domain, topology data unavailable). |
The Cartridge related APIs include the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
The Registry related API includes the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
The Remote related API includes the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
The Rule related APIs include the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown |
The Script related APIs include the following:
This API is disabled by default. To enable this API, see Overview.
Sample usage: If you use & in your sample codes, make sure to convert it to &
Generate a post request using the following URL: https://<server>:<port>/api/v1/script/runScript
The basic format of request body can be set as below:
JSON:
{"script":"System.err.println('Hello World!')"}
XML:
<ScriptBean>
<script>System.err.println("Hello World!");</script>
</ScriptBean>
The complete format is as below:
JSON:
{"script":"#utilization#", "scopeObjectId":"3ebb2158-e5e9-4403-be3c-46fd8020efeb",
"cartridgeName":"Infrastructure"}
XML:
<ScriptBean>
<script>#utilization#</script>
<cartridgeName>Infrastructure</cartridgeName>
<scopeObjectId>3ebb2158-e5e9-4403-be3c-46fd8020efeb</scopeObjectId>
</ScriptBean>
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
| Content-Type | String | - Data format = JSON, this value is application/json". - Data format = XML, this value is “application/xml”. |
Returned value:
| Field | Type | Description |
|---|---|---|
| status | String | The response status. |
| data | String | Either the response data format (JSON/XML) or exception message. |
| error | String | Error code if some exception occurs; otherwise this field is not shown. |
The Topology related APIs include the following:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| path | String | The property path. This may include multiple paths. |
Returned Value:
| Field | Type | Description |
|---|---|---|
| status | String | The status of the API call (success/failure). |
| data | String | Contains the properties data when the call is successful. |
| error | String | Contains error information when the call fails. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned Value:
| Field | Type | Description |
|---|---|---|
| status | String | The status of the API call (success/failure). |
| data | String | Contains the property value data when the call is successful. |
| error | String | Contains error information when the call fails. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned Value:
| Field | Type | Description |
|---|---|---|
| status | String | The status of the API call (success/failure). |
| data | String | Contains the topology object data when the call is successful. |
| error | String | Contains error information when the call fails. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| Id | String | The topology object ID. This may include multiple IDs. |
Returned Value:
| Field | Type | Description |
|---|---|---|
| status | String | The status of the API call (success/failure). |
| data | String | Contains the topology objects data when the call is successful. |
| error | String | Contains error information when the call fails. |
| Name | Description |
|---|---|
| RAW | Retrieve the raw data of an observation based on the time range. |
| AGGREGATE | Retrieve the aggregate data of an observation based on the time range. |
| AGGREGATE_AND_LAST | Retrieve the aggregate and last data of an observation based on the time range. |
| LAST_N | Retrieve the last N data of the observation based on the time range. If retrievalType is set to LAST_N, you need configure the value of numberOfValue that defines the letter N of LAST_N. |
The basic format of request body can be set as below:
{"includes":[{"ids":["ca83d1a2-f04b-483d-b224-055967777e72"],"observationName":"utilization"}],"endTime":1477987660722}
The following is the complete format of request body:
JSON:
{
"includes":[{"ids":["ca83d1a2-f04b-483d-b224-055967777e72"],"observationName":"utilization"},
{"ids":["f58f36ef-88ef-4264-9b8a-91df79fd37e9"],"observationName":"utilization"},
{"ids":["f3df86e1-0718-4ccf-ae05-c25414b53db9","7910afd1-0247-4309-bae4-05f9419ab719","4ed2b409-cf18-4c14-a6ab-fdc19cff006e"],"observationName":"percentMemory"}],
"startTime":1477984060722,
"endTime":1477987660722,
"granularity":3600000,
"numberOfValue":1,
"retrievalType":"AGGREGATE_AND_LAST"
}
XML:
<observationQueryParamBean>
<endTime>1477988816209</endTime>
<granularity>3600000</granularity>
<includes>
<ids>ca83d1a2-f04b-483d-b224-055967777e72</ids>
<observationName>utilization</observationName>
</includes>
<includes>
<ids>f58f36ef-88ef-4264-9b8a-91df79fd37e9</ids>
<observationName>utilization</observationName>
</includes>
<includes>
<ids>f3df86e1-0718-4ccf-ae05-c25414b53db9</ids>
<ids>7910afd1-0247-4309-bae4-05f9419ab719</ids>
<ids>4ed2b409-cf18-4c14-a6ab-fdc19cff006e</ids>
<observationName>percentMemory</observationName>
</includes>
<numberOfValue>1</numberOfValue>
<retrievalType>AGGREGATE_AND_LAST</retrievalType>
<startTime>1477985216208</startTime>
</observationQueryParamBean>
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| Content-Type | String | Data format = JSON, this value is “application/json”. Data format = XML, this value is “application/xml”. |
Returned Value:
| Field | Type | Description |
|---|---|---|
| status | String | The status of the API call (success/failure). |
| data | String | Contains the observations data when the call is successful. |
| error | String | Contains error information when the call fails. |
The basic format of request body can be set as below:
{"queryText":"!Host"}
The following is the complete format of request body:
JSON:
{
"queryText":"!Host",
"caseSensitive":true,
"freshnessFactor":3600000.0,
"params":[{"name":"name","value":"nameofHost"},{"name":"domainName","value":"nameofDomain"}],
"queryTopologyObjects":true,
"requiresCoherentResults":true,
"scopingTopologyObjectId":"4f888425-a734-4bee-a5a7-4e24cd3c83cd",
"transactionTimestampMillis":3600000,
"timeRangeStartTime":1477984060722,
"timeRangeEndTime":1477987094482,
"timeRangeGranularity":3600000,
"timeRangeMaxPoints":500
}
XML:
<queryParamBean>
<caseSensitive>true</caseSensitive>
<freshnessFactor>3600000.0</freshnessFactor>
<params>
<name>name</name>
<value>nameofHost</value>
</params>
<params>
<name>domainName</name>
<value>nameofDomain</value>
</params>
<queryText>!Host</queryText>
<queryTopologyObjects>true</queryTopologyObjects>
<requiresCoherentResults>true</requiresCoherentResults>
<scopingTopologyObjectId>4f888425-a734-4bee-a5a7-4e24cd3c83cd</scopingTopologyObjectId>
<transactionTimestampMillis>3600000</transactionTimestampMillis>
<timeRangeStartTime>1477984060722</timeRangeStartTime>
<timeRangeEndTime>1477987094482</timeRangeEndTime>
<timeRangeGranularity>3600000</timeRangeGranularity>
<timeRangeMaxPoints>500</timeRangeMaxPoints>
</queryParamBean>
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Parameter:
| Field | Type | Description |
|---|---|---|
| Content-Type | String | Data format = JSON, this value is “application/json”. Data format = XML, this value is “application/xml”. |
Returned Value:
| Field | Type | Description |
|---|---|---|
| status | String | The status of the API call (success/failure). |
| data | String | Contains the topology objects data when the call is successful. |
| error | String | Contains error information when the call fails. |
{
"data":[{
"typeName": "TypeName",
"properties": {
"simplePropertyName": "TestData1",
"MetricPropertyName": 11234,
"ObservationPropertyName": {
"simplePropertyNameOne": "testObservation1",
"simplePropertyNameTwo": 1495447993592,
"simplePropertyNameThree": 1495447993592
}
}
}],
"startTime": 1495180240539,
"endTime": 1495180540539,
"agentName": "sampleagent"
}
When invoking this API, note the following:
import com.quest.forge.rest.service.impl.RestAgentManagerImpl;
RestAgentManagerImpl.updateConfig();
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Content-Type | String | Data format = JSON, this value is “application/json”. |
Parameter:
| Name | Description |
|---|---|
| data | Mandatory. Specifies the detailed data of an object. |
| typeName | Mandatory. Specifies the data type, and this field must be either of TopologyObject or its sub type. |
| properties | Mandatory. Specifies the property value of the type. |
| startTime | Mandatory. Specifies the data start time. |
| endTime | Mandatory. Specifies the data end time. |
| agentName | Mandatory. Specifies the value (in the string format) which identifies the client running this API. |
Returned Value:
| Field | Type | Description |
|---|---|---|
| status | String | The status of the API call (success/failure). |
| data | String | Contains the response data when the call is successful. |
| error | String | Contains error information when the call fails. |
Sample usage:
Case 1: Create a general topology type instance. Consider for example we create an FSMAgentBlackout type instance. Find the identity of type FSMAgentBlackout is name in the Schema Browser dashboard. Use the following request body to create the FSMAgentBlackout type instance.
{
"data":[{
"typeName": "FSMAgentBlackout",
"properties": {
"name" : "Test-FSMAgentBlackout"
}
}],
"startTime": 1495180240539,
"endTime": 1495180540539,
"agentName": "sampleagent"
}
Case 2: Create a Host instance. If you want to submit Host type data, the name property is mandatory while vmId and systemId properties are optional. You can set both optional properties if you know their values. hostId is automatically generated based upon values of name, systemId, and vmId, so it is not required to set manually.
{
"data":[{
"typeName": "Host",
"properties": {
"hostId" : "Test-Host",
"name" : "Test-Host"
}
}],
"startTime": 1495180240539,
"endTime": 1495180540539,
"agentName": "sampleagent"
}
Case 3: Create a type instance which identity property is a topology object. Consider for example we create a HostProcess type instance. In the Schema Browser dashboard, find the identity properties of type HostProcess are name and os. The name property is a string, while the os property is OperatingSystem which is a topology type. Use the uniqueId of OperatingSystem as the reference, then create the HostProcess type instance as follows.
{
"data":[{
"typeName": "HostProcess",
"properties": {
"os" : "e197ee1a-a60d-4627-8313-72d6bd49ce61",
"name" : "Test-HostProcess"
}
}],
"startTime": 1495180240539,
"endTime": 1495180540539,
"agentName": "sampleagent"
}
Case 4: Create a custom type instance. Consider for example we have imported the below type definition in the Add Topology Type dashboard.
<type name='PushDataTest' extends='TopologyObject'>
<property name='name' type='String' is-identity='true'/>
</type>
The identity property is name in the above type definition. Use the following request body to create the custom type instance:
{
"data":[{
"typeName": "PushDataTest",
"properties": {
"name" : "Test-PushDataTest"
}
}],
"startTime": 1495180240539,
"endTime": 1495180540539,
"agentName": "sampleagent"
}
Case 5: Consider for example we have the following type definition.
<type name='PushDataTest' extends='TopologyObject'>
<property name='name' type='String' is-identity='true'/>
<property name='testMetric' type='Metric' is-containment='true' unit-name='count' />
</type>
Use the following request body to push metrics.
{
"data":[{
"typeName": "PushDataTest",
"properties": {
"name" : "Test-PushDataTest",
"testMetric" : 100
}
}],
"startTime": 1499830726959,
"endTime": 1499830786959,
"agentName": "sampleagent"
}
If you still see your metrics after the metrics push, check the server log to see if you see any “Discarded value” warning.
Case 6: Consider for example we have the following type definition.
<type name='PushDataTest' extends='TopologyObject'>
<property name='name' type='String' is-identity='true'/>
<property name='testMetric' type='Metric' is-containment='true' unit-name='count' />
<property name='testObservation' type='TestObservation' is-containment='true' unit-name='count' />
</type>
<type name='TestObservation' extends='ComplexObservation'>
<property name='current' type='TestObservationValue' is-many='false' is-containment='true' />
<property name='latest' type='TestObservationValue' is-many='false' is-containment='true' />
<property name='history' type='TestObservationValue' is-many='true' is-containment='true' />
</type>
<type name='TestObservationValue' extends='ObservedValue'>
<property name='value' type='TestObject' is-containment='true'/>
</type>
<type name='TestObject' extends='DataObject'>
<property name='testName' type='String' />
<property name='createDate' type='Date' />
<property name='createTime' type='Double' />
</type>
Use the following request body to push observations.
{
"data":[{
"typeName": "PushDataTest",
"properties": {
"name" : "PushDataTest",
"testMetric": 112233,
"testObservation": {
"testName" : "testObservation",
"createDate": 1495447993592,
"createTime": 1495447993592
}
}
}],
"startTime": 1499839494614,
"endTime": 1499839554614,
"agentName": "sampleagent"
}
The TopologyType related operations enable you to:
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned Value:
| Field | Type | Description |
|---|---|---|
| status | String | The status of the API call (success/failure). |
| data | String | Contains the type information data when the call is successful. |
| error | String | Contains error information when the call fails. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned Value:
| Field | Type | Description |
|---|---|---|
| status | String | The status of the API call (success/failure). |
| data | String | Contains the super type information data when the call is successful. |
| error | String | Contains error information when the call fails. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned Value:
| Field | Type | Description |
|---|---|---|
| status | String | The status of the API call (success/failure). |
| data | String | Contains the instances data when the call is successful. |
| error | String | Contains error information when the call fails. |
Header:
| Field | Type | Description |
|---|---|---|
| Access-Token | String | The token is retrieved after successfully logging in to the Management Server. |
| Accept | String | Specifies the response data format which can be either application/json or application/xml. The default value is application/json. |
Returned Value:
| Field | Type | Description |
|---|---|---|
| status | String | The status of the API call (success/failure). |
| data | String | Contains the user information data when the call is successful. |
| error | String | Contains error information when the call fails. |