tencent cloud

APIs

DescribeClusterMetricConfigs

下载
聚焦模式
字号
最后更新时间: 2026-06-10 15:01:03

1. API Description

Domain name for API request: cls.intl.tencentcloudapi.com.

This API is used to obtain metric subscription configurations.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeClusterMetricConfigs.
Version Yes String Common Params. The value used for this API: 2020-10-16.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
GroupId Yes String Machine group ID.
Filters.N No Array of Filter
  • Filter configId by [collection configuration id]. Type: String. Required: No
  • name - String - required: no - filter by [configuration name]
  • Each request can have up to 10 Filters. The total upper limit of ALL Filter.Values is 100.
  • Offset No Integer Page offset. Default value: 0
    Limit No Integer Maximum number of entries per page. Default value: 20. Maximum value: 100.

    3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer Total number
    Datas Array of MetricCollectConfig List of metric collection configurations.
    Note: This field may return null, indicating that no valid values can be obtained.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Obtaining Metric Collection Configuration Under a Cluster

    Input Example

    POST / HTTP/1.1
    Host: cls.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeClusterMetricConfigs
    <Common request parameters>
    
    {
        "GroupId": "886bf7a8-7340-4314-8d64-b360da0ffd78",
        "Offset": 0,
        "Limit": 10
    }
    

    Output Example

    {
        "Response": {
            "Datas": [
                {
                    "ConfigId": "1bfadff7-9c5d-48c2-b985-21670d9d007e",
                    "CreateTime": 1724308693,
                    "Flag": 1,
                    "GroupIds": [
                        "886bf7a8-7340-4314-8d64-b360da0ffd78"
                    ],
                    "HonorLabels": false,
                    "Name": "test-test",
                    "Operate": 0,
                    "Scheme": "",
                    "ScrapeInterval": "",
                    "ScrapeTimeout": "",
                    "Source": 0,
                    "TopicIds": [
                        "d7adf66d-88a7-4321-8b4b-6f2c7a9773b8"
                    ],
                    "Type": 1,
                    "UpdateTime": 1724308693,
                    "YamlSpec": {
                        "Spec": "typemeta:\n  kind: ServiceMonitor\n  apiversion: monitoring.coreos.com/v1\nobjectmeta:\n  name: test-test\n  generatename: \"\"\n  namespace: test\n  selflink: \"\"\n  uid: \"\"\n  resourceversion: \"\"\n  generation: 0\n  creationtimestamp: \"0001-01-01T00:00:00Z\"\n  deletiontimestamp: null\n  deletiongraceperiodseconds: null\n  labels: {}\n  annotations: {}\n  ownerreferences: []\n  finalizers: []\n  managedfields: []\nspec:\n  joblabel: \"\"\n  targetlabels: []\n  podtargetlabels: []\n  endpoints:\n  - port: 8080-8080-tcp\n    targetport: null\n    path: /metrics\n    scheme: \"\"\n    params: {}\n    interval: 15s\n    scrapetimeout: \"\"\n    tlsconfig: null\n    bearertokenfile: \"\"\n    bearertokensecret: null\n    authorization: null\n    honorlabels: false\n    honortimestamps: null\n    tracktimestampsstaleness: null\n    basicauth: null\n    oauth2: null\n    metricrelabelconfigs: []\n    relabelconfigs:\n    - sourcelabels:\n      - __meta_kubernetes_pod_label_app\n      separator: null\n      targetlabel: application\n      regex: \"\"\n      modulus: 0\n      replacement: null\n      action: replace\n    proxyurl: null\n    followredirects: null\n    enablehttp2: null\n    filterrunning: null\n  selector:\n    matchlabels:\n      app: test\n    matchexpressions: []\n  namespaceselector:\n    any: false\n    matchnames:\n    - test\n  samplelimit: null\n  scrapeprotocols: []\n  targetlimit: null\n  labellimit: null\n  labelnamelengthlimit: null\n  labelvaluelengthlimit: null\n  keepdroppedtargets: null\n  attachmetadata: null\n  scrapeclassname: null\n  bodysizelimit: null\n",
                        "Type": "ServiceMonitor"
                    }
                },
                {
                    "ConfigId": "fd6dced0-5cc1-4d81-b0d3-c42ee56842cd",
                    "CreateTime": 1723640091,
                    "Flag": 0,
                    "GroupIds": [
                        "886bf7a8-7340-4314-8d64-b360da0ffd78"
                    ],
                    "HonorLabels": false,
                    "MetricLabel": {
                        "CustomLabels": [],
                        "Label": {
                            "Keys": [],
                            "Type": 0
                        },
                        "Metadata": [
                            "namespace",
                            "pod_name",
                            "pod_ip",
                            "pod_uid",
                            "container_name",
                            "container_id",
                            "image_name"
                        ]
                    },
                    "Name": "test1",
                    "Operate": 0,
                    "Scheme": "http",
                    "ScrapeInterval": "60s",
                    "ScrapeTimeout": "30s",
                    "Source": 0,
                    "Spec": {
                        "CustomSpecs": [
                            {
                                "Namespaces": [
                                    ""
                                ],
                                "Path": "/erq",
                                "PodLabel": [
                                    {
                                        "Key": "ab",
                                        "Operate": "=",
                                        "Values": [
                                            "em",
                                            "q"
                                        ]
                                    }
                                ],
                                "Port": "8080"
                            }
                        ]
                    },
                    "TopicIds": [
                        "d7adf66d-88a7-4321-8b4b-6f2c7a9773b8"
                    ],
                    "Type": 1,
                    "UpdateTime": 1723709068
                }
            ],
            "RequestId": "a725cc9c-2de7-4180-b1dc-b4bae8a79707",
            "TotalCount": 2
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    AuthFailure CAM signature/authentication error.
    AuthFailure.UnauthorizedOperation Request unauthorized.
    FailedOperation Operation failed.
    InternalError Internal error.
    InternalError.DbError DB Error.
    InternalError.IllegalRole Illegal role.
    InvalidParameter Incorrect parameter.
    InvalidParameter.ParamError Parameter error.
    InvalidParameterValue Incorrect parameter value.
    LimitExceeded.RecordOutOfLimit Record exceeds limit
    MissingParameter Missing parameter.
    OperationDenied.AccountNotExists The account does not exist.
    UnauthorizedOperation Unauthorized operation.
    UnknownParameter Unknown parameter error.
    UnsupportedOperation Unsupported operation.

    帮助和支持

    本页内容是否解决了您的问题?

    填写满意度调查问卷,共创更好文档体验。

    文档反馈