Using Console
Using CLI
INSTANCE_NAME
with the name of the instance that you want to remediate.
INSTANCE_NAME
with the name of the instance that you remediated.
If the output shows storageAutoResize: true
, then the remediation was successful.
Using Python
google-cloud-sql
library using pip:credentials
object using the JSON key file:sql_v1beta4.CloudSqlClient
object using the credentials
object:list()
method of the client.instances()
object:my-project-id
with your GCP project ID and us-central1-a
with the location of your SQL instances.
6. Loop through the list of instances and check if the settings.storageAutoResize
property is set to True
. If not, enable it using the patch()
method of the client.instances()
object:my-project-id
with your GCP project ID.This code will enable storage auto resize for all SQL instances in the specified project and location that do not already have it enabled.