Final Returned Format

Last updated: 2017-12-06 11:21:20

As described in Description of Return Structure, a complete return result of an API consists of Common Return Parameters and Instruction Return Parameters. The common return parameters are returned each time the API is called, while the instruction return parameters are specific to each API.

Take calling View Scaling Group List(DescribeScalingGroup) API via Final Request as an example, the possible return results when the call succeeds and fails are as follows:

1. Return Parameters When API Call Succeeds

If the API call succeeds, the final return parameters will include both common return parameters and instructions return parameters, the error code will be 0, and the message field for error information will be empty.

{
    "code": 0,
    "message": "",
    "data": {
        "totalCount": 1,
        "scalingGroupSet": [
            {
                "scalingGroupId": "asg-d4hmoms6",
                "scalingGroupName": "test",
                "scalingConfigurationId": "asc-hq6jo6h4",
                "scalingConfigurationName": "test",
                "minSize": 0,
                "maxSize": 1,
                "createTime": "2016-06-04 23:58:03",
                "instanceNum": 0,
                "removePolicy": "RemoveOldestInstance",
                "loadBalancerIdSet": [],
                "vpcId": 0,
                "subnetIdSet": [],
                "zoneIdSet": [
                    {
                        "status": 1,
                        "owner": "1251707795",
                        "zoneId": 100002
                    }
                ],
                "projectId": 0
            }
        ]
    }
}

2. Return Parameters When API Call Fails

If the API call fails, the final return parameters will only include common return parameters, the error code will not be 0, and the message field will displays detailed error information.

{
    "code": XXXX,
    "message": "(XXXX)XXXXX",
}