# Google Cloud Dms V1 Client - Class MigrationJob (2.1.3)

2.1.3 (latest) 2.1.2 2.0.6 1.5.5 1.4.2 1.3.0 1.2.1 1.1.0 1.0.5 Reference documentation and code samples for the Google Cloud Dms V1 Client class MigrationJob.

Represents a Database Migration Service migration job object.

Generated from protobuf message `google.cloud.clouddms.v1.MigrationJob`

## Namespace

Google \\ Cloud \\ CloudDms \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` The name (URI) of this migration job resource, in the form of: projects/{project}/locations/{location}/migrationJobs/{migrationJob}. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The timestamp when the migration job resource was created. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The timestamp when the migration job resource was last updated. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs. An object containing a list of "key": "value" pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `↳ display_name` | `string` The migration job display name. |
| `↳ state` | `int` The current migration job state. |
| `↳ phase` | `int` Output only. The current migration job phase. |
| `↳ type` | `int` Required. The migration job type. |
| `↳ dump_path` | `string` The path to the dump file in Google Cloud Storage, in the format: (gs://\[BUCKET_NAME\]/\[OBJECT_NAME\]). This field and the "dump_flags" field are mutually exclusive. |
| `↳ dump_flags` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.DumpFlags` The initial dump flags. This field and the "dump_path" field are mutually exclusive. |
| `↳ source` | `string` Required. The resource name (URI) of the source connection profile. |
| `↳ destination` | `string` Required. The resource name (URI) of the destination connection profile. |
| `↳ reverse_ssh_connectivity` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.ReverseSshConnectivity` The details needed to communicate to the source over Reverse SSH tunnel connectivity. |
| `↳ vpc_peering_connectivity` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.VpcPeeringConnectivity` The details of the VPC network that the source database is located in. |
| `↳ static_ip_connectivity` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.StaticIpConnectivity` static ip connectivity data (default, no additional details needed). |
| `↳ duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Output only. The duration of the migration job (in seconds). A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". |
| `↳ error` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` Output only. The error details in case of state FAILED. |
| `↳ source_database` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseType` The database engine type and provider of the source. |
| `↳ destination_database` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseType` The database engine type and provider of the destination. |
| `↳ end_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. If the migration job is completed, the time when it was completed. |
| `↳ conversion_workspace` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.ConversionWorkspaceInfo` The conversion workspace used by the migration. |
| `↳ filter` | `string` This field can be used to select the entities to migrate as part of the migration job. It uses AIP-160 notation to select a subset of the entities configured on the associated conversion-workspace. This field should not be set on migration-jobs that are not associated with a conversion workspace. |
| `↳ cmek_key_name` | `string` The CMEK (customer-managed encryption key) fully qualified key name used for the migration job. This field supports all migration jobs types except for: \* \* Mysql to Mysql (use the cmek field in the cloudsql connection profile instead). \* \* PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql connection profile instead). \* \* PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb connection profile instead). Each Cloud CMEK key has the following format: projects/\[PROJECT\]/locations/\[REGION\]/keyRings/\[RING\]/cryptoKeys/\[KEY_NAME\] |
| `↳ performance_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.PerformanceConfig` Optional. Data dump parallelism settings used by the migration. Currently applicable only for MySQL to Cloud SQL for MySQL migrations only. |

### getName

The name (URI) of this migration job resource, in the form of:
projects/{project}/locations/{location}/migrationJobs/{migrationJob}.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

The name (URI) of this migration job resource, in the form of:
projects/{project}/locations/{location}/migrationJobs/{migrationJob}.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreateTime

Output only. The timestamp when the migration job resource was created.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
Example: "2014-10-02T15:01:23.045123456Z".

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The timestamp when the migration job resource was created.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
Example: "2014-10-02T15:01:23.045123456Z".

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpdateTime

Output only. The timestamp when the migration job resource was last
updated. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.

Example: "2014-10-02T15:01:23.045123456Z".

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The timestamp when the migration job resource was last
updated. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.

Example: "2014-10-02T15:01:23.045123456Z".

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLabels

The resource labels for migration job to use to annotate any related
underlying resources such as Compute Engine VMs. An object containing a
list of "key": "value" pairs.

Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

The resource labels for migration job to use to annotate any related
underlying resources such as Compute Engine VMs. An object containing a
list of "key": "value" pairs.

Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDisplayName

The migration job display name.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDisplayName

The migration job display name.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getState

The current migration job state.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.State). |

### setState

The current migration job state.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.State). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPhase

Output only. The current migration job phase.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Phase](https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.Phase). |

### setPhase

Output only. The current migration job phase.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Phase](https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.Phase). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getType

Required. The migration job type.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Type](https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.Type). |

### setType

Required. The migration job type.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Type](https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.Type). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDumpPath

The path to the dump file in Google Cloud Storage,
in the format: (gs://\[BUCKET_NAME\]/\[OBJECT_NAME\]).

This field and the "dump_flags" field are mutually exclusive.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDumpPath

The path to the dump file in Google Cloud Storage,
in the format: (gs://\[BUCKET_NAME\]/\[OBJECT_NAME\]).

This field and the "dump_flags" field are mutually exclusive.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDumpFlags

The initial dump flags.

This field and the "dump_path" field are mutually exclusive.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.DumpFlags|null` |   |

### hasDumpFlags

### clearDumpFlags

### setDumpFlags

The initial dump flags.

This field and the "dump_path" field are mutually exclusive.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.DumpFlags` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSource

Required. The resource name (URI) of the source connection profile.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setSource

Required. The resource name (URI) of the source connection profile.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDestination

Required. The resource name (URI) of the destination connection profile.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDestination

Required. The resource name (URI) of the destination connection profile.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReverseSshConnectivity

The details needed to communicate to the source over Reverse SSH
tunnel connectivity.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.ReverseSshConnectivity|null` |   |

### hasReverseSshConnectivity

### setReverseSshConnectivity

The details needed to communicate to the source over Reverse SSH
tunnel connectivity.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.ReverseSshConnectivity` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getVpcPeeringConnectivity

The details of the VPC network that the source database is located in.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.VpcPeeringConnectivity|null` |   |

### hasVpcPeeringConnectivity

### setVpcPeeringConnectivity

The details of the VPC network that the source database is located in.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.VpcPeeringConnectivity` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStaticIpConnectivity

static ip connectivity data (default, no additional details needed).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.StaticIpConnectivity|null` |   |

### hasStaticIpConnectivity

### setStaticIpConnectivity

static ip connectivity data (default, no additional details needed).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.StaticIpConnectivity` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDuration

Output only. The duration of the migration job (in seconds). A duration in
seconds with up to nine fractional digits, terminated by 's'. Example:
"3.5s".

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasDuration

### clearDuration

### setDuration

Output only. The duration of the migration job (in seconds). A duration in
seconds with up to nine fractional digits, terminated by 's'. Example:
"3.5s".

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getError

Output only. The error details in case of state FAILED.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html|null` |   |

### hasError

### clearError

### setError

Output only. The error details in case of state FAILED.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSourceDatabase

The database engine type and provider of the source.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseType|null` |   |

### hasSourceDatabase

### clearSourceDatabase

### setSourceDatabase

The database engine type and provider of the source.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseType` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDestinationDatabase

The database engine type and provider of the destination.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseType|null` |   |

### hasDestinationDatabase

### clearDestinationDatabase

### setDestinationDatabase

The database engine type and provider of the destination.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseType` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEndTime

Output only. If the migration job is completed, the time when it was
completed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasEndTime

### clearEndTime

### setEndTime

Output only. If the migration job is completed, the time when it was
completed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConversionWorkspace

The conversion workspace used by the migration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.ConversionWorkspaceInfo|null` |   |

### hasConversionWorkspace

### clearConversionWorkspace

### setConversionWorkspace

The conversion workspace used by the migration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.ConversionWorkspaceInfo` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFilter

This field can be used to select the entities to migrate as part of
the migration job. It uses AIP-160 notation to select a subset of the
entities configured on the associated conversion-workspace. This field
should not be set on migration-jobs that are not associated with a
conversion workspace.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setFilter

This field can be used to select the entities to migrate as part of
the migration job. It uses AIP-160 notation to select a subset of the
entities configured on the associated conversion-workspace. This field
should not be set on migration-jobs that are not associated with a
conversion workspace.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCmekKeyName

The CMEK (customer-managed encryption key) fully qualified key name used
for the migration job.

This field supports all migration jobs types except for:

- Mysql to Mysql (use the cmek field in the cloudsql connection profile instead).
- PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql connection profile instead).
- PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb connection profile instead). Each Cloud CMEK key has the following format: projects/\[PROJECT\]/locations/\[REGION\]/keyRings/\[RING\]/cryptoKeys/\[KEY_NAME\]

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setCmekKeyName

The CMEK (customer-managed encryption key) fully qualified key name used
for the migration job.

This field supports all migration jobs types except for:

- Mysql to Mysql (use the cmek field in the cloudsql connection profile instead).
- PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql connection profile instead).
- PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb connection profile instead). Each Cloud CMEK key has the following format: projects/\[PROJECT\]/locations/\[REGION\]/keyRings/\[RING\]/cryptoKeys/\[KEY_NAME\]

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPerformanceConfig

Optional. Data dump parallelism settings used by the migration.

Currently applicable only for MySQL to Cloud SQL for MySQL migrations only.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.PerformanceConfig|null` |   |

### hasPerformanceConfig

### clearPerformanceConfig

### setPerformanceConfig

Optional. Data dump parallelism settings used by the migration.

Currently applicable only for MySQL to Cloud SQL for MySQL migrations only.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MigrationJob.PerformanceConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConnectivity

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |