Return Format for Async Task APIs

Last updated: 2019-09-20 11:48:15

    Format of Returned Results for Common Asynchronous Task APIs

    Sending one request to common Asynchronous Task API allows you to operate only one type of resource at a time. For example, you can create load balancer or reset server operating system by making a call to the specified common Asynchronous Task API.

    Name Type Description Required
    code Int Error code of the returned result. 0: success; other values: failure. Yes
    message String Error message of the returned result. No
    requestId String Task number Yes

    Format of Returned Results for Batch Asynchronous Task APIs

    With such asynchronous task APIs, multiple resources can be operated for each request, for example, changing passwords, starting or shutting down servers.

    Name Type Description Required
    code Int Error code of the returned result. 0: success; other values: failure. Yes
    message String Error message of the returned result. No
    detail Array The code, message, and requestId of the resource operation are returned with the resource ID as the key. Yes

    For example:

    {
        "code": 0,
        "message": "success",
        "detail": {
            "qcvm6a456b0d8f01d4b2b1f5073d3fb8ccc0": {
                "code": 0,
                "message": "",
                "requestId": "1231231231231"
            },
            "qcvm6a456b0d8f01d4b2b1f5073d3fb8ccc0": {
                "code": 0,
                "message": "",
                "requestId": "1231231231232"
            }
        }
    }
    • If the operation succeeds for all resources, the outermost code is 0.
    • If the operation fails for all resources, the outermost code is 5100.
    • If the operation fails for some resources, the outermost code is 5400.
    • In the third case, the terminal can obtain information about the failed operations via the detail field.

    Was this page helpful?

    Was this page helpful?

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