Google Cloud Sql Admin V1beta4 Client - Class DatabaseInstance (0.5.0)

Reference documentation and code samples for the Google Cloud Sql Admin V1beta4 Client class DatabaseInstance.

A Cloud SQL instance resource.

Generated from protobuf message google.cloud.sql.v1beta4.DatabaseInstance

Namespace

Google \ Cloud \ Sql \ V1beta4

Methods

__construct

Constructor.

Parameters
NameDescription
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 Google\Cloud\Sql\V1beta4\Settings

The user 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 Google\Cloud\Sql\V1beta4\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 Google\Protobuf\Int64Value

The maximum disk size of the instance in bytes.

↳ 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 array<Google\Cloud\Sql\V1beta4\IpMapping>

The assigned IP addresses for the instance.

↳ server_ca_cert Google\Cloud\Sql\V1beta4\SslCert

SSL configuration.

↳ 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 Google\Cloud\Sql\V1beta4\OnPremisesConfiguration

Configuration specific to on-premises instances.

↳ replica_configuration Google\Cloud\Sql\V1beta4\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 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. Can be: * us-central (FIRST_GEN instances only) * us-central1 (SECOND_GEN instances only) * asia-east1 or europe-west1. Defaults to us-central or us-central1 depending 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. 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 Google\Cloud\Sql\V1beta4\DiskEncryptionConfiguration

Disk encryption configuration specific to an instance.

↳ disk_encryption_status Google\Cloud\Sql\V1beta4\DiskEncryptionStatus

Disk encryption status specific to an instance.

↳ root_password string

Initial root password. Use only on creation. You must set root passwords before you can connect to PostgreSQL instances.

↳ scheduled_maintenance Google\Cloud\Sql\V1beta4\DatabaseInstance\SqlScheduledMaintenance

The start time of any upcoming scheduled maintenance for this instance.

↳ satisfies_pzs Google\Protobuf\BoolValue

The status indicating if instance satisfiesPzs. 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 Google\Cloud\Sql\V1beta4\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.

↳ 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.

getKind

This is always sql#instance.

Returns
TypeDescription
string

setKind

This is always sql#instance.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getState

The current serving state of the Cloud SQL instance.

Returns
TypeDescription
int

setState

The current serving state of the Cloud SQL instance.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getDatabaseVersion

The database engine type and version. The databaseVersion field cannot be changed after instance creation.

Returns
TypeDescription
int

setDatabaseVersion

The database engine type and version. The databaseVersion field cannot be changed after instance creation.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getSettings

The user settings.

Returns
TypeDescription
Google\Cloud\Sql\V1beta4\Settings|null

hasSettings

clearSettings

setSettings

The user settings.

Parameter
NameDescription
var Google\Cloud\Sql\V1beta4\Settings
Returns
TypeDescription
$this

getEtag

This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead.

Returns
TypeDescription
string

setEtag

This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getFailoverReplica

The name and status of the failover replica.

Returns
TypeDescription
Google\Cloud\Sql\V1beta4\DatabaseInstance\SqlFailoverReplica|null

hasFailoverReplica

clearFailoverReplica

setFailoverReplica

The name and status of the failover replica.

Parameter
NameDescription
var Google\Cloud\Sql\V1beta4\DatabaseInstance\SqlFailoverReplica
Returns
TypeDescription
$this

getMasterInstanceName

The name of the instance which will act as primary in the replication setup.

Returns
TypeDescription
string

setMasterInstanceName

The name of the instance which will act as primary in the replication setup.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getReplicaNames

The replicas of the instance.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setReplicaNames

The replicas of the instance.

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this

getMaxDiskSize

The maximum disk size of the instance in bytes.

Returns
TypeDescription
Google\Protobuf\Int64Value|null

hasMaxDiskSize

clearMaxDiskSize

getMaxDiskSizeValue

Returns the unboxed value from getMaxDiskSize()

The maximum disk size of the instance in bytes.

Returns
TypeDescription
int|string|null

setMaxDiskSize

The maximum disk size of the instance in bytes.

Parameter
NameDescription
var Google\Protobuf\Int64Value
Returns
TypeDescription
$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.

Parameter
NameDescription
var int|string|null
Returns
TypeDescription
$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.

Returns
TypeDescription
Google\Protobuf\Int64Value|null

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.

Returns
TypeDescription
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.

Parameter
NameDescription
var Google\Protobuf\Int64Value
Returns
TypeDescription
$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.

Parameter
NameDescription
var int|string|null
Returns
TypeDescription
$this

getIpAddresses

The assigned IP addresses for the instance.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setIpAddresses

The assigned IP addresses for the instance.

Parameter
NameDescription
var array<Google\Cloud\Sql\V1beta4\IpMapping>
Returns
TypeDescription
$this

getServerCaCert

SSL configuration.

Returns
TypeDescription
Google\Cloud\Sql\V1beta4\SslCert|null

hasServerCaCert

clearServerCaCert

setServerCaCert

SSL configuration.

Parameter
NameDescription
var Google\Cloud\Sql\V1beta4\SslCert
Returns
TypeDescription
$this

getInstanceType

The instance type.

Returns
TypeDescription
int

setInstanceType

The instance type.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getProject

The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.

Returns
TypeDescription
string

setProject

The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getIpv6Address

The IPv6 address assigned to the instance.

(Deprecated) This property was applicable only to First Generation instances.

Returns
TypeDescription
string

setIpv6Address

The IPv6 address assigned to the instance.

(Deprecated) This property was applicable only to First Generation instances.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getServiceAccountEmailAddress

The service account email address assigned to the instance. \This property is read-only.

Returns
TypeDescription
string

setServiceAccountEmailAddress

The service account email address assigned to the instance. \This property is read-only.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getOnPremisesConfiguration

Configuration specific to on-premises instances.

Returns
TypeDescription
Google\Cloud\Sql\V1beta4\OnPremisesConfiguration|null

hasOnPremisesConfiguration

clearOnPremisesConfiguration

setOnPremisesConfiguration

Configuration specific to on-premises instances.

Parameter
NameDescription
var Google\Cloud\Sql\V1beta4\OnPremisesConfiguration
Returns
TypeDescription
$this

getReplicaConfiguration

Configuration specific to failover replicas and read replicas.

Returns
TypeDescription
Google\Cloud\Sql\V1beta4\ReplicaConfiguration|null

hasReplicaConfiguration

clearReplicaConfiguration

setReplicaConfiguration

Configuration specific to failover replicas and read replicas.

Parameter
NameDescription
var Google\Cloud\Sql\V1beta4\ReplicaConfiguration
Returns
TypeDescription
$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.

Returns
TypeDescription
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.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

The URI of this resource.

Returns
TypeDescription
string

The URI of this resource.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getSuspensionReason

If the instance state is SUSPENDED, the reason for the suspension.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setSuspensionReason

If the instance state is SUSPENDED, the reason for the suspension.

Parameter
NameDescription
var int[]
Returns
TypeDescription
$this

getConnectionName

Connection name of the Cloud SQL instance used in connection strings.

Returns
TypeDescription
string

setConnectionName

Connection name of the Cloud SQL instance used in connection strings.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getName

Name of the Cloud SQL instance. This does not include the project ID.

Returns
TypeDescription
string

setName

Name of the Cloud SQL instance. This does not include the project ID.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRegion

The geographical region. Can be:

  • us-central (FIRST_GEN instances only)
  • us-central1 (SECOND_GEN instances only)
  • asia-east1 or europe-west1.

Defaults to us-central or us-central1 depending on the instance type. The region cannot be changed after instance creation.

Returns
TypeDescription
string

setRegion

The geographical region. Can be:

  • us-central (FIRST_GEN instances only)
  • us-central1 (SECOND_GEN instances only)
  • asia-east1 or europe-west1.

Defaults to us-central or us-central1 depending on the instance type. The region cannot be changed after instance creation.

Parameter
NameDescription
var string
Returns
TypeDescription
$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.

Returns
TypeDescription
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.

Parameter
NameDescription
var string
Returns
TypeDescription
$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.

Returns
TypeDescription
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.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDiskEncryptionConfiguration

Disk encryption configuration specific to an instance.

Returns
TypeDescription
Google\Cloud\Sql\V1beta4\DiskEncryptionConfiguration|null

hasDiskEncryptionConfiguration

clearDiskEncryptionConfiguration

setDiskEncryptionConfiguration

Disk encryption configuration specific to an instance.

Parameter
NameDescription
var Google\Cloud\Sql\V1beta4\DiskEncryptionConfiguration
Returns
TypeDescription
$this

getDiskEncryptionStatus

Disk encryption status specific to an instance.

Returns
TypeDescription
Google\Cloud\Sql\V1beta4\DiskEncryptionStatus|null

hasDiskEncryptionStatus

clearDiskEncryptionStatus

setDiskEncryptionStatus

Disk encryption status specific to an instance.

Parameter
NameDescription
var Google\Cloud\Sql\V1beta4\DiskEncryptionStatus
Returns
TypeDescription
$this

getRootPassword

Initial root password. Use only on creation. You must set root passwords before you can connect to PostgreSQL instances.

Returns
TypeDescription
string

setRootPassword

Initial root password. Use only on creation. You must set root passwords before you can connect to PostgreSQL instances.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getScheduledMaintenance

The start time of any upcoming scheduled maintenance for this instance.

Returns
TypeDescription
Google\Cloud\Sql\V1beta4\DatabaseInstance\SqlScheduledMaintenance|null

hasScheduledMaintenance

clearScheduledMaintenance

setScheduledMaintenance

The start time of any upcoming scheduled maintenance for this instance.

Parameter
NameDescription
var Google\Cloud\Sql\V1beta4\DatabaseInstance\SqlScheduledMaintenance
Returns
TypeDescription
$this

getSatisfiesPzs

The status indicating if instance satisfiesPzs.

Reserved for future use.

Returns
TypeDescription
Google\Protobuf\BoolValue|null

hasSatisfiesPzs

clearSatisfiesPzs

getSatisfiesPzsValue

Returns the unboxed value from getSatisfiesPzs()

The status indicating if instance satisfiesPzs. Reserved for future use.

Returns
TypeDescription
bool|null

setSatisfiesPzs

The status indicating if instance satisfiesPzs.

Reserved for future use.

Parameter
NameDescription
var Google\Protobuf\BoolValue
Returns
TypeDescription
$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.

Parameter
NameDescription
var bool|null
Returns
TypeDescription
$this

getDatabaseInstalledVersion

Output only. Stores the current database version running on the instance including minor version such as MYSQL_8_0_18.

Returns
TypeDescription
string

setDatabaseInstalledVersion

Output only. Stores the current database version running on the instance including minor version such as MYSQL_8_0_18.

Parameter
NameDescription
var string
Returns
TypeDescription
$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
Returns
TypeDescription
Google\Cloud\Sql\V1beta4\DatabaseInstance\SqlOutOfDiskReport|null

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
Parameter
NameDescription
var Google\Cloud\Sql\V1beta4\DatabaseInstance\SqlOutOfDiskReport
Returns
TypeDescription
$this

getCreateTime

Output only. The time when the instance was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

Output only. The time when the instance was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getAvailableMaintenanceVersions

Output only. List all maintenance versions applicable on the instance

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setAvailableMaintenanceVersions

Output only. List all maintenance versions applicable on the instance

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this

getMaintenanceVersion

The current software version on the instance.

Returns
TypeDescription
string

setMaintenanceVersion

The current software version on the instance.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

Output only. The link to service attachment of PSC instance.

Returns
TypeDescription
string

Output only. The link to service attachment of PSC instance.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDnsName

Output only. The dns name of the instance.

Returns
TypeDescription
string

hasDnsName

clearDnsName

setDnsName

Output only. The dns name of the instance.

Parameter
NameDescription
var string
Returns
TypeDescription
$this