本文介绍每个专有宿主机接口都需要使用的请求参数、返回参数和公共错误码。
公共请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | AllocateDedicatedHosts | API的名称。更多信息,请参见API概览。 |
AccessKeyId | String | 是 | key-test | 访问密钥ID。AccessKey用于调用API,而用户密码用于登录ECS管理控制台。
更多信息,请参见获取AccessKey。 |
Signature | String | 是 | Pc5WB8gokVn0xfeu%2FZV%2BiNM1dgI%3D | 您的签名。更多信息,请参见签名机制。 |
SignatureMethod | String | 是 | HMAC-SHA1 | 签名方式。取值范围:HMAC-SHA1。 |
SignatureVersion | String | 是 | 1.0 | 签名算法版本。取值范围:1.0。 |
SignatureNonce | String | 是 | 15215528852396 | 签名唯一随机数。用于防止网络重放攻击,建议您每一次请求都使用不同的随机数。 |
Timestamp | String | 是 | 2018-01-01T12:00:00Z | 请求的时间戳。按照ISO8601标准表示,并需要使用UTC时间,格式为yyyy-MM-ddTHH:mm:ssZ。 示例: |
Version | String | 是 | 2014-05-26 | API 的版本号,格式为YYYY-MM-DD。取值范围:2014-05-26。 |
Format | String | 否 | xml | 返回参数的语言类型。取值范围:json | xml。
默认值:xml。 |
请求示例:
https://ecs.aliyuncs.com/?Action=AllocateDedicatedHosts
&Format=xml
&Version=2014-05-26
&Signature=Pc5WB8gokVn0xfeu%2FZV%2BiNM1dgI%3D
&SignatureMethod=HMAC-SHA1
&SignatureNonce=15215528852396
&SignatureVersion=1.0
&AccessKeyId=key-test
&Timestamp=2018-01-01T12:00:00Z
…
公共返回参数
API返回结果采用统一格式,调用成功返回的数据格式有XML和JSON两种,可以在发送请求时指定返回的数据格式,默认为XML格式。每次接口调用,无论成功与否,系统都会返回一个唯一识别码RequestId。
- 返回
2xx
HTTP状态码表示调用成功。 - 返回
4xx
或5xx
HTTP状态码表示调用失败。
公共返回参数示例如下:
- XML格式
<?xml version="1.0" encoding="utf-8"?> <!--结果的根结点--> <接口名称+Response> <!--返回请求标签--> <RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId> <!--返回结果数据--> </接口名称+Response>
- JSON格式
{ "RequestId":"4C467B38-3910-447D-87BC-AC049166F216" /*返回结果数据*/ }
公共错误码
错误代码 | 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. |