# Private Cloud › Public VCF as-a-Service › Migration API

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

> 3 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/private-cloud/public-vcf-as-a-service/migration/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/private-cloud/public-vcf-as-a-service/migration.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/private-cloud/public-vcf-as-a-service/migration.json?format=openapi3

## Operations

- `GET /vmwareCloudDirector/migration` — List migration services
- `GET /vmwareCloudDirector/migration/{migrationId}` — Get a migration service
- `PUT /vmwareCloudDirector/migration/{migrationId}` — Update a migration service

## List migration services

`GET /v2/vmwareCloudDirector/migration`

Link: https://developers.eu.ovhcloud.com/reference/private-cloud/public-vcf-as-a-service/migration/#get-vmwareclouddirector-migration

**Status:** Stable production version  
**IAM actions:** `vmwareCloudDirectorMigration:apiovh:get`

Returns the migration services, with their status.

### 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 | vmwareCloudDirector.migration.MigrationDetailsWithIAM[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Datetime when migration was enabled |
| `currentState` | vmwareCloudDirector.migration.CurrentState | read-only | Configuration currently in force on the platform. It catches up with targetSpec once the requested change has been applied. |
| `currentState.azName` | vmwareCloudDirector.AZNameEnum | read-only | Availability zone of VMware Cloud Director organization backup — one of `ca-east-bhs-a`, `eu-central-waw-a`, `eu-west-eri-a`, `eu-west-lim-a`, `eu-west-rbx-a`, `eu-west-sbg-a`, `us-east-vin-a`, `us-west-hil-a` |
| `currentState.ips` | ipBlock[] | read-only | Allowed IP addresses to pair on-premise with cloud migration service |
| `currentState.migrationCloudUrl` | string | read-only | VMware Cloud Director Migration Cloud URL |
| `currentState.organizationId` | string (uuid) | read-only | Identifier of the VMware Cloud Director Organization |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations ongoing on the VMware Cloud Director migration service |
| `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 the VMware Cloud Director migration service |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Reflects the readiness of the VMware Cloud Director migration service. A new target specification request will be accepted only in `READY` status. — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | vmwareCloudDirector.migration.TargetSpec | read-only | Configuration you requested. While a change is still being applied it differs from currentState. |
| `targetSpec.ips` | ipBlock[] |  | Allowed IP addresses to pair on-premise with cloud migration service |
| `updatedAt` | string (date-time) | read-only | Datetime when migration service is modified |

```json
[
  {
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "azName": "ca-east-bhs-a",
      "ips": [
        "192.0.2.0/24"
      ],
      "migrationCloudUrl": "string",
      "organizationId": "00000000-0000-0000-0000-000000000000"
    },
    "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": {
      "ips": [
        "192.0.2.0/24"
      ]
    },
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

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

# 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/vmwareCloudDirector/migration");

print_r($result);
?>
```

## Get a migration service

`GET /v2/vmwareCloudDirector/migration/{migrationId}`

Link: https://developers.eu.ovhcloud.com/reference/private-cloud/public-vcf-as-a-service/migration/#get-vmwareclouddirector-migration-migrationid

**Status:** Stable production version  
**IAM actions:** `vmwareCloudDirectorMigration:apiovh:get`

Returns the migration service: migration cloud URL, organization ID and the IP blocks allowed to pair an on-premises site.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `migrationId` | path | string | yes | Migration ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vmwareCloudDirector.migration.MigrationDetailsWithIAM | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Datetime when migration was enabled |
| `currentState` | vmwareCloudDirector.migration.CurrentState | read-only | Configuration currently in force on the platform. It catches up with targetSpec once the requested change has been applied. |
| `currentState.azName` | vmwareCloudDirector.AZNameEnum | read-only | Availability zone of VMware Cloud Director organization backup — one of `ca-east-bhs-a`, `eu-central-waw-a`, `eu-west-eri-a`, `eu-west-lim-a`, `eu-west-rbx-a`, `eu-west-sbg-a`, `us-east-vin-a`, `us-west-hil-a` |
| `currentState.ips` | ipBlock[] | read-only | Allowed IP addresses to pair on-premise with cloud migration service |
| `currentState.migrationCloudUrl` | string | read-only | VMware Cloud Director Migration Cloud URL |
| `currentState.organizationId` | string (uuid) | read-only | Identifier of the VMware Cloud Director Organization |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations ongoing on the VMware Cloud Director migration service |
| `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 the VMware Cloud Director migration service |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Reflects the readiness of the VMware Cloud Director migration service. A new target specification request will be accepted only in `READY` status. — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | vmwareCloudDirector.migration.TargetSpec | read-only | Configuration you requested. While a change is still being applied it differs from currentState. |
| `targetSpec.ips` | ipBlock[] |  | Allowed IP addresses to pair on-premise with cloud migration service |
| `updatedAt` | string (date-time) | read-only | Datetime when migration service is modified |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "azName": "ca-east-bhs-a",
    "ips": [
      "192.0.2.0/24"
    ],
    "migrationCloudUrl": "string",
    "organizationId": "00000000-0000-0000-0000-000000000000"
  },
  "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": {
    "ips": [
      "192.0.2.0/24"
    ]
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

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

# 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/vmwareCloudDirector/migration/{migrationId}");

print_r($result);
?>
```

## Update a migration service

`PUT /v2/vmwareCloudDirector/migration/{migrationId}`

Link: https://developers.eu.ovhcloud.com/reference/private-cloud/public-vcf-as-a-service/migration/#put-vmwareclouddirector-migration-migrationid

**Status:** Stable production version  
**IAM actions:** `vmwareCloudDirectorMigration:apiovh:edit`

Replaces the IP blocks allowed to pair an on-premises site with the migration service. An IP block left out of the list is removed. Accepted only when the service is `READY`, then applied asynchronously: `currentState` catches up with `targetSpec`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `migrationId` | path | string | yes | Migration ID |

### Request body (required)

Type: `vmwareCloudDirector.migration.Update`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | vmwareCloudDirector.migration.TargetSpec | yes | New target specification for the VCDA migration allowed ips list |
| `targetSpec.ips` | ipBlock[] |  | Allowed IP addresses to pair on-premise with cloud migration service |

```json
{
  "targetSpec": {
    "ips": [
      "192.0.2.0/24"
    ]
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vmwareCloudDirector.migration.MigrationDetails | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Datetime when migration was enabled |
| `currentState` | vmwareCloudDirector.migration.CurrentState | read-only | Configuration currently in force on the platform. It catches up with targetSpec once the requested change has been applied. |
| `currentState.azName` | vmwareCloudDirector.AZNameEnum | read-only | Availability zone of VMware Cloud Director organization backup — one of `ca-east-bhs-a`, `eu-central-waw-a`, `eu-west-eri-a`, `eu-west-lim-a`, `eu-west-rbx-a`, `eu-west-sbg-a`, `us-east-vin-a`, `us-west-hil-a` |
| `currentState.ips` | ipBlock[] | read-only | Allowed IP addresses to pair on-premise with cloud migration service |
| `currentState.migrationCloudUrl` | string | read-only | VMware Cloud Director Migration Cloud URL |
| `currentState.organizationId` | string (uuid) | read-only | Identifier of the VMware Cloud Director Organization |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations ongoing on the VMware Cloud Director migration service |
| `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 the VMware Cloud Director migration service |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Reflects the readiness of the VMware Cloud Director migration service. A new target specification request will be accepted only in `READY` status. — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | vmwareCloudDirector.migration.TargetSpec | read-only | Configuration you requested. While a change is still being applied it differs from currentState. |
| `targetSpec.ips` | ipBlock[] |  | Allowed IP addresses to pair on-premise with cloud migration service |
| `updatedAt` | string (date-time) | read-only | Datetime when migration service is modified |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "azName": "ca-east-bhs-a",
    "ips": [
      "192.0.2.0/24"
    ],
    "migrationCloudUrl": "string",
    "organizationId": "00000000-0000-0000-0000-000000000000"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "string",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "ips": [
      "192.0.2.0/24"
    ]
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/vmwareCloudDirector/migration/{migrationId}" \
  -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: vmwareCloudDirector.migration.Update
result = client.put("/v2/vmwareCloudDirector/migration/{migrationId}",
	targetSpec = None, # New target specification for the VCDA migration allowed ips list (type: vmwareCloudDirector.migration.TargetSpec)
)

# 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: vmwareCloudDirector.migration.Update
$result = $ovh->put("/v2/vmwareCloudDirector/migration/{migrationId}", array(
	targetSpec => null, // New target specification for the VCDA migration allowed ips list (type: vmwareCloudDirector.migration.TargetSpec)
));

print_r($result);
?>
```
