公共头和错误返回

公共头规格

公共请求头

公共头部 描述
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后端生成,并自动设置到响应头域中。

错误返回

当用户访问API出现错误时,会返回给用户相应的错误码和错误信息,便于用户定位问题,并做出适当的处理。请求发生错误时通过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 无权限访问对应的资源。
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头域中附带的签名和服务端验证不一致。

错误返回码

错误码 错误描述 HTTP状态码 中文解释
RegistryAlreadyExist Namespace Already exist. 400 域名已存在
RegistryNoAuth Authorization failed. 404 auth授权失败
RegistryInitFail Init Registry failed. 404 registry初始化失败
RegistryUpdateFail Update user failed. 404 registry更新失败
RegistryUserNotFound Cannot found user. 404 registry所属用户不存在
RegistryLackParams Bad request, lack param: user, namespace or public. 404 缺少参数
RegistryOutOfLimit Create failed, because number of namespaces out of limit. 404 namespace数超额
RegistryNamespaceNotFound Cannot find Namespace. 404 找不到namespace
RegistryRepositoryNotFound Cannot find Repository. 404 registry不存在
RegistryTagNotFound Cannot find tag. 404 tag不存在
RegistryDelFail Delete manifest from registry failed. 404 删除manifest失败
RegistryInvalidParams Invalid params to create image. 404 registry更新失败
RegistryNamespaceNotExist Namespace is not exist. 404 namespace不存在
RegistryImageNotExist Image is not exists. 404 镜像不存在
InternalServerError Unknown error, please try again later. 500 服务器内部错误
Cce.UserNotExist User not exist. 500 用户名不存在
Cce.ClusterDeleted Cluster is deleted already. 500 cluster已删除
Cce.ClusterCreating Cluster is creating. 500 集群正在创建中
Cce.ClusterDeleting Cluster is deleting. 500 集群正在删除中
Cce.ClusterNotExit Cluster is not exist. 500 集群不存在
DuplicateCLusterUuid Generate cluster ID failed, please try again. 500 集群创建失败,请重试
Cce.DeleteIDToken BlbId or clientToken is null. 500 BldID或clientToken为空
Cce.UpdateBlbId BlbId is null. 500 BlbId为空
Cce.CreateTokenNULL ClientToken is null. 500 clientToken为空
Cce.DeleteIdNULL RouteRuled or clientToken is null. 500 RouteRuled或clientToken为空
Cce.RouteInfoIdNULL RouteTableId or vpcId is null. 500 RouteTableId或vpcId为空
Cce.ClusterNotExit Cluster is not exist. 500 集群不存在
Cce.EncryptFail Encrypt passwd wrong. 500 密码加密有误
Cce.DecryptFail Decrypt passwd wrong. 500 密码解密有误
Cce.MoreThanOneUserPerAccount One can create only one user per account. 500 帐号需唯一
Cce.ImageMetaNull ImageMeta is null. 500 镜像元数据为空
Cce.PasswdNotChange New passwd should not as old. 500 新旧密码需不一致
Cce.UserExist Username already exist. 500 用户名已存在
Cce.ConfirmFail Passwd confirm fail. 500 密码确认失败
Cce.UserNoAuth User authorization failed. 500 用户auth授权失败
Cce.NamespaceRepositoryOrTagNull Namespace Repository or Tag is null. 500 镜像的仓库需非空
Cce.ImageTagFormatError image tag cannot be empty, should be 1-65 characters long, and can only contain numbers, letters and '- _ /.' and can only start with letter or number 500 镜像格式有误败
Cce.ImageRepositoryFormatError image repository cannot be empty, should be 1-65 characters long, and can only contain numbers, letters and '- _ /.' and can only start with letter 500 imageRepository的格式有误
Cce.NamespaceNull Namespace is null. 500 namespace为空
Cce.UserNameNull Username cannot be empty. 500 Username为空
Cce.NamespaceRequestFormatError Username or namespace cannot be empty,namespace should be 1-65 characters long, and can only contain numbers and letters and '- _ /.' and only can start with letters. 500 namespace请求格式有误
Cce.PasswordFormatError Password format error or password conformation not same as password. 500 密码格式有误
Cce.UserNameFormatError Username format error,your username must be between 4 and 30 characters long, and can only contain numbers and lowercase letters. 500 用户名格式有误
Cce.WrongMainZone Main zone in order is illegal. 500 主zone非法
Cce.namespaceOverQuota Over the namespace quota. 500 域名配额超限
Cce.slaveOverQuota Over the slave quota. 500 slave配额超限
Cce.ClusterOverQuota Over the cluster quota. 500 集群配额超限
Cce.ContainerNetConflict Container net conflict with vpc or other container nets in the same vpc. 500 容器网络有冲突
Cce.IllegalArguments Illegal arguments, check your input. 500 非法参数
Cce.UnsupportedPayType Unsupported payment method. 500 支付方式不支持
Cce.OrderError Cluster order creation failed. 500 订单有误