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.
↳ database_version
int
The database engine type and version. The databaseVersion
field cannot be changed after instance creation.
↳ settings
↳ etag
string
This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion
field instead.
↳ 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.
↳ 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
↳ 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 tier
property in the settings
object 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 of the Cloud SQL instance. It can be one of the regions
where Cloud SQL operates: For example, asia-east1
, europe-west1
, and us-central1
. The default value is us-central1
.
↳ 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. WARNING: Changing this might restart the instance.
↳ 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.
↳ disk_encryption_configuration
↳ disk_encryption_status
↳ root_password
string
Initial root password. Use only on creation. You must set root passwords before you can connect to PostgreSQL instances.
↳ scheduled_maintenance
DatabaseInstance\SqlScheduledMaintenance
The start time of any upcoming scheduled maintenance for this instance.
↳ satisfies_pzs
Google\Protobuf\BoolValue
This status indicates whether the instance satisfies PZS. The status is reserved for future use.
↳ database_installed_version
string
Output only. Stores the current database version running on the instance including minor version such as MYSQL_8_0_18
.
↳ out_of_disk_report
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
.
↳ available_maintenance_versions
array
Output only. List all maintenance versions applicable on the instance
↳ maintenance_version
string
The current software version on the instance.
↳ upgradable_database_versions
array< AvailableDatabaseVersion
>
Output only. All database versions that are available for upgrade.
↳ sql_network_architecture
int
↳ psc_service_attachment_link
string
Output only. The link to service attachment of PSC instance.
↳ dns_name
string
Output only. The dns name of the instance.
↳ primary_dns_name
string
Output only. DEPRECATED: please use write_endpoint instead.
↳ write_endpoint
string
Output only. The dns name of the primary instance in a replication group.
↳ replication_cluster
ReplicationCluster
Optional. A primary instance and disaster recovery (DR) replica pair. A DR replica is a cross-region replica that you designate for failover in the event that the primary instance experiences regional failure. Only applicable to MySQL.
↳ gemini_config
↳ satisfies_pzi
Google\Protobuf\BoolValue
Output only. This status indicates whether the instance satisfies PZI. The status is reserved for future use.
↳ switch_transaction_logs_to_cloud_storage_enabled
Google\Protobuf\BoolValue
Input only. Whether Cloud SQL is enabled to switch storing point-in-time recovery log files from a data disk to Cloud Storage.
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.
int
setState
The current serving state of the Cloud SQL instance.
var
int
$this
getDatabaseVersion
The database engine type and version. The databaseVersion
field cannot
be changed after instance creation.
int
setDatabaseVersion
The database engine type and version. The databaseVersion
field cannot
be changed after instance creation.
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.settingsVersion
field instead.
string
setEtag
This field is deprecated and will be removed from a future version of the
API. Use the settings.settingsVersion
field 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
getMaxDiskSizeUnwrapped
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
setMaxDiskSizeUnwrapped
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
getCurrentDiskSizeUnwrapped
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
setCurrentDiskSizeUnwrapped
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.
int
setInstanceType
The instance type.
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 tier
property in the settings
object 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 tier
property in the settings
object 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 of the Cloud SQL instance.
It can be one of the regions
where Cloud SQL operates:
For example, asia-east1
, europe-west1
, and us-central1
.
The default value is us-central1
.
string
setRegion
The geographical region of the Cloud SQL instance.
It can be one of the regions
where Cloud SQL operates:
For example, asia-east1
, europe-west1
, and us-central1
.
The default value is us-central1
.
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. WARNING: Changing this might restart the instance.
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. WARNING: Changing this might restart the instance.
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.
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.
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. You must set root passwords before you can connect to PostgreSQL instances.
string
setRootPassword
Initial root password. Use only on creation. You must set root passwords before you can connect to PostgreSQL instances.
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
This status indicates whether the instance satisfies PZS.
The status is reserved for future use.
hasSatisfiesPzs
clearSatisfiesPzs
getSatisfiesPzsUnwrapped
Returns the unboxed value from getSatisfiesPzs()
This status indicates whether the instance satisfies PZS. The status is reserved for future use.
bool|null
setSatisfiesPzs
This status indicates whether the instance satisfies PZS.
The status is reserved for future use.
$this
setSatisfiesPzsUnwrapped
Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object.
This status indicates whether the instance satisfies PZS. The status is reserved for future use.
var
bool|null
$this
getDatabaseInstalledVersion
Output only. Stores the current database version running on the instance
including minor version such as MYSQL_8_0_18
.
string
setDatabaseInstalledVersion
Output only. Stores the current database version running on the instance
including minor version such as MYSQL_8_0_18
.
var
string
$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
getAvailableMaintenanceVersions
Output only. List all maintenance versions applicable on the instance
setAvailableMaintenanceVersions
Output only. List all maintenance versions applicable on the instance
var
string[]
$this
getMaintenanceVersion
The current software version on the instance.
string
setMaintenanceVersion
The current software version on the instance.
var
string
$this
getUpgradableDatabaseVersions
Output only. All database versions that are available for upgrade.
setUpgradableDatabaseVersions
Output only. All database versions that are available for upgrade.
$this
getSqlNetworkArchitecture
Generated from protobuf field optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47;
int
hasSqlNetworkArchitecture
clearSqlNetworkArchitecture
setSqlNetworkArchitecture
Generated from protobuf field optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47;
var
int
$this
getPscServiceAttachmentLink
Output only. The link to service attachment of PSC instance.
string
hasPscServiceAttachmentLink
clearPscServiceAttachmentLink
setPscServiceAttachmentLink
Output only. The link to service attachment of PSC instance.
var
string
$this
getDnsName
Output only. The dns name of the instance.
string
hasDnsName
clearDnsName
setDnsName
Output only. The dns name of the instance.
var
string
$this
getPrimaryDnsName
Output only. DEPRECATED: please use write_endpoint instead.
string
hasPrimaryDnsName
clearPrimaryDnsName
setPrimaryDnsName
Output only. DEPRECATED: please use write_endpoint instead.
var
string
$this
getWriteEndpoint
Output only. The dns name of the primary instance in a replication group.
string
hasWriteEndpoint
clearWriteEndpoint
setWriteEndpoint
Output only. The dns name of the primary instance in a replication group.
var
string
$this
getReplicationCluster
Optional. A primary instance and disaster recovery (DR) replica pair.
A DR replica is a cross-region replica that you designate for failover in the event that the primary instance experiences regional failure. Only applicable to MySQL.
hasReplicationCluster
clearReplicationCluster
setReplicationCluster
Optional. A primary instance and disaster recovery (DR) replica pair.
A DR replica is a cross-region replica that you designate for failover in the event that the primary instance experiences regional failure. Only applicable to MySQL.
$this
getGeminiConfig
Gemini instance configuration.
hasGeminiConfig
clearGeminiConfig
setGeminiConfig
Gemini instance configuration.
$this
getSatisfiesPzi
Output only. This status indicates whether the instance satisfies PZI.
The status is reserved for future use.
hasSatisfiesPzi
clearSatisfiesPzi
getSatisfiesPziUnwrapped
Returns the unboxed value from getSatisfiesPzi()
Output only. This status indicates whether the instance satisfies PZI. The status is reserved for future use.
bool|null
setSatisfiesPzi
Output only. This status indicates whether the instance satisfies PZI.
The status is reserved for future use.
$this
setSatisfiesPziUnwrapped
Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object.
Output only. This status indicates whether the instance satisfies PZI. The status is reserved for future use.
var
bool|null
$this
getSwitchTransactionLogsToCloudStorageEnabled
Input only. Whether Cloud SQL is enabled to switch storing point-in-time recovery log files from a data disk to Cloud Storage.
hasSwitchTransactionLogsToCloudStorageEnabled
clearSwitchTransactionLogsToCloudStorageEnabled
getSwitchTransactionLogsToCloudStorageEnabledUnwrapped
Returns the unboxed value from getSwitchTransactionLogsToCloudStorageEnabled()
Input only. Whether Cloud SQL is enabled to switch storing point-in-time recovery log files from a data disk to Cloud Storage.
bool|null
setSwitchTransactionLogsToCloudStorageEnabled
Input only. Whether Cloud SQL is enabled to switch storing point-in-time recovery log files from a data disk to Cloud Storage.
$this
setSwitchTransactionLogsToCloudStorageEnabledUnwrapped
Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object.
Input only. Whether Cloud SQL is enabled to switch storing point-in-time recovery log files from a data disk to Cloud Storage.
var
bool|null
$this