Class: Google::Apis::SqlV1beta4::DatabaseInstance

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/sql_v1beta4/classes.rb,
generated/google/apis/sql_v1beta4/representations.rb,
generated/google/apis/sql_v1beta4/representations.rb

Overview

A Cloud SQL instance resource.

Defined Under Namespace

Classes: FailoverReplica

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ DatabaseInstance

Returns a new instance of DatabaseInstance.



659
660
661
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 659

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#backend_typeString

FIRST_GEN: First Generation instance. MySQL only.
SECOND_GEN: Second Generation instance or PostgreSQL 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 and Second or First Generation. Corresponds to the JSON property backendType

Returns:

  • (String)


481
482
483
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 481

def backend_type
  @backend_type
end

#connection_nameString

Connection name of the Cloud SQL instance used in connection strings. Corresponds to the JSON property connectionName

Returns:

  • (String)


486
487
488
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 486

def connection_name
  @connection_name
end

#current_disk_sizeFixnum

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 this announcement for details. Corresponds to the JSON property currentDiskSize

Returns:

  • (Fixnum)


497
498
499
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 497

def current_disk_size
  @current_disk_size
end

#database_versionString

The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5 Corresponds to the JSON property databaseVersion

Returns:

  • (String)


507
508
509
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 507

def database_version
  @database_version
end

#disk_encryption_configurationGoogle::Apis::SqlV1beta4::DiskEncryptionConfiguration

Disk encryption configuration for an instance. Corresponds to the JSON property diskEncryptionConfiguration



512
513
514
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 512

def disk_encryption_configuration
  @disk_encryption_configuration
end

#disk_encryption_statusGoogle::Apis::SqlV1beta4::DiskEncryptionStatus

Disk encryption status for an instance. Corresponds to the JSON property diskEncryptionStatus



517
518
519
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 517

def disk_encryption_status
  @disk_encryption_status
end

#etagString

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

Returns:

  • (String)


523
524
525
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 523

def etag
  @etag
end

#failover_replicaGoogle::Apis::SqlV1beta4::DatabaseInstance::FailoverReplica

The name and status of the failover replica. This property is applicable only to Second Generation instances. Corresponds to the JSON property failoverReplica



529
530
531
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 529

def failover_replica
  @failover_replica
end

#gce_zoneString

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. Corresponds to the JSON property gceZone

Returns:

  • (String)


536
537
538
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 536

def gce_zone
  @gce_zone
end

#instance_typeString

The instance type. This can be one of the following.
CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master.
ON_PREMISES_INSTANCE: An instance running on the customer's premises.
READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica. Corresponds to the JSON property instanceType

Returns:

  • (String)


546
547
548
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 546

def instance_type
  @instance_type
end

#ip_addressesArray<Google::Apis::SqlV1beta4::IpMapping>

The assigned IP addresses for the instance. Corresponds to the JSON property ipAddresses



551
552
553
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 551

def ip_addresses
  @ip_addresses
end

#ipv6_addressString

The IPv6 address assigned to the instance. This property is applicable only to First Generation instances. Corresponds to the JSON property ipv6Address

Returns:

  • (String)


557
558
559
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 557

def ipv6_address
  @ipv6_address
end

#kindString

This is always sql#instance. Corresponds to the JSON property kind

Returns:

  • (String)


562
563
564
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 562

def kind
  @kind
end

#master_instance_nameString

The name of the instance which will act as master in the replication setup. Corresponds to the JSON property masterInstanceName

Returns:

  • (String)


567
568
569
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 567

def master_instance_name
  @master_instance_name
end

#max_disk_sizeFixnum

The maximum disk size of the instance in bytes. Corresponds to the JSON property maxDiskSize

Returns:

  • (Fixnum)


572
573
574
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 572

def max_disk_size
  @max_disk_size
end

#nameString

Name of the Cloud SQL instance. This does not include the project ID. Corresponds to the JSON property name

Returns:

  • (String)


577
578
579
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 577

def name
  @name
end

#on_premises_configurationGoogle::Apis::SqlV1beta4::OnPremisesConfiguration

On-premises instance configuration. Corresponds to the JSON property onPremisesConfiguration



582
583
584
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 582

def on_premises_configuration
  @on_premises_configuration
end

#projectString

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

Returns:

  • (String)


588
589
590
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 588

def project
  @project
end

#regionString

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 (First Generation or Second Generation). The region can not be changed after instance creation. Corresponds to the JSON property region

Returns:

  • (String)


599
600
601
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 599

def region
  @region
end

#replica_configurationGoogle::Apis::SqlV1beta4::ReplicaConfiguration

Read-replica configuration for connecting to the master. Corresponds to the JSON property replicaConfiguration



604
605
606
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 604

def replica_configuration
  @replica_configuration
end

#replica_namesArray<String>

The replicas of the instance. Corresponds to the JSON property replicaNames

Returns:

  • (Array<String>)


609
610
611
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 609

def replica_names
  @replica_names
end

#root_passwordString

Initial root password. Use only on creation. Corresponds to the JSON property rootPassword

Returns:

  • (String)


614
615
616
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 614

def root_password
  @root_password
end

#scheduled_maintenanceGoogle::Apis::SqlV1beta4::SqlScheduledMaintenance

Any scheduled maintenancce for this instance. Corresponds to the JSON property scheduledMaintenance



619
620
621
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 619

def scheduled_maintenance
  @scheduled_maintenance
end

The URI of this resource. Corresponds to the JSON property selfLink

Returns:

  • (String)


624
625
626
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 624

def self_link
  @self_link
end

#server_ca_certGoogle::Apis::SqlV1beta4::SslCert

SslCerts Resource Corresponds to the JSON property serverCaCert



629
630
631
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 629

def server_ca_cert
  @server_ca_cert
end

#service_account_email_addressString

The service account email address assigned to the instance. This property is applicable only to Second Generation instances. Corresponds to the JSON property serviceAccountEmailAddress

Returns:

  • (String)


635
636
637
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 635

def 
  @service_account_email_address
end

#settingsGoogle::Apis::SqlV1beta4::Settings

Database instance settings. Corresponds to the JSON property settings



640
641
642
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 640

def settings
  @settings
end

#stateString

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.
FAILED: The instance creation failed.
UNKNOWN_STATE: The state of the instance is unknown. Corresponds to the JSON property state

Returns:

  • (String)


652
653
654
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 652

def state
  @state
end

#suspension_reasonArray<String>

If the instance state is SUSPENDED, the reason for the suspension. Corresponds to the JSON property suspensionReason

Returns:

  • (Array<String>)


657
658
659
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 657

def suspension_reason
  @suspension_reason
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 664

def update!(**args)
  @backend_type = args[:backend_type] if args.key?(:backend_type)
  @connection_name = args[:connection_name] if args.key?(:connection_name)
  @current_disk_size = args[:current_disk_size] if args.key?(:current_disk_size)
  @database_version = args[:database_version] if args.key?(:database_version)
  @disk_encryption_configuration = args[:disk_encryption_configuration] if args.key?(:disk_encryption_configuration)
  @disk_encryption_status = args[:disk_encryption_status] if args.key?(:disk_encryption_status)
  @etag = args[:etag] if args.key?(:etag)
  @failover_replica = args[:failover_replica] if args.key?(:failover_replica)
  @gce_zone = args[:gce_zone] if args.key?(:gce_zone)
  @instance_type = args[:instance_type] if args.key?(:instance_type)
  @ip_addresses = args[:ip_addresses] if args.key?(:ip_addresses)
  @ipv6_address = args[:ipv6_address] if args.key?(:ipv6_address)
  @kind = args[:kind] if args.key?(:kind)
  @master_instance_name = args[:master_instance_name] if args.key?(:master_instance_name)
  @max_disk_size = args[:max_disk_size] if args.key?(:max_disk_size)
  @name = args[:name] if args.key?(:name)
  @on_premises_configuration = args[:on_premises_configuration] if args.key?(:on_premises_configuration)
  @project = args[:project] if args.key?(:project)
  @region = args[:region] if args.key?(:region)
  @replica_configuration = args[:replica_configuration] if args.key?(:replica_configuration)
  @replica_names = args[:replica_names] if args.key?(:replica_names)
  @root_password = args[:root_password] if args.key?(:root_password)
  @scheduled_maintenance = args[:scheduled_maintenance] if args.key?(:scheduled_maintenance)
  @self_link = args[:self_link] if args.key?(:self_link)
  @server_ca_cert = args[:server_ca_cert] if args.key?(:server_ca_cert)
  @service_account_email_address = args[:service_account_email_address] if args.key?(:service_account_email_address)
  @settings = args[:settings] if args.key?(:settings)
  @state = args[:state] if args.key?(:state)
  @suspension_reason = args[:suspension_reason] if args.key?(:suspension_reason)
end