# Public Cloud › Project Management › Barbican API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Public Cloud product's sections: https://developers.eu.ovhcloud.com/reference/public-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 19 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/public-cloud/project-management/barbican.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/public-cloud/project-management/barbican.json?format=openapi3

## Operations

- `GET /publicCloud/project/{projectId}/keyManager/container` — List secret containers
- `GET /publicCloud/project/{projectId}/keyManager/container/{containerId}` — Get a secret container
- `POST /publicCloud/project/{projectId}/keyManager/container` — Create a secret container
- `DELETE /publicCloud/project/{projectId}/keyManager/container/{containerId}` — Delete a secret container
- `PUT /publicCloud/project/{projectId}/keyManager/container/{containerId}` — Replace container secret references
- `GET /publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer` — List container consumers
- `GET /publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer/{consumerId}` — Get a container consumer
- `POST /publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer` — Register a container consumer
- `DELETE /publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer/{consumerId}` — Remove a container consumer
- `GET /publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer` — List secret consumers
- `GET /publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer/{consumerId}` — Get a secret consumer
- `POST /publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer` — Register a secret consumer
- `DELETE /publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer/{consumerId}` — Remove a secret consumer
- `GET /publicCloud/project/{projectId}/keyManager/secret` — List secrets
- `GET /publicCloud/project/{projectId}/keyManager/secret/{secretId}` — Get a secret
- `POST /publicCloud/project/{projectId}/keyManager/secret` — Create a secret
- `DELETE /publicCloud/project/{projectId}/keyManager/secret/{secretId}` — Delete a secret
- `PUT /publicCloud/project/{projectId}/keyManager/secret/{secretId}` — Update secret metadata
- `POST /publicCloud/project/{projectId}/keyManager/secret/{secretId}/payload` — Get a secret payload

## List secret containers

`GET /v2/publicCloud/project/{projectId}/keyManager/container`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#getKeyManagerContainers

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/container/get`

Returns the secret containers of the project. A container groups secrets used together, such as a certificate and its private key. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.Container[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the container |
| `currentState` | publicCloud.keyManager.ContainerCurrentState | read-only | Current observed state of the container from the infrastructure |
| `currentState.creatorId` | string | read-only | Identifier of the user who created the container |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Current container name |
| `currentState.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] | read-only | Current secret references in the container |
| `currentState.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `currentState.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |
| `currentState.status` | publicCloud.keyManager.ContainerStatusEnum | read-only | OpenStack container status — one of `ACTIVE`, `ERROR` |
| `currentState.type` | publicCloud.keyManager.ContainerTypeEnum | read-only | Current container type — one of `CERTIFICATE`, `GENERIC`, `RSA` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the container |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the container |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Container readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.keyManager.ContainerTargetSpec | read-only | Last target specification of the container |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired container name |
| `targetSpec.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] |  | Secret references to include in the container |
| `targetSpec.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `targetSpec.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |
| `targetSpec.type` | publicCloud.keyManager.ContainerTypeEnum | yes | Type of the container — one of `CERTIFICATE`, `GENERIC`, `RSA` |
| `updatedAt` | string (date-time) | read-only | Last update date of the container |

```json
[
  {
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "creatorId": "string",
      "location": {
        "availabilityZone": "string",
        "region": "string"
      },
      "name": "string",
      "secretRefs": [
        {
          "name": "string",
          "secret": {
            "id": "00000000-0000-0000-0000-000000000000"
          }
        }
      ],
      "status": "ACTIVE",
      "type": "CERTIFICATE"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "location": {
        "availabilityZone": "string",
        "region": "string"
      },
      "name": "string",
      "secretRefs": [
        {
          "name": "string",
          "secret": {
            "id": "00000000-0000-0000-0000-000000000000"
          }
        }
      ],
      "type": "CERTIFICATE"
    },
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/container" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/keyManager/container")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/keyManager/container");

print_r($result);
?>
```

## Get a secret container

`GET /v2/publicCloud/project/{projectId}/keyManager/container/{containerId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#getKeyManagerContainer

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/container/get`

Returns the container, its secret references and its current state. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `containerId` | path | string (uuid) | yes | Container ID |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.Container | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the container |
| `currentState` | publicCloud.keyManager.ContainerCurrentState | read-only | Current observed state of the container from the infrastructure |
| `currentState.creatorId` | string | read-only | Identifier of the user who created the container |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Current container name |
| `currentState.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] | read-only | Current secret references in the container |
| `currentState.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `currentState.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |
| `currentState.status` | publicCloud.keyManager.ContainerStatusEnum | read-only | OpenStack container status — one of `ACTIVE`, `ERROR` |
| `currentState.type` | publicCloud.keyManager.ContainerTypeEnum | read-only | Current container type — one of `CERTIFICATE`, `GENERIC`, `RSA` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the container |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the container |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Container readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.keyManager.ContainerTargetSpec | read-only | Last target specification of the container |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired container name |
| `targetSpec.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] |  | Secret references to include in the container |
| `targetSpec.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `targetSpec.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |
| `targetSpec.type` | publicCloud.keyManager.ContainerTypeEnum | yes | Type of the container — one of `CERTIFICATE`, `GENERIC`, `RSA` |
| `updatedAt` | string (date-time) | read-only | Last update date of the container |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "creatorId": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "secretRefs": [
      {
        "name": "string",
        "secret": {
          "id": "00000000-0000-0000-0000-000000000000"
        }
      }
    ],
    "status": "ACTIVE",
    "type": "CERTIFICATE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "secretRefs": [
      {
        "name": "string",
        "secret": {
          "id": "00000000-0000-0000-0000-000000000000"
        }
      }
    ],
    "type": "CERTIFICATE"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}");

print_r($result);
?>
```

## Create a secret container

`POST /v2/publicCloud/project/{projectId}/keyManager/container`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#createKeyManagerContainer

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/container/create`

Creates a certificate, RSA or generic container in a region. It references existing secrets, each under a role name. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.keyManager.ContainerCreation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | publicCloud.keyManager.ContainerTargetSpec | yes | Desired target specification for the container |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired container name |
| `targetSpec.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] |  | Secret references to include in the container |
| `targetSpec.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `targetSpec.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |
| `targetSpec.type` | publicCloud.keyManager.ContainerTypeEnum | yes | Type of the container — one of `CERTIFICATE`, `GENERIC`, `RSA` |

```json
{
  "targetSpec": {
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "secretRefs": [
      {
        "name": "string",
        "secret": {
          "id": "00000000-0000-0000-0000-000000000000"
        }
      }
    ],
    "type": "CERTIFICATE"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.Container | successful operation |
| 400 | object | Error 400 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the container |
| `currentState` | publicCloud.keyManager.ContainerCurrentState | read-only | Current observed state of the container from the infrastructure |
| `currentState.creatorId` | string | read-only | Identifier of the user who created the container |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Current container name |
| `currentState.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] | read-only | Current secret references in the container |
| `currentState.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `currentState.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |
| `currentState.status` | publicCloud.keyManager.ContainerStatusEnum | read-only | OpenStack container status — one of `ACTIVE`, `ERROR` |
| `currentState.type` | publicCloud.keyManager.ContainerTypeEnum | read-only | Current container type — one of `CERTIFICATE`, `GENERIC`, `RSA` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the container |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the container |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Container readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.keyManager.ContainerTargetSpec | read-only | Last target specification of the container |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired container name |
| `targetSpec.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] |  | Secret references to include in the container |
| `targetSpec.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `targetSpec.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |
| `targetSpec.type` | publicCloud.keyManager.ContainerTypeEnum | yes | Type of the container — one of `CERTIFICATE`, `GENERIC`, `RSA` |
| `updatedAt` | string (date-time) | read-only | Last update date of the container |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "creatorId": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "secretRefs": [
      {
        "name": "string",
        "secret": {
          "id": "00000000-0000-0000-0000-000000000000"
        }
      }
    ],
    "status": "ACTIVE",
    "type": "CERTIFICATE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "secretRefs": [
      {
        "name": "string",
        "secret": {
          "id": "00000000-0000-0000-0000-000000000000"
        }
      }
    ],
    "type": "CERTIFICATE"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/container" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.keyManager.ContainerCreation
result = client.post("/v2/publicCloud/project/{projectId}/keyManager/container",
	targetSpec = None, # Desired target specification for the container (type: publicCloud.keyManager.ContainerTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.keyManager.ContainerCreation
$result = $ovh->post("/v2/publicCloud/project/{projectId}/keyManager/container", array(
	targetSpec => null, // Desired target specification for the container (type: publicCloud.keyManager.ContainerTargetSpec)
));

print_r($result);
?>
```

## Delete a secret container

`DELETE /v2/publicCloud/project/{projectId}/keyManager/container/{containerId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#deleteKeyManagerContainer

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/container/delete`

Deletes the container. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `containerId` | path | string (uuid) | yes | Container ID |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.Container | successful operation |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the container |
| `currentState` | publicCloud.keyManager.ContainerCurrentState | read-only | Current observed state of the container from the infrastructure |
| `currentState.creatorId` | string | read-only | Identifier of the user who created the container |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Current container name |
| `currentState.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] | read-only | Current secret references in the container |
| `currentState.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `currentState.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |
| `currentState.status` | publicCloud.keyManager.ContainerStatusEnum | read-only | OpenStack container status — one of `ACTIVE`, `ERROR` |
| `currentState.type` | publicCloud.keyManager.ContainerTypeEnum | read-only | Current container type — one of `CERTIFICATE`, `GENERIC`, `RSA` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the container |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the container |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Container readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.keyManager.ContainerTargetSpec | read-only | Last target specification of the container |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired container name |
| `targetSpec.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] |  | Secret references to include in the container |
| `targetSpec.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `targetSpec.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |
| `targetSpec.type` | publicCloud.keyManager.ContainerTypeEnum | yes | Type of the container — one of `CERTIFICATE`, `GENERIC`, `RSA` |
| `updatedAt` | string (date-time) | read-only | Last update date of the container |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "creatorId": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "secretRefs": [
      {
        "name": "string",
        "secret": {
          "id": "00000000-0000-0000-0000-000000000000"
        }
      }
    ],
    "status": "ACTIVE",
    "type": "CERTIFICATE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "secretRefs": [
      {
        "name": "string",
        "secret": {
          "id": "00000000-0000-0000-0000-000000000000"
        }
      }
    ],
    "type": "CERTIFICATE"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}");

print_r($result);
?>
```

## Replace container secret references

`PUT /v2/publicCloud/project/{projectId}/keyManager/container/{containerId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#editKeyManagerContainer

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/container/edit`

Replaces all secret references of the container. Only the secret references can be changed after creation. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `containerId` | path | string (uuid) | yes | Container ID |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.keyManager.ContainerUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). |
| `targetSpec` | publicCloud.keyManager.ContainerUpdateTargetSpec | yes | Desired target specification for the container |
| `targetSpec.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] | yes | Desired list of secret references. Replaces all existing references. |
| `targetSpec.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `targetSpec.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |

```json
{
  "checksum": "string",
  "targetSpec": {
    "secretRefs": [
      {
        "name": "string",
        "secret": {
          "id": "00000000-0000-0000-0000-000000000000"
        }
      }
    ]
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.Container | successful operation |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the container |
| `currentState` | publicCloud.keyManager.ContainerCurrentState | read-only | Current observed state of the container from the infrastructure |
| `currentState.creatorId` | string | read-only | Identifier of the user who created the container |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Current container name |
| `currentState.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] | read-only | Current secret references in the container |
| `currentState.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `currentState.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |
| `currentState.status` | publicCloud.keyManager.ContainerStatusEnum | read-only | OpenStack container status — one of `ACTIVE`, `ERROR` |
| `currentState.type` | publicCloud.keyManager.ContainerTypeEnum | read-only | Current container type — one of `CERTIFICATE`, `GENERIC`, `RSA` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the container |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the container |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Container readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.keyManager.ContainerTargetSpec | read-only | Last target specification of the container |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired container name |
| `targetSpec.secretRefs` | publicCloud.keyManager.ContainerSecretRef[] |  | Secret references to include in the container |
| `targetSpec.secretRefs[].name` | string | yes | Role name of the secret reference, for example private_key, certificate, public_key |
| `targetSpec.secretRefs[].secret` | publicCloud.keyManager.ContainerSecretRefSecret | yes | Reference to the secret |
| `targetSpec.type` | publicCloud.keyManager.ContainerTypeEnum | yes | Type of the container — one of `CERTIFICATE`, `GENERIC`, `RSA` |
| `updatedAt` | string (date-time) | read-only | Last update date of the container |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "creatorId": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "secretRefs": [
      {
        "name": "string",
        "secret": {
          "id": "00000000-0000-0000-0000-000000000000"
        }
      }
    ],
    "status": "ACTIVE",
    "type": "CERTIFICATE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "secretRefs": [
      {
        "name": "string",
        "secret": {
          "id": "00000000-0000-0000-0000-000000000000"
        }
      }
    ],
    "type": "CERTIFICATE"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.keyManager.ContainerUpdate
result = client.put("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}",
	checksum = None, # Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec = None, # Desired target specification for the container (type: publicCloud.keyManager.ContainerUpdateTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.keyManager.ContainerUpdate
$result = $ovh->put("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}", array(
	checksum => null, // Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec => null, // Desired target specification for the container (type: publicCloud.keyManager.ContainerUpdateTargetSpec)
));

print_r($result);
?>
```

## List container consumers

`GET /v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#getKeyManagerContainerConsumers

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/container/consumer/get`

Returns the resources registered as using the container: instances, images or load balancers. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `containerId` | path | string (uuid) | yes | Container ID |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.ContainerConsumer[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | read-only | Computed consumer identifier |
| `resourceId` | string (uuid) | read-only | UUID of the resource consuming the container |
| `resourceType` | publicCloud.keyManager.ConsumerResourceTypeEnum | read-only | Type of the resource consuming the container — one of `IMAGE`, `INSTANCE`, `LOADBALANCER` |
| `service` | publicCloud.keyManager.ConsumerServiceEnum | read-only | OpenStack service type of the consumer — one of `COMPUTE`, `IMAGE`, `LOADBALANCER`, `NETWORK` |

```json
[
  {
    "id": "string",
    "resourceId": "00000000-0000-0000-0000-000000000000",
    "resourceType": "IMAGE",
    "service": "COMPUTE"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer");

print_r($result);
?>
```

## Get a container consumer

`GET /v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer/{consumerId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#getKeyManagerContainerConsumer

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/container/consumer/get`

Returns one resource registered as using the container, with its type and service. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `consumerId` | path | string | yes | Consumer ID |
| `containerId` | path | string (uuid) | yes | Container ID |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.ContainerConsumer | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | read-only | Computed consumer identifier |
| `resourceId` | string (uuid) | read-only | UUID of the resource consuming the container |
| `resourceType` | publicCloud.keyManager.ConsumerResourceTypeEnum | read-only | Type of the resource consuming the container — one of `IMAGE`, `INSTANCE`, `LOADBALANCER` |
| `service` | publicCloud.keyManager.ConsumerServiceEnum | read-only | OpenStack service type of the consumer — one of `COMPUTE`, `IMAGE`, `LOADBALANCER`, `NETWORK` |

```json
{
  "id": "string",
  "resourceId": "00000000-0000-0000-0000-000000000000",
  "resourceType": "IMAGE",
  "service": "COMPUTE"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer/{consumerId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer/{consumerId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer/{consumerId}");

print_r($result);
?>
```

## Register a container consumer

`POST /v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#createKeyManagerContainerConsumer

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/container/consumer/create`

Records that an instance, an image or a load balancer uses the container. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `containerId` | path | string (uuid) | yes | Container ID |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.keyManager.ContainerConsumerInput`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceId` | string (uuid) | yes | UUID of the resource consuming the container |
| `resourceType` | publicCloud.keyManager.ConsumerResourceTypeEnum | yes | Type of the resource consuming the container — one of `IMAGE`, `INSTANCE`, `LOADBALANCER` |
| `service` | publicCloud.keyManager.ConsumerServiceEnum | yes | OpenStack service type of the consumer — one of `COMPUTE`, `IMAGE`, `LOADBALANCER`, `NETWORK` |

```json
{
  "resourceId": "00000000-0000-0000-0000-000000000000",
  "resourceType": "IMAGE",
  "service": "COMPUTE"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.ContainerConsumer | successful operation |
| 400 | object | Error 400 response |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | read-only | Computed consumer identifier |
| `resourceId` | string (uuid) | read-only | UUID of the resource consuming the container |
| `resourceType` | publicCloud.keyManager.ConsumerResourceTypeEnum | read-only | Type of the resource consuming the container — one of `IMAGE`, `INSTANCE`, `LOADBALANCER` |
| `service` | publicCloud.keyManager.ConsumerServiceEnum | read-only | OpenStack service type of the consumer — one of `COMPUTE`, `IMAGE`, `LOADBALANCER`, `NETWORK` |

```json
{
  "id": "string",
  "resourceId": "00000000-0000-0000-0000-000000000000",
  "resourceType": "IMAGE",
  "service": "COMPUTE"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.keyManager.ContainerConsumerInput
result = client.post("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer",
	resourceId = None, # UUID of the resource consuming the container (type: string)
	resourceType = None, # Type of the resource consuming the container (type: publicCloud.keyManager.ConsumerResourceTypeEnum)
	service = None, # OpenStack service type of the consumer (type: publicCloud.keyManager.ConsumerServiceEnum)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.keyManager.ContainerConsumerInput
$result = $ovh->post("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer", array(
	resourceId => null, // UUID of the resource consuming the container (type: string)
	resourceType => null, // Type of the resource consuming the container (type: publicCloud.keyManager.ConsumerResourceTypeEnum)
	service => null, // OpenStack service type of the consumer (type: publicCloud.keyManager.ConsumerServiceEnum)
));

print_r($result);
?>
```

## Remove a container consumer

`DELETE /v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer/{consumerId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#deleteKeyManagerContainerConsumer

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/container/consumer/delete`

Removes the consumer registration. The resource itself is not deleted. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `consumerId` | path | string | yes | Consumer ID |
| `containerId` | path | string (uuid) | yes | Container ID |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.ContainerConsumer | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | read-only | Computed consumer identifier |
| `resourceId` | string (uuid) | read-only | UUID of the resource consuming the container |
| `resourceType` | publicCloud.keyManager.ConsumerResourceTypeEnum | read-only | Type of the resource consuming the container — one of `IMAGE`, `INSTANCE`, `LOADBALANCER` |
| `service` | publicCloud.keyManager.ConsumerServiceEnum | read-only | OpenStack service type of the consumer — one of `COMPUTE`, `IMAGE`, `LOADBALANCER`, `NETWORK` |

```json
{
  "id": "string",
  "resourceId": "00000000-0000-0000-0000-000000000000",
  "resourceType": "IMAGE",
  "service": "COMPUTE"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer/{consumerId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer/{consumerId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/publicCloud/project/{projectId}/keyManager/container/{containerId}/consumer/{consumerId}");

print_r($result);
?>
```

## List secret consumers

`GET /v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#getKeyManagerSecretConsumers

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/secret/consumer/get`

Returns the resources registered as using the secret: instances, images or load balancers. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `projectId` | path | string | yes | Project ID |
| `secretId` | path | string (uuid) | yes | Secret ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.SecretConsumer[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | read-only | Computed consumer identifier |
| `resourceId` | string (uuid) | read-only | UUID of the resource consuming the secret |
| `resourceType` | publicCloud.keyManager.ConsumerResourceTypeEnum | read-only | Type of the resource consuming the secret — one of `IMAGE`, `INSTANCE`, `LOADBALANCER` |
| `service` | publicCloud.keyManager.ConsumerServiceEnum | read-only | OpenStack service type of the consumer — one of `COMPUTE`, `IMAGE`, `LOADBALANCER`, `NETWORK` |

```json
[
  {
    "id": "string",
    "resourceId": "00000000-0000-0000-0000-000000000000",
    "resourceType": "IMAGE",
    "service": "COMPUTE"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer");

print_r($result);
?>
```

## Get a secret consumer

`GET /v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer/{consumerId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#getKeyManagerSecretConsumer

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/secret/consumer/get`

Returns one resource registered as using the secret, with its type and service. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `consumerId` | path | string | yes | Consumer ID |
| `projectId` | path | string | yes | Project ID |
| `secretId` | path | string (uuid) | yes | Secret ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.SecretConsumer | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | read-only | Computed consumer identifier |
| `resourceId` | string (uuid) | read-only | UUID of the resource consuming the secret |
| `resourceType` | publicCloud.keyManager.ConsumerResourceTypeEnum | read-only | Type of the resource consuming the secret — one of `IMAGE`, `INSTANCE`, `LOADBALANCER` |
| `service` | publicCloud.keyManager.ConsumerServiceEnum | read-only | OpenStack service type of the consumer — one of `COMPUTE`, `IMAGE`, `LOADBALANCER`, `NETWORK` |

```json
{
  "id": "string",
  "resourceId": "00000000-0000-0000-0000-000000000000",
  "resourceType": "IMAGE",
  "service": "COMPUTE"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer/{consumerId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer/{consumerId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer/{consumerId}");

print_r($result);
?>
```

## Register a secret consumer

`POST /v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#createKeyManagerSecretConsumer

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/secret/consumer/create`

Records that an instance, an image or a load balancer uses the secret. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `secretId` | path | string (uuid) | yes | Secret ID |

### Request body (required)

Type: `publicCloud.keyManager.SecretConsumerInput`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceId` | string (uuid) | yes | UUID of the resource consuming the secret |
| `resourceType` | publicCloud.keyManager.ConsumerResourceTypeEnum | yes | Type of the resource consuming the secret — one of `IMAGE`, `INSTANCE`, `LOADBALANCER` |
| `service` | publicCloud.keyManager.ConsumerServiceEnum | yes | OpenStack service type of the consumer — one of `COMPUTE`, `IMAGE`, `LOADBALANCER`, `NETWORK` |

```json
{
  "resourceId": "00000000-0000-0000-0000-000000000000",
  "resourceType": "IMAGE",
  "service": "COMPUTE"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.SecretConsumer | successful operation |
| 400 | object | Error 400 response |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | read-only | Computed consumer identifier |
| `resourceId` | string (uuid) | read-only | UUID of the resource consuming the secret |
| `resourceType` | publicCloud.keyManager.ConsumerResourceTypeEnum | read-only | Type of the resource consuming the secret — one of `IMAGE`, `INSTANCE`, `LOADBALANCER` |
| `service` | publicCloud.keyManager.ConsumerServiceEnum | read-only | OpenStack service type of the consumer — one of `COMPUTE`, `IMAGE`, `LOADBALANCER`, `NETWORK` |

```json
{
  "id": "string",
  "resourceId": "00000000-0000-0000-0000-000000000000",
  "resourceType": "IMAGE",
  "service": "COMPUTE"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.keyManager.SecretConsumerInput
result = client.post("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer",
	resourceId = None, # UUID of the resource consuming the secret (type: string)
	resourceType = None, # Type of the resource consuming the secret (type: publicCloud.keyManager.ConsumerResourceTypeEnum)
	service = None, # OpenStack service type of the consumer (type: publicCloud.keyManager.ConsumerServiceEnum)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.keyManager.SecretConsumerInput
$result = $ovh->post("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer", array(
	resourceId => null, // UUID of the resource consuming the secret (type: string)
	resourceType => null, // Type of the resource consuming the secret (type: publicCloud.keyManager.ConsumerResourceTypeEnum)
	service => null, // OpenStack service type of the consumer (type: publicCloud.keyManager.ConsumerServiceEnum)
));

print_r($result);
?>
```

## Remove a secret consumer

`DELETE /v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer/{consumerId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#deleteKeyManagerSecretConsumer

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/secret/consumer/delete`

Removes the consumer registration. The resource itself is not deleted. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `consumerId` | path | string | yes | Consumer ID |
| `projectId` | path | string | yes | Project ID |
| `secretId` | path | string (uuid) | yes | Secret ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.SecretConsumer | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | read-only | Computed consumer identifier |
| `resourceId` | string (uuid) | read-only | UUID of the resource consuming the secret |
| `resourceType` | publicCloud.keyManager.ConsumerResourceTypeEnum | read-only | Type of the resource consuming the secret — one of `IMAGE`, `INSTANCE`, `LOADBALANCER` |
| `service` | publicCloud.keyManager.ConsumerServiceEnum | read-only | OpenStack service type of the consumer — one of `COMPUTE`, `IMAGE`, `LOADBALANCER`, `NETWORK` |

```json
{
  "id": "string",
  "resourceId": "00000000-0000-0000-0000-000000000000",
  "resourceType": "IMAGE",
  "service": "COMPUTE"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer/{consumerId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer/{consumerId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/consumer/{consumerId}");

print_r($result);
?>
```

## List secrets

`GET /v2/publicCloud/project/{projectId}/keyManager/secret`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#getKeyManagerSecrets

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/secret/get`

Returns the secrets of the project, without their payload. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.Secret[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the secret |
| `currentState` | publicCloud.keyManager.SecretCurrentState | read-only | Current state of the secret |
| `currentState.algorithm` | publicCloud.keyManager.AlgorithmEnum | read-only | Algorithm associated with the secret — one of `AES`, `DH`, `DSA`, `EC`, `RSA` |
| `currentState.bitLength` | publicCloud.keyManager.BitLengthEnum | read-only | Bit length of the secret — one of `128`, `256`, `512`, `1024`, `2048`, `4096` |
| `currentState.creatorId` | string | read-only | Identifier of the user who created the secret |
| `currentState.expiration` | string (date-time) | read-only | Expiration date and time of the secret |
| `currentState.location` | publicCloud.common.Location | read-only | Current location of the secret |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.metadata` | object | read-only | Key-value metadata pairs for the secret |
| `currentState.mode` | publicCloud.keyManager.ModeEnum | read-only | Mode of the algorithm — one of `CBC`, `CTR` |
| `currentState.name` | string | read-only | Human-readable name of the secret |
| `currentState.payloadContentType` | publicCloud.keyManager.PayloadContentTypeEnum | read-only | Content type of the secret payload — one of `APPLICATION_OCTET_STREAM`, `APPLICATION_PKCS8`, `APPLICATION_PKIX_CERT`, `TEXT_PLAIN` |
| `currentState.secretType` | publicCloud.keyManager.SecretTypeEnum | read-only | Type of the secret — one of `CERTIFICATE`, `OPAQUE`, `PASSPHRASE`, `PRIVATE`, `PUBLIC`, `SYMMETRIC` |
| `currentState.status` | publicCloud.keyManager.SecretStatusEnum | read-only | OpenStack status of the secret — one of `ACTIVE`, `ERROR` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the secret |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the secret |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Secret readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.keyManager.SecretTargetSpec | read-only | Last target specification of the secret |
| `targetSpec.algorithm` | publicCloud.keyManager.AlgorithmEnum |  | Algorithm associated with the secret — one of `AES`, `DH`, `DSA`, `EC`, `RSA` |
| `targetSpec.bitLength` | publicCloud.keyManager.BitLengthEnum |  | Bit length of the secret — one of `128`, `256`, `512`, `1024`, `2048`, `4096` |
| `targetSpec.expiration` | string (date-time) |  | Expiration date and time of the secret |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location for the secret |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.metadata` | object |  | Key-value metadata pairs for the secret |
| `targetSpec.mode` | publicCloud.keyManager.ModeEnum |  | Mode of the algorithm — one of `CBC`, `CTR` |
| `targetSpec.name` | string |  | Human-readable name of the secret |
| `targetSpec.payload` | string (password) |  | Secret payload data (base64-encoded). Write-only, never returned in responses. Requires payloadContentType. |
| `targetSpec.payloadContentType` | publicCloud.keyManager.PayloadContentTypeEnum |  | Content type of the secret payload — one of `APPLICATION_OCTET_STREAM`, `APPLICATION_PKCS8`, `APPLICATION_PKIX_CERT`, `TEXT_PLAIN` |
| `targetSpec.secretType` | publicCloud.keyManager.SecretTypeEnum | yes | Type of the secret — one of `CERTIFICATE`, `OPAQUE`, `PASSPHRASE`, `PRIVATE`, `PUBLIC`, `SYMMETRIC` |
| `updatedAt` | string (date-time) | read-only | Last update date of the secret |

```json
[
  {
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "algorithm": "AES",
      "bitLength": 128,
      "creatorId": "string",
      "expiration": "2024-01-01T12:00:00Z",
      "location": {
        "availabilityZone": "string",
        "region": "string"
      },
      "metadata": {
        "key": "string"
      },
      "mode": "CBC",
      "name": "string",
      "payloadContentType": "APPLICATION_OCTET_STREAM",
      "secretType": "CERTIFICATE",
      "status": "ACTIVE"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "algorithm": "AES",
      "bitLength": 128,
      "expiration": "2024-01-01T12:00:00Z",
      "location": {
        "availabilityZone": "string",
        "region": "string"
      },
      "metadata": {
        "key": "string"
      },
      "mode": "CBC",
      "name": "string",
      "payload": "string",
      "payloadContentType": "APPLICATION_OCTET_STREAM",
      "secretType": "CERTIFICATE"
    },
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/secret" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/keyManager/secret")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/keyManager/secret");

print_r($result);
?>
```

## Get a secret

`GET /v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#getKeyManagerSecret

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/secret/get`

Returns the secret metadata and its current state, without the payload. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `secretId` | path | string (uuid) | yes | Secret ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.Secret | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the secret |
| `currentState` | publicCloud.keyManager.SecretCurrentState | read-only | Current state of the secret |
| `currentState.algorithm` | publicCloud.keyManager.AlgorithmEnum | read-only | Algorithm associated with the secret — one of `AES`, `DH`, `DSA`, `EC`, `RSA` |
| `currentState.bitLength` | publicCloud.keyManager.BitLengthEnum | read-only | Bit length of the secret — one of `128`, `256`, `512`, `1024`, `2048`, `4096` |
| `currentState.creatorId` | string | read-only | Identifier of the user who created the secret |
| `currentState.expiration` | string (date-time) | read-only | Expiration date and time of the secret |
| `currentState.location` | publicCloud.common.Location | read-only | Current location of the secret |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.metadata` | object | read-only | Key-value metadata pairs for the secret |
| `currentState.mode` | publicCloud.keyManager.ModeEnum | read-only | Mode of the algorithm — one of `CBC`, `CTR` |
| `currentState.name` | string | read-only | Human-readable name of the secret |
| `currentState.payloadContentType` | publicCloud.keyManager.PayloadContentTypeEnum | read-only | Content type of the secret payload — one of `APPLICATION_OCTET_STREAM`, `APPLICATION_PKCS8`, `APPLICATION_PKIX_CERT`, `TEXT_PLAIN` |
| `currentState.secretType` | publicCloud.keyManager.SecretTypeEnum | read-only | Type of the secret — one of `CERTIFICATE`, `OPAQUE`, `PASSPHRASE`, `PRIVATE`, `PUBLIC`, `SYMMETRIC` |
| `currentState.status` | publicCloud.keyManager.SecretStatusEnum | read-only | OpenStack status of the secret — one of `ACTIVE`, `ERROR` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the secret |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the secret |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Secret readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.keyManager.SecretTargetSpec | read-only | Last target specification of the secret |
| `targetSpec.algorithm` | publicCloud.keyManager.AlgorithmEnum |  | Algorithm associated with the secret — one of `AES`, `DH`, `DSA`, `EC`, `RSA` |
| `targetSpec.bitLength` | publicCloud.keyManager.BitLengthEnum |  | Bit length of the secret — one of `128`, `256`, `512`, `1024`, `2048`, `4096` |
| `targetSpec.expiration` | string (date-time) |  | Expiration date and time of the secret |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location for the secret |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.metadata` | object |  | Key-value metadata pairs for the secret |
| `targetSpec.mode` | publicCloud.keyManager.ModeEnum |  | Mode of the algorithm — one of `CBC`, `CTR` |
| `targetSpec.name` | string |  | Human-readable name of the secret |
| `targetSpec.payload` | string (password) |  | Secret payload data (base64-encoded). Write-only, never returned in responses. Requires payloadContentType. |
| `targetSpec.payloadContentType` | publicCloud.keyManager.PayloadContentTypeEnum |  | Content type of the secret payload — one of `APPLICATION_OCTET_STREAM`, `APPLICATION_PKCS8`, `APPLICATION_PKIX_CERT`, `TEXT_PLAIN` |
| `targetSpec.secretType` | publicCloud.keyManager.SecretTypeEnum | yes | Type of the secret — one of `CERTIFICATE`, `OPAQUE`, `PASSPHRASE`, `PRIVATE`, `PUBLIC`, `SYMMETRIC` |
| `updatedAt` | string (date-time) | read-only | Last update date of the secret |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "algorithm": "AES",
    "bitLength": 128,
    "creatorId": "string",
    "expiration": "2024-01-01T12:00:00Z",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "metadata": {
      "key": "string"
    },
    "mode": "CBC",
    "name": "string",
    "payloadContentType": "APPLICATION_OCTET_STREAM",
    "secretType": "CERTIFICATE",
    "status": "ACTIVE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "algorithm": "AES",
    "bitLength": 128,
    "expiration": "2024-01-01T12:00:00Z",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "metadata": {
      "key": "string"
    },
    "mode": "CBC",
    "name": "string",
    "payload": "string",
    "payloadContentType": "APPLICATION_OCTET_STREAM",
    "secretType": "CERTIFICATE"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}");

print_r($result);
?>
```

## Create a secret

`POST /v2/publicCloud/project/{projectId}/keyManager/secret`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#createKeyManagerSecret

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/secret/create`

Creates a secret in a region. A payload requires a payload content type, and it is never returned in responses. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.keyManager.SecretCreation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | publicCloud.keyManager.SecretTargetSpec | yes | Desired target specification for the secret to create |
| `targetSpec.algorithm` | publicCloud.keyManager.AlgorithmEnum |  | Algorithm associated with the secret — one of `AES`, `DH`, `DSA`, `EC`, `RSA` |
| `targetSpec.bitLength` | publicCloud.keyManager.BitLengthEnum |  | Bit length of the secret — one of `128`, `256`, `512`, `1024`, `2048`, `4096` |
| `targetSpec.expiration` | string (date-time) |  | Expiration date and time of the secret |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location for the secret |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.metadata` | object |  | Key-value metadata pairs for the secret |
| `targetSpec.mode` | publicCloud.keyManager.ModeEnum |  | Mode of the algorithm — one of `CBC`, `CTR` |
| `targetSpec.name` | string |  | Human-readable name of the secret |
| `targetSpec.payload` | string (password) |  | Secret payload data (base64-encoded). Write-only, never returned in responses. Requires payloadContentType. |
| `targetSpec.payloadContentType` | publicCloud.keyManager.PayloadContentTypeEnum |  | Content type of the secret payload — one of `APPLICATION_OCTET_STREAM`, `APPLICATION_PKCS8`, `APPLICATION_PKIX_CERT`, `TEXT_PLAIN` |
| `targetSpec.secretType` | publicCloud.keyManager.SecretTypeEnum | yes | Type of the secret — one of `CERTIFICATE`, `OPAQUE`, `PASSPHRASE`, `PRIVATE`, `PUBLIC`, `SYMMETRIC` |

```json
{
  "targetSpec": {
    "algorithm": "AES",
    "bitLength": 128,
    "expiration": "2024-01-01T12:00:00Z",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "metadata": {
      "key": "string"
    },
    "mode": "CBC",
    "name": "string",
    "payload": "string",
    "payloadContentType": "APPLICATION_OCTET_STREAM",
    "secretType": "CERTIFICATE"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.Secret | successful operation |
| 400 | object | Error 400 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the secret |
| `currentState` | publicCloud.keyManager.SecretCurrentState | read-only | Current state of the secret |
| `currentState.algorithm` | publicCloud.keyManager.AlgorithmEnum | read-only | Algorithm associated with the secret — one of `AES`, `DH`, `DSA`, `EC`, `RSA` |
| `currentState.bitLength` | publicCloud.keyManager.BitLengthEnum | read-only | Bit length of the secret — one of `128`, `256`, `512`, `1024`, `2048`, `4096` |
| `currentState.creatorId` | string | read-only | Identifier of the user who created the secret |
| `currentState.expiration` | string (date-time) | read-only | Expiration date and time of the secret |
| `currentState.location` | publicCloud.common.Location | read-only | Current location of the secret |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.metadata` | object | read-only | Key-value metadata pairs for the secret |
| `currentState.mode` | publicCloud.keyManager.ModeEnum | read-only | Mode of the algorithm — one of `CBC`, `CTR` |
| `currentState.name` | string | read-only | Human-readable name of the secret |
| `currentState.payloadContentType` | publicCloud.keyManager.PayloadContentTypeEnum | read-only | Content type of the secret payload — one of `APPLICATION_OCTET_STREAM`, `APPLICATION_PKCS8`, `APPLICATION_PKIX_CERT`, `TEXT_PLAIN` |
| `currentState.secretType` | publicCloud.keyManager.SecretTypeEnum | read-only | Type of the secret — one of `CERTIFICATE`, `OPAQUE`, `PASSPHRASE`, `PRIVATE`, `PUBLIC`, `SYMMETRIC` |
| `currentState.status` | publicCloud.keyManager.SecretStatusEnum | read-only | OpenStack status of the secret — one of `ACTIVE`, `ERROR` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the secret |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the secret |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Secret readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.keyManager.SecretTargetSpec | read-only | Last target specification of the secret |
| `targetSpec.algorithm` | publicCloud.keyManager.AlgorithmEnum |  | Algorithm associated with the secret — one of `AES`, `DH`, `DSA`, `EC`, `RSA` |
| `targetSpec.bitLength` | publicCloud.keyManager.BitLengthEnum |  | Bit length of the secret — one of `128`, `256`, `512`, `1024`, `2048`, `4096` |
| `targetSpec.expiration` | string (date-time) |  | Expiration date and time of the secret |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location for the secret |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.metadata` | object |  | Key-value metadata pairs for the secret |
| `targetSpec.mode` | publicCloud.keyManager.ModeEnum |  | Mode of the algorithm — one of `CBC`, `CTR` |
| `targetSpec.name` | string |  | Human-readable name of the secret |
| `targetSpec.payload` | string (password) |  | Secret payload data (base64-encoded). Write-only, never returned in responses. Requires payloadContentType. |
| `targetSpec.payloadContentType` | publicCloud.keyManager.PayloadContentTypeEnum |  | Content type of the secret payload — one of `APPLICATION_OCTET_STREAM`, `APPLICATION_PKCS8`, `APPLICATION_PKIX_CERT`, `TEXT_PLAIN` |
| `targetSpec.secretType` | publicCloud.keyManager.SecretTypeEnum | yes | Type of the secret — one of `CERTIFICATE`, `OPAQUE`, `PASSPHRASE`, `PRIVATE`, `PUBLIC`, `SYMMETRIC` |
| `updatedAt` | string (date-time) | read-only | Last update date of the secret |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "algorithm": "AES",
    "bitLength": 128,
    "creatorId": "string",
    "expiration": "2024-01-01T12:00:00Z",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "metadata": {
      "key": "string"
    },
    "mode": "CBC",
    "name": "string",
    "payloadContentType": "APPLICATION_OCTET_STREAM",
    "secretType": "CERTIFICATE",
    "status": "ACTIVE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "algorithm": "AES",
    "bitLength": 128,
    "expiration": "2024-01-01T12:00:00Z",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "metadata": {
      "key": "string"
    },
    "mode": "CBC",
    "name": "string",
    "payload": "string",
    "payloadContentType": "APPLICATION_OCTET_STREAM",
    "secretType": "CERTIFICATE"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/secret" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.keyManager.SecretCreation
result = client.post("/v2/publicCloud/project/{projectId}/keyManager/secret",
	targetSpec = None, # Desired target specification for the secret to create (type: publicCloud.keyManager.SecretTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.keyManager.SecretCreation
$result = $ovh->post("/v2/publicCloud/project/{projectId}/keyManager/secret", array(
	targetSpec => null, // Desired target specification for the secret to create (type: publicCloud.keyManager.SecretTargetSpec)
));

print_r($result);
?>
```

## Delete a secret

`DELETE /v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#deleteKeyManagerSecret

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/secret/delete`

Deletes the secret and its payload. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `secretId` | path | string (uuid) | yes | Secret ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.Secret | successful operation |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the secret |
| `currentState` | publicCloud.keyManager.SecretCurrentState | read-only | Current state of the secret |
| `currentState.algorithm` | publicCloud.keyManager.AlgorithmEnum | read-only | Algorithm associated with the secret — one of `AES`, `DH`, `DSA`, `EC`, `RSA` |
| `currentState.bitLength` | publicCloud.keyManager.BitLengthEnum | read-only | Bit length of the secret — one of `128`, `256`, `512`, `1024`, `2048`, `4096` |
| `currentState.creatorId` | string | read-only | Identifier of the user who created the secret |
| `currentState.expiration` | string (date-time) | read-only | Expiration date and time of the secret |
| `currentState.location` | publicCloud.common.Location | read-only | Current location of the secret |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.metadata` | object | read-only | Key-value metadata pairs for the secret |
| `currentState.mode` | publicCloud.keyManager.ModeEnum | read-only | Mode of the algorithm — one of `CBC`, `CTR` |
| `currentState.name` | string | read-only | Human-readable name of the secret |
| `currentState.payloadContentType` | publicCloud.keyManager.PayloadContentTypeEnum | read-only | Content type of the secret payload — one of `APPLICATION_OCTET_STREAM`, `APPLICATION_PKCS8`, `APPLICATION_PKIX_CERT`, `TEXT_PLAIN` |
| `currentState.secretType` | publicCloud.keyManager.SecretTypeEnum | read-only | Type of the secret — one of `CERTIFICATE`, `OPAQUE`, `PASSPHRASE`, `PRIVATE`, `PUBLIC`, `SYMMETRIC` |
| `currentState.status` | publicCloud.keyManager.SecretStatusEnum | read-only | OpenStack status of the secret — one of `ACTIVE`, `ERROR` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the secret |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the secret |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Secret readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.keyManager.SecretTargetSpec | read-only | Last target specification of the secret |
| `targetSpec.algorithm` | publicCloud.keyManager.AlgorithmEnum |  | Algorithm associated with the secret — one of `AES`, `DH`, `DSA`, `EC`, `RSA` |
| `targetSpec.bitLength` | publicCloud.keyManager.BitLengthEnum |  | Bit length of the secret — one of `128`, `256`, `512`, `1024`, `2048`, `4096` |
| `targetSpec.expiration` | string (date-time) |  | Expiration date and time of the secret |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location for the secret |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.metadata` | object |  | Key-value metadata pairs for the secret |
| `targetSpec.mode` | publicCloud.keyManager.ModeEnum |  | Mode of the algorithm — one of `CBC`, `CTR` |
| `targetSpec.name` | string |  | Human-readable name of the secret |
| `targetSpec.payload` | string (password) |  | Secret payload data (base64-encoded). Write-only, never returned in responses. Requires payloadContentType. |
| `targetSpec.payloadContentType` | publicCloud.keyManager.PayloadContentTypeEnum |  | Content type of the secret payload — one of `APPLICATION_OCTET_STREAM`, `APPLICATION_PKCS8`, `APPLICATION_PKIX_CERT`, `TEXT_PLAIN` |
| `targetSpec.secretType` | publicCloud.keyManager.SecretTypeEnum | yes | Type of the secret — one of `CERTIFICATE`, `OPAQUE`, `PASSPHRASE`, `PRIVATE`, `PUBLIC`, `SYMMETRIC` |
| `updatedAt` | string (date-time) | read-only | Last update date of the secret |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "algorithm": "AES",
    "bitLength": 128,
    "creatorId": "string",
    "expiration": "2024-01-01T12:00:00Z",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "metadata": {
      "key": "string"
    },
    "mode": "CBC",
    "name": "string",
    "payloadContentType": "APPLICATION_OCTET_STREAM",
    "secretType": "CERTIFICATE",
    "status": "ACTIVE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "algorithm": "AES",
    "bitLength": 128,
    "expiration": "2024-01-01T12:00:00Z",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "metadata": {
      "key": "string"
    },
    "mode": "CBC",
    "name": "string",
    "payload": "string",
    "payloadContentType": "APPLICATION_OCTET_STREAM",
    "secretType": "CERTIFICATE"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}");

print_r($result);
?>
```

## Update secret metadata

`PUT /v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#editKeyManagerSecret

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/secret/edit`

Replaces all metadata of the secret. Only the metadata can be changed after creation. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `secretId` | path | string (uuid) | yes | Secret ID |

### Request body (required)

Type: `publicCloud.keyManager.SecretUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). |
| `targetSpec` | publicCloud.keyManager.SecretUpdateTargetSpec | yes | Desired target specification for the secret |
| `targetSpec.metadata` | object | yes | Metadata key-value pairs for the secret. Replaces all existing metadata. |

```json
{
  "checksum": "string",
  "targetSpec": {
    "metadata": {
      "key": "string"
    }
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.Secret | successful operation |
| 400 | object | Error 400 response |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the secret |
| `currentState` | publicCloud.keyManager.SecretCurrentState | read-only | Current state of the secret |
| `currentState.algorithm` | publicCloud.keyManager.AlgorithmEnum | read-only | Algorithm associated with the secret — one of `AES`, `DH`, `DSA`, `EC`, `RSA` |
| `currentState.bitLength` | publicCloud.keyManager.BitLengthEnum | read-only | Bit length of the secret — one of `128`, `256`, `512`, `1024`, `2048`, `4096` |
| `currentState.creatorId` | string | read-only | Identifier of the user who created the secret |
| `currentState.expiration` | string (date-time) | read-only | Expiration date and time of the secret |
| `currentState.location` | publicCloud.common.Location | read-only | Current location of the secret |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.metadata` | object | read-only | Key-value metadata pairs for the secret |
| `currentState.mode` | publicCloud.keyManager.ModeEnum | read-only | Mode of the algorithm — one of `CBC`, `CTR` |
| `currentState.name` | string | read-only | Human-readable name of the secret |
| `currentState.payloadContentType` | publicCloud.keyManager.PayloadContentTypeEnum | read-only | Content type of the secret payload — one of `APPLICATION_OCTET_STREAM`, `APPLICATION_PKCS8`, `APPLICATION_PKIX_CERT`, `TEXT_PLAIN` |
| `currentState.secretType` | publicCloud.keyManager.SecretTypeEnum | read-only | Type of the secret — one of `CERTIFICATE`, `OPAQUE`, `PASSPHRASE`, `PRIVATE`, `PUBLIC`, `SYMMETRIC` |
| `currentState.status` | publicCloud.keyManager.SecretStatusEnum | read-only | OpenStack status of the secret — one of `ACTIVE`, `ERROR` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the secret |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the secret |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Secret readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.keyManager.SecretTargetSpec | read-only | Last target specification of the secret |
| `targetSpec.algorithm` | publicCloud.keyManager.AlgorithmEnum |  | Algorithm associated with the secret — one of `AES`, `DH`, `DSA`, `EC`, `RSA` |
| `targetSpec.bitLength` | publicCloud.keyManager.BitLengthEnum |  | Bit length of the secret — one of `128`, `256`, `512`, `1024`, `2048`, `4096` |
| `targetSpec.expiration` | string (date-time) |  | Expiration date and time of the secret |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location for the secret |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.metadata` | object |  | Key-value metadata pairs for the secret |
| `targetSpec.mode` | publicCloud.keyManager.ModeEnum |  | Mode of the algorithm — one of `CBC`, `CTR` |
| `targetSpec.name` | string |  | Human-readable name of the secret |
| `targetSpec.payload` | string (password) |  | Secret payload data (base64-encoded). Write-only, never returned in responses. Requires payloadContentType. |
| `targetSpec.payloadContentType` | publicCloud.keyManager.PayloadContentTypeEnum |  | Content type of the secret payload — one of `APPLICATION_OCTET_STREAM`, `APPLICATION_PKCS8`, `APPLICATION_PKIX_CERT`, `TEXT_PLAIN` |
| `targetSpec.secretType` | publicCloud.keyManager.SecretTypeEnum | yes | Type of the secret — one of `CERTIFICATE`, `OPAQUE`, `PASSPHRASE`, `PRIVATE`, `PUBLIC`, `SYMMETRIC` |
| `updatedAt` | string (date-time) | read-only | Last update date of the secret |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "algorithm": "AES",
    "bitLength": 128,
    "creatorId": "string",
    "expiration": "2024-01-01T12:00:00Z",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "metadata": {
      "key": "string"
    },
    "mode": "CBC",
    "name": "string",
    "payloadContentType": "APPLICATION_OCTET_STREAM",
    "secretType": "CERTIFICATE",
    "status": "ACTIVE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "algorithm": "AES",
    "bitLength": 128,
    "expiration": "2024-01-01T12:00:00Z",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "metadata": {
      "key": "string"
    },
    "mode": "CBC",
    "name": "string",
    "payload": "string",
    "payloadContentType": "APPLICATION_OCTET_STREAM",
    "secretType": "CERTIFICATE"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.keyManager.SecretUpdate
result = client.put("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}",
	checksum = None, # Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec = None, # Desired target specification for the secret (type: publicCloud.keyManager.SecretUpdateTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.keyManager.SecretUpdate
$result = $ovh->put("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}", array(
	checksum => null, // Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec => null, // Desired target specification for the secret (type: publicCloud.keyManager.SecretUpdateTargetSpec)
));

print_r($result);
?>
```

## Get a secret payload

`POST /v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/payload`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/barbican/#getKeyManagerSecretPayload

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:keyManager/secret/payload/get`

Returns the payload of the secret. No other call returns it. Relies on the OpenStack Barbican component.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `secretId` | path | string (uuid) | yes | Secret ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.keyManager.SecretPayload | successful operation |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | string (password) | read-only | Secret payload data |

```json
{
  "payload": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/payload" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/payload")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/v2/publicCloud/project/{projectId}/keyManager/secret/{secretId}/payload");

print_r($result);
?>
```
