Checking Instance Status

Last updated: 2020-06-07 14:45:54

    Note:

    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new CVM API 3.0 which is standardized and faster.

    1. API Description

    This API (DescribeInstancesStatus) is used to query the status of one or more instances.

    Domain name for API request: cvm.api.qcloud.com

    • You can query the status of an instance according to its ID.
    • If the parameter is empty, the status of a certain number (specified by Limit, the default is 20) of instances is returned to the current user.

    2. Input Parameters

    The following request parameter list only provides API request parameters. For other parameters, please see Common Request Parameters.

    Parameter Name Type Required Description
    Version String Yes API version number, used to identify the API version you are requesting. For the first version of this API, input "2017-03-12".
    InstanceIds.N array of Strings No To query according to one or more instance IDs, such as ins-11112222. For the format of this parameter, please see id.n section of API Introduction.
    Offset Integer No Offset. Default is 0. For more information on offset, please see relevant sections of API Introduction.
    Limit Integer No Number of results to be returned. Default is 20. Maximum is 100. For more information on limit, please see relevant sections of API Introduction.

    3. Output Parameters

    Parameter Name Type Description
    RequestId String Unique request ID. RequestId is returned for each request. In case of a failed call to the API, RequestId needs to be provided when you contact the developer at backend.
    TotalCount Integer Number of instance statuses that meet the condition.
    InstanceStatusSet array of InstanceStatus objects Instance Status list.

    4. Error Codes

    The following error codes only include the business logic error codes for this API. For additional error codes, please see Common Error Codes.

    Error code Description
    InvalidParameterValue Invalid parameter value. Parameter value is in an incorrect format or is not supported.
    InvalidInstanceId.Malformed Invalid instance ID. The specified instance ID is in an incorrect format. For example, ins-1122 indicates an ID length error.
    InvalidParameterValue.LimitExceeded The number of parameter values exceeds the limit.
    InternalServerError Internal service error.

    5. Example

    Input

    https://cvm.api.qcloud.com/v2/index.php?Action=DescribeInstancesStatus
    &Version=2017-03-12
    &InstanceIds.1=ins-r8hr2upy
    &InstanceIds.2=ins-5d8a23rs
    &Offset=0
    &Limit=2
    &<Common request parameters>
    

    Output

    {
        "Response": {
            "TotalCount": 2,
            "InstanceStatusSet": [
                {
                    "InstanceId": "ins-r8hr2upy",
                    "InstanceState": "RUNNING"
                },
                {
                    "InstanceId": "ins-5d8a23rs",
                    "InstanceState": "STOPPED"
                }
            ],
            "RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7"
        }
    }
    

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help