tencent cloud

Feedback

CreatePrometheusClusterAgent

Last updated: 2024-11-26 16:52:00

    1. API Description

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

    This API is used to associate a cluster with a Cloud Monitor (CM)-integrated Tencent Managed Service for Prometheus (TMP) 2.0 instance.

    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: CreatePrometheusClusterAgent.
    Version Yes String Common Params. The value used for this API: 2018-07-24.
    Region Yes String Common Params. For more information, please see the list of regions supported by the product.
    InstanceId Yes String Instance ID
    Agents.N Yes Array of PrometheusClusterAgentBasic Agent list

    3. Output Parameters

    Parameter Name Type Description
    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 Associating with a cluster

    This example shows you how to associate with an EKS cluster.

    Input Example

    POST / HTTP/1.1
    Host: monitor.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreatePrometheusClusterAgent
    <Common request parameters>
    
    {
        "InstanceId": "xxx",
        "Agents": [
            {
                "EnableExternal": true,
                "Region": "xxx",
                "ClusterId": "xxx",
                "ClusterType": "xxx",
                "NotInstallBasicScrape": true,
                "InClusterPodConfig": {
                    "HostNet": true,
                    "Tolerations": [
                        {
                            "Operator": "xxx",
                            "Effect": "xxx",
                            "Key": "xxx"
                        }
                    ],
                    "NodeSelector": [
                        {
                            "Name": "xxx",
                            "Value": "xxx"
                        }
                    ]
                },
                "NotScrape": true,
                "ExternalLabels": [
                    {
                        "Name": "xxx",
                        "Value": "xxx"
                    }
                ]
            }
        ]
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "xxx"
        }
    }
    

    Example2 Associating with an EKS cluster

    This example shows you how to associate with an EKS cluster.

    Input Example

    POST / HTTP/1.1
    Host: monitor.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreatePrometheusClusterAgent
    <Common request parameters>
    
    {
        "InstanceId": "prom-2tghe0lv",
        "Agents": [
            {
                "Region": "ap-beijing",
                "EnableExternal": "false",
                "ClusterId": "cls-ou716dcp",
                "NotScrape": "true",
                "ClusterType": "eks"
            }
        ]
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "562197b9-5253-4981-ab2c-8c648fc5dec8"
        }
    }
    

    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
    FailedOperation.ComponentClientCommon FailedOperation.ComponentClientCommon
    FailedOperation.ComponentClientHttp FailedOperation.ComponentClientHttp
    InternalError Internal error.
    InternalError.Db InternalError.Db
    InternalError.DbRecordNotFound InternalError.DbRecordNotFound
    InternalError.Param InternalError.Param
    InternalError.UnexpectedInternal InternalError.UnexpectedInternal
    InvalidParameter.Param InvalidParameter.Param
    InvalidParameter.PromInstanceNotFound InvalidParameter.PromInstanceNotFound
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support