Tuesday, January 19, 2016

[google-cloud-sql-discuss] Testing Cloud SQL Failover

I've been trying to test SQL failover using the following command:

curl --header 'Content-Type: application/json' --header 'Authorization: Bearer OATH_ACCESS_TOKEN_HERE' -X POST "https://www.googleapis.com/sql/v1beta4/projects/numeric-datum-118114/instances/asia-east1:db-master/failover" --data "{}"

I started with the command here:
but it seems to be a bit off the mark. Eventually I ended up with the curl command above but I keep getting the following response:

{
 
"error": {
 
"errors": [
   
{
   
"domain": "global",
   
"reason": "authError",
   
"message": "Invalid Credentials",
   
"locationType": "header",
   
"location": "Authorization"
   
}
 
],
 
"code": 401,
 
"message": "Invalid Credentials"
 
}
}

The actual access token I'm using in the curl command is the one returned by:
gcloud auth login

I'm assuming this is the wrong thing to do? 
How do I acquire an access token that allows me to make this call?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/5ed3f23d-b82a-481f-8885-7b986bce0966%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment