Reference documentation and code samples for the Google Cloud Sql Admin V1 Client class DatabaseInstance.
A Cloud SQL instance resource.
Generated from protobuf message google.cloud.sql.v1.DatabaseInstance
Namespace
Google \ Cloud \ Sql \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ kind
string
This is always sql#instance.
↳ state
int
The current serving state of the Cloud SQL instance. This can be one of the following: * SQL_INSTANCE_STATE_UNSPECIFIED: The state of the instance is unknown. * RUNNABLE: The instance is running, or has been stopped by owner. * SUSPENDED: The instance is not available, for example due to problems with billing. * PENDING_DELETE: The instance is being deleted. * PENDING_CREATE: The instance is being created. * MAINTENANCE: The instance is down for maintenance. * FAILED: The instance creation failed.
↳ database_version
int
The database engine type and version. The databaseVersionfield cannot be changed after instance creation. * MySQL instances: MYSQL_8_0, MYSQL_5_7 (default), or MYSQL_5_6. * PostgreSQL instances: POSTGRES_9_6, POSTGRES_10, POSTGRES_11, POSTGRES_12, POSTGRES_13 (default). * SQL Server instances: SQLSERVER_2019_STANDARD, SQLSERVER_2019_ENTERPRISE, SQLSERVER_2019_EXPRESS, or SQLSERVER_2019_WEB, SQLSERVER_2017_STANDARD (default), SQLSERVER_2017_ENTERPRISE, SQLSERVER_2017_EXPRESS, or SQLSERVER_2017_WEB.
↳ settings
↳ etag
string
This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersionfield instead.
↳ failover_replica
Google\Cloud\Sql\V1\DatabaseInstance\SqlFailoverReplica
The name and status of the failover replica.
↳ master_instance_name
string
The name of the instance which will act as primary in the replication setup.
↳ replica_names
array
The replicas of the instance.
↳ max_disk_size
↳ current_disk_size
Google\Protobuf\Int64Value
The current disk usage of the instance in bytes. This property has been deprecated. Use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details.
↳ ip_addresses
↳ server_ca_cert
↳ instance_type
int
The instance type. This can be one of the following: * CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a primary instance. * ON_PREMISES_INSTANCE: An instance running on the customer's premises. * READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica.
↳ project
string
The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.
↳ ipv6_address
string
The IPv6 address assigned to the instance. (Deprecated) This property was applicable only to First Generation instances.
↳ service_account_email_address
string
The service account email address assigned to the instance.This property is read-only.
↳ on_premises_configuration
↳ replica_configuration
Google\Cloud\Sql\V1\ReplicaConfiguration
Configuration specific to failover replicas and read replicas.
↳ backend_type
int
The backend type. SECOND_GEN: Cloud SQL database instance. EXTERNAL: A database server that is not managed by Google. This property is read-only; use the tierproperty in the settingsobject to determine the database type.
↳ self_link
string
The URI of this resource.
↳ suspension_reason
array
If the instance state is SUSPENDED, the reason for the suspension.
↳ connection_name
string
Connection name of the Cloud SQL instance used in connection strings.
↳ name
string
Name of the Cloud SQL instance. This does not include the project ID.
↳ region
string
The geographical region. Can be: * us-central( FIRST_GENinstances only) * us-central1( SECOND_GENinstances only) * asia-east1or europe-west1. Defaults to us-centralor us-central1depending on the instance type. The region cannot be changed after instance creation.
↳ gce_zone
string
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.
↳ secondary_gce_zone
string
The Compute Engine zone that the failover instance is currently serving from for a regional instance. 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/failover zone. Reserved for future use.
↳ disk_encryption_configuration
Google\Cloud\Sql\V1\DiskEncryptionConfiguration
Disk encryption configuration specific to an instance.
↳ disk_encryption_status
↳ root_password
string
Initial root password. Use only on creation.
↳ scheduled_maintenance
Google\Cloud\Sql\V1\DatabaseInstance\SqlScheduledMaintenance
The start time of any upcoming scheduled maintenance for this instance.
↳ satisfies_pzs
↳ out_of_disk_report
Google\Cloud\Sql\V1\DatabaseInstance\SqlOutOfDiskReport
This field represents the report generated by the proactive database wellness job for OutOfDisk issues. * Writers: * the proactive database wellness job for OOD. * Readers: * the proactive database wellness job
↳ create_time
Google\Protobuf\Timestamp
Output only. The time when the instance was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
getKind
This is always sql#instance.
string
setKind
This is always sql#instance.
var
string
$this
getState
The current serving state of the Cloud SQL instance. This can be one of the following:
-
SQL_INSTANCE_STATE_UNSPECIFIED: The state of the instance is unknown.
-
RUNNABLE: The instance is running, or has been stopped by owner.
- SUSPENDED: The instance is not available, for example due to problems with billing.
- PENDING_DELETE: The instance is being deleted.
- PENDING_CREATE: The instance is being created.
- MAINTENANCE: The instance is down for maintenance.
- FAILED: The instance creation failed.
int
setState
The current serving state of the Cloud SQL instance. This can be one of the following:
-
SQL_INSTANCE_STATE_UNSPECIFIED: The state of the instance is unknown.
-
RUNNABLE: The instance is running, or has been stopped by owner.
- SUSPENDED: The instance is not available, for example due to problems with billing.
- PENDING_DELETE: The instance is being deleted.
- PENDING_CREATE: The instance is being created.
- MAINTENANCE: The instance is down for maintenance.
- FAILED: The instance creation failed.
var
int
$this
getDatabaseVersion
The database engine type and version. The databaseVersionfield cannot be changed after instance creation.
- MySQL instances: MYSQL_8_0, MYSQL_5_7 (default), or MYSQL_5_6.
- PostgreSQL instances: POSTGRES_9_6, POSTGRES_10, POSTGRES_11, POSTGRES_12, POSTGRES_13 (default).
- SQL Server instances: SQLSERVER_2019_STANDARD, SQLSERVER_2019_ENTERPRISE, SQLSERVER_2019_EXPRESS, or SQLSERVER_2019_WEB, SQLSERVER_2017_STANDARD (default), SQLSERVER_2017_ENTERPRISE, SQLSERVER_2017_EXPRESS, or SQLSERVER_2017_WEB.
int
setDatabaseVersion
The database engine type and version. The databaseVersionfield cannot be changed after instance creation.
- MySQL instances: MYSQL_8_0, MYSQL_5_7 (default), or MYSQL_5_6.
- PostgreSQL instances: POSTGRES_9_6, POSTGRES_10, POSTGRES_11, POSTGRES_12, POSTGRES_13 (default).
- SQL Server instances: SQLSERVER_2019_STANDARD, SQLSERVER_2019_ENTERPRISE, SQLSERVER_2019_EXPRESS, or SQLSERVER_2019_WEB, SQLSERVER_2017_STANDARD (default), SQLSERVER_2017_ENTERPRISE, SQLSERVER_2017_EXPRESS, or SQLSERVER_2017_WEB.
var
int
$this
getSettings
The user settings.
hasSettings
clearSettings
setSettings
The user settings.
$this
getEtag
This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersionfield instead.
string
setEtag
This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersionfield instead.
var
string
$this
getFailoverReplica
The name and status of the failover replica.
hasFailoverReplica
clearFailoverReplica
setFailoverReplica
The name and status of the failover replica.
$this
getMasterInstanceName
The name of the instance which will act as primary in the replication setup.
string
setMasterInstanceName
The name of the instance which will act as primary in the replication setup.
var
string
$this
getReplicaNames
The replicas of the instance.
setReplicaNames
The replicas of the instance.
var
string[]
$this
getMaxDiskSize
The maximum disk size of the instance in bytes.
hasMaxDiskSize
clearMaxDiskSize
getMaxDiskSizeValue
Returns the unboxed value from getMaxDiskSize()
The maximum disk size of the instance in bytes.
int|string|null
setMaxDiskSize
The maximum disk size of the instance in bytes.
$this
setMaxDiskSizeValue
Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object.
The maximum disk size of the instance in bytes.
var
int|string|null
$this
getCurrentDiskSize
The current disk usage of the instance in bytes. This property has been deprecated. Use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details.
hasCurrentDiskSize
clearCurrentDiskSize
getCurrentDiskSizeValue
Returns the unboxed value from getCurrentDiskSize()
The current disk usage of the instance in bytes. This property has been deprecated. Use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details.
int|string|null
setCurrentDiskSize
The current disk usage of the instance in bytes. This property has been deprecated. Use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details.
$this
setCurrentDiskSizeValue
Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object.
The current disk usage of the instance in bytes. This property has been deprecated. Use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details.
var
int|string|null
$this
getIpAddresses
The assigned IP addresses for the instance.
setIpAddresses
The assigned IP addresses for the instance.
$this
getServerCaCert
SSL configuration.
hasServerCaCert
clearServerCaCert
setServerCaCert
SSL configuration.
$this
getInstanceType
The instance type. This can be one of the following:
-
CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a primary instance.
-
ON_PREMISES_INSTANCE: An instance running on the customer's premises.
- READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica.
int
setInstanceType
The instance type. This can be one of the following:
-
CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a primary instance.
-
ON_PREMISES_INSTANCE: An instance running on the customer's premises.
- READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica.
var
int
$this
getProject
The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.
string
setProject
The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.
var
string
$this
getIpv6Address
The IPv6 address assigned to the instance.
(Deprecated) This property was applicable only to First Generation instances.
string
setIpv6Address
The IPv6 address assigned to the instance.
(Deprecated) This property was applicable only to First Generation instances.
var
string
$this
getServiceAccountEmailAddress
The service account email address assigned to the instance.This property is read-only.
string
setServiceAccountEmailAddress
The service account email address assigned to the instance.This property is read-only.
var
string
$this
getOnPremisesConfiguration
Configuration specific to on-premises instances.
hasOnPremisesConfiguration
clearOnPremisesConfiguration
setOnPremisesConfiguration
Configuration specific to on-premises instances.
$this
getReplicaConfiguration
Configuration specific to failover replicas and read replicas.
hasReplicaConfiguration
clearReplicaConfiguration
setReplicaConfiguration
Configuration specific to failover replicas and read replicas.
$this
getBackendType
The backend type.
SECOND_GEN: Cloud SQL database instance. EXTERNAL: A database server that is not managed by Google. This property is read-only; use the tierproperty in the settingsobject to determine the database type.
int
setBackendType
The backend type.
SECOND_GEN: Cloud SQL database instance. EXTERNAL: A database server that is not managed by Google. This property is read-only; use the tierproperty in the settingsobject to determine the database type.
var
int
$this
getSelfLink
The URI of this resource.
string
setSelfLink
The URI of this resource.
var
string
$this
getSuspensionReason
If the instance state is SUSPENDED, the reason for the suspension.
setSuspensionReason
If the instance state is SUSPENDED, the reason for the suspension.
var
int[]
$this
getConnectionName
Connection name of the Cloud SQL instance used in connection strings.
string
setConnectionName
Connection name of the Cloud SQL instance used in connection strings.
var
string
$this
getName
Name of the Cloud SQL instance. This does not include the project ID.
string
setName
Name of the Cloud SQL instance. This does not include the project ID.
var
string
$this
getRegion
The geographical region. Can be:
- us-central( FIRST_GENinstances only)
- us-central1( SECOND_GENinstances only)
- asia-east1or europe-west1.
Defaults to us-centralor us-central1depending on the instance type. The region cannot be changed after instance creation.
string
setRegion
The geographical region. Can be:
- us-central( FIRST_GENinstances only)
- us-central1( SECOND_GENinstances only)
- asia-east1or europe-west1.
Defaults to us-centralor us-central1depending on the instance type. The region cannot be changed after instance creation.
var
string
$this
getGceZone
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.
string
setGceZone
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.
var
string
$this
getSecondaryGceZone
The Compute Engine zone that the failover instance is currently serving from for a regional instance. 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/failover zone.
Reserved for future use.
string
setSecondaryGceZone
The Compute Engine zone that the failover instance is currently serving from for a regional instance. 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/failover zone.
Reserved for future use.
var
string
$this
getDiskEncryptionConfiguration
Disk encryption configuration specific to an instance.
hasDiskEncryptionConfiguration
clearDiskEncryptionConfiguration
setDiskEncryptionConfiguration
Disk encryption configuration specific to an instance.
$this
getDiskEncryptionStatus
Disk encryption status specific to an instance.
hasDiskEncryptionStatus
clearDiskEncryptionStatus
setDiskEncryptionStatus
Disk encryption status specific to an instance.
$this
getRootPassword
Initial root password. Use only on creation.
string
setRootPassword
Initial root password. Use only on creation.
var
string
$this
getScheduledMaintenance
The start time of any upcoming scheduled maintenance for this instance.
hasScheduledMaintenance
clearScheduledMaintenance
setScheduledMaintenance
The start time of any upcoming scheduled maintenance for this instance.
$this
getSatisfiesPzs
The status indicating if instance satisfiesPzs.
Reserved for future use.
hasSatisfiesPzs
clearSatisfiesPzs
getSatisfiesPzsValue
Returns the unboxed value from getSatisfiesPzs()
The status indicating if instance satisfiesPzs. Reserved for future use.
bool|null
setSatisfiesPzs
The status indicating if instance satisfiesPzs.
Reserved for future use.
$this
setSatisfiesPzsValue
Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object.
The status indicating if instance satisfiesPzs. Reserved for future use.
var
bool|null
$this
getOutOfDiskReport
This field represents the report generated by the proactive database wellness job for OutOfDisk issues.
- Writers:
- the proactive database wellness job for OOD.
- Readers:
- the proactive database wellness job
hasOutOfDiskReport
clearOutOfDiskReport
setOutOfDiskReport
This field represents the report generated by the proactive database wellness job for OutOfDisk issues.
- Writers:
- the proactive database wellness job for OOD.
- Readers:
- the proactive database wellness job
$this
getCreateTime
Output only. The time when the instance was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
hasCreateTime
clearCreateTime
setCreateTime
Output only. The time when the instance was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
$this