Help Center/ SoftWare Repository for Container/ API Reference (Enterprise Edition)/ API/ Artifact Repository Management/ Listing Repositories in All SWR Enterprise Edition Instances in the Current Project
Updated on 2026-06-15 GMT+08:00

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.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    swr:repository:listAllInstanceRepositories

    List

    repository *

    • g:ResourceTag/<tag-key>

    • g:EnterpriseProjectId

    -

    -

URI

GET /v2/{project_id}/repositories

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Table 2 Query Parameters

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

Table 3 Request header 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

Table 4 Response body parameters

Parameter

Type

Description

page_info

PageInfo object

Pagination information.

repositories

Array of InstanceRepository objects

Repository list.

Table 5 PageInfo

Parameter

Type

Description

next_marker

String

Start marker for the next pagination query. If this parameter is not returned, the data query is complete.

Table 6 InstanceRepository

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.