You can obtain information related to metrics, such as the display name and unit.
Execution permission
Admin, Modify
Request line
POST baseURL/v1/services/PerformanceData/actions/getMetricData/invoke
Request body
The structure of the request body and the object attributes are as follows:Action
{ "name":"...", "href":"...", "method":"...", "type":"...", "parameters":["...", ...] }
Action (Type: Action)
Attribute |
Type |
Description |
---|---|---|
name |
string |
Name of the action. |
href |
string |
URL for the action. |
method |
string |
Name of the method. |
type |
string |
Data format for the object. |
parameters |
anyType[] |
A list of MetricDataParam objects necessary to execute an operation. For details, see the table below. |
MetricDataParam
{ "resourceType":"...", "componentType":"...", "priority":"..." }
MetricDataParam (Type: MetricDataParam)
Attribute |
Type |
Description |
---|---|---|
resourceType |
enum |
Type of resource that the metric belongs to (For details about the valid values, see the table PerformanceResourceType in List of enumerators.) |
componentType |
enum |
Type of component that the metric belongs to (For details about the valid values, see the table ComponentType in List of enumerators.) |
priority |
enum |
Priority of the metric (For details about the valid values, see the table MetricPriorityType in List of enumerators.) |
Response body
The structure of the response body and the object attributes is as follows:Job
{ "instanceID":"...", "created":"...", "updated":"...", "completed":"...", "state":"...", "affectedResource":["...", ...], "result":["...", ...] }
Job (Type: Job)
Attribute |
Type |
Description |
---|---|---|
instanceID |
string |
ID of the Instance. |
created |
string |
Date the object is generated in "yyyy-mm-ddThh:mm:ss.mmmTZD" format (e.g., 2017-08-25T20:07:39.472+09:00). |
updated |
string |
Time the object is updated in "yyyy-mm-ddThh:mm:ss.mmmTZD" format (e.g., 2017-08-25T20:07:39.472+09:00). |
completed |
string |
Time the processing completed in "yyyy-mm-ddThh:mm:ss.mmmTZD" format (e.g., 2017-08-25T20:07:39.472+09:00). |
state |
string |
One of the following values is set: "failed": The operation failed. "success": The operation completed successfully. |
affectedResource |
string[] |
A blank space is set. |
result |
anyType[] |
A list of Collections objects. For details, see the table below. |
Collections
{ "data":["...", ...], "pagination":{ "page":"...", "pageSize":"...", "numPages":"...", "totalCount":"..." }, "count":"..." }
Collections (Type: Collections)
Attribute |
Type |
Description |
---|---|---|
data |
anyType[] |
A list of MetricType objects. For details, see the table below. |
pagination |
Pagination |
Page information. This parameter is displayed only when the relevant resource exists. |
count |
int |
Number of data items that meet the conditions related to this query(API). |
pagination (Type: Pagination)
Attribute |
Type |
Description |
---|---|---|
page |
integer |
Page. |
pageSize |
integer |
Size of page. |
numPages |
integer |
Number of pages. |
totalCount |
integer |
Number of objects. |
MetricType
{ "metricType":"...", "metricName":"...", "displayOrder":"...", "unit":"...", "priority":"...", "resourceType":"...", "componentType":"...", "status":"...", "proportion":"..." }
MetricType (Type: MetricType)
Attribute |
Type |
Description |
---|---|---|
metricType |
enum |
Type of the metric (For details about the valid values, see the table MetricType in List of enumerators.) |
metricName |
string |
Name of the metric |
displayOrder |
int |
Order of displaying metric |
unit |
string |
Unit of the metric |
priority |
enum |
Priority of the metric (For details about the valid values, see the table MetricPriorityType in List of enumerators.) |
resourceType |
enum |
Type of resource that the metric belongs to (For details about the valid values, see the table PerformanceResourceType in List of enumerators.) |
componentType |
enum |
Type of component that the metric belongs to (For details about the valid values, see the table ComponentType in List of enumerators.) |
status |
enum |
Status of the performance information (For details about the valid values, see the table ElementStatusType in List of enumerators.) |
proportion |
boolean |
Direction of a perfomrance value. If a warning or critical is generated when the the value goes up, "true" is set. If a warning or critical is generated when the value goes down , "false" is set. |
Status codes
Status code |
Reason phrase |
Description |
---|---|---|
200 |
OK |
Success. |
400 |
Bad Request |
The format of the request body is invalid. |
401 |
Unauthorized |
No login privilege. |
403 |
Forbidden |
No reference privilege. |
412 |
Precondition Failed |
The server is not available. |
500 |
Internal Server Error |
Server processing error. |
Example code
[Request Header] POST /Analytics/v1/services/PerformanceData/actions/getMetricData/invoke Authorization: Basic c3lzdGVtOm1hbmFnZXI= Host: localhost:22015 Accept: application/json Content-Type: application/json [Request Body] { "name": "getMetricData", "href": "http://localhost:22015/Analytics/v1/services/PerformanceData/actions/getMetricData/invoke", "method": "POST", "type": "application/json", "parameters":[{ "resourceType":"ESX_VM", "componentType":"VIRTUAL_MACHINE", "priority":"Basic", "metricType":"ESX_VM_VM_CPUREADY" }] } [Response Header] HTTP/1.1 200 OK Date: Thu, 11 Aug 2016 17:56:01 GMT Server: Cosminexus HTTP Server Cache-Control: no-cache WWW-Authenticate: HSSO 8113b75377dac59b7c48ee2b947b20d3bbc11f_YXZvNFIMehp3UB4jbmVyPGUgT3Q=_V0810 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Transfer-Encoding: chunked Content-Type: application/json [Response Body] { "instanceID" : "df788f95-e53f-48e1-b666-8c6e23fe78c4", "created" : "2016-08-12T02:56:01.736+09:00", "updated" : "2016-08-12T02:56:01.737+09:00", "completed" : "2016-08-12T02:56:01.737+09:00", "state" : "success", "affectedResource" : [ ], "result" : [ { "data" : [ { "metricType" : "ESX_VM_VM_CPUREADY", "metricName" : "CPU Ready (VMware Virtual Machine)", "displayOrder" : 41700, "unit" : "msec", "priority" : "Basic", "resourceType" : "ESX_VM", "componentType" : "VIRTUAL_MACHINE", "status" : "Unknown", "proportion" : false } ] } ] }