GetMonitorData

Last updated: 2021-04-06 19:30:06

    API Description

    This API is used to get the monitoring data of the CLB instance by passing in the namespace, object dimension description, and monitoring metric of the instance.

    Domain name for API calls: monitor.api.qcloud.com

    Request Parameters

    The list below contains only the API request parameters. Common parameters should be added when you call the API. For more information, see Common Request Parameters. The Action field for this API is GetMonitorData.

    Parameter Required Type Description
    namespace Yes String Namespace. Each Tencent Cloud service has a namespace. There are two namespaces for CLB: qce/lb_public for public network CLB and qce/lb_private for private network CLB.
    metricName Yes String Monitoring metric to be obtained, such as `connum` for current connection, and `intraffic` for inbound bandwidth. For more information, see the table below.
    dimensions.n.name Yes String Dimension name. You can use a combination of dimensions to get the monitoring data. Each namespace has different dimension structures as shown in the table below. This parameter should be used with `dimensions.n.value`.
    dimensions.n.value Yes String Values of a specified dimension.
    startTime No Datetime Start time such as 2017-01-01 00:00:00. The default time is 00:00:00 on the current day.
    endTime No Datetime End time such as 2017-01-01 10:00:00. The current time is used by default.
    Note: it cannot be earlier than `startTime`, and we recommend configuring it on the same day as `startTime`.
    period No Int Statistical period for monitoring data. Valid values: 60s and 300s. If this parameter is not passed in, 300s will be used by default.

    Currently, CLB supports displaying the following metrics (metricName)

    Metric Description Unit
    Connum Current connections -
    new_conn New connections -
    Intraffic Inbound bandwidth Mbps
    outtraffic Outbound bandwidth Mbps
    inpkg Inbound packets Packets/sec
    outpkg Outbound packets Packets/sec

    The namespaces of CLB instances and their respective monitoring dimensions are described as follows:

    Public network CLB instance namespace qce/lb_public

    The qce/lb_public namespace can be used to query all the monitoring data of the public network CLB instances.
    qce/lb_public supports the following dimension groups:

    • Public network CLB dimension
      This dimension reflects the overall monitoring metric of a public network CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters >
    &namespace=qce/lb_public
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    
    • Public network CLB port dimension
      This dimension reflects the monitoring metric of the port on a public network CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    loadBalancerPort Port Int, such as 80
    protocol Protocol String, such as TCP

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters >
    &namespace=qce/lb_public
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=loadBalancerPort
    &dimensions.1.value=80
    &dimensions.2.name=protocol
    &dimensions.2.value=tcp
    
    • Public network CLB real server dimension
      This dimension reflects the monitoring metric of the real server bound to a public network CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    loadBalancerPort CLB port Int, such as 80
    protocol Protocol String, such as TCP
    vpcId VPC ID of the CLB instance Int, such as 1111
    lanIp IP address of the real server bound to the CLB instance IP address, such as 111.111.111.11

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters >
    &namespace=qce/lb_public
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=loadBalancerPort
    &dimensions.1.value=80
    &dimensions.2.name=protocol
    &dimensions.2.value=tcp
    &dimensions.3.name=vpcId
    &dimensions.3.value=1111
    &dimensions.4.name=lanIp
    &dimensions.4.value=111.222.111.22
    
    • Public network CLB real server port dimension
      This dimension reflects the monitoring metric of a port on the real server bound to a public network CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    loadBalancerPort CLB port Int, such as 80
    protocol Protocol String, such as TCP
    vpcId VPC ID of the CLB instance Int, such as 1111
    lanIp IP address of the real server bound to the CLB instance IP address, such as 111.111.111.11
    port Port number of the real server bound to the CLB instance Int, such as 80

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters >
    &namespace=qce/lb_public
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=loadBalancerPort
    &dimensions.1.value=80
    &dimensions.2.name=protocol
    &dimensions.2.value=tcp
    &dimensions.3.name=vpcId
    &dimensions.3.value=1111
    &dimensions.4.name=lanIp
    &dimensions.4.value=111.222.111.22
    &dimensions.5.name=port
    &dimensions.5.value=80
    

    Private network CLB instance namespace qce/lb_private

    The qce/lb_private namespace can be used to query all monitoring data of the private network CLB instance.

    • Private network CLB dimension
      This dimension reflects the overall monitoring metric of a private network CLB instance. The dimension (dimensions.n.name) to be specified is as follows. Since the private VIP may be repeated, vpcId is also required to uniquely specify a CLB instance:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    vpcId VPC ID of the CLB instance Int, such as 1111

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=Ge