Skip to main content

mysql_migrations

Creates, updates, deletes, gets or lists a mysql_migrations resource.

Overview​

Namemysql_migrations
TypeResource
Idovh.cloud_database.mysql_migrations

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
errorstringError message
messagestringInformation message
methodstringMethod used for the migration
statusstringStatus of the migration (done, failed, running, syncing, waiting)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcluster_id, service_nameGet the MySQL migration status
createinsertcluster_id, service_name, source_host, source_password, source_port, source_ssl, source_usernameCreate a new MySQL migration task
stopexecclusterId, service_nameStop MySQL migration and replication process

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
clusterIdstring (uuid)Cluster ID
cluster_idstring (uuid)Cluster ID (wire: clusterId)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.

SELECT examples​

Get the MySQL migration status

SELECT
error,
message,
method,
status
FROM ovh.cloud_database.mysql_migrations
WHERE cluster_id = '{{ cluster_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Create a new MySQL migration task

INSERT INTO ovh.cloud_database.mysql_migrations (
source_host,
source_password,
source_port,
source_ssl,
source_username,
cluster_id,
service_name
)
SELECT
'{{ source_host }}' /* required */,
'{{ source_password }}' /* required */,
{{ source_port }} /* required */,
{{ source_ssl }} /* required */,
'{{ source_username }}' /* required */,
'{{ cluster_id }}',
'{{ service_name }}'
RETURNING
error,
message,
method,
status
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Stop MySQL migration and replication process

EXEC ovh.cloud_database.mysql_migrations.stop
@clusterId='{{ clusterId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;