Creates a namespace in an instance.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateNamespace |
The operation that you want to perform. Set the value to CreateNamespace. |
InstanceId | String | Yes | cri-xkx6vujuhay0tqwe |
The ID of the instance. |
NamespaceName | String | Yes | namespace1 |
The name of the namespace. |
RegionId | String | Yes | cn-shanghai |
The ID of the region where the instance resides. |
AutoCreateRepo | Boolean | No | true |
Specifies whether to automatically create a repository when an image is pushed to the namespace. |
DefaultRepoType | String | No | PUBLIC |
The default type of the repository created in the namespace. Valid values: PUBLIC and PRIVATE. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
IsSuccess | Boolean | true |
Indicates whether the operation is successful. |
Code | String | success |
The code returned for the request. |
RequestId | String | BC648259-91A7-4502-BED3-EDF64361FA83 |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/? Action=CreateNamespace
&InstanceId=cri-xkx6vujuhay0tqwe
&NamespaceName=namespace1
&RegionId=cn-shanghai
&<Common request parameters>
Sample success responses
JSON
format
{
"IsSuccess":true,
"RequestId":"BC648259-91A7-4502-BED3-EDF64361FA83",
"Code":"success"
}
XML
format
<IsSuccess>true</IsSuccess>
<RequestId>BC648259-91A7-4502-BED3-EDF64361FA83</RequestId>
<Code>success</Code>
Error codes
For a list of error codes, visit the API Error Center.