公共头和错误返回
更新时间:2024-06-17
公共头规格
公共请求头
| 公共头部 | 描述 |
|---|---|
| Authorization | 包含 Access Key 与请求签名 |
| Content-Type | application/json; charset=utf-8 |
| x-bce-date | 表示日期的字符串,符合 API 规范 |
HTTP 协议的标准头域不再这里列出。公共头域将在每个 API 中出现,是必需的头域。POST、PUT、DELETE 等请求数据放在 request body 中。
公共响应头
| 公共头部 | 描述 |
|---|---|
| Content-Type | application/json; charset=utf-8 |
| x-bce-request-id | 后端服务生成,并自动设置到响应头域中 |
错误返回
当用户访问 API 出现错误时,会返回给用户相应的错误码和错误信息,便于用户定位问题,并做出适当的处理。请求发生错误时通过 Response Body 返回详细错误信息,遵循如下格式:
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | String | 错误码 |
| message | String | 错误描述 |
| requestId | String | 本次请求的 requestID |
示例:
Plain Text
1{
2 "code": "NoSuchObject",
3 "message": "account not exist",
4 "requestId": "c4abab14-ebc4-4eb0-85d2-03c4d51eed18"
5}
BCE公共错误码
| 错误返回码 | 错误消息 | 状态码 | 说明 |
|---|---|---|---|
| AccessDenied | Access denied. | 403 Forbidden | 无权限访问对应的资源。 |
| 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. | 403 Forbidden | 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. | 403 Forbidden | 没有开通对应的服务。 |
| PreconditionFailed | The specified If-Match header doesn’tmatch the ETag header. | 412 PreconditionFailed | 详见 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. | 403 Forbidden | 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 BadRequest | 域名已存在 |
| RegistryNoAuth | Authorization failed. | 404 NotFound | auth 授权失败 |
| RegistryInitFail | Init Registry failed. | 404 NotFound | registry 初始化失败 |
| RegistryUpdateFail | Update user failed. | 404 NotFound | registry 更新失败 |
| RegistryUserNotFound | Cannot found user. | 404 NotFound | registry 所属用户不存在 |
| RegistryLackParams | Bad request, lack param: user, namespace or public. | 404 NotFound | 缺少参数 |
| RegistryOutOfLimit | Create failed, because number of namespaces out of limit. | 404 NotFound | namespace 数超额 |
| RegistryNamespaceNotFound | Cannot find Namespace. | 404 NotFound | 找不到 namespace |
| RegistryRepositoryNotFound | Cannot find Repository. | 404 NotFound | registry 不存在 |
| RegistryTagNotFound | Cannot find tag. | 404 NotFound | tag 不存在 |
| RegistryDelFail | Delete manifest from registry failed. | 404 NotFound | 删除 manifest 失败 |
| RegistryInvalidParams | Invalid params to create image. | 404 NotFound | registry 更新失败 |
| RegistryNamespaceNotExist | Namespace is not exist. | 404 NotFound | namespace 不存在 |
| RegistryImageNotExist | Image is not exists. | 404 NotFound | 镜像不存在 |
| InternalServerError | Unknown error, please try again later. | 500 Internal Server | 服务器内部错误 |
| Cce.warning.UserNotExist | User not exist. | 404 NotFound | 用户名不存在 |
| Cce.ClusterDeleted | Cluster is deleted already. | 500 Internal Server | cluster 已删除 |
| Cce.ClusterCreating | Cluster is creating. | 500 Internal Server | 集群正在创建中 |
| Cce.ClusterDeleting | Cluster is deleting. | 500 Internal Server | 集群正在删除中 |
| Cce.ClusterNotExit | Cluster is not exist. | 500 Internal Server | 集群不存在 |
| DuplicateCLusterUuid | Generate cluster ID failed, please try again. | 500 Internal Server | 集群创建失败,请重试 |
| Cce.DeleteIDToken | BlbId or clientToken is null. | 500 Internal Server | BldID 或clientToken为空 |
| Cce.UpdateBlbId | BlbId is null. | 500 Internal Server | BlbId 为空 |
| Cce.CreateTokenNULL | ClientToken is null. | 500 Internal Server | clientToken 为空 |
| Cce.DeleteIdNULL | RouteRuled or clientToken is null. | 500 Internal Server | RouteRuled或clientToken为空 |
| Cce.RouteInfoIdNULL | RouteTableId or vpcId is null. | 500 Internal Server | RouteTableId 或vpcId为空 |
| Cce.ClusterNotExit | Cluster is not exist. | 500 Internal Server | 集群不存在 |
| Cce.EncryptFail | Encrypt passwd wrong. | 500 Internal Server | 密码加密有误 |
| Cce.DecryptFail | Decrypt passwd wrong. | 500 Internal Server | 密码解密有误 |
| Cce.MoreThanOneUserPerAccount | One can create only one user per account. | 500 Internal Server | 账号需唯一 |
| Cce.ImageMetaNull | ImageMeta is null. | 500 Internal Server | 镜像元数据为空 |
| Cce.PasswdNotChange | New passwd should not as old. | 500 Internal Server | 新旧密码需不一致 |
| Cce.UserExist | Username already exist. | 500 Internal Server | 用户名已存在 |
| Cce.ConfirmFail | Passwd confirm fail. | 500 Internal Server | 密码确认失败 |
| Cce.UserNoAuth | User authorization failed. | 500 Internal Server | 用户 auth 授权失败 |
| Cce.NamespaceRepositoryOrTagNull | Namespace Repository or Tag is null. | 500 Internal Server | 镜像的仓库需非空 |
| 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 Internal Server | 镜像格式有误败 |
| 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 Internal Server | imageRepository 的格式有误 |
| Cce.NamespaceNull | Namespace is null. | 500 Internal Server | namespace 为空 |
| Cce.UserNameNull | Username cannot be empty. | 500 Internal Server | 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 Internal Server | namespace请求格式有误 |
| Cce.PasswordFormatError | Password format error or password conformation not same as password. | 500 Internal Server | 密码格式有误 |
| Cce.UserNameFormatError | Username format error,your username must be between 4 and 30 characters long, and can only contain numbers and lowercase letters. | 500 Internal Server | 用户名格式有误 |
| Cce.WrongMainZone | Main zone in order is illegal. | 500 Internal Server | 主 zone 非法 |
| Cce.namespaceOverQuota | Over the namespace quota. | 500 Internal Server | 域名配额超限 |
| Cce.slaveOverQuota | Over the slave quota. | 500 Internal Server | slave 配额超限 |
| Cce.ClusterOverQuota | Over the cluster quota. | 500 Internal Server | 集群配额超限 |
| Cce.ContainerNetConflict | Container net conflict with vpc or other container nets in the same vpc. | 500 Internal Server | 容器网络有冲突 |
| Cce.IllegalArguments | Illegal arguments, check your input. | 500 Internal Server | 非法参数 |
| Cce.UnsupportedPayType | Unsupported payment method. | 500 Internal Server | 支付方式不支持 |
| Cce.OrderError | Cluster order creation failed. | 500 Internal Server | 订单有误 |
