Querying the User List of Self-Hosted Repos
Function
Query the user list of self-hosted repos.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
codeartsartifact:repository:listUsers |
List |
- |
- |
- |
- |
URI
GET /cloudartifact/v5/repositories/users
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
user_name |
No |
String |
Definition: Username. Constraints: N/A Value range: N/A Default value: N/A |
|
page_no |
No |
Integer |
Definition: Number of pages in a pagination query. Constraints: N/A Value range: 1–2,147,483,647 Default value: 1 |
|
page_size |
No |
Integer |
Definition: Number of records on each page during the pagination query. Constraints: N/A Value range: 1–100 Default value: 10 |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
status |
String |
Definition Request status. Range success: The request is successful. error: The request fails. |
|
trace_id |
String |
Definition Request ID, which uniquely identifies the current request. Range A string of digits and hyphens (-). |
|
result |
DevcloudUserDOV5Page object |
Definition User list. Range N/A. |
|
Parameter |
Type |
Description |
|---|---|---|
|
total_records |
Integer |
Definition Total number of records. Range N/A. |
|
total_pages |
Integer |
Definition Total number of pages. Range N/A. |
|
data |
Array of DevcloudUserDOV5 objects |
Definition User list. Range N/A. |
|
Parameter |
Type |
Description |
|---|---|---|
|
status |
String |
Definition Repository status. Range active: Normal. delete: Deleted. disabled: Invalid. view: Viewer of self-hosted repos. trash: Deprecated. |
|
domain_id |
String |
Definition Tenant ID. Range N/A. |
|
region |
String |
Definition Area. Range N/A. |
|
created_time |
String |
Definition Creation time, in yyyy-MM-dd HH:mm:ss format. Range N/A. |
|
modified_time |
String |
Definition Modification time, in yyyy-MM-dd HH:mm:ss format. Range N/A. |
|
created_user_id |
String |
Definition Creator ID. Range N/A. |
|
created_user_name |
String |
Definition Creator. Range N/A. |
|
modified_user_id |
String |
Definition Modifier ID. Range N/A. |
|
modified_user_name |
String |
Definition Modifier. Range N/A. |
|
user_id |
String |
Definition User ID. Range N/A. |
|
user_name |
String |
Definition Username. Range N/A. |
|
user_type |
String |
Definition User type. Range N/A. |
|
enabled |
String |
Definition enabled. Range N/A. |
|
repo_user_name |
String |
Definition Repository username. Range N/A. |
|
repo_number |
Integer |
Definition repo_number. Range N/A. |
|
inner_repo_user_name |
String |
Definition Username of the internal repository. Range N/A. |
Example Requests
Query the user list of self-hosted repos.
https://{URL}/cloudartifact/v5/repositories/users
Example Responses
Status code: 200
OK
{
"status" : "success",
"trace_id" : "a72721003f014cb187729e1995f5a625",
"result" : {
"data" : [ {
"status" : 0,
"region" : "xx-xxxxx-x",
"domain_id" : "09d2ca2f5080d5b60f51c00ae5bad0a0",
"created_time" : "2024-12-21 15:15:25",
"modified_time" : "2025-06-06 14:42:15",
"user_id" : "006f4d03f5834347bead2cf8e579028c",
"user_name" : "devcloud_devcloud_c00642318",
"user_type" : "personal",
"repo_user_name" : "09d2ca2f5080d5b60f51c00ae5bad0a0_006f4d03f5834347bead2cf8e579028c",
"repo_number" : 2,
"inner_repo_user_name" : "xx-xxxxx-x_09d2ca2f5080d5b60f51c00ae5bad0a0_006f4d03f5834347bead2cf8e579028c"
}, {
"status" : 0,
"region" : "xx-xxxxx-x",
"domain_id" : "09d2ca2f5080d5b60f51c00ae5bad0a0",
"created_time" : "2025-01-11 16:57:10",
"modified_time" : "2025-06-06 14:42:10",
"user_id" : "02202edb3f624e4ca6ee30166c18cda4",
"user_name" : "devcloud_y00226182_05_user077",
"user_type" : "personal",
"repo_user_name" : "09d2ca2f5080d5b60f51c00ae5bad0a0_02202edb3f624e4ca6ee30166c18cda4",
"repo_number" : 0,
"inner_repo_user_name" : "xx-xxxxx-x_09d2ca2f5080d5b60f51c00ae5bad0a0_02202edb3f624e4ca6ee30166c18cda4"
}, {
"status" : 0,
"region" : "xx-xxxxx-x",
"domain_id" : "09d2ca2f5080d5b60f51c00ae5bad0a0",
"created_time" : "2023-04-10 18:09:13",
"modified_time" : "2025-06-06 14:42:10",
"user_id" : "05c1c44cc81f4b6b9b60799acb17638e",
"user_name" : "devcloud_y00226182_05_user097",
"user_type" : "personal",
"repo_user_name" : "09d2ca2f5080d5b60f51c00ae5bad0a0_05c1c44cc81f4b6b9b60799acb17638e",
"repo_number" : 5,
"inner_repo_user_name" : "xx-xxxxx-x_09d2ca2f5080d5b60f51c00ae5bad0a0_05c1c44cc81f4b6b9b60799acb17638e"
}, {
"status" : 0,
"region" : "xx-xxxxx-x",
"domain_id" : "09d2ca2f5080d5b60f51c00ae5bad0a0",
"created_time" : "2023-04-10 18:09:13",
"modified_time" : "2025-06-06 14:42:10",
"user_id" : "066c3b933c114c94b4763e4f35e05502",
"user_name" : "devcloud_y00226182_05_user014",
"user_type" : "personal",
"repo_user_name" : "09d2ca2f5080d5b60f51c00ae5bad0a0_066c3b933c114c94b4763e4f35e05502",
"repo_number" : 4,
"inner_repo_user_name" : "xx-xxxxx-x_09d2ca2f5080d5b60f51c00ae5bad0a0_066c3b933c114c94b4763e4f35e05502"
}, {
"status" : 0,
"region" : "xx-xxxxx-x",
"domain_id" : "09d2ca2f5080d5b60f51c00ae5bad0a0",
"created_time" : "2025-03-17 17:08:26",
"modified_time" : "2025-06-06 14:42:16",
"user_id" : "0955f5d66a2245f09ba176bf22417113",
"user_name" : "test",
"user_type" : "personal",
"repo_user_name" : "09d2ca2f5080d5b60f51c00ae5bad0a0_0955f5d66a2245f09ba176bf22417113",
"repo_number" : 0,
"inner_repo_user_name" : "xx-xxxxx-x_09d2ca2f5080d5b60f51c00ae5bad0a0_0955f5d66a2245f09ba176bf22417113"
}, {
"status" : 0,
"region" : "xx-xxxxx-x",
"domain_id" : "09d2ca2f5080d5b60f51c00ae5bad0a0",
"created_time" : "2023-04-10 18:09:13",
"modified_time" : "2025-06-06 14:42:10",
"user_id" : "09af75516874459090abc461473096aa",
"user_name" : "devcloud_y00226182_05_user090",
"user_type" : "personal",
"repo_user_name" : "09d2ca2f5080d5b60f51c00ae5bad0a0_09af75516874459090abc461473096aa",
"repo_number" : 4,
"inner_repo_user_name" : "xx-xxxxx-x_09d2ca2f5080d5b60f51c00ae5bad0a0_09af75516874459090abc461473096aa"
}, {
"status" : 0,
"region" : "xx-xxxxx-x",
"domain_id" : "09d2ca2f5080d5b60f51c00ae5bad0a0",
"created_time" : "2025-03-04 21:00:26",
"modified_time" : "2025-06-06 14:42:16",
"user_id" : "09c2c1ef5180d3dd1f2bc011d6bc9459",
"user_name" : "devcloud_devcloud_y00226182_05",
"user_type" : "personal",
"repo_user_name" : "09d2ca2f5080d5b60f51c00ae5bad0a0_09c2c1ef5180d3dd1f2bc011d6bc9459",
"repo_number" : 3,
"inner_repo_user_name" : "xx-xxxxx-x_09d2ca2f5080d5b60f51c00ae5bad0a0_09c2c1ef5180d3dd1f2bc011d6bc9459"
}, {
"status" : 0,
"region" : "xx-xxxxx-x",
"domain_id" : "09d2ca2f5080d5b60f51c00ae5bad0a0",
"created_time" : "2023-02-08 22:33:44",
"modified_time" : "2025-07-08 11:33:15",
"user_id" : "09d2ca2ffd00d3c21ff8c00a4dd1e080",
"user_name" : "devcloud_devcloud_y00226182_05",
"user_type" : "personal",
"repo_user_name" : "09d2ca2f5080d5b60f51c00ae5bad0a0_09d2ca2ffd00d3c21ff8c00a4dd1e080",
"repo_number" : 69949,
"inner_repo_user_name" : "xx-xxxxx-x_09d2ca2f5080d5b60f51c00ae5bad0a0_09d2ca2ffd00d3c21ff8c00a4dd1e080"
}, {
"status" : 0,
"region" : "xx-xxxxx-x",
"domain_id" : "09d2ca2f5080d5b60f51c00ae5bad0a0",
"created_time" : "2023-04-10 18:09:12",
"modified_time" : "2025-06-06 14:42:10",
"user_id" : "0b0d2b3ab46247d094cccb5998aaaa7d",
"user_name" : "devcloud_y00226182_05_user038",
"user_type" : "personal",
"repo_user_name" : "09d2ca2f5080d5b60f51c00ae5bad0a0_0b0d2b3ab46247d094cccb5998aaaa7d",
"repo_number" : 4,
"inner_repo_user_name" : "xx-xxxxx-x_09d2ca2f5080d5b60f51c00ae5bad0a0_0b0d2b3ab46247d094cccb5998aaaa7d"
}, {
"status" : 0,
"region" : "xx-xxxxx-x",
"domain_id" : "09d2ca2f5080d5b60f51c00ae5bad0a0",
"created_time" : "2023-02-09 10:58:46",
"modified_time" : "2025-06-06 14:42:06",
"user_id" : "0c709421f700d2fa1f84c00a3a3da91a",
"user_name" : "self1",
"user_type" : "personal",
"repo_user_name" : "09d2ca2f5080d5b60f51c00ae5bad0a0_0c709421f700d2fa1f84c00a3a3da91a",
"repo_number" : 3,
"inner_repo_user_name" : "xx-xxxxx-x_09d2ca2f5080d5b60f51c00ae5bad0a0_0c709421f700d2fa1f84c00a3a3da91a"
} ],
"total_records" : 142,
"total_pages" : 15
}
}
SDK Sample Code
The SDK sample code is as follows.
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.codeartsartifact.v2.region.CodeArtsArtifactRegion; import com.huaweicloud.sdk.codeartsartifact.v2.*; import com.huaweicloud.sdk.codeartsartifact.v2.model.*; public class ListMavenUserSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); CodeArtsArtifactClient client = CodeArtsArtifactClient.newBuilder() .withCredential(auth) .withRegion(CodeArtsArtifactRegion.valueOf("<YOUR REGION>")) .build(); ListMavenUserRequest request = new ListMavenUserRequest(); try { ListMavenUserResponse response = client.listMavenUser(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkcodeartsartifact.v2.region.codeartsartifact_region import CodeArtsArtifactRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcodeartsartifact.v2 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] credentials = BasicCredentials(ak, sk) client = CodeArtsArtifactClient.new_builder() \ .with_credentials(credentials) \ .with_region(CodeArtsArtifactRegion.value_of("<YOUR REGION>")) \ .build() try: request = ListMavenUserRequest() response = client.list_maven_user(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
Go
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" codeartsartifact "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsartifact/v2" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsartifact/v2/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsartifact/v2/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := codeartsartifact.NewCodeArtsArtifactClient( codeartsartifact.CodeArtsArtifactClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ListMavenUserRequest{} response, err := client.ListMavenUser(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
More
For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
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