公共头和错误返回
更新时间:2021-02-03
公共头规格
公共请求头
公共头部 | 描述 |
---|---|
Authorization | 包含Access Key与请求签名。 |
Content-Type | application/json; charset=utf-8。 |
x-bce-date | 表示日期的字符串,符合API规范。 |
HTTP协议的标准头域不再这里列出。公共头域将在每个BCC API中出现,是必需的头域。POST、PUT、DELETE等请求数据放在request body中。
公共响应头
公共头部 | 描述 |
---|---|
Content-Type | application/json; charset=utf-8。 |
x-bce-request-id | VPC后端生成,并自动设置到响应头域中。 |
错误返回
当用户访问VPC出现错误时,VPC会返回给用户相应的错误码和错误信息,便于用户定位问题,并做出适当的处理。请求发生错误时通过Response Body返回详细错误信息,遵循如下格式:
参数名 | 类型 | 说明 |
---|---|---|
code | String | 错误码 |
message | String | 错误描述 |
requestId | String | 本次请求的requestId |
示例:
{
"code": "NoSuchObject",
"message": "account not exist",
"requestId": "c4abab14-ebc4-4eb0-85d2-03c4d51eed18"
}
BCE公共错误码
错误返回码 | 错误消息 | 状态码 | 说明 |
---|---|---|---|
AccessDenied | Access denied. | 403Forbidden | 无权限访问对应的资源。 |
QualifyNotPass | The User has not pass qualify. | 403 | 账号没有通过实名认证 |
InappropriateJSON | The JSON you provided was well-formed and valid, but not appropriate forthis operation. | 400 Bad Request | 请求中的JSON格式正确,但语义上不符合要求。如缺少某个必需项,或值类型不匹配等。出于兼容性考虑,对于所有无法识别的项应直接忽略,不应该返回这个错误。 |
InternalError | We encountered an internal error Please try again. | 500 Internal Server Error | 所有未定义的其他错误。在有明确对应的其他类型的错误时(包括通用的和服务自定义的)不应该使用。 |
InvalidAccessKeyId | The Access Key ID you provided doesnot exist in our records. | 403Forbidden | Access Key ID不存在。 |
InvalidHTTPAuthHeader | The Access Key ID you provided does notexist in our records. | 400 BadRequest | Authorization头域格式错误。 |
InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 Bad Request | HTTP body格式错误。例如不符合指定的Encoding等。 |
InvalidURI | Could not parse the specified URI. | 400 Bad Request | URI形式不正确。例如一些服务定义的关键词不匹配等。对于ID不匹配的问题,应定义更加具体的错误码,如NoSuchKey。 |
MalformedJSON | The JSON you provided was not well-formed. | 400 BadRequest | JSON格式不合法。 |
InvalidVersion | The API version specified was invalid. | 404 NotFound | URI的版本号不合法。 |
OptInRequired | A subscription for the service is required. | 403Forbidden | 没有开通对应的服务。 |
PreconditionFailed | The specified If-Match header doesn’tmatch the ETag header. | 412PreconditionFailed | 详见Etag。 |
RequestExpired | Request has expired. Timestamp date is <Data>. | 400 BadRequest | 请求超时。要改成x-bce-date。若请求中只有Date,需将Date转成datetime。 |
IdempotentParameterMismatch | The request uses the same client token asa previous, but non-identical request. | 403Forbidden | clientToken对应的API参数不一样。 |
SignatureDoesNotMatch | The request signature we calculated does not match the signature you provided. Check yourSecret Access Key and signing method. Consultthe service documentation for details. | 400 Bad Request | Authorization头域中附带的签名和服务端验证不一致。 |
VPC错误返回码
错误码 | 错误描述 | HTTP状态码 | 中文解释 |
---|---|---|---|
BadRequest | Bad request parameters or illegal request. | 400 | 请求有误 |
NoSuchObject | The specified object is not found or resource do not exist. | 404 | 对象未找到 |
ServiceInternalError | Internal service occurs error. | 500 | 服务内部错误 |
LimitExceeded | Limit exceeded for current request. | 413 | 超出限制 |
OperationDenied | Operation not available. | 409 | 不可操作 |
CidrConflict | This subnet's cidr has conflict with other subnets'. | 409 | 子网网段不能重叠 |
ResourceNeedRelease | Delete failed, please delete bcc, blb, nat, vpn, rds and so on in the VPC. | 409 | 有资源需要释放 |
ACL错误返回码
错误码 | 错误描述 | HTTP状态码 | 语义 |
---|---|---|---|
InvalidAction | The ACL rule's action was invalid. | 400 | ACL规则的策略不合法。 |
InvalidProtocol | The ACL rule's protocal was invalid. | 400 | ACL规则的协议不合法。 |
InvalidPosition | The ACL rule's position was out of range. | 400 | ACL规则的优先级不在合法范围内。 |
DuplicatePosition | The ACL rule's position was repeated. | 400 | ACL规则的优先级重复。 |
InvalidPort | The ACL rule's port was invalid. | 400 | ACL规则的端口不合法。 |
NAT网关错误返回码
错误码 | 错误描述 | HTTP状态码 | 语义 |
---|---|---|---|
RequestVpcIdEmpty | The request's param vpcId cannot be empty. | 400 | 请求参数中的vpcId不能为空。 |
RequestNatIdEmpty | The request's param natId cannot be empty. | 400 | 请求参数中的natId不能为空。 |
NoSuchNat | The specified nat is not found. | 404 | 查询的nat网关未找到。 |
RequestNameEmpty | The request's param name cannot be empty. | 400 | 请求参数中的name不能为空。 |
RequestSpecEmpty | The request's param spec cannot be empty. | 400 | 请求参数中的spec不能为空。 |
RequestBillingEmpty | The request's param billing cannot be empty. | 400 | 请求参数中的billing不能为空。 |
SpecInvalid | The request's param spec is invalid. | 400 | 请求参数中的spec不合法。 |
PaymentTimingEmpty | The request's param paymentTiming cannot be empty. | 400 | 请求参数中的paymentTiming不能为空。 |
PaymentTimingInvalid | The request's param paymentTiming is invalid. | 400 | 请求参数中的paymentTiming不合法。 |
ReservationEmpty | The request's param reservation cannot be empty when paymentiming is Preaid. | 400 | 请求参数中当paymentTiming为Prepaid时,reservation不能为空。 |
createOrderError | Create nat gateway order error. | 500 | 创建NAT订单失败。 |
subnatEmpty | The VPC in the creation request has no subnet. | 500 | 创建请求中的vpc没有子网。 |
NoSuchEip | The specified eip is not found. | 404 | 指定的eip未找到。 |
RequestEipInvalid | The request's param eip is invalid. | 400 | 请求参数中的eip不合法。 |
NatPostpaid | Postpaid nat cannot be renewed. | 400 | 后付费nat不能续费。 |
ReservationLengthInvalid | The request's param reservationLength is invalid. | 400 | 请求参数中的reservationLength不合法。 |
ReservationTimeUnitInvalid | The request's param reservationTimeUnit is invalid. | 400 | 请求参数中的reservationTimeUnit不合法。 |
NatIdInvalid | The natId is invalid | 400 | natId不合法 |
SnatRuleSourceAddressInvalid | The snat rule source address is invalid | 400 | 源地址不合法 |
CidrFormatIllegal | Cidr format is illegal. | 400 | 源地址格式不正确 |
SnatRuleSourceAddressConflict | The snat rule source address is conflict | 400 | 源地址冲突 |
LimitExceeded | Limit exceeded for current request. | 400 | 配额超限 |
RuleIdNotExist | The rule id is not exist | 404 | ruleId不合法 |
BadRequest | Bad request parameters or illegal request. | 400 | 参数不合法 |
SnatRuleEipsInvalid | The snat rule eips is invalid | 400 | 公网IP不合法 |
DnatRuleConflictException | The DnatRule's protocol Ip and port has exist. | 400 | DNAT规则冲突 |
DnatRuleProtocolInvalid | The DnatRule's protocol is invalid. | 400 | DNAT协议不合法 |
DnatRuleInternalPortInvalid | The DnatRule's internal port is invalid. | 400 | 内网IP端口不合法 |
DnatRulePublicPortInvalid | The DnatRule's public port is invalid. | 400 | 公网IP端口不合法 |
DnatRuleInternalIpInvalid | The DnatRule's internalIp not allow empty. | 400 | 内网IP不合法 |
DnatRuleEipNotAllowEmpty | The DnatRule's eip not allow empty. | 400 | DNAT规则的EIP不允许为空 |
DnatEipEmpty | The NatGateway is not bind dnat eip. | 400 | NAT网关没有绑定DNAT EIP |
DnatRuleEipInvalid | The DnatRule’s eip is invalid. | 400 | 绑定的eip和NAT网关绑定的DNAT EIP 不一致 |
DnatRuleIdException | The DnatRule's id invalid. | 400 | DNAT规则ID不合法 |
对等连接错误返回码
错误码 | 错误描述 | HTTP状态码 | 语义 |
---|---|---|---|
BadRequest | BadRequest | 400 | 请求参数错误 |
UnsupportedPeerConnOperation | The peerConn does not support this operation | 400 | 对等连接不支持该操作 |
PeerIfNameException | diff account are not allowed to set PeerIfName | 400 | 跨账号对等连接不支持设置对端接口名。 |
ResizeException | The prepay peerConn only support enlarge bandwidth | 400 | 预付费对等连接仅支持升配操作。 |
弹性网卡业务错误码
错误码 | 错误描述 | HTTP状态码 | 语义 |
---|---|---|---|
SubnetHasNoMoreIpException | The subnet has no more Ip to allocate. | 400 | 该子网内无可用ip。 |
VmMemoryCanNotAttachMoreIpException | The device's memory can not attach more ip. | 403 | 该虚机的内存不允许添加更多Ip。 |
DeviceInvalidException | he deviceId is not same with eni's deviceId. | 400 | 虚机Id不合法。 |
VmStatusException | The vm status is not allowed to operate. | 403 | 当前虚机状态不允许该操作 |
EniAndDeviceNotInSameAzException | The eni and device not in same az or not in same vpc. | 403 | 网卡和虚机不属于同一个可用区 |
NatSubnetCanNotBindEip | The subnet's type can not allow bind eip. | 403 | NAT型子网内的弹性网卡不允许绑定EIP |
PrimaryIPException | The privateIp is invalid or primary Ip is not allowed to delete. | 403 | 主IP不能被删除 |
EniStatusException | The eni status is not allowed to operate. | 403 | 当前网卡的状态不允许该操作 |
EniIdException | The param eniId is invalid. | 400 | 网卡id不合法 |
PrivateIpInUseException | The ip is inuse. | 400 | 该IP地址已被占用 |
SubnetTypeInvalidException | The subnetType is invalid,not allow create eni in subnet which type is BBC and BBC_NAT. | 400 | 弹性网卡不能创建在BBC或BBC_NAT子网中 |