5.11.2 Time-series data acquisition
- Description
-
Gets time-series data that corresponds to the SID and metric of the specified IM management node.
- Execution permissions
-
-
JP1_Console_Admin
-
JP1_Console_Operator
-
JP1_Console_User
-
- API version
-
v1
- Format
-
- Request line
POST /application/component/apiVersion/nodes/timeSeries httpVersion
- Request message body
{ "sid": IM-management-node-SID "metric": metric-name, "startTime": start-time, "endTime": end-time, "countPerInstance":upper-limit-for-the-number-of-data-sets-per-instance, "instanceCount":upper-limit-for-the-number-of-instances, }
- Response message body
{ "metric": "metric", "timeSeriesData":[ { "instance": "instance-name", "unit":"unit", "data":[ {"time":"time","value": value}, ... ] }, ... ] , "exceedCountDetected": { "countPerInstance": whether-an-excess-of-the-upper-limit-for-the-number-of-data-sets-per-instance-is-detected, "instanceCount": whether-an-excess-of-the-upper-limit-for-the-number-of-instances-is-detected }, "messageId": "message-id", "message": "message" }
- Parameters
-
- sid
-
Specifies the SID (management object ID). This parameter cannot be omitted.
- metric
-
Specifies the metric to be obtained. This parameter cannot be omitted.
Specify it with half-width alphanumeric characters and the following symbols from 1 to 255 characters:
- (hyphen), _ (underscore)
- startTime
-
Specifies the start time of time-series data as the UTC time in ISO8601 format. This parameter cannot be omitted. The number of seconds after the decimal point cannot be specified.
- endTime
-
Specifies the endtime of time-series data as the UTC time in ISO8601 format. This parameter cannot be omitted. The number of seconds after the decimal point cannot be specified.
- countPerInstance
-
Specifies the upper limit for the number of data sets per instance to be obtained. The range is from 1 to 30,000. Specify it so that the value obtained by multiplying countPerInstance paramater by instanceCount paramater is less than or equal to 30,000. Omitting this parameter causes the parameter to be set to 60.
- instanceCount
-
Specifies the upper limit for the number of instances to be obtained. The range is from 1 to 30,000. Specify it so that the value obtained by multiplying countPerInstance paramater by instanceCount paramater is less than or equal to 30,000. Omitting this parameter causes the parameter to be set to 10.
- Status codes
-
Status code
Message
Description
200
None
Processing of the time-series data acquisition REST API was successful.
KAJY22012-W
Data that is not returned exists because the upper limit value is exceeded.
400
KAJY22010-E
The time-series data acquisition REST API cannot be executed due to an invalid parameter of the time-series data acquisition REST API.
KAJY22011-E
A nonexistent SID has been specified.
403
KAJY01000-E
There is no permission to run the REST API.
500
KAJY22006-E
An attempt to obtain time-series data failed.
KAJY22008-E
The obtained data is invalid.
- Return values
-
The following information is returned in the response body if the status code is 200:
No.
Member name
Data type
Description
1
timeSeriesData
object[]
The obtained time-series data is returned as an array.
2
metric
string
Is filled with the metric name.
3
instance
string
Is filled with the instance name.
If not specified, it is omitted.
4
unit
string
Is filled with the unit of the metric.
5
data
object[]
The time and value data is returned as an array.
6
time
string
The time of time-series data is specified as the UTC time in ISO8601 format. The number of seconds after the decimal point is not specified.
7
value
number
The data value is specified.
8
exceedCountDetected
object
Whether to detect an excess of the upper limit of the specified parameter value. It has a member for each parameter.
9
countPerInstance
boolean
Whether to detect an excess of the upper limit for the number of data sets per instance:
-
true: Exceeded
-
false: Not exceeded
10
instanceCount
boolean
Whether the number of instances exceeds the upper limit.
-
true: Exceeded
-
false: Not exceeded
11
messageId
string
The message ID.
This is returned only if there is a message to be notified.
12
message
string
The message body.
The used language is determined by the value specified for the Accept-Language property in the HTTP request header.
This is returned only if there is a message to be notified.
-
- Examples
-
The following shows a usage example of the API to get time-series data of a service (sid: _JP1PFM-M_HOST2/_JP1PFM-AHOST_HOST20/_HOST_HOST20/_JP1PFM-A_serviceID) of a PFM agent that is a management object.
- Request:
POST http://hostname:20703/im/api/v1/nodes/timeSeries { "sid":"_JP1PFM-M_HOST2/_JP1PFM-AHOST_HOST20/_HOST_HOST20/_JP1PFM-A_serviceID", "metric":"cpu_used_rate", "startTime":"2019-05-22T00:00:00Z", "endTime":"2019-05-22T01:00:00Z", "countPerInstance":60, "instanceCount":10 }
- Response:
{ "metric":"cpu_used_rate", "timeSeriesData":[ { "unit":"%", "data":[ {"time":"2019-05-22T00:00:00Z","value":14.04}, ... ] } ], "exceedCountDetected": { "countPerInstance": true, "instanceCount": false } }