tencent cloud

Feedback

DescribeHealthScore

Last updated: 2024-11-19 21:55:25

    1. API Description

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

    This API is used to obtain the health score and deduction for exceptions in the specified time period (30 minutes) based on the instance ID.

    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: DescribeHealthScore.
    Version Yes String Common Params. The value used for this API: 2019-10-16.
    Region Yes String Common Params. For more information, please see the list of regions supported by the product.
    InstanceId Yes String The instance ID that needs to obtain the health score
    Time Yes Timestamp ISO8601 Time to obtain the health score
    Product Yes String Service type. Valid values: mysql (TencentDB for MySQL), cynosdb (TDSQL-C for MySQL (compatible with MySQL)). Default value: mysql.

    3. Output Parameters

    Parameter Name Type Description
    Data HealthScoreInfo Health score and deduction for exceptions
    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 health score

    This example shows you how to obtain health score and deduction for exceptions based on instance ID.

    Input Example

    https://dbbrain.intl.tencentcloudapi.com/?Action=DescribeHealthScore
    &InstanceId=test
    &Time=2019-01-01T00:00:00+08:00
    &Product=mysql
    &<common request parameters>
    

    Output Example

    {
        "Response": {
            "RequestId": "8b307450-6118-11eb-88ad-93c053da68c6",
            "Data": {
                "IssueTypes": [
                    {
                        "TotalCount": 0,
                        "Events": [],
                        "IssueType": "AVAILABILITY"
                    },
                    {
                        "TotalCount": 0,
                        "Events": [],
                        "IssueType": "MAINTAINABILITY"
                    },
                    {
                        "TotalCount": 1,
                        "Events": [
                            {
                                "DiagType": “high-concurrency/pressure request”,
                                "ScoreLost": 6,
                                "EndTime": "2021-01-28 11:20:42",
                                "StartTime": "2021-01-28 11:00:00",
                                "EventId": 780019530,
                                "Outline": "Monitoring metric \"cpu_use_rate\" triggered an alarm. Current value: 100",
                                "Severity": 1,
                                "Metric": "cpu_use_rate",
                                "Count": 1
                            }
                        ],
                        "IssueType": "PERFORMANCE"
                    },
                    {
                        "TotalCount": 3,
                        "Events": [
                            {
                                "DiagType": “Replicate”,
                                "ScoreLost": 10,
                                "EndTime": "2021-01-28 11:21:17",
                                "StartTime": "2021-01-28 11:20:25",
                                "EventId": 780018741,
                                "Outline": “I/O replication thread interrupted”,
                                "Severity": 1,
                                "Metric": "slave_io_running",
                                "Count": 1
                            },
                            {
                                "DiagType": “Replicate”,
                                "ScoreLost": 10,
                                "EndTime": "2021-01-28 11:09:37",
                                "StartTime": "2021-01-28 11:09:32",
                                "EventId": 779984938,
                                "Outline": “I/O replication thread interrupted”,
                                "Severity": 1,
                                "Metric": "slave_io_running",
                                "Count": 1
                            },
                            {
                                "DiagType": “Replicate”,
                                "ScoreLost": 8,
                                "EndTime": "2021-01-28 11:20:00",
                                "StartTime": "2021-01-28 11:20:00",
                                "EventId": 780021648,
                                "Outline": “Replication delayed”,
                                "Severity": 2,
                                "Metric": "slave_io_running",
                                "Count": 1
                            }
                        ],
                        "IssueType": "RELIABILITY"
                    }
                ],
                "EventsTotalCount": 4,
                "HealthLevel": "RISK"
            }
        }
    }
    

    Example2 Requesting health score

    Input Example

    POST / HTTP/1.1
    Host: dbbrain.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeHealthScore
    <Common request parameters>
    
    {
        "InstanceId": "cdb-8jawylhf",
        "Product": "mysql",
        "Time": "2021-02-01 14:30:00"
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "0736b315-a9be-4991-92e6-28eccf3d31e3",
            "Data": {
                "IssueTypes": [
                    {
                        "TotalCount": 0,
                        "Events": [],
                        "IssueType": "AVAILABILITY"
                    },
                    {
                        "TotalCount": 0,
                        "Events": [],
                        "IssueType": "MAINTAINABILITY"
                    },
                    {
                        "TotalCount": 0,
                        "Events": [],
                        "IssueType": "PERFORMANCE"
                    },
                    {
                        "TotalCount": 0,
                        "Events": [],
                        "IssueType": "RELIABILITY"
                    }
                ],
                "HealthScore": 100,
                "EventsTotalCount": 0,
                "HealthLevel": "HEALTH"
            }
        }
    }
    

    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 Error with CAM signature/authentication.
    InternalError Internal error.
    InvalidParameter Incorrect parameter.
    InvalidParameterValue Incorrect parameter value.
    MissingParameter Missing parameter.
    OperationDenied.UserHasNoStrategy Error with CAM authentication.
    RequestLimitExceeded The number of requests exceeds the frequency limit.
    UnauthorizedOperation The operation is unauthorized.
    UnknownParameter Unknown parameter.
    UnsupportedOperation Unsupported operation.
    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