Developing
The TrueSight IT Data Analytics product provides you with the capability of running REST APIs or endpoints.
You can use various REST clients such as cURL, wget, and REST client browser plugins for running the supported endpoints. The client can consume the API endpoints using the standard HTTP and HTTPS protocols, same as those used for connecting to the product UI.
Note
The endpoints support the JSON encoding scheme only.
This topic contains the following information:
Supported endpoints
You can accomplish the following goals with the supported endpoints:
Note
Before you run these endpoints, you need to generate an authorization token by running the login
endpoint. This token is used for authenticating a user into the product. For more information, see Authentication and authorization.
- Creating hosts with a REST API
- Deleting hosts with a REST API
- Enabling or disabling Agents with a REST API
- Getting details of a saved search with a REST API
- Listing host details with a REST API
- Modifying tag details associated with hosts with a REST API
- Modifying user groups associated with hosts with a REST API
- Searching and getting results asynchronously with a REST API
- Searching and getting results synchronously with a REST API
Authentication and authorization
You need to authenticate with a user name and password for running the REST operations. Additionally,
role-based authorization
is required for authenticating into the product and running various operations.
To be able to authenticate, you need to generate the authorization token by running a POST call with the following request URL. You also need to provide the user name and password in the request body (in JSON format).
<protocol>://<host>:<port>/olaengine/itdaws/authservices/login
In the preceding URL, the following definitions apply:
<protocol>
refers to the protocol that you want to use for communication with the Console Server.The value can be one of the following:
http
https
<host>
refers to the host name of the Console Server.<Port>
refers to the port number of the Console Server. Default port is 9797.
Output
The response is an authorization token. By default, this token is valid for a period of 60 minutes. After the default period expires, the token cannot be used, you need to generate a new token.
Required headers while running the supported endpoints
Authorization
Pass the authorization token as the value.Content-Type: application/json
Example
POST
https://hou-clt-01:9797/olaengine/itdaws/authservices/login
{
"username": "admin",
"password": "admin12345"
}
{
"username": "admin",
"authToken": "6AkjnOzw9hH8/t5hUAIn7b0rbNI="
}
Logging out of a user session
You can log out and terminate a user session by sending a POST request. You also need to provide the authorization token in the request body (in JSON format).
After you log out from a given session, the authorization token generated earlier does not remain valid. Attempts to reuse the earlier generated token generates an error.
<protocol>://<host>:<port>/olaengine/itdaws/authservices/logout
In the preceding URL, the following definitions apply:
<protocol>
refers to the protocol that you want to use for communication with the Console Server.The value can be one of the following:
http
https
<host>
refers to the host name of the Console Server.<Port>
refers to the port number of the Console Server. Default port is 9797.
Required headers
Authorization
Pass the authorization token as the value. For more information, see Authentication and authorization.Content-Type: application/json
Example
POST
https://hou-clt-01:9797/olaengine/itdaws/authservices/logout
{
"Authorization": "7dNJZSao3zZKjuZ5/o1Z8Ji570Q="
}
{
"status": "SUCCESS"
}
HTTP status codes
The supported endpoints follow the HTTP standard for reporting status. The endpoint responses can include one of the following HTTP status codes.
For a complete list of status codes and their meaning, see Hypertext Transfer Protocol -- HTTP/1.1 status code definitions. To understand the status codes relevant to each endpoint, see the individual API topics.
Status code | Description |
---|---|
200 | Request completed successfully. |
202 | Request accepted (valid inputs) but processing was no completed. |
207 | Multiple status for a request. |
400 | Request contains invalid inputs. |
401 | Authorization error (invalid authorization token or authorization token not present). |
404 | Requested resource does not exist. |
500 | Error occurred while processing the request. Occurrence of this error is rare. For more information, see the error message. Alternatively, see the itda.log located at %BMC_ITDA_HOME%\logs. |
Comments
Log in or register to comment.