Updated on 2022-02-22 GMT+08:00

Querying the Host Configuration

Function

This API is used to query the host configuration for a specified event type in a specified period of time. You can specify the dimension of data to be queried.

This API is provided for SAP Monitor in the HANA scenario to query the host configuration. In other scenarios, the host configuration cannot be queried with this API.

URI

GET /V1.0/{project_id}/event-data

  • Parameter description
    Table 1 Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

    For details about how to obtain the project ID, see Obtaining a Project ID.

  • Parameters that are used to query the host configuration

    Parameter

    Mandatory

    Type

    Description

    namespace

    Yes

    String

    Query the namespace of a service. For example, see Namespace for ECS namespace.

    The value must be in the service.item format and can contain 3 to 32 characters. service and item each must be a string that starts with a letter and contains only uppercase letters, lowercase letters, digits, and underscores (_).

    type

    Yes

    String

    Specifies the event type.

    It can contain only letters, underscores (_), and hyphens (-). It must start with a letter and cannot exceed 64 characters, for example, instance_host_info.

    from

    Yes

    String

    Specifies the start time of the query.

    The value is a UNIX timestamp and the unit is ms.

    to

    Yes

    String

    Specifies the end time of the query.

    The value is a UNIX timestamp and the unit is ms.

    The value of parameter from must be earlier than that of parameter to.

    dim

    Yes

    String

    Specifies the dimension. For example, the ECS dimension is instance_id.

    Specifies the dimension. A maximum of three dimensions are supported, and the dimensions are numbered from 0 in dim.{i}=key,value format. The key cannot exceed 32 characters and the value cannot exceed 256 characters.

    Example: dim.0=instance_id,i-12345

  • Example: Query the configuration information about the ECS whose ID is 33328f02-3814-422e-b688-bfdba93d4051 and type is instance_host_info.
    GET https://{Cloud Eye endpoint}/V1.0/{project_id}/event-data?namespace=SYS.ECS&dim.0=instance_id,33328f02-3814-422e-b688-bfdba93d4051&type=instance_host_info&from=1450234543422&to=1450320943422

Request

None

Response

  • Response parameters
    Table 2 Response parameters

    Parameter

    Type

    Description

    datapoints

    Array of objects

    Specifies the configuration list.

    If the corresponding configuration information does not exist, datapoints is an empty array and is [].

    For details, see Table 3.

    Table 3 datapoints field data structure description

    Parameter

    Type

    Description

    type

    String

    Specifies the event type, for example, instance_host_info.

    timestamp

    long

    Specifies the time when the event is reported. It is a UNIX timestamp and the unit is ms.

    value

    String

    Specifies the host configuration information.

  • Example response
    {
        "datapoints": [
            {
                "type": "instance_host_info",
                "timestamp": 1450231200000,
                "value": "xxx"
            },
            {
                "type": "instance_host_info",
                "timestamp": 1450231800000,
                "value": "xxx"
            }
        ]
    }

Returned Values

  • Normal

    200

  • Abnormal

    Returned Values

    Description

    400 Bad Request

    Request error.

    401 Unauthorized

    The authentication information is not provided or is incorrect.

    403 Forbidden

    You are forbidden to access the page requested.

    408 Request Timeout

    The request timed out.

    429 Too Many Requests

    Concurrent requests are excessive.

    500 Internal Server Error

    Failed to complete the request because of an internal service error.

    503 Service Unavailable

    The service is currently unavailable.

Error Code

For details, see Error Codes.