Listing Repositories in All SWR Enterprise Edition Instances in the Current Project
Function
This API is used to list the repositories in all SWR Enterprise Edition instances in the current project, excluding repositories in shared Enterprise Edition instances.
Constraints
None
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
URI
GET /v2/{project_id}/repositories
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| marker | No | String | Marker for pagination query. The value is the next_marker value returned in the last API calling. By default, the query starts from the first data record. Parameters marker and limit should always be used together. |
| limit | No | Integer | The number of items. This parameter is used for pagination query. Both the default value and the maximum value are 100. |
| name | No | String | Repository name. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. You can obtain it by calling the IAM API for obtaining a user token. The token is the value of X-Subject-Token in the response header. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| page_info | PageInfo object | Pagination information. |
| repositories | Array of InstanceRepository objects | Repository list. |
| Parameter | Type | Description |
|---|---|---|
| next_marker | String | Start marker for the next pagination query. If this parameter is not returned, the data query is complete. |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Repository ID. |
| name | String | Repository name. |
| namespace_name | String | Namespace name. |
| namespace_id | Integer | Namespace ID. |
| tag_count | Integer | Number of artifact tags in a repository. |
| pull_count | Integer | Total number of downloads. |
| artifact_count | Integer | Total number of artifact packages. |
| description | String | Description. |
| created_at | String | Creation time. |
| updated_at | String | Update time. |
| instance_id | String | ID of an SWR Enterprise Edition instance. |
| instance_name | String | Name of an SWR Enterprise Edition instance. |
| resource_urn | String | Resource URN. The format is swr:[/topic/body/section/table/tgroup/tbody/row/entry/p/i/br {""}) (br]:[/topic/body/section/table/tgroup/tbody/row/entry/p/i/br {""}) (br]:repository:[/topic/body/section/table/tgroup/tbody/row/entry/p/i/br {""}) (br]/[/topic/body/section/table/tgroup/tbody/row/entry/p/i/br {""}) (br]. |
Example Requests
GET https://{endpoint}/v2/{project_id}/repositories Example Responses
Status code: 200
The repository list is queried successfully.
{
"repositories" : [ {
"tag_count" : 1,
"created_at" : "2020-09-19T01:39:58.326Z",
"description" : "test",
"id" : 158,
"name" : "ccccc/test",
"namespace_id" : 36,
"pull_count" : 12,
"artifact_count" : 12,
"updated_at" : "2020-10-27T07:28:04.051Z",
"instance_id" : "xx-xx-xx-xx",
"instance_name" : "test",
"resource_urn" : "swr:cn-north-4:xxxx:repository:test-swr/swr-test-1215/test2"
} ],
"page_info" : {
"next_marker" : "xxx"
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The repository list is queried successfully. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot