Restore Instance (Pay per Use)

Last updated: 2017-12-14 10:06:52

    1. API Description

    This API (OpenCdbHour) is used to recover the isolated instance with pay by usage mode. Please make sure that the account is topped up.
    Domain for API request: cdb.api.qcloud.com

    2. Input Parameters

    The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is OpenCdbHour.

    Parameter Name Required Type Description
    cdbInstanceIds.n Yes String One or more instance IDs (n represents array subscript starting with 0). Instance ID, such as: cdb-c1nl9rpv. It is identical to the instance ID displayed in the Cloud Database console page and can be obtained using API Query List of Instances. Its value equals to the uInstanceId field value in the output parameter.
    instanceRole No String Instance type. Default is master. Possible values include: master - master instance/disaster recovery instance; ro - read-only instance.

    3. Output Parameters

    Parameter Name Type Description
    code Int Common error code; 0: Succeeded; other values: Failed. For more information, please refer to Common Error Codes on the Error Code page.
    message String Module error message description depending on API.
    codeDesc String Error description
    data Array Returned data

    Parameter data is composed of the following parameters:

    Parameter Name Type Description
    instanceRole String Instance type. Default is master. Possible values include: master - master instance/disaster recovery instance; ro - read-only instance.
    cdbInstanceIds Array List of the result of recovering instances
    Parameter cdbInstanceIds is composed of the following parameters:
    Parameter Name Type Description
    code Int Result, possibly return values: 0 - Succeeded; other values - Failed
    message String Error description. Valid only if code is not 0
    oldStatus String Status value of instance before change, possible values include: 1 - running; 5 - isolated
    cdbInstanceId String Instance ID

    4. Error Codes

    The following error codes only include the business logic error codes for this API.

    Error Code Error Message Error Description
    100207 OperationConstraints.AccountBalanceNotEnough Insufficient balance
    9003 InvalidParameter Incorrect parameter
    9640 InternalFailure Account balance query failed
    9572 InstanceNotExists Instance does not exist
    9548 IncorrectInstanceStatus Database is not isolated
    9592 OperationDenied Task is running

    5. Example

    Input

    https://cdb.api.qcloud.com/v2/index.php?Action=OpenCdbHour
    &<Common request parameters>
    &cdbInstanceIds.0=cdb-41lrk52w
    &instanceRole=master
    

    Output

    {
        "code":"0",
        "message":"",
        "codeDesc":"Success",
        "data":{
            "cdbInstanceIds":[
                {
                    "oldStatus":"5",
                    "code":"0",
                    "message":"",
                    "cdbInstanceId":"cdb-41lrk52w"
                }
            ],
            "instanceRole":"master"
        }
    }

    Was this page helpful?

    Was this page helpful?

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