Getting resource data information

Ops Center Analyzer Detail View REST API Reference Guide

Version
11.0.x
Audience
anonymous
Part Number
MK-99ANA004-10

You can obtain the following resource data information: start time, signature, relations, and scalar data. If the requested resource does not exist, then an error message is received in the response message.

Request line

baseURL/dbapi.do?action=retrieveResourceData&dataset=<Datasetname>

Request body

{
  "resSignatures":[
    "",
    ""
  ]
  "resType":""
  "attrId":""
  "attrValue":""
  "snapshotTime":
}

Request example using GET

GET /dbapi.do?action=retrieveResourceData&dataset=defaultDs&resSignatures=vm#cumulus-lab-vm1,h#cumulus-lab-host1 HTTP /1.1 Authorization:Basic ZnJlZDpmcmVk
The resource signatures in the query parameter, # must be replaced with its encode value, which is %23. So, the above request example will be:
GET /dbapi.do?action=retrieveResourceData&dataset=defaultDs&resSignatures=vm%23cumulus-lab-vm1,h%23cumulus-lab-host1 HTTP /1.1

Request example using POST

POST /dbapi.do?action=retrieveResourceData&dataset=defaultDs HTTP /1.1 Authorization:Basic ZnJlZDpmcmVk
{
  "resSignatures":[
    "vm#cumulus-lab-vm1",
    "h#cumulus-lab-host1"
  ]
}

Request parameters

Parameter Type Description
action String retrieveResourceData

Specify the API function to be invoked.

dataset String Dataset name. From 2 to 32 alphanumeric, underscore (_), and hyphen (-) characters are allowed.
resSignatures String[ ] (Optional) One or more comma-separated resource signatures.
resType String (Optional) Resource type.

From 1 to 32 alphanumeric, underscore (_), and hyphen (-) characters are allowed.

attrId String (Optional) Attribute ID of type scalar.

From 2 to 32 alphanumeric, underscore (_), and hyphen (-) characters are allowed.

attrValue String (Optional) Value of the specified attribute ID. From 1 to 4000 alphanumeric characters are allowed.
snapshotTime String

(Optional) Snapshot time to get the resources data in yyyyMMdd_HHmmss format.

Default time zone is UTC and the default time is the current time of the Analyzer detail view server.

You must specify one of the following parameters:
  • resSignatures
  • resType
  • attrId and attrValue

If the resSignatures is specified, then theresType, attrId, and attrValue parameters are ignored.

The parameters resType, attrId, and attrValue can be used in a combination or separately.

Response body

{
  "retrieved":[
    {
      "startTime":"",
      "signature":"",
      "name":"",
      "memory":"",
      "relations":[
        ""
      "endTime:""
      ]
    }
  ]
}
{
  "code":"",
  "error":""
}

Response example

{
  "retrieved":[
    {
      "startTime":"20140714_000000",
      "signature":"vm#cumulus-vm1",
      "name":"cumulus-lab-vm1",
      "memory":"204600",
      "relations":[
        "h#cumulus-lab-host1"
      ]
    },
    {
      "startTime":" 20140714_000000",
      "signature":"h#cumulus-lab-host1",
      "name":"cumulus-lab-host1",
      "relations":[
        "vm#cumulus-lab-vm1"
      ]
    }
  ]
}
Note: The startTime is when the resource appeared for the first time, in the UTC time zone. Every resource has a startTime associated with it. A resource can also have an endTime when the resource expired, also in the UTC time zone.

Response parameters

Parameter

Type

Description

retrieved Object[ ] List of resource data.
retrieved.signature String Resource signature.
retrieved.name String Value of the scalar attribute, either name or value of the signature.
retrieved.<scalar attribute> String Attributes data.
retrieved.relations String[ ] List of related resource signatures.
retrieved.startTime String UTC time when the resource was created.
retrieved.endTime String UTC time when the resource was created.
code String Eight-digit hexadecimal error code.
error String Error message.

Status codes

Status code

Message

Description

200 OK Request was successful, and the response body contains the requested log details.
206 PARTIAL CONTENT Request is in progress, and the incremental content is available in the response body.
400 BAD REQUEST Request URL or request body validation failed. Check the response body for details.
401 UNAUTHORIZED Supplied authentication token is invalid or does not have the appropriate credentials to access the resource.
404 NOT FOUND API server could not find a resource matching the request.
405 METHOD NOT ALLOWED Request HTTP method is not allowed for the operation.
500 SERVER ERROR API operation request failed. Check the response body for details.

Response codes

The following table lists the common API response codes that might be generated through the standard API. If an error response is not listed, examine the HTTP status codes to determine the best method for addressing the issue.

Response code Message Condition
52010002 Invalid JSON Request. Specified JSON input is invalid.
52010009 At least one of {resSignatures}, {resType}, {attrId}, or {attrValue} parameters must be specified. Required parameters are not specified, or the specified parameters are not sufficient.
5201000F Invalid value specified for parameter {resSignatures}. It must be of type JSON list of string. Specified resSignatures is not of type JSON list of string.
5201000F Invalid value specified for parameter {resType}. It must be of type string. Specified resType is not of type string.
5201000F Invalid value specified for parameter {attrId}. It must be of type string. Specified attrId is not of type string.
5201000F Invalid value specified for parameter {attrValue}. It must be of type string. Specified attrValue is not of type string.
5201000F Invalid value specified for parameter {attrValue}. It must be of type string. Specified attrValue is not of type string.
5201000F Invalid value specified for parameter {snapshotTime}. It must be of type string. Specified snapshotTime is not of type string.
5201000F Invalid value specified for parameter {snapshotTime}. Parameter {snapshotTime} must be in yyyyMMdd_HHmmss format. Specified snapshotTime is not in valid format.
5201000F Invalid value specified for parameter {snapshotTime} Specified snapshotTime is not in valid range.
5202000F Invalid value specified for parameter {resSignatures} Specified resSignatures list is empty.
5202000F Invalid value specified for parameter {attrValue}. If {attrId} is specified, then {attrValue} must be specified. Parameter attrId is specified but attrValue is not specified.
Invalid value specified for parameter {attrId}. If {attrValue} is specified, then {attrId} must be specified. Parameter attrValue is specified but attrId is not specified.
5202000F Invalid value specified for parameter {resType}. Resource {type}:[h$%] contains invalid characters. Valid characters are [alphanumeric, - and _]. Specified resType contains invalid characters.
5202000F Invalid value specified for parameter {resType}. Resource {type}:[] length must be between 1-32 characters. Specified resType is not valid in terms of length.
5202000F Invalid value specified for parameter {attrId}. {attrId} length must be between 2 to 32 characters. Specified attrId is not valid in terms of length.
5202000F Invalid value specified for parameter {attrId}. {attrId} contains invalid characters. Valid characters are [alphanumeric, - and _]. Specified attrId contains invalid characters.
5202000F Invalid value specified for parameter {attrValue}. {attrValue} length must be between 1to 4000 characters. Specified attrValue is not valid in terms of length.
52000005 Resource definition with {resType}:[vm] does not exist. Resource definition does not exist for specified resType.
52000005 Attribute definition with {attrId}:[name] does not exist. Attribute definition does not exist for specified attrId.
5200000F Invalid value specified for parameter {attrId}. Specified Attribute definition is not of type scalar. Specified attrId is not of type scalar.
520000E9 License is not valid . License is not uploaded, or the uploaded license is invalid or expired .
520000E9 Authorization needed. Request is sent with an invalid authentication token.
520000E4 Dataset with {name}:[ds1] does not exist. Request sent for a dataset that does not exist.
520600E6 Requested resource is not found. Requested resource is not found.
520000E4 HTTP method [PUT] is not supported for action [retrieveResourceData]. Request is sent with any HTTP method other than GET or POST.
520000E2 Application encountered an internal error. API server encountered an unknown error.