Assign Tags to an Asset
Assigns one or more tags to an image or a container.
Input ParametersInput Parameters
| Parameter | Mandatory/Optional | Data Type | Description |
|---|---|---|---|
| entityUUID | Mandatory | string | Specify the UUID of the asset. |
| tagsToAdd | Mandatory | string | Specify details of the tags to be assigned to an asset. |
| tagUuid | Mandatory | string | Specify the UUID of the tag to be assigned. |
| isCascadeToContainer |
Mandatory | boolean |
Specify whether to apply an image tag to the container spawned using that image.
|
| subscriptionId | Optional | string | Specify the Subscription ID of the user. |
| entityType | Mandatory | string | Specify the type of entity to which you want to assign a tag. Valid values: 'IMAGE' or 'CONTAINER' |
| moduleCode | Optional | string | Specify Qualys module code. Valid value: "CS" |
| entitySha | Mandatory | string |
Identify the target image or container when the entity UUID is not provided. At least one of the following must be provided for tag assignment: entitySha or entityUUID. |
| tagName | Mandatory | string |
Specify the tag to assign by name, and trigger tag creation if the tag does not already exist. At least one of the following must be provided for tag assignment: tagName or tagUuid |
Sample: Assign a tag to an image in your accountSample: Assign a tag to an image in your account
API Request
curl -X "POST" "<qualys_base_url>/csapi/v1.3/tag/assign" -H "accept: application/json" -H "Authorization: Bearer <token>" -H "Content-Type: application/json" -d "{"entitySha": "string","tagName": "string",
"entityUUID": "string",
"tagsToAdd": [
{
"tagUuid": "string",
"isCascadeToContainer": true
}
],
"subscriptionId": "string",
"entityType": "IMAGE / CONTAINER",
"moduleCode": "string"
}
Response
{
"entityUUID": "5344c653-2472-3727-8397-3163d97ce6cb",
"cascadingKafkaJobUuid": "dfb4c607-e549-4bc9-8652-a15299e27111"
}
Sample: Assign multiple tags to an image in your accountSample: Assign multiple tags to an image in your account
API Request
curl -X "POST" "<qualys_base_url>/csapi/v1.3/tag/assign" -H "accept: application/json" -H "Authorization: Bearer <token>" -H "Content-Type: application/json" -d "{"entitySha": "string","entityUUID": "string", "tagsToAdd": [ { "tagUuid": "string","tagName": "string","isCascadeToContainer": true } { "tagUuid": "string", "isCascadeToContainer": true } ], "subscriptionId": "string", "entityType": "IMAGE / CONTAINER", "moduleCode": "string" }
Response
{
"entityUUID": "5344c653-2472-3727-8397-3163d97ce6cb",
"cascadingKafkaJobUuid": "dfb4c607-e549-4bc9-8652-a15299e27111"
}