Lists a secret’s user-defined metadata.
If a secret does not contain any user metadata, an empty list will be returned.
GET /v1/secrets/{uuid}/metadata
Headers:
Accept: application/json
X-Auth-Token: <token>
{
'metadata': {
'description': 'contains the AES key',
'geolocation': '12.3456, -98.7654'
}
}
Name | Type | Description |
---|---|---|
metadata | list | Contains a list of the secret metadata’s key/value pairs. The provided keys must be lowercase. If not they will be converted to lowercase. |
Code | Description |
---|---|
200 | Successful Request |
401 | Invalid X-Auth-Token or the token doesn’t have permissions to access this resource. |
403 | Forbidden. The user has been authenticated, but is not authorized to retrieve secret metadata. This can be based on the user’s role. |
404 | Not Found |
Sets the metadata for a secret. Any metadata that was previously set will be deleted and replaced with this metadata.
Name | Type | Description |
---|---|---|
metadata | list | Contains a list of the secret metadata’s key/value pairs. The provided keys must be lowercase. If not they will be converted to lowercase. |
PUT /v1/secrets/{uuid}/metadata
Headers:
Content-Type: application/json
X-Auth-Token: <token>
Content:
{
'metadata': {
'description': 'contains the AES key',
'geolocation': '12.3456, -98.7654'
}
}
201 OK
{
"metadata_ref": "https://{barbican_host}/v1/secrets/{secret_uuid}/metadata"
}
Code | Description |
---|---|
201 | Successfully created/updated Secret Metadata |
400 | Bad Request |
401 | Invalid X-Auth-Token or the token doesn’t have permissions to access this resource. |
403 | Forbidden. The user has been authenticated, but is not authorized to create secret metadata. This can be based on the user’s role. |
Retrieves a secret’s user-added metadata.
GET /v1/secrets/{uuid}/metadata/{key}
Headers:
Accept: application/json
X-Auth-Token: <token>
200 OK
{
"key": "access-limit",
"value": "0"
}
Code | Description |
---|---|
200 | Successful request |
401 | Invalid X-Auth-Token or the token doesn’t have permissions to access this resource |
403 | Forbidden. The user has been authenticated, but is not authorized to retrieve secret metadata. This can be based on the user’s role. |
404 | Not Found |
Adds a new key/value pair to the secret’s user metadata. The key sent in the request must not already exist in the metadata. The key must also be in lowercase, otherwise it will automatically be changed to lowercase.
POST /v1/secrets/{uuid}/metadata/
Headers:
X-Auth-Token: <token>
Content-Type: application/json
Content:
{
"key": "access-limit",
"value": "11"
}
201 Created
Secret Metadata Location: http://example.com:9311/v1/secrets/{uuid}/metadata/access-limit
{
"key": "access-limit",
"value": "11"
}
Code | Description |
---|---|
201 | Successful request |
400 | Bad Request |
401 | Invalid X-Auth-Token or the token doesn’t have permissions to access this resource. |
403 | Forbidden. The user has been authenticated, but is not authorized to create secret metadata. This can be based on the user’s role. |
409 | Conflict. The provided metadata key already exists. |
Updates an existing key/value pair in the secret’s user metadata. The key sent in the request must already exist in the metadata. The key must also be in lowercase, otherwise it will automatically be changed to lowercase.
PUT /v1/secrets/{uuid}/metadata/{key}
Headers:
X-Auth-Token: <token>
Content-Type: application/json
Content:
{
"key": "access-limit",
"value": "11"
}
200 OK
{
"key": "access-limit",
"value": "11"
}
Code | Description |
---|---|
200 | Successful request |
400 | Bad Request |
401 | Invalid X-Auth-Token or the token doesn’t have permissions to access this resource. |
403 | Forbidden. The user has been authenticated, but is not authorized to update secret metadata. This can be based on the user’s role. |
404 | Not Found |
Delete secret metadata by key.
DELETE /v1/secrets/{uuid}/metadata/{key}
Headers:
X-Auth-Token: <token>
204 No Content
Code | Description |
---|---|
204 | Successful request |
401 | Invalid X-Auth-Token or the token doesn’t have permissions to access this resource. |
403 | Forbidden. The user has been authenticated, but is not authorized to delete secret metadata. This can be based on the user’s role. |
404 | Not Found |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.