Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
### Get information on backup settings

To retrieve information about a specific cluster, make a `GET` request to the `/v1/clusters/{cluster_id}/backups/config` endpoint.
To retrieve information about a specific cluster, make a `GET` request to the `/v1/clusters/{cluster_id}/backups-config` endpoint.

{% include_cached copy-clipboard.html %}
~~~ shell
curl --request GET \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/backups/config \
--header 'Authorization: Bearer {secret_key}'
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/backups-config \
--header "Authorization: Bearer {secret_key}"
~~~

Set the following:

- `{cluster_id}` is the unique ID of the cluster. Use this ID when making API requests. You can find the cluster ID in the cluster's Cloud Console page. Find your cluster ID in the URL of the single cluster overview page: `https://cockroachlabs.cloud/cluster/{your_cluster_id}/overview`. The ID should resemble `f78b7feb-b6cf-4396-9d7f-494982d7d81e`.
- `{cluster_id}` is the unique ID of the cluster. This ID is written in a UUID format similar to `f78b7feb-b6cf-4396-9d7f-494982d7d81e` and is returned by a [GET request against the `/v1/clusters` endpoint]({% link cockroachcloud/cloud-api.md %}#list-all-clusters-in-an-organization). You can also find the cluster ID in the Cloud Console, in the URL of the single cluster overview page: `https://cockroachlabs.cloud/cluster/{your_cluster_id}/overview`.
- `{secret_key}` is your API key. Refer to [API Access]({% link cockroachcloud/managing-access.md %}#api-access) for more details.

If the request is successful, the API will return details about the managed backup settings:
Expand All @@ -36,19 +36,19 @@ If the request is successful, the API will return details about the managed back

{% include cockroachcloud/backups/review-settings.md %}

To configure the frequency and retention of managed backups, send a `PUT` request to the `/v1/clusters/{cluster_id}/backups/config` endpoint.
To configure the frequency and retention of managed backups, send a `PUT` request to the `/v1/clusters/{cluster_id}/backups-config` endpoint.

{% include_cached copy-clipboard.html %}
~~~ shell
curl --request PUT \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/backups/config \
--header 'Authorization: Bearer {secret_key}' \
--data '{"enabled": true, "frequency_minutes": 30, "retention_days": 2}'
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/backups-config \
--header "Authorization: Bearer {secret_key}" \
--data "{"enabled": true, "frequency_minutes": 30, "retention_days": 2}"
~~~

Set the following:

- `{cluster_id}` is the unique ID of the cluster. Use this ID when making API requests. You can find the cluster ID in the cluster's Cloud Console page. Find your cluster ID in the URL of the single cluster overview page: `https://cockroachlabs.cloud/cluster/{your_cluster_id}/overview`. The ID should resemble `f78b7feb-b6cf-4396-9d7f-494982d7d81e`.
- `{cluster_id}` is the unique ID of the cluster. This ID is written in a UUID format similar to `f78b7feb-b6cf-4396-9d7f-494982d7d81e` and is returned by a [GET request against the `/v1/clusters` endpoint]({% link cockroachcloud/cloud-api.md %}#list-all-clusters-in-an-organization). You can also find the cluster ID in the Cloud Console, in the URL of the single cluster overview page: `https://cockroachlabs.cloud/cluster/{your_cluster_id}/overview`.
- `{enabled}` controls whether managed backups are enabled or disabled. If you are disabling managed backups, you cannot set backup frequency or retention. Possible values are: `true`, `false`.
- `{frequency_minutes}` determines [how often](#frequency) the managed backup will run in minutes. Possible values are: `5`, `10`, `15`, `30`, `60`, `240` (4 hours), `1440` (24 hours).
- `{retention_days}` sets the number of days Cockroach Labs will [retain](#retention) the managed backup in storage. You can change `retention_days` for the cluster **once** (whether in the Cloud API or [Cloud Console](#cloud-console)). Possible values are: `2`, `7`, `30`, `90`, `365`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To view a list of managed backups on a cluster with timestamps and their respect
~~~ shell
curl --request GET \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/backups \
--header 'Authorization: Bearer {secret_key}' \
--header "Authorization: Bearer {secret_key}" \
~~~

If the request is successful, the client recieves a JSON response listing backups with their unique `{id}`. The `{as_of_time}` timestamp describes the system time of the cluster when the backup was created:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ To restore a cluster to a recent managed backup, send a `POST` request to the `/
{% include_cached copy-clipboard.html %}
~~~ shell
curl --request POST \
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores \
--header "Authorization: Bearer {secret_key}" \
--json '{
"source_cluster_id": "{cluster_id}"
--json "{
"source_cluster_id": "{cluster_id}",
"type": "CLUSTER"
}'
}"
~~~

By default, the restore job uses the most recent backup stored within the last 7 days on the cluster specified in `source_cluster_id`. To restore a specific backup, include the `backup_id` field and specify a backup ID from the [managed backups list](#view-managed-backups):

{% include_cached copy-clipboard.html %}
~~~ shell
curl --request POST \
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores \
--header "Authorization: Bearer {secret_key}" \
--json '{
--json "{
"backup_id": "example-2d25-4a64-8172-28af7a0d41cc",
"type": "CLUSTER"
}'
}"
~~~

{% if page.name == "managed-backups-advanced.md" %}
Expand All @@ -50,12 +50,12 @@ To restore a cluster backup into a different cluster, ensure that the destinatio
{% include_cached copy-clipboard.html %}
~~~ shell
curl --request POST \
--url 'https://cockroachlabs.cloud/api/v1/clusters/{destination_cluster_id}/restores' \
--url https://cockroachlabs.cloud/api/v1/clusters/{destination_cluster_id}/restores \
--header "Authorization: Bearer {secret_key}" \
--json '{
--json "{
"source_cluster_id": "{source_cluster_id}",
"type": "CLUSTER"
}'
}"
~~~

You can specify additional options for the restore job in the `restore_opts` object. For more information, see the [API endpoint documentation](https://www.cockroachlabs.com/docs/api/cloud/v1#get-/api/v1/clusters/-cluster_id-/restores-config).
Expand Down Expand Up @@ -83,10 +83,10 @@ To restore one or more databases from a cluster's managed backup, send a `POST`
{% include_cached copy-clipboard.html %}
~~~ shell
curl --request POST \
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores \
--header "Authorization: Bearer {secret_key}" \
--json '{
"source_cluster_id": "{cluster_id}"
--json "{
"source_cluster_id": "{cluster_id}",
"type": "DATABASE",
"objects": [
{
Expand All @@ -96,18 +96,18 @@ curl --request POST \
"database": "movr"
}
]
}'
}"
~~~

By default, the database is restored into the original database name from the managed backup. To restore the database contents into a new database, include the field `restore_opts.new_db_name` with the new database name. You can only restore one database at a time when using this option.

{% include_cached copy-clipboard.html %}
~~~ shell
curl --request POST \
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores \
--header "Authorization: Bearer {secret_key}" \
--json '{
"source_cluster_id": "{cluster_id}"
--json "{
"source_cluster_id": "{cluster_id}",
"type": "DATABASE",
"objects": [
{
Expand All @@ -117,43 +117,43 @@ curl --request POST \
"restore_opts": {
"new_db_name": "tpcc2"
}
}'
}"
~~~

To restore from a specific backup rather than the most recently created managed backup, include the `backup_id` field specifying a backup ID:

{% include_cached copy-clipboard.html %}
~~~ shell
curl --request POST \
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores \
--header "Authorization: Bearer {secret_key}" \
--json '{
--json "{
"backup_id": "example-2d25-4a64-8172-28af7a0d41cc",
"type": "DATABASE",
"objects": [
{
"database": "tpcc"
}
],
}'
]
}"
~~~

To restore a database from a source cluster's managed backup into a different cluster, send the restore request to the destination cluster ID. Specify the ID of the backup's cluster as `source_cluster_id`. Both the source cluster and the destination cluster must use the Advanced plan.

{% include_cached copy-clipboard.html %}
~~~ shell
curl --request POST \
--url 'https://cockroachlabs.cloud/api/v1/clusters/{destination_cluster_id}/restores' \
--url https://cockroachlabs.cloud/api/v1/clusters/{destination_cluster_id}/restores \
--header "Authorization: Bearer {secret_key}" \
--json '{
--json "{
"source_cluster_id": "{source_cluster_id}",
"type": "DATABASE",
"objects": [
{
"database": "tpcc"
}
],
}'
]
}"
~~~

You can specify additional options for the restore jobs in the `restore_opts` object. For more information, see the [API endpoint documentation](https://www.cockroachlabs.com/docs/api/cloud/v1#get-/api/v1/clusters/-cluster_id-/restores-config).
Expand All @@ -178,10 +178,10 @@ To restore a one or more tables from a cluster's managed backup, send a `POST` r
{% include_cached copy-clipboard.html %}
~~~ shell
curl --request POST \
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores \
--header "Authorization: Bearer {secret_key}" \
--json '{
"source_cluster_id": "{cluster_id}"
--json "{
"source_cluster_id": "{cluster_id}",
"type": "TABLE",
"objects": [
{
Expand All @@ -195,18 +195,18 @@ curl --request POST \
"table": "customer"
}
]
}'
}"
~~~

By default, the table is restored into the original database name from the managed backup. To restore the table into a different database, include the field `restore_opts.into_db` with the desired database name. The following example restores the `tpcc.public.warehouse` table from the most recent managed backup into `tpcc2.public.warehouse` on the cluster:

{% include_cached copy-clipboard.html %}
~~~ shell
curl --request POST \
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores \
--header "Authorization: Bearer {secret_key}" \
--json '{
"source_cluster_id": "{cluster_id}"
--json "{
"source_cluster_id": "{cluster_id}",
"type": "TABLE",
"objects": [
{
Expand All @@ -223,17 +223,17 @@ curl --request POST \
"restore_opts": {
"into_db": "tpcc2"
}
}'
}"
~~~

To restore from a specific backup rather than the most recently created managed backup, include the `backup_id` field specifying a backup ID:

{% include_cached copy-clipboard.html %}
~~~ shell
curl --request POST \
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores \
--header "Authorization: Bearer {secret_key}" \
--json '{
--json "{
"backup_id": "example-2d25-4a64-8172-28af7a0d41cc",
"type": "TABLE",
"objects": [
Expand All @@ -243,17 +243,17 @@ curl --request POST \
"table": "warehouse"
}
]
}'
}"
~~~

To restore a table from a source cluster's managed backup into a different cluster, send the restore request to the destination cluster ID. Specify the ID of the backup's cluster as `source_cluster_id`. Both the source cluster and the destination cluster must use the Advanced plan.

{% include_cached copy-clipboard.html %}
~~~ shell
curl --request POST \
--url 'https://cockroachlabs.cloud/api/v1/clusters/{destination_cluster_id}/restores' \
--url https://cockroachlabs.cloud/api/v1/clusters/{destination_cluster_id}/restores \
--header "Authorization: Bearer {secret_key}" \
--json '{
--json "{
"source_cluster_id": "{source_cluster_id}",
"type": "TABLE",
"objects": [
Expand All @@ -263,7 +263,7 @@ curl --request POST \
"table": "warehouse"
}
]
}'
}"
~~~

You can specify additional options for the restore jobs in the `restore_opts` object. For more information, see the [API endpoint documentation](https://www.cockroachlabs.com/docs/api/cloud/v1#get-/api/v1/clusters/-cluster_id-/restores-config).
Expand Down Expand Up @@ -294,7 +294,7 @@ To view the status of a restore job using the cloud API, send a `GET` request to
~~~ shell
curl --request GET \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores/{restore_id} \
--header 'Authorization: Bearer {secret_key}' \
--header "Authorization: Bearer {secret_key}"
~~~

If the request is successful, the client recieves a response containing JSON describing the status of the specified request operation:
Expand Down
12 changes: 6 additions & 6 deletions src/current/cockroachcloud/aws-privatelink.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ To [add a private endpoint trusted owner](https://www.cockroachlabs.com/docs/api
~~~ shell
curl --request POST \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/networking/private-endpoint-trusted-owners \
--header 'Authorization: Bearer {bearer_token' \
--header 'content-type: application/json' \
--data '{"external_owner_id":"{aws_account_id}","type":"AWS_ACCOUNT_ID"}'
--header "Authorization: Bearer {bearer_token}" \
--header "content-type: application/json" \
--data "{"external_owner_id":"{aws_account_id}","type":"AWS_ACCOUNT_ID"}"
~~~

Replace:
Expand All @@ -101,7 +101,7 @@ To [list private endpoint trusted owners](https://www.cockroachlabs.com/docs/api
~~~ shell
curl --request GET \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/networking/private-endpoint-trusted-owners \
--header 'Authorization: Bearer {bearer_token}'
--header "Authorization: Bearer {bearer_token}"
~~~

Replace:
Expand All @@ -117,7 +117,7 @@ To [get details about a private endpoint trusted owner](https://www.cockroachlab
~~~ shell
curl --request GET \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/networking/private-endpoint-trusted-owners/{owner_id} \
--header 'Authorization: Bearer {bearer_token}'
--header "Authorization: Bearer {bearer_token}"
~~~

Replace:
Expand All @@ -134,7 +134,7 @@ To [remove a private endpoint trusted owner](https://www.cockroachlabs.com/docs/
~~~ shell
curl --request DELETE \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/networking/private-endpoint-trusted-owners/{owner_id} \
--header 'Authorization: {bearer_token}'
--header "Authorization: {bearer_token}"
~~~

Replace:
Expand Down
4 changes: 2 additions & 2 deletions src/current/cockroachcloud/client-certs-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ The [Cluster Admin]({% link cockroachcloud/authorization.md %}#cluster-admin) or
curl --request POST \
--url ${COCKROACH_SERVER}/api/v1/clusters/${CLUSTER_ID}/client-ca-cert \
--header "Authorization: Bearer ${API_KEY}" \
--header 'content-type: application/json' \
--header "content-type: application/json" \
--data "@cockroach_client_ca_cert.json"
~~~

Expand Down Expand Up @@ -263,7 +263,7 @@ The [Cluster Admin]({% link cockroachcloud/authorization.md %}#cluster-admin) or
curl --request PATCH \
--url ${COCKROACH_SERVER}/api/v1/clusters/${CLUSTER_ID}/client-ca-cert \
--header "Authorization: Bearer ${API_KEY}" \
--header 'content-type: application/json' \
--header "content-type: application/json" \
--data "@cockroach_client_ca_cert.json"
~~~

Expand Down
Loading
Loading