Updated on 2025-12-05 GMT+08:00

Advanced Search

Function

Advanced search.

Calling Method

For details, see Calling APIs.

URI

POST /cloudartifact/v5/tree/repos/artifacts

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

artifact_name

Yes

String

Definition

Search by artifact name.

Constraints

Maximum length: 200 characters.

Range

N/A.

Default value

None

artifact_type

No

String

Definition

Package type.

Constraints

N/A.

Range

maven2, npm, go, pypi, rpm, composer, debian, conan, nuget, docker2, cocoapods, and ohpm.

Default value

N/A.

page_no

No

Integer

Definition

Number of pages in a pagination query.

Constraints

N/A.

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.

Range

1–100

Default value

10

project_id

No

String

Definition

Project ID, which can be obtained by calling an API or from the console. For details about how to obtain the project ID, see Obtaining a Project ID (CloudArtifact_api_0015.xml).

Constraints

The value contains 32 characters. Only letters and digits are supported. This parameter is valid only when in_project is set to true.

Range

N/A.

Default value

None

in_project

No

Boolean

Definition

Whether the repository to query is in a project. If the value is true and project_id is specified, the queried repository is in a project. If project_id is not specified, the queried repository is outside of the project. If the value is false or not transferred, the repository data of the unassociated project of the current tenant is queried.

Constraints

N/A.

Range

true and false.

Default value

N/A.

Response Parameters

Status code: 200

Table 2 Response body parameters

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

SearchArtifactsResult object

Definition

File list.

Range

N/A.

Table 3 SearchArtifactsResult

Parameter

Type

Description

artifacts

Array of ArtifactSearchResult objects

Definition

File list.

Range

N/A.

Table 4 ArtifactSearchResult

Parameter

Type

Description

name

String

Definition

File name.

Range

N/A.

relativePath

String

Definition

Relative file path.

Range

N/A.

repo

String

Definition

Repository ID.

Range

N/A.

repoName

String

Definition

Repository name.

Range

N/A.

displayName

String

Definition

Display name.

Range

N/A.

repoType

String

Definition

Package type.

Range

N/A.

createdBy

String

Definition

Creator ID.

Range

N/A.

createdUserName

String

Definition

Creator name.

Range

N/A.

created

String

Definition

Creation time.

Range

N/A.

modified

String

Definition

Modification time.

Range

N/A.

oldRepoId

String

Definition

Old repository ID.

Range

N/A.

Example Requests

Advanced search.

https://artifact.example.myhuaweicloud.com/cloudartifact/v5/tree/repos/artifacts

{
  "artifact_name" : "mod.txt",
  "artifact_type" : "pypi",
  "page_no" : 1,
  "page_size" : 10,
  "project_id" : "e2ee90487d6349dd944a5767225f6f55",
  "in_project" : true
}

Example Responses

Status code: 200

OK

{
  "status" : "success",
  "trace_id" : "143002-1701221035715-403",
  "result" : {
    "artifacts" : [ {
      "name" : "mod.txt",
      "relativePath" : "1/1/mod.txt",
      "createdBy" : "xx-xxxxx-x_5a775fdcb14f4431b6c0015618140bc3_e9253deb37654775bb3c411aca89153a",
      "createdUserName" : "devcloud_devcloud_y00226182_01",
      "created" : "1701220753711",
      "modified" : "2023-11-29T09:19:13.711+08:00",
      "repo" : "xx-xxxxx-x_5a775fdcb14f4431b6c0015618140bc3_pypi_40",
      "repoName" : "testpypi",
      "displayName" : null,
      "oldRepoId" : "xx-xxxxx-x_5a775fdcb14f4431b6c0015618140bc3_pypi_40",
      "repoType" : "pypi"
    } ]
  }
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.