All Products
Search
Document Center

Create a repository

Last Updated: May 28, 2018

Description

Create a repository.

Request information

Request line

  1. PUT /repos HTTP/1.1

Request line parameters (URI parameters)

None.

Special request header

None.

Request body

  1. {
  2. "Repo": {
  3. "RepoNamespace": "String" Required [2-30],
  4. "RepoName": "String" Required [2-30],
  5. "Summary": "String" Required [1-100],
  6. "Detail": "String" Optional [*-2000] Markdown syntax is supported,
  7. "RepoType": "String" Required enumeration (PRIVATE PUBLIC),
  8. }
  9. }

Request body explanation

Name Type Required Description
RepoNamespace String Yes The namespace that the repository belongs to, must be selected from the namespaces you have applied for. The name can be 2-30 characters in length, and contain lowercase letters, numbers, hyphens (-), and underscores (_). The name cannot start with hyphens and underscores.
RepoName String Yes The name of the repository. The name can be 1-64 characters in length, and contain lowercase letters, numbers, hyphens (-), and underscores (_). The name cannot start with hyphens and underscores.
Summary String Yes The repository general information. It can contain 1 to 80 characters.
Detail String No The repository spesific information. MarkDown format is supported, and the length limit is 2000.
RepoType String Yes Enumeration (public, private). Public repository supports anonymous downloads; private repository requires logon to download.

Response information

Response line

  1. HTTP/1.1 200 OK

Special response header

None.

Response body

  1. {
  2. "data": {},
  3. "requestId": "String"
  4. }

Example

Request example

  1. PUT /repos HTTP/1.1
  2. <Common request header>
  3. {
  4. "repo": {
  5. "RepoNamespace": "aliyun",
  6. "RepoName": "Tengine",
  7. "Summary": "This is Aliyun Nginx",
  8. "RepoType": "PUBLIC"
  9. }
  10. }

Response example

  1. HTTP/1.1 200 OK
  2. <Common response header>
  3. {
  4. "data": {},
  5. "requestId": "80705201-FE46-4C08-AE30-FD50F5930993"
  6. }