PATCH
/
organizations
/
{organization}
/
databases
/
{database}
/
workflows
/
{number}
/
reverse-cutover
Reverse traffic cutover
curl --request PATCH \
  --url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/workflows/{number}/reverse-cutover \
  --header 'Authorization: <api-key>'
{
  "id": "<string>",
  "name": "<string>",
  "number": 123,
  "state": "pending",
  "created_at": "<string>",
  "updated_at": "<string>",
  "started_at": "<string>",
  "completed_at": "<string>",
  "cancelled_at": "<string>",
  "reversed_at": "<string>",
  "retried_at": "<string>",
  "data_copy_completed_at": "<string>",
  "cutover_at": "<string>",
  "replicas_switched": true,
  "primaries_switched": true,
  "switch_replicas_at": "<string>",
  "switch_primaries_at": "<string>",
  "verify_data_at": "<string>",
  "workflow_type": "move_tables",
  "workflow_subtype": "<string>",
  "defer_secondary_keys": true,
  "on_ddl": "IGNORE",
  "may_retry": true,
  "verified_data_stale": true,
  "sequence_tables_applied": true,
  "actor": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "verify_data_by": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "reversed_by": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "switch_replicas_by": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "switch_primaries_by": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "cancelled_by": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "completed_by": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "retried_by": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "cutover_by": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "reversed_cutover_by": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "branch": {
    "id": "<string>",
    "name": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>",
    "deleted_at": "<string>"
  },
  "source_keyspace": {
    "id": "<string>",
    "name": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>",
    "deleted_at": "<string>"
  },
  "target_keyspace": {
    "id": "<string>",
    "name": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>",
    "deleted_at": "<string>"
  },
  "global_keyspace": {
    "id": "<string>",
    "name": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>",
    "deleted_at": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Path Parameters

organization
string
required

The name of the organization the workflow belongs to

database
string
required

The name of the database the workflow belongs to

number
string
required

The sequence number of the workflow

Response

Returns a workflow

id
string
required

The ID of the workflow

name
string
required

The name of the workflow

number
number
required

The sequence number of the workflow

state
enum<string>
required

The state of the workflow

Available options:
pending,
copying,
running,
stopped,
verifying_data,
verified_data,
switching_replicas,
switched_replicas,
switching_primaries,
switched_primaries,
reversing_traffic,
reversing_traffic_for_cancel,
cutting_over,
cutover,
reversed_cutover,
completed,
cancelling,
cancelled,
error
created_at
string
required

When the workflow was created

updated_at
string
required

When the workflow was last updated

started_at
string
required

When the workflow was started

completed_at
string
required

When the workflow was completed

cancelled_at
string
required

When the workflow was cancelled

reversed_at
string
required

When the workflow was reversed

retried_at
string
required

When the workflow was retried

data_copy_completed_at
string
required

When the data copy was completed

cutover_at
string
required

When the cutover was completed

replicas_switched
boolean
required

Whether or not the replicas have been switched

primaries_switched
boolean
required

Whether or not the primaries have been switched

switch_replicas_at
string
required

When the replicas were switched

switch_primaries_at
string
required

When the primaries were switched

verify_data_at
string
required

When the data was verified

workflow_type
enum<string>
required

The type of the workflow

Available options:
move_tables
workflow_subtype
string
required

The subtype of the workflow

defer_secondary_keys
boolean
required

Whether or not secondary keys are deferred

on_ddl
enum<string>
required

The behavior when DDL changes during the workflow

Available options:
IGNORE,
STOP,
EXEC,
EXEC_IGNORE
may_retry
boolean
required

Whether or not the workflow may be retried

verified_data_stale
boolean
required

Whether or not the verified data is stale

sequence_tables_applied
boolean
required

Whether or not sequence tables have been created

actor
object
required
verify_data_by
object
required
reversed_by
object
required
switch_replicas_by
object
required
switch_primaries_by
object
required
cancelled_by
object
required
completed_by
object
required
retried_by
object
required
cutover_by
object
required
reversed_cutover_by
object
required
branch
object
required
source_keyspace
object
required
target_keyspace
object
required
global_keyspace
object
required