Manually Starting an Artifact Scan
Function
This API is used to start an artifact scan manually.
Constraints
This API is only supported by SWR Enterprise Edition instances v25.7.20 or later.
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:startManualScanning
Write
repository *
-
g:ResourceTag/<tag-key>
-
g:EnterpriseProjectId
-
-
-
URI
POST /v2/{project_id}/instances/{instance_id}/namespaces/{namespace_name}/repositories/{repository_name}/artifacts/{reference}/scan
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. |
|
instance_id |
Yes |
String |
ID of an SWR Enterprise Edition instance. |
|
namespace_name |
Yes |
String |
Namespace name. |
|
repository_name |
Yes |
String |
Repository name. |
|
reference |
Yes |
String |
Artifact digest. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. The token can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 202
The request for starting the artifact scan has been accepted.
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
|
encoded_authorization_message |
String |
Detailed rejection reason after encryption. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
|
encoded_authorization_message |
String |
Detailed rejection reason after encryption. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
|
encoded_authorization_message |
String |
Detailed rejection reason after encryption. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
|
encoded_authorization_message |
String |
Detailed rejection reason after encryption. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
|
encoded_authorization_message |
String |
Detailed rejection reason after encryption. You can call the API decode-authorization-message of STS to decrypt the reason. |
Example Requests
POST https://{endpoint}/v2/{project_id}/instances/{instance_id}/namespaces/{namespace_name}/repositories/{repository_name}/artifacts/{reference}/scan
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
202 |
The request for starting the artifact scan has been accepted. |
|
400 |
Request error. |
|
401 |
Authentication failed. |
|
403 |
Access denied. |
|
404 |
Resource not found. |
|
500 |
Internal error. |
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