curl --request PATCH \
--url https://cockroachlabs.cloud/api/v1/physical-replication-streams/{id} \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--json '{"failover_at":"2006-01-03T15:04:05Z","status":"FAILING_OVER"}'{
"activation_at": "2006-01-03T15:04:15Z",
"created_at": "2006-01-02T15:04:05Z",
"failover_at": "2006-01-03T15:04:05Z",
"id": "00000000-0000-0000-0000-000000000001",
"primary_cluster_id": "00000000-0000-0000-0000-000000000002",
"replicated_time": "2006-01-03T15:04:04Z",
"retained_time": "2006-01-02T15:04:06Z",
"standby_cluster_id": "00000000-0000-0000-0000-000000000003",
"status": "COMPLETED"
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Update a physical replication stream
Can be used by the following roles assigned at the organization, folder or cluster scope:
- CLUSTER_ADMIN
curl --request PATCH \
--url https://cockroachlabs.cloud/api/v1/physical-replication-streams/{id} \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--json '{"failover_at":"2006-01-03T15:04:05Z","status":"FAILING_OVER"}'{
"activation_at": "2006-01-03T15:04:15Z",
"created_at": "2006-01-02T15:04:05Z",
"failover_at": "2006-01-03T15:04:05Z",
"id": "00000000-0000-0000-0000-000000000001",
"primary_cluster_id": "00000000-0000-0000-0000-000000000002",
"replicated_time": "2006-01-03T15:04:04Z",
"retained_time": "2006-01-02T15:04:06Z",
"standby_cluster_id": "00000000-0000-0000-0000-000000000003",
"status": "COMPLETED"
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Authorizations
Body
spec contains the information that is being updated for the given replication stream.
failover_at is the crdb system time at which failover occurs. If the user sets the status to 'FAILING_OVER' but omits failover_at, the failover time will default to the latest consistent replicated time. Otherwise, the user can pick a time up to one hour in the future to schedule a failover, or a time in the past to restore the cluster to a recent state. If the time is in the past, the API will make a best-effort attempt to validate that the time is not earlier than the retained time. In this case, if the retained time is updated in between validation and failover execution and the failover time becomes invalid, the stream will failover to the retained time. failover_at is not required when updating the status to 'CANCELED'.
status describes the desired status of the replication stream.
- STARTING: signifies that a stream is starting
- REPLICATING: during an update request, status 'REPLICATING' is allowed to transition to 'FAILING_OVER' or 'CANCELED'. Other status transitions are not supported.
- FAILING_OVER: used to trigger a failover, or to signify that a failover is occurring.
- COMPLETED: signifies that a failover is complete.
- CANCELED: signifies that a stream is canceled.
STARTING, REPLICATING, FAILING_OVER, COMPLETED, CANCELED Response
A successful response.
status describes the desired status of the replication stream.
- STARTING: signifies that a stream is starting
- REPLICATING: during an update request, status 'REPLICATING' is allowed to transition to 'FAILING_OVER' or 'CANCELED'. Other status transitions are not supported.
- FAILING_OVER: used to trigger a failover, or to signify that a failover is occurring.
- COMPLETED: signifies that a failover is complete.
- CANCELED: signifies that a stream is canceled.
STARTING, REPLICATING, FAILING_OVER, COMPLETED, CANCELED failover_at is the time for which failover is requested. If the user sets the status to 'FAILING_OVER' but omits failover_at, the failover time will default to the latest consistent replicated time. Otherwise, the user can pick a time up to one hour in the future to schedule a failover, or a time in the past to restore the cluster to a recent state. This field will be present if the user has requested failover at a future time.

