Hitachi

JP1 Version 12 JP1/Operations Analytics REST API Reference Guide


1.8.10 Acquiring basic information and performance information for resources in CSV format

This section describes the formats of the requests to be used to output the following information in CSV format: basic information of the target resource, the latest performance information of each metric owned by the target resource, and performance information (in chronological order) of a specific metric owned by the target resource. This section also describes the contents to be specified in the request body.

Context

Acquire basic information and performance information for a resource step-by-step. The following is the acquisition procedure:

  1. Use the API function for acquiring the list of resources to acquire the resource ID.

  2. Use the API function for acquiring resource information in CSV format to acquire resource information. Specify the resource ID acquired in step 1 in the request body.

  3. Use the API function for acquiring the latest resource performance information in CSV format to acquire the latest resource performance information. Specify the resource ID acquired in step 1 or step 2 in the request body.

  4. Use the API function for acquiring metric performance information (in chronological order) in CSV format to acquire metric performance information (in chronological order). Specify the metric ID acquired in step 3 in the request body.

The following describes the acquisition procedure by using an example of acquiring the usage of CPU01, a resource of hypervisor 01.

Procedure

  1. Acquire the list of hypervisors to acquire the ID of hypervisor 01, which owns CPU01. Issue the request in the following format:

    GET http://host:port/Analytics/version/objects/Hypervisors

    In the response body that is output as follows, confirm that the ID of hypervisor 01 is "4".

    {
      "data" : [ {
        "instanceID" : 4,
        "name" : "hyperV",
        ...,
      }, ...
    }
  2. Specify the ID of hypervisor 01 in the request body to acquire information about hypervisor 01. Issue the request in the following format:

    POST http://host:port/Analytics/version/services/E2EView/actions/getNodesDataCSV/invoke

    The table below shows the objects to be specified as the members of the parameters in the request body.

    Table 1‒12: Members to be specified when acquiring basic resource information

    Member

    Whether to specify

    Description

    basePointNodes

    Required

    For nodeID, specify "4", which is the ID acquired in step 1. For nodeType, specify the type of the node. For the values that can be specified as a node type, see the table for E2ENodeType in 1.6 List of enumerators.

    getType

    Required

    To acquire basic information only, specify BasicInformation. To also acquire related information, specify AllInformation. To acquire information about the components, such as the CPU, memory, and NICs, specify AllInformation.

    In the response body that is output as follows, confirm that the ID of CPU01 is "4".

    {
      "instanceID" : "0052a2e2-713c-4cfb-892c-e9aaefb32b50",
      "created" : "2019-09-22T11:53:42.188+09:00",
      "updated" : "2019-09-22T11:53:42.354+09:00",
      "completed" : "2019-09-22T11:53:42.354+09:00",
      "state" : "success", 
      "affectedResource" : [ ],
      "result" : [ {
        "data": ""#JP1/Operations Analytics","121000","UTF-8 (BOM)"\n"#Resource Information"\n...",...,ResourceID,ResourceName,ResourceType,...,cpu4,CPU01,CPU,...,vm1,VM001,VM,...
      } ]
    }
  3. Specify the ID of CPU01 in the request body to acquire the latest performance information for the resource. Issue the request in the following format:

    POST http://host:port/Analytics/version/services/PerfComponents/actions/getNodesGraphDataCSV/invoke

    The table below shows the objects to be specified as members of parameters in the request body.

    Table 1‒13: Members to be specified when acquiring the latest resource performance information

    Member

    Whether to specify

    Description

    basePointNodes

    Required

    For nodeID, specify "4", which is the ID that was acquired in step 2. For nodeType, specify the type of the node. For the values can be specified as a node type, see the table for E2ENodeType in 1.6 List of enumerators.

    baseTime

    Optional

    The time of the base point to acquire performance information. If you omit this item, the time that the API function is executed is used as the base point.

    In the response body that is output as follows, confirm that the ID of CPU usage is "2".

    {
      "instanceID" : "0052a2e2-713c-4cfb-892c-e9aaefb32b50",
      "created" : "2019-09-22T11:53:42.188+09:00",
      "updated" : "2019-09-22T11:53:42.354+09:00",
      "completed" : "2019-09-22T11:53:42.354+09:00",
      "state" : "success",
      "affectedResource" : [ ],
      "result" : [ {
        "data": ""#JP1/Operations Analytics","111000","UTF-8 (BOM)"\n"#Latest PerformanceInformation"\n...",...,Performance ID,...,1,...,2,...,3,...
      } ]
    }
    
  4. Specify the ID of CPU usage in the request body to acquire resource performance information (in chronological order). Issue the request in the following format:

    POST http://host:port/Analytics/version/services/PerfComponents/actions/getGraphDataCSV/invoke

    The table below shows the objects to be specified as members of parameters in the request body.

    Table 1‒14: Members to be specified when acquiring resource performance information (in chronological order)

    Member

    Whether to specify

    Description

    perfComponentIDs

    Required

    For perfComponentIDs, specify "2", which is the ID acquired in step 3.

    baseTime

    Optional

    The time of the base point to acquire performance information. If you omit this item, the time that the API function is executed is used as the base point.

    pointTimeRange

    Required

    Specify the period (in milliseconds) for acquiring performance information.

Result

You can acquire, in CSV format, basic information of the target resource by performing step 2, the latest performance information of each metric owned by the target resource by performing step 3, and performance information (in chronological order) of a specific metric owned by the target resource by performing step 4.