Creating a Bulk Job
Use the post /v1/cckm/aws/bulkjob
API to create a job to perform the specified operation on multiple AWS keys in one attempt.
Note
To perform the bulk job operations, the CCKM Users group requires the keybulkoperation
ACL. Refer to Managing User Permissions on AWS KMS for details.
Syntax
curl -k '<IP>/api/v1/cckm/aws/bulkjob' -H 'Authorization: Bearer AUTHTOKEN' -H 'Content-Type: application/json' --data-binary $'{\n "operation": "<operation>",\n "keys": [\n "<key1-id>",\n "<key2-id>"\n ]\n}' --compressed
Request Parameters
Parameter | Type | Description |
---|---|---|
AUTHTOKEN | string | Authorization token. |
keys | array of strings | List of IDs of the keys on which the operations are to be performed. A maximum of 100 keys are supported for bulk operations. |
operation | string | Operation to be performed on the keys. The supported operations are: • enablekey • disablekey • cancelkeydeletion • applypolicytemplate (optionally, also specify policy_template_id .)• schedulekeydeletion (optionally, also specify days ) |
days | integer | Number of days after which the keys are to be scheduled for deletion. This parameter is applicable to the schedulekeydeletion operation only. |
policy_template_id | string | ID of the policy template to be applied to the key. This parameter is applicable to the applypolicytemplate operation only.Note: All the keys and the specified policy template must belong to the same AWS KMS Account. |
Example Request
curl -k 'https://127.0.0.1/api/v1/cckm/aws/bulkjob' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjNWMwZGJlNC1lMmJmLTQ3M2MtODY4MC01NWVkMWIzMDEzMmEiLCJzdWIiOiJsb2NhbHxhNjdjMzc0OC05YTRiLTRhZGQtYjNkOS0wNTRiYTIwYmUzYWMiLCJpc3MiOiJreWxvIiwiYWNjIjoia3lsbyIsInByZWZlcnJlZF91c2VybmFtZSI6ImFkbWluIiwiY3VzdCI6eyJkb21haW5faWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJncm91cHMiOlsiYWRtaW4iXSwic2lkIjoiMDhkNDI5ZjktNDgzYi00ODdlLWJjOTQtNGE1Mjc2ZDI2ZjZjIiwiem9uZV9pZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCJ9LCJqd3RpZCI6ImYyYjVlZmIxLTkyMmEtNGFiNC04NGVmLTJlMGU4NDlmZDEyYiIsImlhdCI6MTYwNDU1ODQyNiwiZXhwIjoxNjA0NTU4NzI2fQ.SWwAyD4uOEMNxkwvJBH9jFGlVwgKzKM6aDWeR_JUXdc' -H 'Content-Type: application/json' --data-binary $'{\n "operation": "enablekey",\n "keys": [\n "2387500d-bcac-4055-a48d-19592c3332ff",\n "2387500d-bcac-4055-a48d-19592c3332fg"\n ]\n}' --compressed
Example Response
{
"id": "d8251b71-9302-445c-a251-cbe1fddb3909",
"uri": "kylo:kylo:cckm:bulkjob:d8251b71-9302-445c-a251-cbe1fddb3909",
"account": "kylo:kylo:admin:accounts:kylo",
"createdAt": "2023-02-10T08:07:20.139366Z",
"updatedAt": "2023-02-10T08:07:20.138471Z",
"overall_status": "in_progress",
"abort": false,
"cloud": "aws",
"keys": [
"2387500d-bcac-4055-a48d-19592c3332ff",
"2387500d-bcac-4055-a48d-19592c3332fg"
],
"operation": "enablekey"
}
The sample output above shows that a bulk job to perform the enablekey
operation has been created, the status is "in_progress". The specified operation will be performed on the specified keys.
Response Codes
Response Code | Description |
---|---|
2xx | Success |
4xx | Client errors |
5xx | Server errors |
Refer to HTTP status codes for details.