Defining the import tag policy type
Procedure to define the import tags policy in a JSON payload.
About this task
You can create the import tags policies by using the policy management REST API. A sample policy that is defined in a JSON payload is shown:
{
"pol _id": "importtags_pol",
"action_id": "IMPORT_TAGS",
"action_params": {
"agent":"Import Tags",
"source_connection":"camera_vaul t",
"tag_file_path":"camera_lidar _semantic/A2D2_labels.csv",
"tag_file_type":"csv"
},
"schedule": "NOW",
"pol_state": "active",
"pol_filter": "datasource=' camera_lidar_semanti c' "
}
The following table lists the action parameters for defining the import tags policy type:
Action Parameter | Description |
---|---|
souce_connection | The Cloud Object Storage (COS) or S3 connection name that is defined in IBM Spectrum® Discover for the records that the imported tags can be applied to. |
tag_file_path | The absolute path (bucket or object name) of the CSV file that contains the list of objects and associated tags to import. |
IMPORT_TAGS is the new action_id that is defined for the import tags policies.
Procedure
Example
Send the following request to create an Import Tags policy for data source connection camera_vault that runs immediately by using the external tag file A2D2_labels.csv:
curl - k - H ' Authorization: Bearer <token>'
https: //<spectrum_discover_host>/policyengine/v1/policies-d'
{
"pol_id": "importtags",
"action_id": "IMPORT_TAGS",
"action_params": {
"agent": "Import Tags",
"source_connection": "camera_vault",
"tag_file_path": "camera_lidar_semantic/A2D2_labels.csv",
"tag_file_type": "csv"
},
"schedule": "NOW",
"pol_state": "active",
"pol _filter": "datasource='camera_lidar _semantic' "
}
'-XPOST -H" Content-Type:application/json"
The following response is returned:
Policy 'importtags_ut'added