Creates 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

Parameter Type Required Example Description
Action String Yes CreateRepository

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

InstanceId String Yes cri-xkx6vujuhay0tqea

The ID of the instance.

RegionId String Yes cn-shanghai

The ID of the region.

RepoName String Yes repo1

The name of the image repository.

RepoNamespaceName String Yes namespace01

The name of the namespace to which the repository belongs.

RepoType String Yes PRIVATE

The type of the image repository. Valid values: PUBLIC and PRIVATE.

Summary String Yes repo1

The summary of the repository.

Detail String No repo1

The description of the repository.

TagImmutability Boolean No true

Specifies whether the repository is immutable. Valid values: true and false.

Response parameters

Parameter Type Example Description
Code String success

The return value.

IsSuccess Boolean true

Indicates whether the operation is successful.

RepoId String crr-xwvi3osiy4fforqq

The ID of the image repository.

RequestId String 886FB272-15C3-44FC-AA54-F4ABD5B93A28

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/? Action=CreateRepository
&InstanceId=cri-xkx6vujuhay0tqea
&RegionId=cn-shanghai
&RepoName=repo1
&RepoNamespaceName=namespace01
&RepoType=PRIVATE
&Summary=repo1
&TagImmutability=true
&<Common request parameters>

Sample success responses

XML format

<IsSuccess>true</IsSuccess>
<RequestId>886FB272-15C3-44FC-AA54-F4ABD5B93A28</RequestId>
<RepoId>crr-xwvi3osiy4fforqq</RepoId>
<Code>success</Code>

JSON format

{
    "IsSuccess":true,
    "RequestId":"886FB272-15C3-44FC-AA54-F4ABD5B93A28",
    "RepoId":"crr-xwvi3osiy4fforqq",
    "Code":"success"
}

Error codes

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