1

I'm not able to find a way to simply start and stop a Cloud SQL instance using java mysql admin-api.

I found this official google documentation that explain how to start and stop the Cloud SQL instance via gcloud: https://cloud.google.com/sql/docs/mysql/start-stop-restart-instance But I'm not able to obtain the same things via java using mysql admin-api,

Anybody can help me?

1

To add visibility posting Yandrak3's answer on Stackoverflow which suggests changing the activation policy of the instance.

"I have tried running the API with the NEVER and ALWAYS states, and my Cloud SQL instance stopped and started accordingly. So in your case, and going back to the Admin API for Java, you should be looking at the Settings of your instance, specifically at this method:

public Settings setActivationPolicy(java.lang.String activationPolicy)

Changing the Activation Policy to NEVER or ALWAYS should be what you need here, although you can have a look at the other possible instance states in case they fit your requirements better."

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.