Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Instances

The Instances resource represents a Google Cloud SQL instance. Cloud SQL instances are MySQL databases hosted in Google's cloud. The Instances resource provides methods for common configuration and management tasks.

For a list of methods for this resource, see the end of this page.

Resource representations

A Cloud SQL instance resource.

{
  "kind": "sql#instance",
  "instance": string,
  "etag": etag,
  "project": string,
  "state": string,
  "databaseVersion": string,
  "region": string,
  "currentDiskSize": long,
  "maxDiskSize": long,
  "settings": {
    "kind": "sql#settings",
    "settingsVersion": long,
    "authorizedGaeApplications": [
      string
    ],
    "tier": string,
    "backupConfiguration": [
      {
        "kind": "sql#backupConfiguration",
        "startTime": string,
        "enabled": boolean,
        "id": string,
        "binaryLogEnabled": boolean
      }
    ],
    "pricingPlan": string,
    "replicationType": string,
    "activationPolicy": string,
    "ipConfiguration": {
      "enabled": boolean,
      "authorizedNetworks": [
        string
      ],
      "requireSsl": boolean
    },
    "locationPreference": {
      "kind": "sql#locationPreference",
      "followGaeApplication": string,
      "zone": string
    },
    "databaseFlags": [
      {
        "name": string,
        "value": string
      }
    ]
  },
  "serverCaCert": sslCerts Resource,
  "ipAddresses": [
    {
      "ipAddress": string,
      "timeToRetire": datetime
    }
  ]
}
Property name Value Description Notes
currentDiskSize long The current disk usage of the instance in bytes.
databaseVersion string The database engine type and version. Can be MYSQL_5_5 or MYSQL_5_6 . Defaults to MYSQL_5_5 . The databaseVersion cannot be changed after instance creation.
etag etag HTTP 1.1 Entity tag for the resource.
instance string Name of the Cloud SQL instance. This does not include the project ID.
ipAddresses[] list The assigned IP addresses for the instance.
ipAddresses[]. ipAddress string The IP address assigned.
ipAddresses[]. timeToRetire datetime The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z . This field is only available when the IP is scheduled to be retired.
kind string This is always sql#instance .
maxDiskSize long The maximum disk size of the instance in bytes.
project string The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.
region string The geographical region. Can be us-east1 , us-central , asia-east1 or europe-west1 . Defaults to us-central . The region can not be changed after instance creation. writable
serverCaCert nested object SSL configuration.
settings nested object The user settings.
settings. activationPolicy string The activation policy for this instance. This specifies when the instance should be activated and is applicable only when the instance state is RUNNABLE . This can be one of the following.
ALWAYS : The instance should always be active.
NEVER : The instance should never be activated.
ON_DEMAND : The instance is activated upon receiving requests.


writable
settings. authorizedGaeApplications[] list The App Engine app IDs that can access this instance. writable
settings. backupConfiguration[] list The daily backup configuration for the instance. writable
settings.backupConfiguration[]. binaryLogEnabled boolean Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well. writable
settings.backupConfiguration[]. enabled boolean Whether this configuration is enabled. writable
settings.backupConfiguration[]. id string Identifier for this configuration. This gets generated automatically when a backup configuration is created.
settings.backupConfiguration[]. kind string This is always sql#backupConfiguration .
settings.backupConfiguration[]. startTime string Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM . writable
settings. databaseFlags[] list The database flags passed to the instance at startup.
settings.databaseFlags[]. name string The name of the flag. These flags are passed at instance startup, so include both MySQL server options and MySQL system variables. Flags should be specified with underscores, not hyphens. Refer to the official MySQL documentation on server options and system variables for descriptions of what these flags do. Acceptable values are:
event_scheduler
on or off (Note: The event scheduler will only work reliably if the instance activationPolicy is set to ALWAYS.)
general_log
on or off
group_concat_max_len
4..17179869184
innodb_flush_log_at_trx_commit
0..2
innodb_lock_wait_timeout
1..1073741824
log_bin_trust_function_creators
on or off
log_output
Can be either TABLE or NONE , FILE is not supported.
log_queries_not_using_indexes
on or off
long_query_time
0..30000000
lower_case_table_names
0..2
max_allowed_packet
16384..1073741824
read_only
on or off
skip_show_database
on or off
slow_query_log
on or off . If set to on , you must also set the log_output flag to TABLE to receive logs.
wait_timeout
1..31536000
settings.databaseFlags[]. value string The value of the flag. Booleans should be set using 1 for true, and 0 for false. This field must be omitted if the flag doesn't take a value.
settings. ipConfiguration nested object The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. writable
settings.ipConfiguration. authorizedNetworks[] list The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation , also known as 'slash' notation (e.g. 192.168.100.0/24 ). writable
settings.ipConfiguration. enabled boolean Whether the instance should be assigned an IP address or not. writable
settings.ipConfiguration. requireSsl boolean Whether the mysqld should default to 'REQUIRE X509' for users connecting over IP. writable
settings. kind string This is always sql#settings .
settings. locationPreference nested object The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or GCE zone for better performance. writable
settings.locationPreference. followGaeApplication string The App Engine application to follow, it must be in the same region as the Cloud SQL instance. writable
settings.locationPreference. kind string This is always sql#locationPreference .
settings.locationPreference. zone string The preferred Compute Engine zone (e.g. us-centra1-a, us-central1-b, etc.). writable
settings. pricingPlan string The pricing plan for this instance. This can be either PER_USE or PACKAGE . writable
settings. replicationType string The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS . writable
settings. settingsVersion long The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value.
settings. tier string The tier of service for this instance, for example D1 , D2 . For more information, see pricing . writable
state string The current serving state of the Cloud SQL instance. This can be one of the following.
RUNNABLE : The instance is running, or is ready to run when accessed.
SUSPENDED : The instance is not available, for example due to problems with billing.
PENDING_CREATE : The instance is being created.
MAINTENANCE : The instance is down for maintenance.
UNKNOWN_STATE : The state of the instance is unknown.




Methods

Available methods for Instances resources are:

clone
Creates a Cloud SQL instance as a clone of a source instance.
delete
Deletes a Cloud SQL instance.
export
Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a MySQL dump file.
get
Retrieves information about a Cloud SQL instance.
import
Imports data into a Cloud SQL instance from a MySQL dump file stored in a Google Cloud Storage bucket.
insert
Creates a new Cloud SQL instance.
list
Lists instances for a given project, in alphabetical order by instance name.
patch
Updates the settings of a Cloud SQL instance. This method supports patch semantics.
resetSslConfig
Deletes all client certificates and generates a new server SSL certificate for a Cloud SQL instance.
restart
Restarts a Cloud SQL instance.
restoreBackup
Restores a backup of a Cloud SQL instance.
setRootPassword
Sets the password for the root user of the specified Cloud SQL instance.
update
Updates the settings of a Cloud SQL instance.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.