Create a namespace.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| sae:CreateNamespace | create | *All Resources * |
| none |
Request syntax
POST /pop/v1/paas/namespace HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| NamespaceId | string | No | The data returned. | cn-beijing:test |
| NamespaceName | string | Yes | The ID of the request. | name |
| NamespaceDescription | string | No | The message returned for the operation. | desc |
| NameSpaceShortId | string | No | The trace ID that is used to query the details of the request. | test |
| EnableMicroRegistration | boolean | No | Indicates whether to enable SAE built-in registry:
Default value: true. If you do not use the built-in registry, you can set this parameter to false to accelerate the creation of a namespace. | true |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
"Message": "success",
"TraceId": "0a981dd515966966104121683d****",
"Data": {
"NamespaceDescription": "desc",
"NamespaceId": "cn-beijing:test",
"NamespaceName": "name",
"RegionId": "cn-beijing",
"NameSpaceShortId": "test",
"EnableMicroRegistration": true
},
"ErrorCode": "bucketName",
"Code": 200,
"Success": true
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | InstanceExist.NamespaceId | The specified namespace ID already exists. | The specified namespace ID already exists. |
| 400 | InvalidNamespace.WithUppercase | This namespace does not support creating SAE apps because it contains uppercase letters. | - |
| 400 | InvalidNamespaceId.Format | The specified NamespaceId is invalid. | The specified NamespaceId is invalid. The correct format is [regionId]:[namespace]. For example, cn-beijing:test. NamespaceId cannot exceed 32 characters in length. |
| 400 | InvalidNamespaceIdSuffix.Format | The specified NamespaceId is invalid. NamespaceId can only contain alphabetical letters or numbers. | The specified NamespaceId is invalid. NamespaceId can only contain alphabetical letters or numbers. |
| 400 | InvalidNamespaceName.Format | The specified NamespaceName is invalid. The name of the namespace cannot exceed 63 characters in length. | The specified NamespaceName is invalid. The name of the namespace cannot exceed 63 characters in length. |
| 400 | InvalidOperation.NamespaceClusterNotDeleted | The specified NamespaceId contains clusters. | The specified NamespaceId contains clusters. |
| 400 | Namespace.AppExists | Please delete the application first. | - |
| 400 | System.Upgrading | The system is being upgraded. Please try again later. | - |
| 400 | Exceed.Namespace | Too many namespaces have been created. | - |
| 500 | OperationFailed.DauthHttpRequest | request dauth failed. | - |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2023-03-10 | The Error code has changed. The request parameters of the API has changed | View Change Details |
