返回結果主要有 XML 和 JSON 兩種格式,預設為 XML,您可以指定公共請求參數 Format 變更返回結果的格式。更多詳情,請參閱 公共參數。為了便於查看和美觀,API 文檔返回樣本均有換行和縮排等處理,實際返回結果無換行和縮排處理。

正常返回樣本

介面調用成功後會返回介面返回參數和請求 ID,我們稱這樣的返回為正常返回。HTTP 狀態碼為 2xx。

  • XML 樣本
    <?xml version="1.0" encoding="UTF-8"?> <!--結果的根結點-->
    <ActionResponse> <!--返回請求標籤-->
        <RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId> <!--返回結果資料-->
    </ActionResponse>
  • JSON 樣本
    {
        "RequestId": "4C467B38-3910-447D-87BC-AC049166F216" /* 返回結果資料 */
    }

異常返回樣本

介面調用出錯後,會返回錯誤碼、錯誤資訊和請求 ID,我們稱這樣的返回為異常返回。HTTP 狀態碼為 4xx 或者 5xx。

您可以根據介面錯誤碼以及 公共錯誤碼 以及 API 錯誤中心 排查錯誤。當您無法排查錯誤時,可以 提交工單 聯繫我們,並在工單中註明服務節點 HostIdRequestId

  • XML 樣本
    <?xml version="1.0" encoding="UTF-8"?><!--結果的根結點-->
    <Error>
        <RequestId>540CFF28-407A-40B5-B6A5-74Bxxxxxxxxx</RequestId> <!--請求 ID-->
        <HostId>ecs.aliyuncs.com</HostId> <!--服務節點-->
        <Code>MissingParameter.CommandId</Code> <!--錯誤碼-->
        <Message>The input parameter “CommandId” that is mandatory for processing this request is not supplied.</Message> <!--錯誤資訊-->
    </Error>
  • JSON 樣本
    {
        "RequestId": "540CFF28-407A-40B5-B6A5-74Bxxxxxxxxx", /* 請求 ID */
        "HostId": "ecs.aliyuncs.com", /* 服務節點 */
        "Code": "MissingParameter.CommandId", /* 錯誤碼 */
        "Message": "The input parameter “CommandId” that is mandatory for processing this request is not supplied." /* 錯誤資訊 */
    }

公共錯誤碼

錯誤碼 HTTP 狀態碼 錯誤資訊
IdempotentParameterMismatch 400 The request is retried with updated parameters.
IllegalTimestamp 400 The input parameter “Timestamp” that is mandatory for processing this request is not supplied.
IncompleteSignature 400 The request signature does not conform to Aliyun standards.
InsufficientBalance 400 Your account does not have enough balance.
InvalidAccessKeyId.NotFound 400 The specified Access Key ID does not exist.
InvalidOwner 400 OwnerId and OwnerAccount can’t be used at one API access.
InvalidOwnerAccount 400 The specified OwnerAccount is not valid.
InvalidOwnerId 400 The specified OwnerId is not valid.
InvalidParamater 400 The specified parameter “SignatureMethod” is not valid.
InvalidParamater 400 The specified parameter “SignatureVersion” is not valid.
InvalidParameter 400 The specified parameter is not valid
InvalidParameter 400 The specified parameter “Action or Version” is not valid.
InvalidParameter.IsNull 400 The required parameter must be not null.
MissingParameter 400 The input parameter “Action” that is mandatory for processing this request is not supplied
MissingParameter 400 The input parameter “AccessKeyId” that is mandatory for processing this request is not supplied
MissingParameter 400 The input parameter “Signature” that is mandatory for processing the request is not supplied.
MissingParameter 400 The input parameter “TimeStamp” that is mandatory for processing this request is not supplied
MissingParameter 400 The input parameter “Version” that is mandatory for processing this request is not supplied
SignatureNonceUsed 400 The request signature nonce has been used.
Throttling 400 You have made too many requests within a short time; your request is denied due to request throttling.
UnsupportedParameter 400 The parameters is unsupported.
UnknownError 400 The request processing has failed due to some unknown error.
ChargeTypeViolation 403 The operation is not permitted due to charge type of the instance.
Forbidden.AccessKeyDisabled 403 The Access Key is disabled.
Forbidden.NotSupportRAM 403 This action does not support accessed by RAM mode.
Forbidden.RAM 403 User not authorized to operate on the specified resource, or this API doesn’t support RAM.
Forbidden.RiskControl 403 This operation is forbidden by Aliyun RiskControl system.
Forbidden.SubUser 403 The specified action is not available for you.
Forbidden.Unauthorized 403 User not authorized to operate on the specified resource.
InvalidAccount.NotFound 403 The specified Account does not exist.
InvalidAction 403 Specified action is not valid.
InvalidIdempotenceParameter.Mismatch 403 The specified parameters are different from before.
InvalidParameter.OwnerAccount 403 OwnerAccount is Invalid.
InvalidParameter.ResourceOwnerAccount 403 ResourceOwnerAccount is Invalid.
LastTokenProcessing 403 The last token request is processing.
MissingParameter 403 The input parameter OwnerId,OwnerAccount that is mandatory for processing this request is not supplied.
RealNameAuthenticationError 403 Your account has not passed the real-name authentication yet.
UnsupportedHTTPMethod 403 This http method is not supported.
InvalidDiskId.NotFound 404 The specified DiskId does not exist.
InvalidImageId.NotFound 404 The specified ImageId does not exist.
InvalidInstanceId.NotFound 404 The specified InstanceId does not exist.
InvalidRegionId.NotFound 404 The specified RegionId does not exist.
InvalidSecurityGroupId.NotFound 404 The specified SecurityGroupId does not exist.
InvalidSnapshotId.NotFound 404 The specified SnapshotId does not exist.
OperationConflict 409 Request was denied due to conflict with a previous request.
InternalError 500 The request processing has failed due to some unknown error, exception or failure.
ServiceUnavailable 503 The request has failed due to a temporary failure of the server.
ServiceUnavailable.RegionMaintaining 503 System maintenance is in progress on the selected region, please wait a few minutes before trying again.