All Products
Search
Document Center

:CreateRepo

Last Updated:Feb 18, 2024

Creates a repository.

Request information

Request line

PUT /repos HTTP/1.1

Request line parameters

None.

Operation-specific request headers

None.

Request body

{
       "Repo": {
           "RepoNamespace": "String", //This parameter is required. The value must be 2 to 30 characters in length.
           "RepoName": "String", /This parameter is required. The value must be 2 to 30 characters in length.
           "Summary": "String", //This parameter is required. The value must be 1 to 100 characters in length.
           "Detail": "String", //This parameter is optional. The value of this parameter cannot exceed 2,000 characters in length. The Markdown syntax is supported.
           "RepoType": "String" //This parameter is required. Valid values: PRIVATE and PUBLIC.
       }
   }

Request body parameters

Parameter

Type

Required

Description

RepoNamespace

String

Yes

The namespace to which the image repository belongs. The name of the namespace must be 2 to 30 characters in length and can contain lowercase letters, digits, hyphens (-), and underscores (_). It cannot start with a hyphen (-) or an underscore (_).

RepoName

String

Yes

The name of the repository. The name must be 2 to 30 characters in length, and can contain lowercase letters, digits, hyphens (-), and underscores (_). It cannot start with a hyphen (-) or an underscore (_).

Summary

String

Yes

The summary of the repository. The summary must be 1 to 100 characters in length.

Detail

String

No

The detailed information about the repository. The Markdown syntax is supported. The value of this parameter cannot exceed 2,000 characters in length.

RepoType

String

Yes

The type of the repository. Valid values: PRIVATE and PUBLIC. You can download images from a public repository as an anonymous user. To download images from a private repository, you must log on to the repository.

Response information

Response line

HTTP/1.1 200 OK

Operation-specific response headers

None.

Response body

{
    "data": {},
    "requestId": "String"
}

Examples

Sample requests

PUT /repos HTTP/1.1
<Common request headers>

{
    "repo": {
        "RepoNamespace": "aliyun",
        "RepoName": "Tengine",
        "Summary": "This is Aliyun Nginx",
        "RepoType": "PUBLIC"
    }
}

Sample responses

HTTP/1.1 200 OK
<Common response headers>

{
    "data": {},
    "requestId": "80705201-FE46-4C08-AE30-FD50F5930993"
}