Creates a new Cloud SQL instance.
Scopes
You will need authorization for at least one of the following scopes to make a valid call:
- https://www.googleapis.com/auth/cloud-platform
- https://www.googleapis.com/auth/sqlservice.admin
If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-platform.
You can set the scope for this method like this: sql1-beta4 --scope <scope> instances insert ...
Required Scalar Argument
- <project> (string)
- Project ID of the project to which the newly created Cloud SQL instances should belong.
Required Request Value
The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.
For example, a structure like this:
DatabaseInstance:
backend-type: string
connection-name: string
current-disk-size: string
database-version: string
disk-encryption-configuration:
kind: string
kms-key-name: string
disk-encryption-status:
kind: string
kms-key-version-name: string
etag: string
failover-replica:
available: boolean
name: string
gce-zone: string
instance-type: string
ipv6-address: string
kind: string
master-instance-name: string
max-disk-size: string
name: string
on-premises-configuration:
ca-certificate: string
client-certificate: string
client-key: string
dump-file-path: string
host-port: string
kind: string
password: string
username: string
project: string
region: string
replica-configuration:
failover-target: boolean
kind: string
mysql-replica-configuration:
ca-certificate: string
client-certificate: string
client-key: string
connect-retry-interval: integer
dump-file-path: string
kind: string
master-heartbeat-period: string
password: string
ssl-cipher: string
username: string
verify-server-certificate: boolean
replica-names: [string]
root-password: string
scheduled-maintenance:
can-defer: boolean
can-reschedule: boolean
start-time: string
self-link: string
server-ca-cert:
cert: string
cert-serial-number: string
common-name: string
create-time: string
expiration-time: string
instance: string
kind: string
self-link: string
sha1-fingerprint: string
service-account-email-address: string
settings:
activation-policy: string
authorized-gae-applications: [string]
availability-type: string
backup-configuration:
binary-log-enabled: boolean
enabled: boolean
kind: string
location: string
point-in-time-recovery-enabled: boolean
replication-log-archiving-enabled: boolean
start-time: string
crash-safe-replication-enabled: boolean
data-disk-size-gb: string
data-disk-type: string
database-replication-enabled: boolean
ip-configuration:
ipv4-enabled: boolean
private-network: string
require-ssl: boolean
kind: string
location-preference:
follow-gae-application: string
kind: string
zone: string
maintenance-window:
day: integer
hour: integer
kind: string
update-track: string
pricing-plan: string
replication-type: string
settings-version: string
storage-auto-resize: boolean
storage-auto-resize-limit: string
tier: string
user-labels: { string: string }
state: string
suspension-reason: [string]
can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.
-r . backend-type=accusam
- <code>FIRST_GEN</code>: First Generation instance. MySQL only. <br /><code>SECOND_GEN</code>: Second Generation instance or PostgreSQL instance. <br /><code>EXTERNAL</code>: A database server that is not managed by Google. <br>This property is read-only; use the <code>tier</code> property in the <code>settings</code> object to determine the database type and Second or First Generation.
connection-name=voluptua.
- Connection name of the Cloud SQL instance used in connection strings.
current-disk-size=dolore
- The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see <a href="https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ">this announcement</a> for details.
database-version=dolore
- The database engine type and version. The <code>databaseVersion</code> field can not be changed after instance creation. MySQL Second Generation instances: <code>MYSQL_5_7</code> (default) or <code>MYSQL_5_6</code>. PostgreSQL instances: <code>POSTGRES_9_6</code> (default) or <code>POSTGRES_11 Beta</code> MySQL First Generation instances: <code>MYSQL_5_6</code> (default) or <code>MYSQL_5_5</code>
disk-encryption-configuration kind=dolore
- This is always <code>sql#diskEncryptionConfiguration</code>.
-
kms-key-name=voluptua.
- Resource name of KMS key for disk encryption
-
..disk-encryption-status kind=amet.
- This is always <code>sql#diskEncryptionStatus</code>.
-
kms-key-version-name=ea
- KMS key version used to encrypt the Cloud SQL instance resource
-
.. etag=sadipscing
- This field is deprecated and will be removed from a future version of the API. Use the <code>settings.settingsVersion</code> field instead.
failover-replica available=true
- The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the failover replica when the status is true.
-
name=no
- The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances.
-
.. gce-zone=est
- The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone.
instance-type=at
- The instance type. This can be one of the following. <br><code>CLOUD_SQL_INSTANCE</code>: A Cloud SQL instance that is not replicating from a master. <br><code>ON_PREMISES_INSTANCE</code>: An instance running on the customer's premises. <br><code>READ_REPLICA_INSTANCE</code>: A Cloud SQL instance configured as a read-replica.
ipv6-address=sed
- The IPv6 address assigned to the instance. This property is applicable only to First Generation instances.
kind=sit
- This is always <code>sql#instance</code>.
master-instance-name=et
- The name of the instance which will act as master in the replication setup.
max-disk-size=tempor
- The maximum disk size of the instance in bytes.
name=aliquyam
- Name of the Cloud SQL instance. This does not include the project ID.
on-premises-configuration ca-certificate=ipsum
- PEM representation of the trusted CA's x509 certificate.
client-certificate=et
- PEM representation of the slave's x509 certificate.
client-key=sanctus
- PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate.
dump-file-path=lorem
- The dump file to create the Cloud SQL replica.
host-port=est
- The host and port of the on-premises instance in host:port format
kind=sed
- This is always <code>sql#onPremisesConfiguration</code>.
password=diam
- The password for connecting to on-premises instance.
-
username=dolores
- The username for connecting to on-premises instance.
-
.. project=dolores
- The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.
region=et
- The geographical region. Can be <code>us-central</code> (<code>FIRST_GEN</code> instances only), <code>us-central1</code> (<code>SECOND_GEN</code> instances only), <code>asia-east1</code> or <code>europe-west1</code>. Defaults to <code>us-central</code> or <code>us-central1</code> depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation.
replica-configuration failover-target=false
- Specifies if the replica is the failover target. If the field is set to <code>true</code> the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance. <p>Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance.
kind=no
- This is always <code>sql#replicaConfiguration</code>.
mysql-replica-configuration ca-certificate=et
- PEM representation of the trusted CA's x509 certificate.
client-certificate=elitr
- PEM representation of the slave's x509 certificate.
client-key=sed
- PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate.
connect-retry-interval=40
- Seconds to wait between connect retries. MySQL's default is 60 seconds.
dump-file-path=nonumy
- Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs: //bucketName/fileName. Compressed gzip files (.gz) are also supported. // Dumps should have the binlog co-ordinates from which replication should // begin. This can be accomplished by setting --master-data to 1 when using // mysqldump.
kind=at
- This is always <code>sql#mysqlReplicaConfiguration</code>.
master-heartbeat-period=sadipscing
- Interval in milliseconds between replication heartbeats.
password=aliquyam
- The password for the replication connection.
ssl-cipher=dolores
- A list of permissible ciphers to use for SSL encryption.
username=sadipscing
- The username for the replication connection.
-
verify-server-certificate=false
- Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake.
-
... replica-names=amet
- The replicas of the instance.
- Each invocation of this argument appends the given value to the array.
root-password=est
- Initial root password. Use only on creation.
scheduled-maintenance can-defer=false
- No description provided.
can-reschedule=true
- If the scheduled maintenance can be rescheduled.
-
start-time=stet
- The start time of any upcoming scheduled maintenance for this instance.
-
.. self-link=est
- The URI of this resource.
server-ca-cert cert=aliquyam
- PEM representation.
cert-serial-number=elitr
- Serial number, as extracted from the certificate.
common-name=duo
- User supplied name. Constrained to [a-zA-Z.-_ ]+.
create-time=diam
- The time when the certificate was created in <a href="https://tools.ietf.org/html/rfc3339">RFC 3339</a> format, for example <code>2012-11-15T16:19:00.094Z</code>
expiration-time=est
- The time when the certificate expires in <a href="https://tools.ietf.org/html/rfc3339">RFC 3339</a> format, for example <code>2012-11-15T16:19:00.094Z</code>.
instance=sit
- Name of the database instance.
kind=sed
- This is always <code>sql#sslCert</code>.
self-link=eos
- The URI of this resource.
-
sha1-fingerprint=lorem
- Sha1 Fingerprint.
-
.. service-account-email-address=ea
- The service account email address assigned to the instance. This property is applicable only to Second Generation instances.
settings activation-policy=stet
- The activation policy specifies when the instance is activated; it is applicable only when the instance state is <code>RUNNABLE</code>. Valid values: <br><code>ALWAYS</code>: The instance is on, and remains so even in the absence of connection requests. <br><code>NEVER</code>: The instance is off; it is not activated, even if a connection request arrives. <br><code>ON_DEMAND</code>: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with <code>PER_USE</code> pricing turn off after 15 minutes of inactivity. Instances with <code>PER_PACKAGE</code> pricing turn off after 12 hours of inactivity.
authorized-gae-applications=dolores
- The App Engine app IDs that can access this instance. First Generation instances only.
- Each invocation of this argument appends the given value to the array.
availability-type=eos
- Availability type (PostgreSQL and MySQL instances only). Potential values: <br><code>ZONAL</code>: The instance serves data from only one zone. Outages in that zone affect data accessibility. <br><code>REGIONAL</code>: The instance can serve data from more than one zone in a region (it is highly available). <br>For more information, see <a href="https://cloud.google.com/sql/docs/postgres/high-availability">Overview of the High Availability Configuration</a>.
backup-configuration binary-log-enabled=true
- (MySQL only) Whether binary log is enabled. If backup configuration is disabled, binarylog must be disabled as well.
enabled=false
- Whether this configuration is enabled.
kind=at
- This is always <code>sql#backupConfiguration</code>.
location=dolore
- Location of the backup
point-in-time-recovery-enabled=true
- Reserved for future use.
replication-log-archiving-enabled=true
- Reserved for future use.
-
start-time=accusam
- Start time for the daily backup configuration in UTC timezone in the 24 hour format - <code>HH:MM</code>.
-
.. crash-safe-replication-enabled=true
- Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances.
data-disk-size-gb=erat
- The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances.
data-disk-type=dolores
- The type of data disk: <code>PD_SSD</code> (default) or <code>PD_HDD</code>. Not used for First Generation instances.
database-replication-enabled=false
- Configuration specific to read replica instances. Indicates whether replication is enabled or not.
ip-configuration ipv4-enabled=false
- Whether the instance should be assigned an IP address or not.
private-network=sea
- The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, <code>/projects/myProject/global/networks/default</code>. This setting can be updated, but it cannot be removed after it is set.
-
require-ssl=true
- Whether SSL connections over IP should be enforced or not.
-
.. kind=lorem
- This is always <code>sql#settings</code>.
location-preference follow-gae-application=et
- The AppEngine application to follow, it must be in the same region as the Cloud SQL instance.
kind=at
- This is always <code>sql#locationPreference</code>.
-
zone=dolor
- The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.).
-
..maintenance-window day=79
- day of week (1-7), starting on Monday.
hour=53
- hour of day - 0 to 23.
kind=erat
- This is always <code>sql#maintenanceWindow</code>.
-
update-track=sea
- Maintenance timing setting: <code>canary</code> (Earlier) or <code>stable</code> (Later). <br /><a href="/sql/docs/db_path/instance-settings#maintenance-timing-2ndgen"> Learn more</a>.
-
.. pricing-plan=nonumy
- The pricing plan for this instance. This can be either <code>PER_USE</code> or <code>PACKAGE</code>. Only <code>PER_USE</code> is supported for Second Generation instances.
replication-type=et
- The type of replication this instance uses. This can be either <code>ASYNCHRONOUS</code> or <code>SYNCHRONOUS</code>. This property is only applicable to First Generation instances.
settings-version=gubergren
- 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.
storage-auto-resize=true
- Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances.
storage-auto-resize-limit=consetetur
- The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances.
tier=sit
- The tier (or machine type) for this instance, for example <code>db-n1-standard-1</code> (MySQL instances) or <code>db-custom-1-3840</code> (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see <a href="/sql/docs/db_path/instance-settings">Instance Settings</a>.
-
user-labels=key=aliquyam
- User-provided labels, represented as a dictionary where each label is a single key value pair.
- the value will be associated with the given
key
-
.. state=eos
- The current serving state of the Cloud SQL instance. This can be one of the following. <br><code>RUNNABLE</code>: The instance is running, or is ready to run when accessed. <br><code>SUSPENDED</code>: The instance is not available, for example due to problems with billing. <br><code>PENDING_CREATE</code>: The instance is being created. <br><code>MAINTENANCE</code>: The instance is down for maintenance. <br><code>FAILED</code>: The instance creation failed. <br><code>UNKNOWN_STATE</code>: The state of the instance is unknown.
suspension-reason=at
- If the instance state is SUSPENDED, the reason for the suspension.
- Each invocation of this argument appends the given value to the array.
About Cursors
The cursor position is key to comfortably set complex nested structures. The following rules apply:
- The cursor position is always set relative to the current one, unless the field name starts with the
.
character. Fields can be nested such as in-r f.s.o
. - The cursor position is set relative to the top-level structure if it starts with
.
, e.g.-r .s.s
- You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify
-r struct.sub_struct=bar
. - You can move the cursor one level up by using
..
. Each additional.
moves it up one additional level. E.g....
would go three levels up.
Optional Output Flags
The method's return value a JSON encoded structure, which will be written to standard output by default.
- -o out
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
-
to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
Optional General Properties
The following properties can configure any call, and are not specific to this method.
-
-p $-xgafv=string
- V1 error format.
-
-p access-token=string
- OAuth access token.
-
-p alt=string
- Data format for response.
-
-p callback=string
- JSONP
-
-p fields=string
- Selector specifying which fields to include in a partial response.
-
-p key=string
- API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
-
-p oauth-token=string
- OAuth 2.0 token for the current user.
-
-p pretty-print=boolean
- Returns response with indentations and line breaks.
-
-p quota-user=string
- Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
-
-p upload-type=string
- Legacy upload protocol for media (e.g. "media", "multipart").
-
-p upload-protocol=string
- Upload protocol for media (e.g. "raw", "multipart").