Summary:
Test a user defined REST poller.
URL:
http(s)://{server hostname}/api/ud/test
Methods summary
- POST Method - tests a user defined REST poller.
POST Method detail
Tests a user defined REST poller.
Request:
| Name | Description |
|---|---|
|
url |
URL for the REST API to connect to. |
|
methodType |
HTTP method, usually "GET" or "POST". |
| credential | Credential information required for authentication. |
| mediaType | Specifies the media type being sent in a POST request, usually "json". |
| timeoutSecs | Optionally overrides the default amount of time the engine will wait before timing out the request (which is 30 seconds) |
| body | Defines the body text to be sent. Only required for POST requests. |
| headers | List of headers to be sent and their values. |
| variables | List of variables to be sent and their values. |
| prerequisiteSteps | List of prerequisite poller steps to be evaluated before this test can be executed. Each of this defines a complete poller step from a poller. Typically these would establish authentication and/or set the value of one or more variables that will be used during this test. |
Response:
| Name | Description |
|---|---|
|
returnCode |
Code returned by the Entuity collection engine. One of "OK", "WARN" or "ERROR". |
|
errorCode |
Error code from the collection engine. May contain useful error information in the event of internal errors. |
| requestId | Internal ID used for this request by the collection engine. |
| type | Additional information from the collection engine. |
| timeStamp | Timestamp that the response was created, |
| lapsedTimeMs | Lapsed time in milliseconds processing the API request. |
| messages | List of error messages. |
| httpCode | HTTP code returned from the REST API endpoint. |
| httpErrorMessage | Empty string if HTTP request was a success, or an error string if an error occurred. |
| httpBody | Body of the HTTP response if successful. This will usually be a JSON or XML string, but in some cases APIs return HTML or other data. |
| httpHeaders | List of HTTP headers in the response, as name-value pairs. |
| httpCookies | List of HTTP cookies returned in the response. This have a name, a value and a list of properties. |
| variables | List of variables available to subsequent poller steps. This can be null, or a list of name-value pairs. |
Example:
INPUT
curl -k -u admin:admin https://localhost/api/ud/test -X POST -H "content-type:application/json" -d '
{
"url" : "https://localhost/api/service/1644?media=json",
"credential" : {
"attributes" : {
"UserAndPasswordAttributes" : {
"username" : "admin",
"password" : "admin"
}
}
}
}'
OUTPUT
{
"returnCode" : "OK",
"errorCode" : null,
"requestId" : "DISC_1",
"type" : null,
"timeStamp" : 1638462971764,
"lapsedTimeMs" : 109,
"messages" : [ ],
"httpCode" : 200,
"httpErrorMessage" : "",
"httpBody" : "{\r\n \"info\" : {\r\n \"serviceId\" : 1644,\r\n \"serviceName\" : \"Stuff\",\r\n \"serviceType\" : 1,\r\n \"serv iceAtLeastValue\" : 0,\r\n \"serviceDegradedThreshold\" : 0,\r\n \"raiseEvents\" : true,\r\n \"treatUnknownAsDown\" : false,\r\n \ "serviceSlaGoal\" : 0.0,\r\n \"serviceWebImage\" : 0,\r\n \"descriptiveAlias\" : \"\",\r\n \"ownerId\" : \"kim1\",\r\n \"hasAdminP ermission\" : true,\r\n \"availableEyeServers\" : null,\r\n \"defaultEyeServerId\" : null,\r\n \"users\" : [ {\r\n \"first\" : 3 ,\r\n \"second\" : \"admin\"\r\n }, {\r\n \"first\" : 4,\r\n \"second\" : \"user\"\r\n }, {\r\n \"first\" : 6,\r\n \"second\" : \"kim1\"\r\n }, {\r\n \"first\" : 7,\r\n \"second\" : \"poller1\"\r\n } ],\r\n \"aggregateEnable\" : false ,\r\n \"serviceTag\" : \"Standard\",\r\n \"message\" : \"ok\"\r\n },\r\n \"componentIds\" : [ {\r\n \"serverId\" : \"400e61cf-873d-4504-8784-f9075a9a5150\",\r\n \"objectId\" : 869\r\n } ]\r\n}",
"httpHeaders" : null
}
Comments
0 comments
Please sign in to leave a comment.