Last active
December 23, 2022 18:32
-
-
Save ianlintner/0b1eae81cf4bdaae206fac7476306dca to your computer and use it in GitHub Desktop.
Google Cloud Sql Cross Project Restore Database with Curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TOKEN=$(gcloud auth application-default print-access-token) | |
curl -H "Authorization: Bearer $TOKEN" \ | |
-H "Content-Type: application/json; charset=utf-8" \ | |
-X GET \ | |
https://sqladmin.googleapis.com/sql/v1beta4/projects/example-project-1/instances/source-db/backupRuns | |
curl -H "Authorization: Bearer $TOKEN" \ | |
-H "Content-Type: application/json; charset=utf-8" \ | |
-X POST \ | |
https://sqladmin.googleapis.com/sql/v1beta4/projects/example-project-2/instances/target-db/restoreBackup \ | |
-d \ | |
' | |
{ | |
"restoreBackupContext": | |
{ | |
"backupRunId": "12345", | |
"project": "example-project-1", | |
"instanceId": "source-db" | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment