# Storage & Backup › Backup & Disaster recovery solutions › Backup Agent API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Storage & Backup product's sections: https://developers.eu.ovhcloud.com/reference/storage-backup/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 17 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/storage-backup/backup-disaster-recovery-solutions/backup-agent/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/storage-backup/backup-disaster-recovery-solutions/backup-agent.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/storage-backup/backup-disaster-recovery-solutions/backup-agent.json?format=openapi3

## Operations

- `GET /backupServices/tenant` — Retrieves the backup tenants you manage
- `GET /backupServices/tenant/{backupServicesId}` — Retrieves the details of your backup tenant
- `GET /backupServices/tenant/{backupServicesId}/vault` — Lists vaults for your tenant
- `GET /backupServices/tenant/{backupServicesId}/vault/{vaultId}` — Retrieves specific vault details
- `PUT /backupServices/tenant/{backupServicesId}/vault/{vaultId}` — Updates vault display name and cloud repository
- `GET /backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket` — Lists buckets of the vault
- `GET /backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket/{bucketId}` — Gets specific vault bucket details
- `GET /backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket/{bucketId}/credentials` — Retrieves S3™*-compatible credentials and connection endpoint for a vault bucket
- `GET /backupServices/tenant/{backupServicesId}/vspc` — Retrieves list of VSPC tenants
- `GET /backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}` — Retrieves details of a specific VSPC tenant
- `PUT /backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}` — Updates the display name of a VSPC tenant
- `GET /backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent` — Lists backup agents
- `POST /backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent` — Creates backup agent
- `GET /backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}` — Gets specific backup agent details
- `PUT /backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}` — Updates backup agent
- `DELETE /backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}` — Deletes backup agent
- `GET /backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupPolicies` — Retrieves the list of backup policies available in your VSPC

## Retrieves the backup tenants you manage

`GET /v2/backupServices/tenant`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `iamTags` | query | object |  | Filter resources on IAM tags |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenantWithIAM[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Date and time the backup tenant is created |
| `currentState` | backup.tenant.CurrentState | read-only | Current operational state of the backup tenant |
| `currentState.id` | string (uuid) | read-only | Identifier of the backup tenant |
| `currentState.name` | string | read-only | Name of the backup tenant |
| `currentState.vaults` | string[] | read-only | List of vault resource names associated with the backup tenant |
| `currentState.vspcTenants` | string[] | read-only | List of VSPC tenant resource names associated with the backup tenant |
| `currentTasks` | common.CurrentTask[] | read-only | List of tasks that are currently running for the backup tenant |
| `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 |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `id` | string (uuid) | read-only | Unique identifier of the backup tenant |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness status of the backup tenant — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | backup.tenant.TargetSpec | read-only | Specification of the target state of the backup tenant |
| `targetSpec.name` | string | read-only | The display name of your backup tenant |
| `updatedAt` | string (date-time) | read-only | Date and time the backup tenant is last updated |

```json
[
  {
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "id": "00000000-0000-0000-0000-000000000000",
      "name": "string",
      "vaults": [
        "string"
      ],
      "vspcTenants": [
        "string"
      ]
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "iam": {
      "displayName": "string",
      "id": "00000000-0000-0000-0000-000000000000",
      "state": "EXPIRED",
      "tags": {
        "key": "string"
      },
      "urn": "string"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "name": "string"
    },
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant" \
  -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/backupServices/tenant")

# 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/backupServices/tenant");

print_r($result);
?>
```

## Retrieves the details of your backup tenant

`GET /v2/backupServices/tenant/{backupServicesId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant-backupservicesid

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenantWithIAM | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Date and time the backup tenant is created |
| `currentState` | backup.tenant.CurrentState | read-only | Current operational state of the backup tenant |
| `currentState.id` | string (uuid) | read-only | Identifier of the backup tenant |
| `currentState.name` | string | read-only | Name of the backup tenant |
| `currentState.vaults` | string[] | read-only | List of vault resource names associated with the backup tenant |
| `currentState.vspcTenants` | string[] | read-only | List of VSPC tenant resource names associated with the backup tenant |
| `currentTasks` | common.CurrentTask[] | read-only | List of tasks that are currently running for the backup tenant |
| `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 |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `id` | string (uuid) | read-only | Unique identifier of the backup tenant |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness status of the backup tenant — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | backup.tenant.TargetSpec | read-only | Specification of the target state of the backup tenant |
| `targetSpec.name` | string | read-only | The display name of your backup tenant |
| `updatedAt` | string (date-time) | read-only | Date and time the backup tenant is last updated |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "vaults": [
      "string"
    ],
    "vspcTenants": [
      "string"
    ]
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "name": "string"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}" \
  -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/backupServices/tenant/{backupServicesId}")

# 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/backupServices/tenant/{backupServicesId}");

print_r($result);
?>
```

## Lists vaults for your tenant

`GET /v2/backupServices/tenant/{backupServicesId}/vault`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant-backupservicesid-vault

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vault/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `iamTags` | query | object |  | Filter resources on IAM tags |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenant.vaultWithIAM[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Date and time when you created the vault |
| `currentState` | backup.tenant.vault.CurrentState | read-only | Current state of your vault |
| `currentState.buckets` | backup.tenant.vault.bucket[] | read-only | Provides list of vault buckets |
| `currentState.buckets[].encrypted` | boolean | read-only | Whether the backup data stored in the bucket is encrypted. Always true for Managed Backup buckets. Null when not reported by the platform. |
| `currentState.buckets[].id` | string (uuid) | read-only | Specifies the unique identifier of the bucket |
| `currentState.buckets[].immutability` | backup.tenant.vault.bucket.Immutability | read-only | Immutability settings of the bucket, enabled on the buckets of a PREMIUM Managed Backup vault. Null when not reported by the platform. |
| `currentState.buckets[].name` | string | read-only | Specifies the name of the bucket |
| `currentState.buckets[].performance` | backup.BucketPerformanceEnum | read-only | Specifies the performance tier of the bucket — one of `HIGH_PERF`, `STANDARD` |
| `currentState.buckets[].region` | common.RegionEnum | read-only | Specifies the geographic region where the bucket is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.buckets[].role` | backup.BucketRoleEnum | read-only | Specifies the role assigned to the bucket — one of `PRIMARY`, `REPLICA` |
| `currentState.buckets[].status` | common.ResourceStatusEnum | read-only | Specifies the current status of the bucket — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.id` | string | read-only | Identifies the vault uniquely. A UUID for Backup Agent and Backup Licenses vaults, the vault name for Managed Backup vaults. |
| `currentState.includedSoftQuotaGb` | integer | read-only | Included soft quota in GB for a Backup Licenses BUNDLE vault. Null for PAYGO, BACKUP_AGENT, MANAGED_BACKUP or when not applicable. |
| `currentState.name` | string | read-only | Specifies the vault name |
| `currentState.region` | common.RegionEnum | read-only | Specifies the region where the vault is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.resourceName` | string | read-only | Specifies the vault resource name |
| `currentState.status` | common.ResourceStatusEnum | read-only | Indicates the current status of the vault — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.type` | backup.VaultTypeEnum | read-only | Specifies the vault type — one of `BUNDLE`, `PAYGO` |
| `currentState.vaultProductLine` | backup.VaultProductLineEnum | read-only | Product line that owns the vault. Interpret it together with type to tell the two PAYGO offers apart. Null for vaults created before this field existed. — one of `BACKUP_AGENT`, `BACKUP_LICENSES`, `MANAGED_BACKUP` |
| `currentState.vspcTenants` | string[] | read-only | Lists resource names of VSPC tenants linked to the vault |
| `currentTasks` | common.CurrentTask[] | read-only | List of tasks currently running on your vault |
| `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 |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `id` | string | read-only | Unique identifier of your vault. A UUID for Backup Agent and Backup Licenses vaults, the vault name for Managed Backup vaults. |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Indicates the readiness of your vault — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | backup.tenant.vault.TargetSpec | read-only | Specification of your vault target |
| `targetSpec.name` | string | yes | Display name of your vault |
| `updatedAt` | string (date-time) | read-only | Date and time when you last updated the vault |

```json
[
  {
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "buckets": [
        {
          "encrypted": true,
          "id": "00000000-0000-0000-0000-000000000000",
          "immutability": {
            "enabled": true,
            "retentionDays": 0
          },
          "name": "string",
          "performance": "HIGH_PERF",
          "region": "af-north-lz-rba",
          "role": "PRIMARY",
          "status": "CREATING"
        }
      ],
      "id": "string",
      "includedSoftQuotaGb": 0,
      "name": "string",
      "region": "af-north-lz-rba",
      "resourceName": "string",
      "status": "CREATING",
      "type": "BUNDLE",
      "vaultProductLine": "BACKUP_AGENT",
      "vspcTenants": [
        "string"
      ]
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "iam": {
      "displayName": "string",
      "id": "00000000-0000-0000-0000-000000000000",
      "state": "EXPIRED",
      "tags": {
        "key": "string"
      },
      "urn": "string"
    },
    "id": "string",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "name": "string"
    },
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vault" \
  -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/backupServices/tenant/{backupServicesId}/vault")

# 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/backupServices/tenant/{backupServicesId}/vault");

print_r($result);
?>
```

## Retrieves specific vault details

`GET /v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant-backupservicesid-vault-vaultid

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vault/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `vaultId` | path | string | yes | Vault ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenant.vaultWithIAM | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Date and time when you created the vault |
| `currentState` | backup.tenant.vault.CurrentState | read-only | Current state of your vault |
| `currentState.buckets` | backup.tenant.vault.bucket[] | read-only | Provides list of vault buckets |
| `currentState.buckets[].encrypted` | boolean | read-only | Whether the backup data stored in the bucket is encrypted. Always true for Managed Backup buckets. Null when not reported by the platform. |
| `currentState.buckets[].id` | string (uuid) | read-only | Specifies the unique identifier of the bucket |
| `currentState.buckets[].immutability` | backup.tenant.vault.bucket.Immutability | read-only | Immutability settings of the bucket, enabled on the buckets of a PREMIUM Managed Backup vault. Null when not reported by the platform. |
| `currentState.buckets[].name` | string | read-only | Specifies the name of the bucket |
| `currentState.buckets[].performance` | backup.BucketPerformanceEnum | read-only | Specifies the performance tier of the bucket — one of `HIGH_PERF`, `STANDARD` |
| `currentState.buckets[].region` | common.RegionEnum | read-only | Specifies the geographic region where the bucket is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.buckets[].role` | backup.BucketRoleEnum | read-only | Specifies the role assigned to the bucket — one of `PRIMARY`, `REPLICA` |
| `currentState.buckets[].status` | common.ResourceStatusEnum | read-only | Specifies the current status of the bucket — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.id` | string | read-only | Identifies the vault uniquely. A UUID for Backup Agent and Backup Licenses vaults, the vault name for Managed Backup vaults. |
| `currentState.includedSoftQuotaGb` | integer | read-only | Included soft quota in GB for a Backup Licenses BUNDLE vault. Null for PAYGO, BACKUP_AGENT, MANAGED_BACKUP or when not applicable. |
| `currentState.name` | string | read-only | Specifies the vault name |
| `currentState.region` | common.RegionEnum | read-only | Specifies the region where the vault is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.resourceName` | string | read-only | Specifies the vault resource name |
| `currentState.status` | common.ResourceStatusEnum | read-only | Indicates the current status of the vault — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.type` | backup.VaultTypeEnum | read-only | Specifies the vault type — one of `BUNDLE`, `PAYGO` |
| `currentState.vaultProductLine` | backup.VaultProductLineEnum | read-only | Product line that owns the vault. Interpret it together with type to tell the two PAYGO offers apart. Null for vaults created before this field existed. — one of `BACKUP_AGENT`, `BACKUP_LICENSES`, `MANAGED_BACKUP` |
| `currentState.vspcTenants` | string[] | read-only | Lists resource names of VSPC tenants linked to the vault |
| `currentTasks` | common.CurrentTask[] | read-only | List of tasks currently running on your vault |
| `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 |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `id` | string | read-only | Unique identifier of your vault. A UUID for Backup Agent and Backup Licenses vaults, the vault name for Managed Backup vaults. |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Indicates the readiness of your vault — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | backup.tenant.vault.TargetSpec | read-only | Specification of your vault target |
| `targetSpec.name` | string | yes | Display name of your vault |
| `updatedAt` | string (date-time) | read-only | Date and time when you last updated the vault |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "buckets": [
      {
        "encrypted": true,
        "id": "00000000-0000-0000-0000-000000000000",
        "immutability": {
          "enabled": true,
          "retentionDays": 0
        },
        "name": "string",
        "performance": "HIGH_PERF",
        "region": "af-north-lz-rba",
        "role": "PRIMARY",
        "status": "CREATING"
      }
    ],
    "id": "string",
    "includedSoftQuotaGb": 0,
    "name": "string",
    "region": "af-north-lz-rba",
    "resourceName": "string",
    "status": "CREATING",
    "type": "BUNDLE",
    "vaultProductLine": "BACKUP_AGENT",
    "vspcTenants": [
      "string"
    ]
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "id": "string",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "name": "string"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}" \
  -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/backupServices/tenant/{backupServicesId}/vault/{vaultId}")

# 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/backupServices/tenant/{backupServicesId}/vault/{vaultId}");

print_r($result);
?>
```

## Updates vault display name and cloud repository

`PUT /v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#put-backupservices-tenant-backupservicesid-vault-vaultid

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vault/edit`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `vaultId` | path | string | yes | Vault ID |

### Request body (required)

Type: `backup.tenant.vault.TargetSpec`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes | Display name of your vault |

```json
{
  "name": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenant.vault | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Date and time when you created the vault |
| `currentState` | backup.tenant.vault.CurrentState | read-only | Current state of your vault |
| `currentState.buckets` | backup.tenant.vault.bucket[] | read-only | Provides list of vault buckets |
| `currentState.buckets[].encrypted` | boolean | read-only | Whether the backup data stored in the bucket is encrypted. Always true for Managed Backup buckets. Null when not reported by the platform. |
| `currentState.buckets[].id` | string (uuid) | read-only | Specifies the unique identifier of the bucket |
| `currentState.buckets[].immutability` | backup.tenant.vault.bucket.Immutability | read-only | Immutability settings of the bucket, enabled on the buckets of a PREMIUM Managed Backup vault. Null when not reported by the platform. |
| `currentState.buckets[].name` | string | read-only | Specifies the name of the bucket |
| `currentState.buckets[].performance` | backup.BucketPerformanceEnum | read-only | Specifies the performance tier of the bucket — one of `HIGH_PERF`, `STANDARD` |
| `currentState.buckets[].region` | common.RegionEnum | read-only | Specifies the geographic region where the bucket is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.buckets[].role` | backup.BucketRoleEnum | read-only | Specifies the role assigned to the bucket — one of `PRIMARY`, `REPLICA` |
| `currentState.buckets[].status` | common.ResourceStatusEnum | read-only | Specifies the current status of the bucket — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.id` | string | read-only | Identifies the vault uniquely. A UUID for Backup Agent and Backup Licenses vaults, the vault name for Managed Backup vaults. |
| `currentState.includedSoftQuotaGb` | integer | read-only | Included soft quota in GB for a Backup Licenses BUNDLE vault. Null for PAYGO, BACKUP_AGENT, MANAGED_BACKUP or when not applicable. |
| `currentState.name` | string | read-only | Specifies the vault name |
| `currentState.region` | common.RegionEnum | read-only | Specifies the region where the vault is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.resourceName` | string | read-only | Specifies the vault resource name |
| `currentState.status` | common.ResourceStatusEnum | read-only | Indicates the current status of the vault — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.type` | backup.VaultTypeEnum | read-only | Specifies the vault type — one of `BUNDLE`, `PAYGO` |
| `currentState.vaultProductLine` | backup.VaultProductLineEnum | read-only | Product line that owns the vault. Interpret it together with type to tell the two PAYGO offers apart. Null for vaults created before this field existed. — one of `BACKUP_AGENT`, `BACKUP_LICENSES`, `MANAGED_BACKUP` |
| `currentState.vspcTenants` | string[] | read-only | Lists resource names of VSPC tenants linked to the vault |
| `currentTasks` | common.CurrentTask[] | read-only | List of tasks currently running on your vault |
| `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 | read-only | Unique identifier of your vault. A UUID for Backup Agent and Backup Licenses vaults, the vault name for Managed Backup vaults. |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Indicates the readiness of your vault — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | backup.tenant.vault.TargetSpec | read-only | Specification of your vault target |
| `targetSpec.name` | string | yes | Display name of your vault |
| `updatedAt` | string (date-time) | read-only | Date and time when you last updated the vault |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "buckets": [
      {
        "encrypted": true,
        "id": "00000000-0000-0000-0000-000000000000",
        "immutability": {
          "enabled": true,
          "retentionDays": 0
        },
        "name": "string",
        "performance": "HIGH_PERF",
        "region": "af-north-lz-rba",
        "role": "PRIMARY",
        "status": "CREATING"
      }
    ],
    "id": "string",
    "includedSoftQuotaGb": 0,
    "name": "string",
    "region": "af-north-lz-rba",
    "resourceName": "string",
    "status": "CREATING",
    "type": "BUNDLE",
    "vaultProductLine": "BACKUP_AGENT",
    "vspcTenants": [
      "string"
    ]
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "string",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "name": "string"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}" \
  -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: backup.tenant.vault.TargetSpec
result = client.put("/v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}",
	name = None, # Display name of your vault (type: string)
)

# 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: backup.tenant.vault.TargetSpec
$result = $ovh->put("/v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}", array(
	name => null, // Display name of your vault (type: string)
));

print_r($result);
?>
```

## Lists buckets of the vault

`GET /v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant-backupservicesid-vault-vaultid-bucket

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vault/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `vaultId` | path | string | yes | Vault ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenant.vault.bucket[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `encrypted` | boolean | read-only | Whether the backup data stored in the bucket is encrypted. Always true for Managed Backup buckets. Null when not reported by the platform. |
| `id` | string (uuid) | read-only | Specifies the unique identifier of the bucket |
| `immutability` | backup.tenant.vault.bucket.Immutability | read-only | Immutability settings of the bucket, enabled on the buckets of a PREMIUM Managed Backup vault. Null when not reported by the platform. |
| `immutability.enabled` | boolean | read-only | Whether restore points stored in the bucket are immutable |
| `immutability.retentionDays` | integer | read-only | Number of days during which a restore point can neither be modified nor deleted. Null when immutability is disabled. |
| `name` | string | read-only | Specifies the name of the bucket |
| `performance` | backup.BucketPerformanceEnum | read-only | Specifies the performance tier of the bucket — one of `HIGH_PERF`, `STANDARD` |
| `region` | common.RegionEnum | read-only | Specifies the geographic region where the bucket is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `role` | backup.BucketRoleEnum | read-only | Specifies the role assigned to the bucket — one of `PRIMARY`, `REPLICA` |
| `status` | common.ResourceStatusEnum | read-only | Specifies the current status of the bucket — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |

```json
[
  {
    "encrypted": true,
    "id": "00000000-0000-0000-0000-000000000000",
    "immutability": {
      "enabled": true,
      "retentionDays": 0
    },
    "name": "string",
    "performance": "HIGH_PERF",
    "region": "af-north-lz-rba",
    "role": "PRIMARY",
    "status": "CREATING"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket" \
  -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/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket")

# 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/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket");

print_r($result);
?>
```

## Gets specific vault bucket details

`GET /v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket/{bucketId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant-backupservicesid-vault-vaultid-bucket-bucketid

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vault/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `bucketId` | path | string (uuid) | yes | Bucket ID |
| `vaultId` | path | string | yes | Vault ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenant.vault.bucket | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `encrypted` | boolean | read-only | Whether the backup data stored in the bucket is encrypted. Always true for Managed Backup buckets. Null when not reported by the platform. |
| `id` | string (uuid) | read-only | Specifies the unique identifier of the bucket |
| `immutability` | backup.tenant.vault.bucket.Immutability | read-only | Immutability settings of the bucket, enabled on the buckets of a PREMIUM Managed Backup vault. Null when not reported by the platform. |
| `immutability.enabled` | boolean | read-only | Whether restore points stored in the bucket are immutable |
| `immutability.retentionDays` | integer | read-only | Number of days during which a restore point can neither be modified nor deleted. Null when immutability is disabled. |
| `name` | string | read-only | Specifies the name of the bucket |
| `performance` | backup.BucketPerformanceEnum | read-only | Specifies the performance tier of the bucket — one of `HIGH_PERF`, `STANDARD` |
| `region` | common.RegionEnum | read-only | Specifies the geographic region where the bucket is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `role` | backup.BucketRoleEnum | read-only | Specifies the role assigned to the bucket — one of `PRIMARY`, `REPLICA` |
| `status` | common.ResourceStatusEnum | read-only | Specifies the current status of the bucket — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |

```json
{
  "encrypted": true,
  "id": "00000000-0000-0000-0000-000000000000",
  "immutability": {
    "enabled": true,
    "retentionDays": 0
  },
  "name": "string",
  "performance": "HIGH_PERF",
  "region": "af-north-lz-rba",
  "role": "PRIMARY",
  "status": "CREATING"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket/{bucketId}" \
  -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/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket/{bucketId}")

# 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/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket/{bucketId}");

print_r($result);
?>
```

## Retrieves S3™*-compatible credentials and connection endpoint for a vault bucket

`GET /v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket/{bucketId}/credentials`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant-backupservicesid-vault-vaultid-bucket-bucketid-credentials

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vault/credentials/get`

<sup>*</sup> S3 is a trademark filed by Amazon Technologies,Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies,Inc.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `bucketId` | path | string (uuid) | yes | Bucket ID |
| `vaultId` | path | string | yes | Vault ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenant.vault.bucket.Credentials | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accessKey` | string | read-only | S3 access key |
| `bucketName` | string | read-only | Name of the bucket these credentials belong to |
| `endpoint` | string | read-only | S3 endpoint URL to configure in your environment |
| `regionCode` | backup.RegionCodeEnum | read-only | Short region code of the bucket — one of `ap-south-mum`, `ap-southeast-syd`, `bhs`, `ca-east-tor`, `de`, `eu-south-mil`, `eu-west-par`, `gra`, `rbx`, `sbg`, `sgp`, `uk`, … |
| `secretKey` | string (password) | read-only | S3 secret key, sensitive value |

```json
{
  "accessKey": "string",
  "bucketName": "string",
  "endpoint": "string",
  "regionCode": "ap-south-mum",
  "secretKey": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket/{bucketId}/credentials" \
  -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/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket/{bucketId}/credentials")

# 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/backupServices/tenant/{backupServicesId}/vault/{vaultId}/bucket/{bucketId}/credentials");

print_r($result);
?>
```

## Retrieves list of VSPC tenants

`GET /v2/backupServices/tenant/{backupServicesId}/vspc`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant-backupservicesid-vspc

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vspc/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `iamTags` | query | object |  | Filter resources on IAM tags |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenant.vspcWithIAM[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Date and time when the tenant is created |
| `currentState` | backup.tenant.vspc.CurrentState | read-only | Current state of the tenant |
| `currentState.accessUrl` | string | read-only | URL you use to access the tenant |
| `currentState.backupAgents` | backup.tenant.vspc.backupAgent.CurrentState[] | read-only | Backup agents associated with the tenant |
| `currentState.backupAgents[].id` | string (uuid) | read-only | Unique identifier of the backup agent |
| `currentState.backupAgents[].ips` | ipBlock[] | read-only | List of IP addresses assigned to the backup agent |
| `currentState.backupAgents[].name` | string | read-only | Name of the backup agent |
| `currentState.backupAgents[].policy` | string | read-only | VSPC backup policy configured for the agent |
| `currentState.backupAgents[].productResourceName` | string | read-only | Resource name of the product backed up by the agent |
| `currentState.backupAgents[].type` | backup.AgentProductTypeEnum | read-only | Type of the product managed by the agent — one of `ON_PREMISE`, `OVHCLOUD_BAREMETAL`, `OVHCLOUD_PUBLIC_CLOUD`, `OVHCLOUD_VPS` |
| `currentState.backupAgents[].vaultId` | string (uuid) | read-only | Unique identifier of the vault storing the backup agent data |
| `currentState.backupLicensesId` | string | read-only | Backup Licenses subscription identifier of the tenant. Null when the Backup Licenses add-on is not enabled. |
| `currentState.companyName` | string | read-only | Name of your tenant company in VSPC |
| `currentState.enabledAddons` | backup.AddonEnum[] | read-only | Add-ons active on this tenant |
| `currentState.id` | string (uuid) | read-only | Unique identifier of the tenant |
| `currentState.managedBackupIds` | string[] | read-only | Managed Backup service identifiers of the tenant, one per protected Hosted Private Cloud, each formatted managed-backup- followed by the Hosted Private Cloud service name. Null when the Managed Backup add-on is not enabled. |
| `currentState.name` | string | read-only | Display name of the tenant |
| `currentState.region` | common.RegionEnum | read-only | Region where the tenant is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.status` | common.ResourceStatusEnum | read-only | Current status of the tenant — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.vaults` | backup.tenant.vspc.vault[] | read-only | Vaults linked to the tenant |
| `currentState.vaults[].allowedIps` | ipBlock[] | read-only | Provides list of allowed IPs at the vault level |
| `currentState.vaults[].id` | string (uuid) | read-only | Unique identifier of the vault |
| `currentState.vaults[].name` | string | read-only | Name of the vault |
| `currentState.vaults[].performance` | backup.BucketPerformanceEnum | read-only | Performance tier of the vault — one of `HIGH_PERF`, `STANDARD` |
| `currentState.vaults[].region` | common.RegionEnum | read-only | Geographic region where the vault is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.vaults[].resourceName` | string | read-only | Resource name of the vault as used in the system |
| `currentState.vaults[].status` | common.ResourceStatusEnum | read-only | Current status of the vault — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.vaults[].type` | backup.VaultTypeEnum | read-only | Kind of vault — one of `BUNDLE`, `PAYGO` |
| `currentState.vspcType` | backup.VspcTypeEnum | read-only | VSPC infrastructure type backing this tenant. BASIC carries backup agents, ADVANCED carries Backup Licenses and Managed Backup. — one of `ADVANCED`, `BASIC` |
| `currentTasks` | common.CurrentTask[] | read-only | List of tasks currently running for the tenant |
| `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 |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `id` | string (uuid) | read-only | Unique identifier of the tenant |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Indicates whether the vault is ready — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | backup.tenant.vspc.TargetSpec | read-only | Specification of the target for the tenant |
| `targetSpec.name` | string | yes | Display name of the tenant |
| `updatedAt` | string (date-time) | read-only | Date and time when the tenant is last updated |

```json
[
  {
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "accessUrl": "string",
      "backupAgents": [
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "ips": [
            "192.0.2.0/24"
          ],
          "name": "string",
          "policy": "string",
          "productResourceName": "string",
          "type": "ON_PREMISE",
          "vaultId": "00000000-0000-0000-0000-000000000000"
        }
      ],
      "backupLicensesId": "string",
      "companyName": "string",
      "enabledAddons": [
        "BACKUP_AGENT"
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "managedBackupIds": [
        "string"
      ],
      "name": "string",
      "region": "af-north-lz-rba",
      "status": "CREATING",
      "vaults": [
        {
          "allowedIps": [
            "192.0.2.0/24"
          ],
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "string",
          "performance": "HIGH_PERF",
          "region": "af-north-lz-rba",
          "resourceName": "string",
          "status": "CREATING",
          "type": "BUNDLE"
        }
      ],
      "vspcType": "ADVANCED"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "iam": {
      "displayName": "string",
      "id": "00000000-0000-0000-0000-000000000000",
      "state": "EXPIRED",
      "tags": {
  …
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vspc" \
  -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/backupServices/tenant/{backupServicesId}/vspc")

# 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/backupServices/tenant/{backupServicesId}/vspc");

print_r($result);
?>
```

## Retrieves details of a specific VSPC tenant

`GET /v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant-backupservicesid-vspc-vspctenantid

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vspc/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `vspcTenantId` | path | string (uuid) | yes | Vspc tenant ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenant.vspcWithIAM | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Date and time when the tenant is created |
| `currentState` | backup.tenant.vspc.CurrentState | read-only | Current state of the tenant |
| `currentState.accessUrl` | string | read-only | URL you use to access the tenant |
| `currentState.backupAgents` | backup.tenant.vspc.backupAgent.CurrentState[] | read-only | Backup agents associated with the tenant |
| `currentState.backupAgents[].id` | string (uuid) | read-only | Unique identifier of the backup agent |
| `currentState.backupAgents[].ips` | ipBlock[] | read-only | List of IP addresses assigned to the backup agent |
| `currentState.backupAgents[].name` | string | read-only | Name of the backup agent |
| `currentState.backupAgents[].policy` | string | read-only | VSPC backup policy configured for the agent |
| `currentState.backupAgents[].productResourceName` | string | read-only | Resource name of the product backed up by the agent |
| `currentState.backupAgents[].type` | backup.AgentProductTypeEnum | read-only | Type of the product managed by the agent — one of `ON_PREMISE`, `OVHCLOUD_BAREMETAL`, `OVHCLOUD_PUBLIC_CLOUD`, `OVHCLOUD_VPS` |
| `currentState.backupAgents[].vaultId` | string (uuid) | read-only | Unique identifier of the vault storing the backup agent data |
| `currentState.backupLicensesId` | string | read-only | Backup Licenses subscription identifier of the tenant. Null when the Backup Licenses add-on is not enabled. |
| `currentState.companyName` | string | read-only | Name of your tenant company in VSPC |
| `currentState.enabledAddons` | backup.AddonEnum[] | read-only | Add-ons active on this tenant |
| `currentState.id` | string (uuid) | read-only | Unique identifier of the tenant |
| `currentState.managedBackupIds` | string[] | read-only | Managed Backup service identifiers of the tenant, one per protected Hosted Private Cloud, each formatted managed-backup- followed by the Hosted Private Cloud service name. Null when the Managed Backup add-on is not enabled. |
| `currentState.name` | string | read-only | Display name of the tenant |
| `currentState.region` | common.RegionEnum | read-only | Region where the tenant is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.status` | common.ResourceStatusEnum | read-only | Current status of the tenant — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.vaults` | backup.tenant.vspc.vault[] | read-only | Vaults linked to the tenant |
| `currentState.vaults[].allowedIps` | ipBlock[] | read-only | Provides list of allowed IPs at the vault level |
| `currentState.vaults[].id` | string (uuid) | read-only | Unique identifier of the vault |
| `currentState.vaults[].name` | string | read-only | Name of the vault |
| `currentState.vaults[].performance` | backup.BucketPerformanceEnum | read-only | Performance tier of the vault — one of `HIGH_PERF`, `STANDARD` |
| `currentState.vaults[].region` | common.RegionEnum | read-only | Geographic region where the vault is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.vaults[].resourceName` | string | read-only | Resource name of the vault as used in the system |
| `currentState.vaults[].status` | common.ResourceStatusEnum | read-only | Current status of the vault — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.vaults[].type` | backup.VaultTypeEnum | read-only | Kind of vault — one of `BUNDLE`, `PAYGO` |
| `currentState.vspcType` | backup.VspcTypeEnum | read-only | VSPC infrastructure type backing this tenant. BASIC carries backup agents, ADVANCED carries Backup Licenses and Managed Backup. — one of `ADVANCED`, `BASIC` |
| `currentTasks` | common.CurrentTask[] | read-only | List of tasks currently running for the tenant |
| `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 |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `id` | string (uuid) | read-only | Unique identifier of the tenant |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Indicates whether the vault is ready — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | backup.tenant.vspc.TargetSpec | read-only | Specification of the target for the tenant |
| `targetSpec.name` | string | yes | Display name of the tenant |
| `updatedAt` | string (date-time) | read-only | Date and time when the tenant is last updated |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "accessUrl": "string",
    "backupAgents": [
      {
        "id": "00000000-0000-0000-0000-000000000000",
        "ips": [
          "192.0.2.0/24"
        ],
        "name": "string",
        "policy": "string",
        "productResourceName": "string",
        "type": "ON_PREMISE",
        "vaultId": "00000000-0000-0000-0000-000000000000"
      }
    ],
    "backupLicensesId": "string",
    "companyName": "string",
    "enabledAddons": [
      "BACKUP_AGENT"
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "managedBackupIds": [
      "string"
    ],
    "name": "string",
    "region": "af-north-lz-rba",
    "status": "CREATING",
    "vaults": [
      {
        "allowedIps": [
          "192.0.2.0/24"
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "name": "string",
        "performance": "HIGH_PERF",
        "region": "af-north-lz-rba",
        "resourceName": "string",
        "status": "CREATING",
        "type": "BUNDLE"
      }
    ],
    "vspcType": "ADVANCED"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  …
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}" \
  -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/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}")

# 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/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}");

print_r($result);
?>
```

## Updates the display name of a VSPC tenant

`PUT /v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#put-backupservices-tenant-backupservicesid-vspc-vspctenantid

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vspc/edit`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `vspcTenantId` | path | string (uuid) | yes | Vspc tenant ID |

### Request body (required)

Type: `backup.tenant.vspc.TargetSpec`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes | Display name of the tenant |

```json
{
  "name": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenant.vspc | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Date and time when the tenant is created |
| `currentState` | backup.tenant.vspc.CurrentState | read-only | Current state of the tenant |
| `currentState.accessUrl` | string | read-only | URL you use to access the tenant |
| `currentState.backupAgents` | backup.tenant.vspc.backupAgent.CurrentState[] | read-only | Backup agents associated with the tenant |
| `currentState.backupAgents[].id` | string (uuid) | read-only | Unique identifier of the backup agent |
| `currentState.backupAgents[].ips` | ipBlock[] | read-only | List of IP addresses assigned to the backup agent |
| `currentState.backupAgents[].name` | string | read-only | Name of the backup agent |
| `currentState.backupAgents[].policy` | string | read-only | VSPC backup policy configured for the agent |
| `currentState.backupAgents[].productResourceName` | string | read-only | Resource name of the product backed up by the agent |
| `currentState.backupAgents[].type` | backup.AgentProductTypeEnum | read-only | Type of the product managed by the agent — one of `ON_PREMISE`, `OVHCLOUD_BAREMETAL`, `OVHCLOUD_PUBLIC_CLOUD`, `OVHCLOUD_VPS` |
| `currentState.backupAgents[].vaultId` | string (uuid) | read-only | Unique identifier of the vault storing the backup agent data |
| `currentState.backupLicensesId` | string | read-only | Backup Licenses subscription identifier of the tenant. Null when the Backup Licenses add-on is not enabled. |
| `currentState.companyName` | string | read-only | Name of your tenant company in VSPC |
| `currentState.enabledAddons` | backup.AddonEnum[] | read-only | Add-ons active on this tenant |
| `currentState.id` | string (uuid) | read-only | Unique identifier of the tenant |
| `currentState.managedBackupIds` | string[] | read-only | Managed Backup service identifiers of the tenant, one per protected Hosted Private Cloud, each formatted managed-backup- followed by the Hosted Private Cloud service name. Null when the Managed Backup add-on is not enabled. |
| `currentState.name` | string | read-only | Display name of the tenant |
| `currentState.region` | common.RegionEnum | read-only | Region where the tenant is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.status` | common.ResourceStatusEnum | read-only | Current status of the tenant — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.vaults` | backup.tenant.vspc.vault[] | read-only | Vaults linked to the tenant |
| `currentState.vaults[].allowedIps` | ipBlock[] | read-only | Provides list of allowed IPs at the vault level |
| `currentState.vaults[].id` | string (uuid) | read-only | Unique identifier of the vault |
| `currentState.vaults[].name` | string | read-only | Name of the vault |
| `currentState.vaults[].performance` | backup.BucketPerformanceEnum | read-only | Performance tier of the vault — one of `HIGH_PERF`, `STANDARD` |
| `currentState.vaults[].region` | common.RegionEnum | read-only | Geographic region where the vault is located — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `currentState.vaults[].resourceName` | string | read-only | Resource name of the vault as used in the system |
| `currentState.vaults[].status` | common.ResourceStatusEnum | read-only | Current status of the vault — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.vaults[].type` | backup.VaultTypeEnum | read-only | Kind of vault — one of `BUNDLE`, `PAYGO` |
| `currentState.vspcType` | backup.VspcTypeEnum | read-only | VSPC infrastructure type backing this tenant. BASIC carries backup agents, ADVANCED carries Backup Licenses and Managed Backup. — one of `ADVANCED`, `BASIC` |
| `currentTasks` | common.CurrentTask[] | read-only | List of tasks currently running for the tenant |
| `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 tenant |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Indicates whether the vault is ready — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | backup.tenant.vspc.TargetSpec | read-only | Specification of the target for the tenant |
| `targetSpec.name` | string | yes | Display name of the tenant |
| `updatedAt` | string (date-time) | read-only | Date and time when the tenant is last updated |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "accessUrl": "string",
    "backupAgents": [
      {
        "id": "00000000-0000-0000-0000-000000000000",
        "ips": [
          "192.0.2.0/24"
        ],
        "name": "string",
        "policy": "string",
        "productResourceName": "string",
        "type": "ON_PREMISE",
        "vaultId": "00000000-0000-0000-0000-000000000000"
      }
    ],
    "backupLicensesId": "string",
    "companyName": "string",
    "enabledAddons": [
      "BACKUP_AGENT"
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "managedBackupIds": [
      "string"
    ],
    "name": "string",
    "region": "af-north-lz-rba",
    "status": "CREATING",
    "vaults": [
      {
        "allowedIps": [
          "192.0.2.0/24"
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "name": "string",
        "performance": "HIGH_PERF",
        "region": "af-north-lz-rba",
        "resourceName": "string",
        "status": "CREATING",
        "type": "BUNDLE"
      }
    ],
    "vspcType": "ADVANCED"
  },
  "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": {
    "name": "string"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}" \
  -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: backup.tenant.vspc.TargetSpec
result = client.put("/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}",
	name = None, # Display name of the tenant (type: string)
)

# 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: backup.tenant.vspc.TargetSpec
$result = $ovh->put("/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}", array(
	name => null, // Display name of the tenant (type: string)
));

print_r($result);
?>
```

## Lists backup agents

`GET /v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant-backupservicesid-vspc-vspctenantid-backupagent

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vspc/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `vspcTenantId` | path | string (uuid) | yes | Vspc tenant ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenant.vspc.backupAgent[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Date and time when you create the backup agent |
| `currentState` | backup.tenant.vspc.backupAgent.CurrentState | read-only | Current state of the backup agent |
| `currentState.id` | string (uuid) | read-only | Unique identifier of the backup agent |
| `currentState.ips` | ipBlock[] | read-only | List of IP addresses assigned to the backup agent |
| `currentState.name` | string | read-only | Name of the backup agent |
| `currentState.policy` | string | read-only | VSPC backup policy configured for the agent |
| `currentState.productResourceName` | string | read-only | Resource name of the product backed up by the agent |
| `currentState.type` | backup.AgentProductTypeEnum | read-only | Type of the product managed by the agent — one of `ON_PREMISE`, `OVHCLOUD_BAREMETAL`, `OVHCLOUD_PUBLIC_CLOUD`, `OVHCLOUD_VPS` |
| `currentState.vaultId` | string (uuid) | read-only | Unique identifier of the vault storing the backup agent data |
| `currentTasks` | common.CurrentTask[] | read-only | Current tasks that the backup agent performs |
| `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 backup agent |
| `status` | backup.AgentStatusEnum | read-only | Shows whether the backup agent is ready — one of `CREATING`, `DISABLED`, `ENABLED`, `NOT_CONFIGURED`, `NOT_INSTALLED`, `UPDATING` |
| `targetSpec` | backup.tenant.vspc.backupAgent.TargetSpec | read-only | Target specification for the backup agent |
| `targetSpec.displayName` | string |  | Human readable name of the backup agent |
| `targetSpec.ips` | ipBlock[] |  | IP addresses assigned to the backup agent |
| `targetSpec.policy` | string |  | Name of the backup policy applied to the agent |
| `updatedAt` | string (date-time) | read-only | Date and time when you update the backup agent |

```json
[
  {
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "id": "00000000-0000-0000-0000-000000000000",
      "ips": [
        "192.0.2.0/24"
      ],
      "name": "string",
      "policy": "string",
      "productResourceName": "string",
      "type": "ON_PREMISE",
      "vaultId": "00000000-0000-0000-0000-000000000000"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "status": "CREATING",
    "targetSpec": {
      "displayName": "string",
      "ips": [
        "192.0.2.0/24"
      ],
      "policy": "string"
    },
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent" \
  -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/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent")

# 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/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent");

print_r($result);
?>
```

## Creates backup agent

`POST /v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#post-backupservices-tenant-backupservicesid-vspc-vspctenantid-backupagent

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vspc/edit`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `vspcTenantId` | path | string (uuid) | yes | Vspc tenant ID |

### Request body (required)

Type: `backup.tenant.vspc.backupAgent.CreateSpec`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `displayName` | string |  | Specifies the name of the backup agent |
| `ips` | ipBlock[] |  | Specifies the IP addresses assigned to the backup agent |
| `productResourceName` | string |  | Specifies the product resource name that the agent backs up |
| `region` | common.RegionEnum |  | Specifies the geographic region where the backup agent operates — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |

```json
{
  "displayName": "string",
  "ips": [
    "192.0.2.0/24"
  ],
  "productResourceName": "string",
  "region": "af-north-lz-rba"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent" \
  -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: backup.tenant.vspc.backupAgent.CreateSpec
result = client.post("/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent",
	displayName = None, # Specifies the name of the backup agent (type: string)
	ips = None, # Specifies the IP addresses assigned to the backup agent (type: array)
	productResourceName = None, # Specifies the product resource name that the agent backs up (type: string)
	region = None, # Specifies the geographic region where the backup agent operates (type: common.RegionEnum)
)

# 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: backup.tenant.vspc.backupAgent.CreateSpec
$result = $ovh->post("/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent", array(
	displayName => null, // Specifies the name of the backup agent (type: string)
	ips => null, // Specifies the IP addresses assigned to the backup agent (type: array)
	productResourceName => null, // Specifies the product resource name that the agent backs up (type: string)
	region => null, // Specifies the geographic region where the backup agent operates (type: common.RegionEnum)
));

print_r($result);
?>
```

## Gets specific backup agent details

`GET /v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant-backupservicesid-vspc-vspctenantid-backupagent-backupagentid

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vspc/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupAgentId` | path | string (uuid) | yes | Backup agent ID |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `vspcTenantId` | path | string (uuid) | yes | Vspc tenant ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | backup.tenant.vspc.backupAgent | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Date and time when you create the backup agent |
| `currentState` | backup.tenant.vspc.backupAgent.CurrentState | read-only | Current state of the backup agent |
| `currentState.id` | string (uuid) | read-only | Unique identifier of the backup agent |
| `currentState.ips` | ipBlock[] | read-only | List of IP addresses assigned to the backup agent |
| `currentState.name` | string | read-only | Name of the backup agent |
| `currentState.policy` | string | read-only | VSPC backup policy configured for the agent |
| `currentState.productResourceName` | string | read-only | Resource name of the product backed up by the agent |
| `currentState.type` | backup.AgentProductTypeEnum | read-only | Type of the product managed by the agent — one of `ON_PREMISE`, `OVHCLOUD_BAREMETAL`, `OVHCLOUD_PUBLIC_CLOUD`, `OVHCLOUD_VPS` |
| `currentState.vaultId` | string (uuid) | read-only | Unique identifier of the vault storing the backup agent data |
| `currentTasks` | common.CurrentTask[] | read-only | Current tasks that the backup agent performs |
| `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 backup agent |
| `status` | backup.AgentStatusEnum | read-only | Shows whether the backup agent is ready — one of `CREATING`, `DISABLED`, `ENABLED`, `NOT_CONFIGURED`, `NOT_INSTALLED`, `UPDATING` |
| `targetSpec` | backup.tenant.vspc.backupAgent.TargetSpec | read-only | Target specification for the backup agent |
| `targetSpec.displayName` | string |  | Human readable name of the backup agent |
| `targetSpec.ips` | ipBlock[] |  | IP addresses assigned to the backup agent |
| `targetSpec.policy` | string |  | Name of the backup policy applied to the agent |
| `updatedAt` | string (date-time) | read-only | Date and time when you update the backup agent |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "id": "00000000-0000-0000-0000-000000000000",
    "ips": [
      "192.0.2.0/24"
    ],
    "name": "string",
    "policy": "string",
    "productResourceName": "string",
    "type": "ON_PREMISE",
    "vaultId": "00000000-0000-0000-0000-000000000000"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "status": "CREATING",
  "targetSpec": {
    "displayName": "string",
    "ips": [
      "192.0.2.0/24"
    ],
    "policy": "string"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}" \
  -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/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}")

# 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/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}");

print_r($result);
?>
```

## Updates backup agent

`PUT /v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#put-backupservices-tenant-backupservicesid-vspc-vspctenantid-backupagent-backupagentid

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vspc/edit`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupAgentId` | path | string (uuid) | yes | Backup agent ID |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `vspcTenantId` | path | string (uuid) | yes | Vspc tenant ID |

### Request body (required)

Type: `backup.tenant.vspc.backupAgent.TargetSpec`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `displayName` | string |  | Human readable name of the backup agent |
| `ips` | ipBlock[] |  | IP addresses assigned to the backup agent |
| `policy` | string |  | Name of the backup policy applied to the agent |

```json
{
  "displayName": "string",
  "ips": [
    "192.0.2.0/24"
  ],
  "policy": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}" \
  -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: backup.tenant.vspc.backupAgent.TargetSpec
result = client.put("/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}",
	displayName = None, # Human readable name of the backup agent (type: string)
	ips = None, # IP addresses assigned to the backup agent (type: array)
	policy = None, # Name of the backup policy applied to the agent (type: string)
)

# 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: backup.tenant.vspc.backupAgent.TargetSpec
$result = $ovh->put("/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}", array(
	displayName => null, // Human readable name of the backup agent (type: string)
	ips => null, // IP addresses assigned to the backup agent (type: array)
	policy => null, // Name of the backup policy applied to the agent (type: string)
));

print_r($result);
?>
```

## Deletes backup agent

`DELETE /v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#delete-backupservices-tenant-backupservicesid-vspc-vspctenantid-backupagent-backupagentid

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vspc/edit`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupAgentId` | path | string (uuid) | yes | Backup agent ID |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `vspcTenantId` | path | string (uuid) | yes | Vspc tenant ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}" \
  -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/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}")

# 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/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupAgent/{backupAgentId}");

print_r($result);
?>
```

## Retrieves the list of backup policies available in your VSPC

`GET /v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupPolicies`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/backup-disaster-recovery-solutions/backup-agent/#get-backupservices-tenant-backupservicesid-vspc-vspctenantid-backuppolicies

**Status:** Beta version  
**IAM actions:** `backupServices:apiovh:vspc/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `backupServicesId` | path | string (uuid) | yes | Backup services ID |
| `vspcTenantId` | path | string (uuid) | yes | Vspc tenant ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string[] | successful operation |

```json
[
  "string"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupPolicies" \
  -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/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupPolicies")

# 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/backupServices/tenant/{backupServicesId}/vspc/{vspcTenantId}/backupPolicies");

print_r($result);
?>
```
