- What's New
- Function Overview
- Service Overview
- Getting Started
-
User Guide
- Overview
- Permissions Management
- Basics of Docker
-
Image Management
- Pushing an Image Through a Container Engine Client
- Obtaining a Long-Term Valid Docker Login Command
- Obtaining a Long-Term Valid containerd Pull/Push Command
- Uploading an Image Through the SWR Console
- Pulling an Image
- Setting Image Attributes
- Sharing Private Images
- Adding a Trigger
- Adding an Image Retention Policy
- Image Center
- Organization Management
- User Permissions
- Auditing
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
API
- Organization Management
- Image Repository Management
- Image Tag Management
- Shared Account Management
- API Versions
- Organization Permission Management
- Image Permission Management
- Automatic Image Synchronization Task Management
- Trigger Management
- Image Retention Policy Management
- Temporary Login Command
- Quota Management
- Example Applications
- Appendixes
- Change History
- FAQs
- Videos
- SDK Reference
Show all
Creating an Image Repository
Scenario
This section describes how to create and delete an image repository using APIs. For details on how to call APIs, see Calling APIs.
Involved APIs
In this example, the following APIs are used:
Procedure
- Create an organization.
- URI format
For details, see Creating an Organization.
- Example request
POST https://{endpoint}/v2/manage/namespaces
Body:{ "namespace": "group" }
- Example response
{}
- URI format
- Query the list of organizations.
- URI format
GET /v2/manage/namespaces?filter=namespace::{namespace}
For details, see Querying the List of Organizations.
- Example request
GET https://{endpoint}/v2/manage/namespaces?filter=namespace::group
- Example response
{ "namespaces": [ { "auth": 7, "creator_name": "test", "id": 7, "name": "group" } ] }
- URI format
- Create an image repository.
- URI format
POST /v2/manage/namespaces/{namespace}/repos
For details, see Creating an Image Repository.
- Example request
POST https://{endpoint}/v2/manage/namespaces/{namespace}/repos?repository=test&category=linux&description=test&is_public=false
- Example response
{}
- URI format
- Query the brief information on an image repository.
- URI format
GET /v2/manage/namespaces/{namespace}/repos/{repository}
For details, see Querying the Brief Information on an Image Repository.
- Example request
GET https://{endpoint}/v2/manage/namespaces/{namespace}/repos/{repository}
- Example response
{ "category": "other", "created": "2020-10-30T11:35:02.939134Z", "creator_id": "ff4f44473a1d4ab3847906410af2d152", "creator_name": "test", "description": "", "domain_id": "8b1e8153e5c4414fa57c356319b633fb", "id": 379367, "internal_path": , "is_public": true, "name": "test", "ns_id": 7, "num_download": 3, "num_images": 1, "path": , "priority": 0, "size": 1304902, "updated": "2020-10-30T11:47:46.084808Z", "url": "" }
- URI format
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.