/
classes.rb
3133 lines (2589 loc) · 122 KB
/
classes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
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
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module SqladminV1beta4
# An entry for an Access Control list.
class AclEntry
include Google::Apis::Core::Hashable
# The time when this access control entry expires in RFC 3339 format, for
# example *2012-11-15T16:19:00.094Z*.
# Corresponds to the JSON property `expirationTime`
# @return [String]
attr_accessor :expiration_time
# This is always *sql#aclEntry*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Optional. A label to identify this entry.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The allowlisted value for the access control list.
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@expiration_time = args[:expiration_time] if args.key?(:expiration_time)
@kind = args[:kind] if args.key?(:kind)
@name = args[:name] if args.key?(:name)
@value = args[:value] if args.key?(:value)
end
end
# An Admin API warning message.
class ApiWarning
include Google::Apis::Core::Hashable
# Code to uniquely identify the warning type.
# Corresponds to the JSON property `code`
# @return [String]
attr_accessor :code
# The warning message.
# Corresponds to the JSON property `message`
# @return [String]
attr_accessor :message
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@code = args[:code] if args.key?(:code)
@message = args[:message] if args.key?(:message)
end
end
# Database instance backup configuration.
class BackupConfiguration
include Google::Apis::Core::Hashable
# We currently only support backup retention by specifying the number of backups
# we will retain.
# Corresponds to the JSON property `backupRetentionSettings`
# @return [Google::Apis::SqladminV1beta4::BackupRetentionSettings]
attr_accessor :backup_retention_settings
# (MySQL only) Whether binary log is enabled. If backup configuration is
# disabled, binarylog must be disabled as well.
# Corresponds to the JSON property `binaryLogEnabled`
# @return [Boolean]
attr_accessor :binary_log_enabled
alias_method :binary_log_enabled?, :binary_log_enabled
# Whether this configuration is enabled.
# Corresponds to the JSON property `enabled`
# @return [Boolean]
attr_accessor :enabled
alias_method :enabled?, :enabled
# This is always *sql#backupConfiguration*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Location of the backup
# Corresponds to the JSON property `location`
# @return [String]
attr_accessor :location
# Reserved for future use.
# Corresponds to the JSON property `pointInTimeRecoveryEnabled`
# @return [Boolean]
attr_accessor :point_in_time_recovery_enabled
alias_method :point_in_time_recovery_enabled?, :point_in_time_recovery_enabled
# Reserved for future use.
# Corresponds to the JSON property `replicationLogArchivingEnabled`
# @return [Boolean]
attr_accessor :replication_log_archiving_enabled
alias_method :replication_log_archiving_enabled?, :replication_log_archiving_enabled
# Start time for the daily backup configuration in UTC timezone in the 24 hour
# format - *HH:MM*.
# Corresponds to the JSON property `startTime`
# @return [String]
attr_accessor :start_time
# The number of days of transaction logs we retain for point in time restore,
# from 1-7.
# Corresponds to the JSON property `transactionLogRetentionDays`
# @return [Fixnum]
attr_accessor :transaction_log_retention_days
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@backup_retention_settings = args[:backup_retention_settings] if args.key?(:backup_retention_settings)
@binary_log_enabled = args[:binary_log_enabled] if args.key?(:binary_log_enabled)
@enabled = args[:enabled] if args.key?(:enabled)
@kind = args[:kind] if args.key?(:kind)
@location = args[:location] if args.key?(:location)
@point_in_time_recovery_enabled = args[:point_in_time_recovery_enabled] if args.key?(:point_in_time_recovery_enabled)
@replication_log_archiving_enabled = args[:replication_log_archiving_enabled] if args.key?(:replication_log_archiving_enabled)
@start_time = args[:start_time] if args.key?(:start_time)
@transaction_log_retention_days = args[:transaction_log_retention_days] if args.key?(:transaction_log_retention_days)
end
end
# Backup context.
class BackupContext
include Google::Apis::Core::Hashable
# The identifier of the backup.
# Corresponds to the JSON property `backupId`
# @return [Fixnum]
attr_accessor :backup_id
# This is always *sql#backupContext*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@backup_id = args[:backup_id] if args.key?(:backup_id)
@kind = args[:kind] if args.key?(:kind)
end
end
# We currently only support backup retention by specifying the number of backups
# we will retain.
class BackupRetentionSettings
include Google::Apis::Core::Hashable
# Depending on the value of retention_unit, this is used to determine if a
# backup needs to be deleted. If retention_unit is 'COUNT', we will retain this
# many backups.
# Corresponds to the JSON property `retainedBackups`
# @return [Fixnum]
attr_accessor :retained_backups
# The unit that 'retained_backups' represents.
# Corresponds to the JSON property `retentionUnit`
# @return [String]
attr_accessor :retention_unit
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@retained_backups = args[:retained_backups] if args.key?(:retained_backups)
@retention_unit = args[:retention_unit] if args.key?(:retention_unit)
end
end
# A BackupRun resource.
class BackupRun
include Google::Apis::Core::Hashable
# Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
# Corresponds to the JSON property `backupKind`
# @return [String]
attr_accessor :backup_kind
# The description of this run, only applicable to on-demand backups.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Disk encryption configuration for an instance.
# Corresponds to the JSON property `diskEncryptionConfiguration`
# @return [Google::Apis::SqladminV1beta4::DiskEncryptionConfiguration]
attr_accessor :disk_encryption_configuration
# Disk encryption status for an instance.
# Corresponds to the JSON property `diskEncryptionStatus`
# @return [Google::Apis::SqladminV1beta4::DiskEncryptionStatus]
attr_accessor :disk_encryption_status
# The time the backup operation completed in UTC timezone in RFC 3339 format,
# for example *2012-11-15T16:19:00.094Z*.
# Corresponds to the JSON property `endTime`
# @return [String]
attr_accessor :end_time
# The time the run was enqueued in UTC timezone in RFC 3339 format, for example *
# 2012-11-15T16:19:00.094Z*.
# Corresponds to the JSON property `enqueuedTime`
# @return [String]
attr_accessor :enqueued_time
# Database instance operation error.
# Corresponds to the JSON property `error`
# @return [Google::Apis::SqladminV1beta4::OperationError]
attr_accessor :error
# The identifier for this backup run. Unique only for a specific Cloud SQL
# instance.
# Corresponds to the JSON property `id`
# @return [Fixnum]
attr_accessor :id
# Name of the database instance.
# Corresponds to the JSON property `instance`
# @return [String]
attr_accessor :instance
# This is always *sql#backupRun*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Location of the backups.
# Corresponds to the JSON property `location`
# @return [String]
attr_accessor :location
# The URI of this resource.
# Corresponds to the JSON property `selfLink`
# @return [String]
attr_accessor :self_link
# The time the backup operation actually started in UTC timezone in RFC 3339
# format, for example *2012-11-15T16:19:00.094Z*.
# Corresponds to the JSON property `startTime`
# @return [String]
attr_accessor :start_time
# The status of this run.
# Corresponds to the JSON property `status`
# @return [String]
attr_accessor :status
# The type of this run; can be either "AUTOMATED" or "ON_DEMAND".
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
# The start time of the backup window during which this the backup was attempted
# in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.
# Corresponds to the JSON property `windowStartTime`
# @return [String]
attr_accessor :window_start_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@backup_kind = args[:backup_kind] if args.key?(:backup_kind)
@description = args[:description] if args.key?(:description)
@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)
@end_time = args[:end_time] if args.key?(:end_time)
@enqueued_time = args[:enqueued_time] if args.key?(:enqueued_time)
@error = args[:error] if args.key?(:error)
@id = args[:id] if args.key?(:id)
@instance = args[:instance] if args.key?(:instance)
@kind = args[:kind] if args.key?(:kind)
@location = args[:location] if args.key?(:location)
@self_link = args[:self_link] if args.key?(:self_link)
@start_time = args[:start_time] if args.key?(:start_time)
@status = args[:status] if args.key?(:status)
@type = args[:type] if args.key?(:type)
@window_start_time = args[:window_start_time] if args.key?(:window_start_time)
end
end
# Backup run list results.
class ListBackupRunsResponse
include Google::Apis::Core::Hashable
# A list of backup runs in reverse chronological order of the enqueued time.
# Corresponds to the JSON property `items`
# @return [Array<Google::Apis::SqladminV1beta4::BackupRun>]
attr_accessor :items
# This is always *sql#backupRunsList*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The continuation token, used to page through large result sets. Provide this
# value in a subsequent request to return the next page of results.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@items = args[:items] if args.key?(:items)
@kind = args[:kind] if args.key?(:kind)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
# Binary log coordinates.
class BinLogCoordinates
include Google::Apis::Core::Hashable
# Name of the binary log file for a Cloud SQL instance.
# Corresponds to the JSON property `binLogFileName`
# @return [String]
attr_accessor :bin_log_file_name
# Position (offset) within the binary log file.
# Corresponds to the JSON property `binLogPosition`
# @return [Fixnum]
attr_accessor :bin_log_position
# This is always *sql#binLogCoordinates*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@bin_log_file_name = args[:bin_log_file_name] if args.key?(:bin_log_file_name)
@bin_log_position = args[:bin_log_position] if args.key?(:bin_log_position)
@kind = args[:kind] if args.key?(:kind)
end
end
# Database instance clone context.
class CloneContext
include Google::Apis::Core::Hashable
# Binary log coordinates.
# Corresponds to the JSON property `binLogCoordinates`
# @return [Google::Apis::SqladminV1beta4::BinLogCoordinates]
attr_accessor :bin_log_coordinates
# Name of the Cloud SQL instance to be created as a clone.
# Corresponds to the JSON property `destinationInstanceName`
# @return [String]
attr_accessor :destination_instance_name
# This is always *sql#cloneContext*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Reserved for future use.
# Corresponds to the JSON property `pitrTimestampMs`
# @return [Fixnum]
attr_accessor :pitr_timestamp_ms
# Reserved for future use.
# Corresponds to the JSON property `pointInTime`
# @return [String]
attr_accessor :point_in_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@bin_log_coordinates = args[:bin_log_coordinates] if args.key?(:bin_log_coordinates)
@destination_instance_name = args[:destination_instance_name] if args.key?(:destination_instance_name)
@kind = args[:kind] if args.key?(:kind)
@pitr_timestamp_ms = args[:pitr_timestamp_ms] if args.key?(:pitr_timestamp_ms)
@point_in_time = args[:point_in_time] if args.key?(:point_in_time)
end
end
# Represents a SQL database on the Cloud SQL instance.
class Database
include Google::Apis::Core::Hashable
# The Cloud SQL charset value.
# Corresponds to the JSON property `charset`
# @return [String]
attr_accessor :charset
# The Cloud SQL collation value.
# Corresponds to the JSON property `collation`
# @return [String]
attr_accessor :collation
# This field is deprecated and will be removed from a future version of the API.
# Corresponds to the JSON property `etag`
# @return [String]
attr_accessor :etag
# The name of the Cloud SQL instance. This does not include the project ID.
# Corresponds to the JSON property `instance`
# @return [String]
attr_accessor :instance
# This is always *sql#database*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The name of the database in the Cloud SQL instance. This does not include the
# project ID or instance name.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The project ID of the project containing the Cloud SQL database. The Google
# apps domain is prefixed if applicable.
# Corresponds to the JSON property `project`
# @return [String]
attr_accessor :project
# The URI of this resource.
# Corresponds to the JSON property `selfLink`
# @return [String]
attr_accessor :self_link
# Represents a Sql Server database on the Cloud SQL instance.
# Corresponds to the JSON property `sqlserverDatabaseDetails`
# @return [Google::Apis::SqladminV1beta4::SqlServerDatabaseDetails]
attr_accessor :sqlserver_database_details
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@charset = args[:charset] if args.key?(:charset)
@collation = args[:collation] if args.key?(:collation)
@etag = args[:etag] if args.key?(:etag)
@instance = args[:instance] if args.key?(:instance)
@kind = args[:kind] if args.key?(:kind)
@name = args[:name] if args.key?(:name)
@project = args[:project] if args.key?(:project)
@self_link = args[:self_link] if args.key?(:self_link)
@sqlserver_database_details = args[:sqlserver_database_details] if args.key?(:sqlserver_database_details)
end
end
# Database flags for Cloud SQL instances.
class DatabaseFlags
include Google::Apis::Core::Hashable
# The name of the flag. These flags are passed at instance startup, so include
# both server options and system variables for MySQL. Flags are specified with
# underscores, not hyphens. For more information, see Configuring Database Flags
# in the Cloud SQL documentation.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The value of the flag. Booleans are set to *on* for true and *off* for false.
# This field must be omitted if the flag doesn't take a value.
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@name = args[:name] if args.key?(:name)
@value = args[:value] if args.key?(:value)
end
end
# A Cloud SQL instance resource. Next field: 36
class DatabaseInstance
include Google::Apis::Core::Hashable
# *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.
# Corresponds to the JSON property `backendType`
# @return [String]
attr_accessor :backend_type
# Connection name of the Cloud SQL instance used in connection strings.
# Corresponds to the JSON property `connectionName`
# @return [String]
attr_accessor :connection_name
# 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.
# Corresponds to the JSON property `currentDiskSize`
# @return [Fixnum]
attr_accessor :current_disk_size
# The database engine type and version. The *databaseVersion* field 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* or *POSTGRES_12* (default). SQL Server instances: *
# SQLSERVER_2017_STANDARD* (default), *SQLSERVER_2017_ENTERPRISE*, *
# SQLSERVER_2017_EXPRESS*, or *SQLSERVER_2017_WEB*.
# Corresponds to the JSON property `databaseVersion`
# @return [String]
attr_accessor :database_version
# Disk encryption configuration for an instance.
# Corresponds to the JSON property `diskEncryptionConfiguration`
# @return [Google::Apis::SqladminV1beta4::DiskEncryptionConfiguration]
attr_accessor :disk_encryption_configuration
# Disk encryption status for an instance.
# Corresponds to the JSON property `diskEncryptionStatus`
# @return [Google::Apis::SqladminV1beta4::DiskEncryptionStatus]
attr_accessor :disk_encryption_status
# 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`
# @return [String]
attr_accessor :etag
# The name and status of the failover replica. This property is applicable only
# to Second Generation instances.
# Corresponds to the JSON property `failoverReplica`
# @return [Google::Apis::SqladminV1beta4::DatabaseInstance::FailoverReplica]
attr_accessor :failover_replica
# 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`
# @return [String]
attr_accessor :gce_zone
# 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.
# Corresponds to the JSON property `instanceType`
# @return [String]
attr_accessor :instance_type
# The assigned IP addresses for the instance.
# Corresponds to the JSON property `ipAddresses`
# @return [Array<Google::Apis::SqladminV1beta4::IpMapping>]
attr_accessor :ip_addresses
# The IPv6 address assigned to the instance. (Deprecated) This property was
# applicable only to First Generation instances.
# Corresponds to the JSON property `ipv6Address`
# @return [String]
attr_accessor :ipv6_address
# This is always *sql#instance*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The name of the instance which will act as primary in the replication setup.
# Corresponds to the JSON property `masterInstanceName`
# @return [String]
attr_accessor :master_instance_name
# The maximum disk size of the instance in bytes.
# Corresponds to the JSON property `maxDiskSize`
# @return [Fixnum]
attr_accessor :max_disk_size
# Name of the Cloud SQL instance. This does not include the project ID.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# On-premises instance configuration.
# Corresponds to the JSON property `onPremisesConfiguration`
# @return [Google::Apis::SqladminV1beta4::OnPremisesConfiguration]
attr_accessor :on_premises_configuration
# 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`
# @return [String]
attr_accessor :project
# 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.
# Corresponds to the JSON property `region`
# @return [String]
attr_accessor :region
# Read-replica configuration for connecting to the primary instance.
# Corresponds to the JSON property `replicaConfiguration`
# @return [Google::Apis::SqladminV1beta4::ReplicaConfiguration]
attr_accessor :replica_configuration
# The replicas of the instance.
# Corresponds to the JSON property `replicaNames`
# @return [Array<String>]
attr_accessor :replica_names
# Initial root password. Use only on creation.
# Corresponds to the JSON property `rootPassword`
# @return [String]
attr_accessor :root_password
# The status indicating if instance satisfies physical zone separation. Reserved
# for future use.
# Corresponds to the JSON property `satisfiesPzs`
# @return [Boolean]
attr_accessor :satisfies_pzs
alias_method :satisfies_pzs?, :satisfies_pzs
# Any scheduled maintenancce for this instance.
# Corresponds to the JSON property `scheduledMaintenance`
# @return [Google::Apis::SqladminV1beta4::SqlScheduledMaintenance]
attr_accessor :scheduled_maintenance
# 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.
# Corresponds to the JSON property `secondaryGceZone`
# @return [String]
attr_accessor :secondary_gce_zone
# The URI of this resource.
# Corresponds to the JSON property `selfLink`
# @return [String]
attr_accessor :self_link
# SslCerts Resource
# Corresponds to the JSON property `serverCaCert`
# @return [Google::Apis::SqladminV1beta4::SslCert]
attr_accessor :server_ca_cert
# The service account email address assigned to the instance. This property is
# applicable only to Second Generation instances.
# Corresponds to the JSON property `serviceAccountEmailAddress`
# @return [String]
attr_accessor :service_account_email_address
# Database instance settings.
# Corresponds to the JSON property `settings`
# @return [Google::Apis::SqladminV1beta4::Settings]
attr_accessor :settings
# 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 has been stopped by owner. It is not
# currently running, but it's ready to be restarted. *SUSPENDED*: The instance
# is not available, for example due to problems with billing. 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.
# Corresponds to the JSON property `state`
# @return [String]
attr_accessor :state
# If the instance state is SUSPENDED, the reason for the suspension.
# Corresponds to the JSON property `suspensionReason`
# @return [Array<String>]
attr_accessor :suspension_reason
def initialize(**args)
update!(**args)
end
# Update properties of this object
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)
@satisfies_pzs = args[:satisfies_pzs] if args.key?(:satisfies_pzs)
@scheduled_maintenance = args[:scheduled_maintenance] if args.key?(:scheduled_maintenance)
@secondary_gce_zone = args[:secondary_gce_zone] if args.key?(:secondary_gce_zone)
@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
# The name and status of the failover replica. This property is applicable only
# to Second Generation instances.
class FailoverReplica
include Google::Apis::Core::Hashable
# The availability status of the failover replica. A false status indicates that
# the failover replica is out of sync. The primary instance can only failover to
# the failover replica when the status is true.
# Corresponds to the JSON property `available`
# @return [Boolean]
attr_accessor :available
alias_method :available?, :available
# 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.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@available = args[:available] if args.key?(:available)
@name = args[:name] if args.key?(:name)
end
end
end
# Database list response.
class ListDatabasesResponse
include Google::Apis::Core::Hashable
# List of database resources in the instance.
# Corresponds to the JSON property `items`
# @return [Array<Google::Apis::SqladminV1beta4::Database>]
attr_accessor :items
# This is always *sql#databasesList*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@items = args[:items] if args.key?(:items)
@kind = args[:kind] if args.key?(:kind)
end
end
# Read-replica configuration for connecting to the on-premises primary instance.
class DemoteMasterConfiguration
include Google::Apis::Core::Hashable
# This is always *sql#demoteMasterConfiguration*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Read-replica configuration specific to MySQL databases.
# Corresponds to the JSON property `mysqlReplicaConfiguration`
# @return [Google::Apis::SqladminV1beta4::DemoteMasterMySqlReplicaConfiguration]
attr_accessor :mysql_replica_configuration
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@kind = args[:kind] if args.key?(:kind)
@mysql_replica_configuration = args[:mysql_replica_configuration] if args.key?(:mysql_replica_configuration)
end
end
# Database instance demote primary instance context.
class DemoteMasterContext
include Google::Apis::Core::Hashable
# This is always *sql#demoteMasterContext*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The name of the instance which will act as on-premises primary instance in the
# replication setup.
# Corresponds to the JSON property `masterInstanceName`
# @return [String]
attr_accessor :master_instance_name
# Read-replica configuration for connecting to the on-premises primary instance.
# Corresponds to the JSON property `replicaConfiguration`
# @return [Google::Apis::SqladminV1beta4::DemoteMasterConfiguration]
attr_accessor :replica_configuration
# Verify GTID consistency for demote operation. Default value: *True*. Second
# Generation instances only. Setting this flag to false enables you to bypass
# GTID consistency check between on-premises primary instance and Cloud SQL
# instance during the demotion operation but also exposes you to the risk of
# future replication failures. Change the value only if you know the reason for
# the GTID divergence and are confident that doing so will not cause any
# replication issues.
# Corresponds to the JSON property `verifyGtidConsistency`
# @return [Boolean]
attr_accessor :verify_gtid_consistency
alias_method :verify_gtid_consistency?, :verify_gtid_consistency
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@kind = args[:kind] if args.key?(:kind)
@master_instance_name = args[:master_instance_name] if args.key?(:master_instance_name)
@replica_configuration = args[:replica_configuration] if args.key?(:replica_configuration)
@verify_gtid_consistency = args[:verify_gtid_consistency] if args.key?(:verify_gtid_consistency)
end
end
# Read-replica configuration specific to MySQL databases.
class DemoteMasterMySqlReplicaConfiguration
include Google::Apis::Core::Hashable
# PEM representation of the trusted CA's x509 certificate.
# Corresponds to the JSON property `caCertificate`
# @return [String]
attr_accessor :ca_certificate
# PEM representation of the replica's x509 certificate.
# Corresponds to the JSON property `clientCertificate`
# @return [String]
attr_accessor :client_certificate
# PEM representation of the replica's private key. The corresponsing public key
# is encoded in the client's certificate. The format of the replica's private
# key can be either PKCS #1 or PKCS #8.
# Corresponds to the JSON property `clientKey`
# @return [String]
attr_accessor :client_key
# This is always *sql#demoteMasterMysqlReplicaConfiguration*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The password for the replication connection.
# Corresponds to the JSON property `password`
# @return [String]
attr_accessor :password
# The username for the replication connection.
# Corresponds to the JSON property `username`
# @return [String]
attr_accessor :username
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@ca_certificate = args[:ca_certificate] if args.key?(:ca_certificate)
@client_certificate = args[:client_certificate] if args.key?(:client_certificate)
@client_key = args[:client_key] if args.key?(:client_key)
@kind = args[:kind] if args.key?(:kind)
@password = args[:password] if args.key?(:password)
@username = args[:username] if args.key?(:username)
end
end
# Deny Maintenance Periods. This specifies a date range during when all CSA
# rollout will be denied.
class DenyMaintenancePeriod
include Google::Apis::Core::Hashable
# "deny maintenance period" end date. If the year of the end date is empty, the
# year of the start date also must be empty. In this case, it means the deny
# maintenance period recurs every year. The date is in format yyyy-mm-dd i.e.,
# 2020-11-01, or mm-dd, i.e., 11-01
# Corresponds to the JSON property `endDate`
# @return [String]
attr_accessor :end_date
# "deny maintenance period" start date. If the year of the start date is empty,
# the year of the end date also must be empty. In this case, it means the deny
# maintenance period recurs every year. The date is in format yyyy-mm-dd i.e.,
# 2020-11-01, or mm-dd, i.e., 11-01
# Corresponds to the JSON property `startDate`
# @return [String]
attr_accessor :start_date
# Time in UTC when the "deny maintenance period" starts on start_date and ends
# on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
# Corresponds to the JSON property `time`
# @return [String]
attr_accessor :time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@end_date = args[:end_date] if args.key?(:end_date)
@start_date = args[:start_date] if args.key?(:start_date)
@time = args[:time] if args.key?(:time)
end
end
# Disk encryption configuration for an instance.
class DiskEncryptionConfiguration
include Google::Apis::Core::Hashable
# This is always *sql#diskEncryptionConfiguration*.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Resource name of KMS key for disk encryption
# Corresponds to the JSON property `kmsKeyName`
# @return [String]
attr_accessor :kms_key_name
def initialize(**args)
update!(**args)
end