Queries the namespaces.

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

Parameter Type Required Example Description
Action String Yes ListNamespace

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

RegionId String Yes cn-shanghai

The region ID of the instance.

InstanceId String Yes cri-94klsruryslx****

The ID of the instance.

NamespaceStatus String No NORMAL

The status of the namespace. Valid values:

  • NORMAL: The namespace is normal.
  • DELETING: The namespace is being deleted.
NamespaceName String No test-namespace

The name of the namespace.

PageNo Integer No 1

The number of the page to return.

PageSize Integer No 30

The number of entries to return on each page.

Response parameters

Parameter Type Example Description
RequestId String B7E5FCA5-55ED-451C-9649-0BB2B93387D0

The ID of the request.

Code String success

The return value.

PageNo Integer 1

The page number of the returned page.

IsSuccess Boolean true

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request fails.
PageSize Integer 30

The number of entries returned per page.

TotalCount String 1

The total number of returned entries.

Namespaces Array of Namespaces

The list of namespaces.

DefaultRepoType String PUBLIC

The default type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
NamespaceStatus String NORMAL

The status of the namespace. Valid values:

  • NORMAL: The namespace is normal.
  • DELETING: The namespace is being deleted.
NamespaceId String crn-tiw8t3f8i5lt****

The ID of the namespace.

AutoCreateRepo Boolean true

Indicates whether a repository is automatically created when an image is pushed to the namespace.

InstanceId String cri-94klsruryslx****

The ID of the instance.

NamespaceName String test

The names of the queried namespaces.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListNamespace
&InstanceId=cri-94klsruryslx****
&RegionId=cn-shanghai
&<Common request parameters>

Sample success responses

XML format

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

<IsSuccess>true</IsSuccess>
<Namespaces>
    <NamespaceStatus>NORMAL</NamespaceStatus>
    <NamespaceName>test</NamespaceName>
    <DefaultRepoType>PUBLIC</DefaultRepoType>
    <InstanceId>cri-94klsruryslx****</InstanceId>
    <AutoCreateRepo>true</AutoCreateRepo>
    <NamespaceId>crn-tiw8t3f8i5lt****</NamespaceId>
</Namespaces>
<TotalCount>1</TotalCount>
<PageSize>30</PageSize>
<RequestId>B7E5FCA5-55ED-451C-9649-0BB2B93387D0</RequestId>
<PageNo>1</PageNo>
<Code>success</Code>

JSON format

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

{
  "IsSuccess" : true,
  "Namespaces" : {
    "NamespaceStatus" : "NORMAL",
    "NamespaceName" : "test",
    "DefaultRepoType" : "PUBLIC",
    "InstanceId" : "cri-94klsruryslx****",
    "AutoCreateRepo" : true,
    "NamespaceId" : "crn-tiw8t3f8i5lt****"
  },
  "TotalCount" : 1,
  "PageSize" : 30,
  "RequestId" : "B7E5FCA5-55ED-451C-9649-0BB2B93387D0",
  "PageNo" : 1,
  "Code" : "success"
}

Error code

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