Guest User

Untitled

a guest
Jan 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. gcloud sql backups restore 1504554300110 --restore-instance=[MY-DB-INSTANCE]
  2.  
  3. ERROR: (gcloud.sql.backups.restore) HTTPError 503: Service temporarily unavailable.
  4.  
  5. gcloud sql backups restore [BACKUP_ID] --restore-instance=[INSTANCE_NAME]
  6.  
  7. gcloud sql backups restore [BACKUP_ID] --restore-instance=[TARGET_INSTANCE_NAME]
  8. --backup-instance=[SOURCE_INSTANCE_NAME]
  9.  
  10. gcloud sql backups list --instance [INSTANCE_NAME]
  11.  
  12. echo "Getting Access Token"
  13. ACCESS_TOKEN="$(gcloud auth print-access-token)"
  14.  
  15. echo "List available backups for the instance [INSTANCE_NAME] in [PROJECT_ID]"
  16. curl --header "Authorization: Bearer ${ACCESS_TOKEN}"
  17. -X GET
  18. https://www.googleapis.com/sql/v1beta4/projects/[PROJECT_ID]/instances/[INSTANCE_NAME]/backupRuns
  19.  
  20. echo "Restore backup [BACKUP_ID] in instance [INSTANCE_NAME] in [PROJECT_ID]"
  21. curl --header "Authorization: Bearer ${ACCESS_TOKEN}"
  22. --header 'Content-Type: application/json'
  23. --data '{ "restoreBackupContext": {"backupRunId": "[BACKUP_ID]"}}'
  24. -X POST
  25. https://www.googleapis.com/sql/v1beta4/projects/[PROJECT-ID]/instances/[INSTANCE_NAME]/restoreBackup
Add Comment
Please, Sign In to add comment