Creates a namespace for an image repository.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Name Type Required Example Description
Action String Yes CreateNamespace

The operation that you want to perform. Set the value to CreateNamespace.

RegionId String Yes cn-shanghai

The region ID of the namespace.

InstanceId String Yes cri-xkx6vujuhay0****

The ID of the instance.

NamespaceName String Yes namespace1

The name of the namespace.

AutoCreateRepo Boolean No true

Specifies whether to automatically create an image repository.

DefaultRepoType String No PUBLIC

The default type of the repository that is automatically created. Valid values:

  • PUBLIC
  • PRIVATE

Response parameters

Name Type Example Description
Code String success

The return value.

IsSuccess Boolean true

Indicates whether the API call is successful.

RequestId String BC648259-91A7-4502-BED3-EDF64361FA83

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateNamespace
&InstanceId=cri-xkx6vujuhay0****
&NamespaceName=namespace1
&RegionId=cn-shanghai
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<IsSuccess>true</IsSuccess>
<RequestId>BC648259-91A7-4502-BED3-EDF64361FA83</RequestId>
<Code>success</Code>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "IsSuccess" : true,
  "RequestId" : "BC648259-91A7-4502-BED3-EDF64361FA83",
  "Code" : "success"
}

Error codes

For a list of error codes, visit the API Error Center.