Updating Attributes of Azure Secrets
Use the patch /v1/cckm/azure/secrets/{id} API to update the attributes of a secret. You can modify the attributes and tags of the secret.
Syntax
curl -k '<IP>/api/v1/cckm/azure/secrets/{id}' -X PATCH -H 'Authorization: Bearer AUTHTOKEN' -H 'Content-Type: application/json' -H 'accept: application/json' --data-binary $'{\n  "attributes": {\n   "nbf": "<activation-time>",\n   "exp": "<expiration-time>"\n  },\n  "tags": {\n     "key1": "value1"\n  }\n}' --compressed
Here, {id} is the resource ID of the secret on the CipherTrust Manager.
Request Parameters
| Parameter | Type | Description | 
|---|---|---|
| AUTHTOKEN | string | Authorization token. | 
| attributes | JSON | Attributes to be updated such as exp, enabled, and nbf. Possible options are: • nbf - Activation date for the secret in Unix epoch time format. For example, the corresponding epoch time for September 9, 2022, 5:52:20 AM is 1662702740. • exp - Expiration date for the secret in Unix epoch time format. For example, the corresponding epoch time for September 9, 2022, 5:52:20 AM is 1662702740. • enabled - Specify whether the secret is enabled or disabled (true/false). | 
| contentType (optional) | string | Update content type for secrets to aid interpretation on retrieval. | 
| tags | JSON | An optional parameter to add additional information to the secret. The value must be specified as the key-value pair. Refer to the following rules on tag values. | 
- CCKM allows the following characters in tag values: - Alphanumeric characters 
- Special characters ** ! @ # $ ) ( { } > < ? + - / [ ] ^ & + = | ~ ` ; . ' _ ** 
 
- CCKM does not allow colon (:) and percent (%) special characters in tag values. 
Example Request
curl -k 'https://127.0.0.1/api/v1/cckm/azure/secrets/beb06ea5-47a0-4d47-85c0-0a0e4f1a9531' -X PATCH -H 'Authorization: Bearer AUTHTOKEN' -H 'Content-Type: application/json' -H 'accept: application/json' --data-binary $'{\n  "attributes": {\n "recoveryLevel": "Purgeable",
            \n "enabled": true, \n   "nbf": "1662702740", \n   "exp": "1662702740"\n  },\n  "tags": {\n     "Key1": "Value1"\n  }\n}' --compressed
Example Response
{
    "application/json": {
        "id": "beb06ea5-47a0-4d47-85c0-0a0e4f1a9531",
        "uri": "kylo:kylo:cckm:azure-secret:d20f9d11-6f16-44fe-9ce2-74f9c29ab49a",
        "account": "kylo:kylo:admin:accounts:kylo",
        "createdAt": "2022-04-18T11:30:21.740289Z",
        "updatedAt": "2022-04-22T04:28:58.298891292Z",
        "key_vault": "pkv-premium::260ecbe7-777b-4d3c-84ea-887620498863",
        "key_vault_id": "fd882f9e-db62-48d9-b222-1353abcdfb28",
        "region": "northcentralus",
        "deleted": false,
        "backup_at": "2022-04-19T05:34:59.035573Z",
        "soft_delete_enabled": false,
        "secret_soft_deleted_in_azure": false,
        "syncedAt": "2022-04-14T09:08:42Z",
        "created_by": "a8f38993-aa49-4281-888c-52afd80af6b1",
        "modified_by": "a8f38993-aa49-4281-888c-52afd80af6b1",
        "version": "5d5d51d5168f429bb9306fba2ded0b05",
        "backup": "2943054df7a9441e8be67666ae895be33974235a199440aea6abb2d5190f08fb",
        "secret_name": "secretNew102",
        "cloud_name": "AzureCloud",
        "azure_created_at": "2022-04-14T09:08:42Z",
        "azure_updated_at": "2022-04-14T09:08:42Z",
        "tenant": "d27d849e-e487-4b0e-a54c-a71e67687d10",
        "status": "AVAILABLE",
        "cm_secret_id": "",
        "gone": false,
        "azure_param": {
            "value": "dummy value",
            "id": "https://pkv-premium.vault.azure.net/secrets/secretNew102/5d5d51d5168f429bb9306fba2ded0b05",
            "attributes": {
                "recoveryLevel": "Purgeable",
                "enabled": true,
                "created": 1649927322,
                "updated": 1649927322
            },
            "tags": {
                "Key1": "Value1"
            }
        }
    }
}
The sample output shows that the attributes and tags parameters are modified.
Response Codes
| Response Code | Description | 
|---|---|
| 2xx | Success | 
| 4xx | Client errors | 
| 5xx | Server errors | 
Refer to HTTP status codes for details.