Searching for Files Using Checksums
Function
This API is used to search for files using checksums.
Calling Method
For details, see Calling APIs.
URI
GET /cloudartifact/v5/search/checksum
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
checksum |
Yes |
String |
Definition File checksums, which can be obtained from the General tab. The checksums can be MD5, SHA-1, SHA-256, or SHA-512. Constraints N/A. Range Only letters and digits are supported. The character length can be 32, 40, 64, or 128. 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 |
|
format |
No |
String |
Definition Repository type. Constraints N/A. Range maven2, npm, go, pypi, rpm, composer, debian, conan, nuget, docker2, cocoapods, and ohpm. Default value N/A. |
|
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. |
|
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 |
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 |
Array of ArtifactSearchResult objects |
Definition File list. Range N/A. |
|
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
This API is used to search for files using checksums.
https://artifact.example.myhuaweicloud.com/cloudartifact/v5/search/checksum?checksum=eb05a9df1e3403a5f54e03de073a6ce6&page_no=1&page_size=10&in_project=true&project_id=e2ee90487d6349dd944a5767225f6f55&format=pypi
Example Responses
Status code: 200
OK
{
"status" : "success",
"trace_id" : "143006-1701220804200-277",
"result" : [ {
"name" : "mod.txt",
"relativePath" : "1/1/mod.txt",
"createdBy" : null,
"createdUserName" : "devcloud_devcloud_y00226182_01",
"created" : null,
"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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.