/
sqladmin-gen.go
9498 lines (8603 loc) · 320 KB
/
sqladmin-gen.go
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 2018 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package sqladmin provides access to the Cloud SQL Admin API.
//
// See https://cloud.google.com/sql/docs/reference/latest
//
// Usage example:
//
// import "google.golang.org/api/sqladmin/v1beta4"
// ...
// sqladminService, err := sqladmin.New(oauthHttpClient)
package sqladmin // import "google.golang.org/api/sqladmin/v1beta4"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
const apiId = "sqladmin:v1beta4"
const apiName = "sqladmin"
const apiVersion = "v1beta4"
const basePath = "https://www.googleapis.com/sql/v1beta4/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// Manage your Google SQL Service instances
SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.BackupRuns = NewBackupRunsService(s)
s.Databases = NewDatabasesService(s)
s.Flags = NewFlagsService(s)
s.Instances = NewInstancesService(s)
s.Operations = NewOperationsService(s)
s.SslCerts = NewSslCertsService(s)
s.Tiers = NewTiersService(s)
s.Users = NewUsersService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
BackupRuns *BackupRunsService
Databases *DatabasesService
Flags *FlagsService
Instances *InstancesService
Operations *OperationsService
SslCerts *SslCertsService
Tiers *TiersService
Users *UsersService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewBackupRunsService(s *Service) *BackupRunsService {
rs := &BackupRunsService{s: s}
return rs
}
type BackupRunsService struct {
s *Service
}
func NewDatabasesService(s *Service) *DatabasesService {
rs := &DatabasesService{s: s}
return rs
}
type DatabasesService struct {
s *Service
}
func NewFlagsService(s *Service) *FlagsService {
rs := &FlagsService{s: s}
return rs
}
type FlagsService struct {
s *Service
}
func NewInstancesService(s *Service) *InstancesService {
rs := &InstancesService{s: s}
return rs
}
type InstancesService struct {
s *Service
}
func NewOperationsService(s *Service) *OperationsService {
rs := &OperationsService{s: s}
return rs
}
type OperationsService struct {
s *Service
}
func NewSslCertsService(s *Service) *SslCertsService {
rs := &SslCertsService{s: s}
return rs
}
type SslCertsService struct {
s *Service
}
func NewTiersService(s *Service) *TiersService {
rs := &TiersService{s: s}
return rs
}
type TiersService struct {
s *Service
}
func NewUsersService(s *Service) *UsersService {
rs := &UsersService{s: s}
return rs
}
type UsersService struct {
s *Service
}
// AclEntry: An entry for an Access Control list.
type AclEntry struct {
// ExpirationTime: The time when this access control entry expires in
// RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
ExpirationTime string `json:"expirationTime,omitempty"`
// Kind: This is always sql#aclEntry.
Kind string `json:"kind,omitempty"`
// Name: An optional label to identify this entry.
Name string `json:"name,omitempty"`
// Value: The whitelisted value for the access control list.
Value string `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "ExpirationTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ExpirationTime") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AclEntry) MarshalJSON() ([]byte, error) {
type NoMethod AclEntry
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ApiWarning: An Admin API warning message.
type ApiWarning struct {
// Code: Code to uniquely identify the warning type.
Code string `json:"code,omitempty"`
// Message: The warning message.
Message string `json:"message,omitempty"`
// ForceSendFields is a list of field names (e.g. "Code") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Code") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ApiWarning) MarshalJSON() ([]byte, error) {
type NoMethod ApiWarning
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackupConfiguration: Database instance backup configuration.
type BackupConfiguration struct {
// BinaryLogEnabled: Whether binary log is enabled. If backup
// configuration is disabled, binary log must be disabled as well.
BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"`
// Enabled: Whether this configuration is enabled.
Enabled bool `json:"enabled,omitempty"`
// Kind: This is always sql#backupConfiguration.
Kind string `json:"kind,omitempty"`
// ReplicationLogArchivingEnabled: Reserved for future use.
ReplicationLogArchivingEnabled bool `json:"replicationLogArchivingEnabled,omitempty"`
// StartTime: Start time for the daily backup configuration in UTC
// timezone in the 24 hour format - HH:MM.
StartTime string `json:"startTime,omitempty"`
// ForceSendFields is a list of field names (e.g. "BinaryLogEnabled") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BinaryLogEnabled") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BackupConfiguration) MarshalJSON() ([]byte, error) {
type NoMethod BackupConfiguration
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackupRun: A BackupRun resource.
type BackupRun struct {
// Description: The description of this run, only applicable to
// on-demand backups.
Description string `json:"description,omitempty"`
// EndTime: The time the backup operation completed in UTC timezone in
// RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
EndTime string `json:"endTime,omitempty"`
// EnqueuedTime: The time the run was enqueued in UTC timezone in RFC
// 3339 format, for example 2012-11-15T16:19:00.094Z.
EnqueuedTime string `json:"enqueuedTime,omitempty"`
// Error: Information about why the backup operation failed. This is
// only present if the run has the FAILED status.
Error *OperationError `json:"error,omitempty"`
// Id: The identifier for this backup run. Unique only for a specific
// Cloud SQL instance.
Id int64 `json:"id,omitempty,string"`
// Instance: Name of the database instance.
Instance string `json:"instance,omitempty"`
// Kind: This is always sql#backupRun.
Kind string `json:"kind,omitempty"`
// SelfLink: The URI of this resource.
SelfLink string `json:"selfLink,omitempty"`
// StartTime: The time the backup operation actually started in UTC
// timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
StartTime string `json:"startTime,omitempty"`
// Status: The status of this run.
Status string `json:"status,omitempty"`
// Type: The type of this run; can be either "AUTOMATED" or "ON_DEMAND".
Type string `json:"type,omitempty"`
// WindowStartTime: 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.
WindowStartTime string `json:"windowStartTime,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BackupRun) MarshalJSON() ([]byte, error) {
type NoMethod BackupRun
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackupRunsListResponse: Backup run list results.
type BackupRunsListResponse struct {
// Items: A list of backup runs in reverse chronological order of the
// enqueued time.
Items []*BackupRun `json:"items,omitempty"`
// Kind: This is always sql#backupRunsList.
Kind string `json:"kind,omitempty"`
// NextPageToken: The continuation token, used to page through large
// result sets. Provide this value in a subsequent request to return the
// next page of results.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) {
type NoMethod BackupRunsListResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BinLogCoordinates: Binary log coordinates.
type BinLogCoordinates struct {
// BinLogFileName: Name of the binary log file for a Cloud SQL instance.
BinLogFileName string `json:"binLogFileName,omitempty"`
// BinLogPosition: Position (offset) within the binary log file.
BinLogPosition int64 `json:"binLogPosition,omitempty,string"`
// Kind: This is always sql#binLogCoordinates.
Kind string `json:"kind,omitempty"`
// ForceSendFields is a list of field names (e.g. "BinLogFileName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BinLogFileName") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) {
type NoMethod BinLogCoordinates
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CloneContext: Database instance clone context.
type CloneContext struct {
// BinLogCoordinates: Binary log coordinates, if specified, identify the
// position up to which the source instance should be cloned. If not
// specified, the source instance is cloned up to the most recent binary
// log coordinates.
BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"`
// DestinationInstanceName: Name of the Cloud SQL instance to be created
// as a clone.
DestinationInstanceName string `json:"destinationInstanceName,omitempty"`
// Kind: This is always sql#cloneContext.
Kind string `json:"kind,omitempty"`
// PitrTimestampMs: Reserved for future use.
PitrTimestampMs int64 `json:"pitrTimestampMs,omitempty,string"`
// ForceSendFields is a list of field names (e.g. "BinLogCoordinates")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BinLogCoordinates") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *CloneContext) MarshalJSON() ([]byte, error) {
type NoMethod CloneContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Database: Represents a SQL database on the Cloud SQL instance.
type Database struct {
// Charset: The MySQL charset value.
Charset string `json:"charset,omitempty"`
// Collation: The MySQL collation value.
Collation string `json:"collation,omitempty"`
// Etag: This field is deprecated and will be removed from a future
// version of the API.
Etag string `json:"etag,omitempty"`
// Instance: The name of the Cloud SQL instance. This does not include
// the project ID.
Instance string `json:"instance,omitempty"`
// Kind: This is always sql#database.
Kind string `json:"kind,omitempty"`
// Name: The name of the database in the Cloud SQL instance. This does
// not include the project ID or instance name.
Name string `json:"name,omitempty"`
// Project: The project ID of the project containing the Cloud SQL
// database. The Google apps domain is prefixed if applicable.
Project string `json:"project,omitempty"`
// SelfLink: The URI of this resource.
SelfLink string `json:"selfLink,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Charset") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Charset") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Database) MarshalJSON() ([]byte, error) {
type NoMethod Database
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DatabaseFlags: Database flags for Cloud SQL instances.
type DatabaseFlags struct {
// Name: The name of the flag. These flags are passed at instance
// startup, so include both server options and system variables for
// MySQL. Flags should be specified with underscores, not hyphens. For
// more information, see Configuring Database Flags in the Cloud SQL
// documentation.
Name string `json:"name,omitempty"`
// Value: The value of the flag. Booleans should be set to on for true
// and off for false. This field must be omitted if the flag doesn't
// take a value.
Value string `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DatabaseFlags) MarshalJSON() ([]byte, error) {
type NoMethod DatabaseFlags
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DatabaseInstance: A Cloud SQL instance resource.
type DatabaseInstance struct {
// BackendType: 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.
BackendType string `json:"backendType,omitempty"`
// ConnectionName: Connection name of the Cloud SQL instance used in
// connection strings.
ConnectionName string `json:"connectionName,omitempty"`
// CurrentDiskSize: 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.
CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"`
// DatabaseVersion: 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 MySQL First Generation instances:
// MYSQL_5_6 (default) or MYSQL_5_5
DatabaseVersion string `json:"databaseVersion,omitempty"`
// Etag: This field is deprecated and will be removed from a future
// version of the API. Use the settings.settingsVersion field instead.
Etag string `json:"etag,omitempty"`
// FailoverReplica: The name and status of the failover replica. This
// property is applicable only to Second Generation instances.
FailoverReplica *DatabaseInstanceFailoverReplica `json:"failoverReplica,omitempty"`
// GceZone: 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.
GceZone string `json:"gceZone,omitempty"`
// InstanceType: 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.
InstanceType string `json:"instanceType,omitempty"`
// IpAddresses: The assigned IP addresses for the instance.
IpAddresses []*IpMapping `json:"ipAddresses,omitempty"`
// Ipv6Address: The IPv6 address assigned to the instance. This property
// is applicable only to First Generation instances.
Ipv6Address string `json:"ipv6Address,omitempty"`
// Kind: This is always sql#instance.
Kind string `json:"kind,omitempty"`
// MasterInstanceName: The name of the instance which will act as master
// in the replication setup.
MasterInstanceName string `json:"masterInstanceName,omitempty"`
// MaxDiskSize: The maximum disk size of the instance in bytes.
MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"`
// Name: Name of the Cloud SQL instance. This does not include the
// project ID.
Name string `json:"name,omitempty"`
// OnPremisesConfiguration: Configuration specific to on-premises
// instances.
OnPremisesConfiguration *OnPremisesConfiguration `json:"onPremisesConfiguration,omitempty"`
// Project: The project ID of the project containing the Cloud SQL
// instance. The Google apps domain is prefixed if applicable.
Project string `json:"project,omitempty"`
// Region: 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.
Region string `json:"region,omitempty"`
// ReplicaConfiguration: Configuration specific to failover replicas and
// read replicas.
ReplicaConfiguration *ReplicaConfiguration `json:"replicaConfiguration,omitempty"`
// ReplicaNames: The replicas of the instance.
ReplicaNames []string `json:"replicaNames,omitempty"`
// SelfLink: The URI of this resource.
SelfLink string `json:"selfLink,omitempty"`
// ServerCaCert: SSL configuration.
ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
// ServiceAccountEmailAddress: The service account email address
// assigned to the instance. This property is applicable only to Second
// Generation instances.
ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"`
// Settings: The user settings.
Settings *Settings `json:"settings,omitempty"`
// State: 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.
State string `json:"state,omitempty"`
// SuspensionReason: If the instance state is SUSPENDED, the reason for
// the suspension.
SuspensionReason []string `json:"suspensionReason,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "BackendType") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BackendType") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DatabaseInstance) MarshalJSON() ([]byte, error) {
type NoMethod DatabaseInstance
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DatabaseInstanceFailoverReplica: The name and status of the failover
// replica. This property is applicable only to Second Generation
// instances.
type DatabaseInstanceFailoverReplica struct {
// Available: The availability status of the failover replica. A false
// status indicates that the failover replica is out of sync. The master
// can only failover to the falover replica when the status is true.
Available bool `json:"available,omitempty"`
// Name: 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.
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Available") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Available") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DatabaseInstanceFailoverReplica) MarshalJSON() ([]byte, error) {
type NoMethod DatabaseInstanceFailoverReplica
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DatabasesListResponse: Database list response.
type DatabasesListResponse struct {
// Items: List of database resources in the instance.
Items []*Database `json:"items,omitempty"`
// Kind: This is always sql#databasesList.
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DatabasesListResponse) MarshalJSON() ([]byte, error) {
type NoMethod DatabasesListResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DemoteMasterConfiguration: Read-replica configuration for connecting
// to the on-premises master.
type DemoteMasterConfiguration struct {
// Kind: This is always sql#demoteMasterConfiguration.
Kind string `json:"kind,omitempty"`
// MysqlReplicaConfiguration: MySQL specific configuration when
// replicating from a MySQL on-premises master. Replication
// configuration information such as the username, password,
// certificates, and keys are not stored in the instance metadata. The
// configuration information is used only to set up the replication
// connection and is stored by MySQL in a file named master.info in the
// data directory.
MysqlReplicaConfiguration *DemoteMasterMySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DemoteMasterConfiguration) MarshalJSON() ([]byte, error) {
type NoMethod DemoteMasterConfiguration
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DemoteMasterContext: Database instance demote master context.
type DemoteMasterContext struct {
// Kind: This is always sql#demoteMasterContext.
Kind string `json:"kind,omitempty"`
// MasterInstanceName: The name of the instance which will act as
// on-premises master in the replication setup.
MasterInstanceName string `json:"masterInstanceName,omitempty"`
// ReplicaConfiguration: Configuration specific to read-replicas
// replicating from the on-premises master.
ReplicaConfiguration *DemoteMasterConfiguration `json:"replicaConfiguration,omitempty"`
// VerifyGtidConsistency: 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 master 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.
VerifyGtidConsistency bool `json:"verifyGtidConsistency,omitempty"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DemoteMasterContext) MarshalJSON() ([]byte, error) {
type NoMethod DemoteMasterContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DemoteMasterMySqlReplicaConfiguration: Read-replica configuration
// specific to MySQL databases.
type DemoteMasterMySqlReplicaConfiguration struct {
// CaCertificate: PEM representation of the trusted CA's x509
// certificate.
CaCertificate string `json:"caCertificate,omitempty"`
// ClientCertificate: PEM representation of the slave's x509
// certificate.
ClientCertificate string `json:"clientCertificate,omitempty"`
// ClientKey: PEM representation of the slave's private key. The
// corresponsing public key is encoded in the client's certificate. The
// format of the slave's private key can be either PKCS #1 or PKCS #8.
ClientKey string `json:"clientKey,omitempty"`
// Kind: This is always sql#demoteMasterMysqlReplicaConfiguration.
Kind string `json:"kind,omitempty"`
// Password: The password for the replication connection.
Password string `json:"password,omitempty"`
// Username: The username for the replication connection.
Username string `json:"username,omitempty"`
// ForceSendFields is a list of field names (e.g. "CaCertificate") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CaCertificate") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DemoteMasterMySqlReplicaConfiguration) MarshalJSON() ([]byte, error) {
type NoMethod DemoteMasterMySqlReplicaConfiguration
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ExportContext: Database instance export context.
type ExportContext struct {
// CsvExportOptions: Options for exporting data as CSV.
// Exporting in CSV format using the Cloud SQL Admin API is not
// supported for PostgreSQL instances.
CsvExportOptions *ExportContextCsvExportOptions `json:"csvExportOptions,omitempty"`
// Databases: Databases to be exported.
// MySQL instances: If fileType is SQL and no database is specified, all
// databases are exported, except for the mysql system database. If
// fileType is CSV, you can specify one database, either by using this
// property or by using the csvExportOptions.selectQuery property, which
// takes precedence over this property.
// PostgreSQL instances: If fileType is SQL, you must specify one
// database to be exported. A fileType of CSV is not supported for
// PostgreSQL instances.
Databases []string `json:"databases,omitempty"`
// FileType: The file type for the specified uri.
// SQL: The file contains SQL statements.
// CSV: The file contains CSV data.
// CSV is not supported for PostgreSQL instances.
FileType string `json:"fileType,omitempty"`
// Kind: This is always sql#exportContext.
Kind string `json:"kind,omitempty"`
// SqlExportOptions: Options for exporting data as SQL statements.
SqlExportOptions *ExportContextSqlExportOptions `json:"sqlExportOptions,omitempty"`
// Uri: The path to the file in Google Cloud Storage where the export
// will be stored. The URI is in the form gs://bucketName/fileName. If
// the file already exists, the requests succeeds, but the operation
// fails. If fileType is SQL and the filename ends with .gz, the
// contents are compressed.
Uri string `json:"uri,omitempty"`
// ForceSendFields is a list of field names (e.g. "CsvExportOptions") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CsvExportOptions") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *ExportContext) MarshalJSON() ([]byte, error) {
type NoMethod ExportContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ExportContextCsvExportOptions: Options for exporting data as
// CSV.
// Exporting in CSV format using the Cloud SQL Admin API is not
// supported for PostgreSQL instances.
type ExportContextCsvExportOptions struct {
// SelectQuery: The select query used to extract the data.