Scheduling Deletion of an OCI Key Version
Use the post /v1/cckm/oci/keys/{id}/versions/{versionID}/schedule-deletion
API to schedule automatic deletion of an OCI key version in a specified number of days. Specify the key ID and the version ID.
Syntax
curl -k '<IP>/api/v1/cckm/oci/keys/{id}/versions/{versionID}/schedule-deletion' -H 'Authorization: Bearer AUTHTOKEN' -H 'Content-Type: application/json' -H 'accept: application/json' --data-binary $'{\n "days": <delete-in-days>\n}' --compressed
Here, {id}
is the resource ID of the OCI key and {versionID}
is the resource ID of the key version.
Note that the resource id
is different from key_id
on OCI. Run the get /v1/cckm/oci/keys
API to view the resource ID (id
) of the OCI key on the CipherTrust Manager. Similarly, run the get /v1/cckm/oci/keys/{id}/versions
API to get the resource ID of an OCI key version.
Request Parameters
Parameter | Type | Description |
---|---|---|
AUTHTOKEN | string | Authentication token. |
days | number | Number of days after which the key version will be deleted. The number of days can be 7 to 30. The default value is 7 . |
Example Request
curl -k 'https://127.0.0.1/api/v1/cckm/oci/keys/69f02b1d-c7c7-45fb-84e3-7d2f86a3f60b/versions/0d14b497-68db-474a-8d94-9e47507a122d/schedule-deletion' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiIxYzU1ZWY0Yi01MThjLTQ5ZmMtODRmMy1mYjk4MGY4YTQ3ODQiLCJzdWIiOiJsb2NhbHwyZjBmZWViNC02MjkwLTQ4ZWQtYmU1Yy0wYmU4NTVkMzE4NzMiLCJpc3MiOiJreWxvIiwiYWNjIjoia3lsbyIsInByZWZlcnJlZF91c2VybmFtZSI6ImFkbWluIiwiY3VzdCI6eyJkb21haW5faWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJncm91cHMiOlsiYWRtaW4iXSwic2lkIjoiODU3ZDEyYjItNjljZi00OWY1LThkYjktMjI0NWMwODNiODg5Iiwiem9uZV9pZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCJ9LCJqd3RpZCI6IjA3ZjkwZWEwLTc3ODgtNDIzNS04MDRmLWYzYmEzYTRmMWQ4MCIsImlhdCI6MTY0Mzg2NDIyMiwiZXhwIjoxNjQzODY0NTIyfQ.ByO5gHR8rzu6SRgX4beGY_3b6AOXGK1M0x3TQgKbg24' -H 'Content-Type: application/json' -H 'accept: application/json' --data-binary $'{\n "days": 7\n}' --compressed
Example Response
{
"id": "ec7acd24-bbe7-40c1-9c66-efb4467559c9",
"uri": "kylo:kylo:cckm:oci-key-version:ec7acd24-bbe7-40c1-9c66-efb4467559c9",
"account": "kylo:kylo:admin:accounts:kylo",
"createdAt": "2022-02-03T04:51:54.435551Z",
"updatedAt": "2022-02-03T04:51:54.43417Z",
"gone": false,
"oci_key_version_params": {
"compartment_id": "ocid1.tenancy.oc1..aaaaaaaadixb52q2mvlsn634ql5aaal6hb2vg7audpd4d4mcf5zluymff6sq",
"version_id": "ocid1.keyversion.oc1.iad.b5q6uxdhaahdg.avaimh5v62iaa.abuwcljstdcbcw2rpy56v5m55t5ygq4xucitd6wdqrmk4dazymr2zya7zabq",
"key_id": "ocid1.key.oc1.iad.b5q6uxdhaahdg.abuwcljrbluqjkyywbhoho652oxrngjibgq5yhtxbeonszmmj7g4zgj4efma",
"time_created": "2022-02-03T04:51:54.139Z",
"vault_id": "ocid1.vault.oc1.iad.b5q6uxdhaahdg.abuwcljs6qwagycytfmnryece3u55fswvaioqfeozixgt5if5f354umdamdq",
"lifecycle_state": "SCHEDULING_DELETION",
"origin": "INTERNAL",
"is_primary": true
}
}
Response Codes
Response Code | Description |
---|---|
2xx | Success |
4xx | Client errors |
5xx | Server errors |
Refer to HTTP status codes for details.