forked from googleapis/google-api-go-client
/
sqladmin-gen.go
4339 lines (3905 loc) · 131 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
// Package sqladmin provides access to the Cloud SQL Administration API.
//
// See https://developers.google.com/cloud-sql/docs/admin-api/
//
// Usage example:
//
// import "google.golang.org/api/sqladmin/v1beta4"
// ...
// sqladminService, err := sqladmin.New(oauthHttpClient)
package sqladmin
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"google.golang.org/api/googleapi"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// 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 _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Background
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
}
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"`
}
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"`
// StartTime: Start time for the daily backup configuration in UTC
// timezone in the 24 hour format - HH:MM.
StartTime string `json:"startTime,omitempty"`
}
type BackupRun struct {
// 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: A unique identifier for this backup run. Note that this is unique
// only within the scope of a particular 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"`
// 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"`
}
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"`
}
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"`
}
type CloneContext struct {
// BinLogCoordinates: Binary log coordinates, if specified, indentify
// the 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 coordintes.
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"`
}
type Database struct {
// Charset: The MySQL charset value.
Charset string `json:"charset,omitempty"`
// Collation: The MySQL collation value.
Collation string `json:"collation,omitempty"`
// Etag: HTTP 1.1 Entity tag for the resource.
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"`
}
type DatabaseFlags struct {
// Name: The name of the flag. These flags are passed at instance
// startup, so include both MySQL server options and MySQL system
// variables. Flags should be specified with underscores, not hyphens.
// For more information, see Configuring MySQL Flags in the Google Cloud
// SQL documentation, as well as the official MySQL documentation for
// server options and system variables.
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"`
}
type DatabaseInstance struct {
// CurrentDiskSize: The current disk usage of the instance in bytes.
CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"`
// DatabaseVersion: The database engine type and version. Can be
// MYSQL_5_5 or MYSQL_5_6. Defaults to MYSQL_5_5. The databaseVersion
// can not be changed after instance creation.
DatabaseVersion string `json:"databaseVersion,omitempty"`
// Etag: HTTP 1.1 Entity tag for the resource.
Etag string `json:"etag,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.
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, asia-east1 or
// europe-west1. Defaults to us-central. The region can not be changed
// after instance creation.
Region string `json:"region,omitempty"`
// ReplicaConfiguration: Configuration specific to read-replicas
// replicating from on-premises masters.
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.
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.
// UNKNOWN_STATE: The state of the instance is unknown.
State string `json:"state,omitempty"`
}
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"`
}
type ExportContext struct {
// CsvExportOptions: Options for exporting data as CSV.
CsvExportOptions *ExportContextCsvExportOptions `json:"csvExportOptions,omitempty"`
// Databases: Databases (for example, guestbook) from which the export
// is made. If fileType is SQL and no database is specified, all
// databases are exported. If fileType is CSV, you can optionally
// specify at most one database to export. If
// csvExportOptions.selectQuery also specifies the database, this field
// will be ignored.
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.
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 operation fails. If fileType is SQL and
// the filename ends with .gz, the contents are compressed.
Uri string `json:"uri,omitempty"`
}
type ExportContextCsvExportOptions struct {
// SelectQuery: The select query used to extract the data.
SelectQuery string `json:"selectQuery,omitempty"`
}
type ExportContextSqlExportOptions struct {
// Tables: Tables to export, or that were exported, from the specified
// database. If you specify tables, specify one and only one database.
Tables []string `json:"tables,omitempty"`
}
type Flag struct {
// AllowedStringValues: For STRING flags, a list of strings that the
// value can be set to.
AllowedStringValues []string `json:"allowedStringValues,omitempty"`
// AppliesTo: The database version this flag applies to. Currently this
// can only be [MYSQL_5_5].
AppliesTo []string `json:"appliesTo,omitempty"`
// Kind: This is always sql#flag.
Kind string `json:"kind,omitempty"`
// MaxValue: For INTEGER flags, the maximum allowed value.
MaxValue int64 `json:"maxValue,omitempty,string"`
// MinValue: For INTEGER flags, the minimum allowed value.
MinValue int64 `json:"minValue,omitempty,string"`
// Name: This is the name of the flag. Flag names always use
// underscores, not hyphens, e.g. max_allowed_packet
Name string `json:"name,omitempty"`
// Type: The type of the flag. Flags are typed to being BOOLEAN, STRING,
// INTEGER or NONE. NONE is used for flags which do not take a value,
// such as skip_grant_tables.
Type string `json:"type,omitempty"`
}
type FlagsListResponse struct {
// Items: List of flags.
Items []*Flag `json:"items,omitempty"`
// Kind: This is always sql#flagsList.
Kind string `json:"kind,omitempty"`
}
type ImportContext struct {
// CsvImportOptions: Options for importing data as CSV.
CsvImportOptions *ImportContextCsvImportOptions `json:"csvImportOptions,omitempty"`
// Database: The database (for example, guestbook) to which the import
// is made. If fileType is SQL and no database is specified, it is
// assumed that the database is specified in the file to be imported. If
// fileType is CSV, it must be specified.
Database string `json:"database,omitempty"`
// FileType: The file type for the specified uri.
// SQL: The file contains SQL statements.
// CSV: The file contains CSV data.
FileType string `json:"fileType,omitempty"`
// Kind: This is always sql#importContext.
Kind string `json:"kind,omitempty"`
// Uri: A path to the file in Google Cloud Storage from which the import
// is made. The URI is in the form gs://bucketName/fileName. Compressed
// gzip files (.gz) are supported when fileType is SQL.
Uri string `json:"uri,omitempty"`
}
type ImportContextCsvImportOptions struct {
// Columns: The columns to which CSV data is imported. If not specified,
// all columns of the database table are loaded with CSV data.
Columns []string `json:"columns,omitempty"`
// Table: The table to which CSV data is imported.
Table string `json:"table,omitempty"`
}
type InstancesCloneRequest struct {
// CloneContext: Contains details about the clone operation.
CloneContext *CloneContext `json:"cloneContext,omitempty"`
}
type InstancesExportRequest struct {
// ExportContext: Contains details about the export operation.
ExportContext *ExportContext `json:"exportContext,omitempty"`
}
type InstancesImportRequest struct {
// ImportContext: Contains details about the import operation.
ImportContext *ImportContext `json:"importContext,omitempty"`
}
type InstancesListResponse struct {
// Items: List of database instance resources.
Items []*DatabaseInstance `json:"items,omitempty"`
// Kind: This is always sql#instancesList.
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"`
}
type InstancesRestoreBackupRequest struct {
// RestoreBackupContext: Parameters required to perform the restore
// backup operation.
RestoreBackupContext *RestoreBackupContext `json:"restoreBackupContext,omitempty"`
}
type IpConfiguration struct {
// AuthorizedNetworks: The list of external networks that are allowed to
// connect to the instance using the IP. In CIDR notation, also known as
// 'slash' notation (e.g. 192.168.100.0/24).
AuthorizedNetworks []*AclEntry `json:"authorizedNetworks,omitempty"`
// Ipv4Enabled: Whether the instance should be assigned an IP address or
// not.
Ipv4Enabled bool `json:"ipv4Enabled,omitempty"`
// RequireSsl: Whether the mysqld should default to 'REQUIRE X509' for
// users connecting over IP.
RequireSsl bool `json:"requireSsl,omitempty"`
}
type IpMapping struct {
// IpAddress: The IP address assigned.
IpAddress string `json:"ipAddress,omitempty"`
// TimeToRetire: The due time for this IP to be retired in RFC 3339
// format, for example 2012-11-15T16:19:00.094Z. This field is only
// available when the IP is scheduled to be retired.
TimeToRetire string `json:"timeToRetire,omitempty"`
}
type LocationPreference struct {
// FollowGaeApplication: The AppEngine application to follow, it must be
// in the same region as the Cloud SQL instance.
FollowGaeApplication string `json:"followGaeApplication,omitempty"`
// Kind: This is always sql#locationPreference.
Kind string `json:"kind,omitempty"`
// Zone: The preferred Compute Engine zone (e.g. us-centra1-a,
// us-central1-b, etc.).
Zone string `json:"zone,omitempty"`
}
type MySqlReplicaConfiguration 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.
ClientKey string `json:"clientKey,omitempty"`
// ConnectRetryInterval: Seconds to wait between connect retries.
// MySQL's default is 60 seconds.
ConnectRetryInterval int64 `json:"connectRetryInterval,omitempty"`
// DumpFilePath: Path to a SQL dump file in Google Cloud Storage from
// which the slave instance is to be created. The URI is in the form
// gs://bucketName/fileName. Compressed gzip files (.gz) are also
// supported. Dumps should have the binlog co-ordinates from which
// replication should begin. This can be accomplished by setting
// --master-data to 1 when using mysqldump.
DumpFilePath string `json:"dumpFilePath,omitempty"`
// Kind: This is always sql#mysqlReplicaConfiguration.
Kind string `json:"kind,omitempty"`
// MasterHeartbeatPeriod: Interval in milliseconds between replication
// heartbeats.
MasterHeartbeatPeriod int64 `json:"masterHeartbeatPeriod,omitempty,string"`
// Password: The password for the replication connection.
Password string `json:"password,omitempty"`
// SslCipher: A list of permissible ciphers to use for SSL encryption.
SslCipher string `json:"sslCipher,omitempty"`
// Username: The username for the replication connection.
Username string `json:"username,omitempty"`
// VerifyServerCertificate: Whether or not to check the master's Common
// Name value in the certificate that it sends during the SSL handshake.
VerifyServerCertificate bool `json:"verifyServerCertificate,omitempty"`
}
type OnPremisesConfiguration struct {
// HostPort: The host and port of the on-premises instance in host:port
// format
HostPort string `json:"hostPort,omitempty"`
// Kind: This is always sql#onPremisesConfiguration.
Kind string `json:"kind,omitempty"`
}
type Operation struct {
// EndTime: The time this operation finished in UTC timezone in RFC 3339
// format, for example 2012-11-15T16:19:00.094Z.
EndTime string `json:"endTime,omitempty"`
Error *OperationErrors `json:"error,omitempty"`
// ExportContext: The context for export operation, if applicable.
ExportContext *ExportContext `json:"exportContext,omitempty"`
// ImportContext: The context for import operation, if applicable.
ImportContext *ImportContext `json:"importContext,omitempty"`
// InsertTime: The time this operation was enqueued in UTC timezone in
// RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
InsertTime string `json:"insertTime,omitempty"`
// Kind: This is always sql#operation.
Kind string `json:"kind,omitempty"`
// Name: An identifier that uniquely identifies the operation. You can
// use this identifier to retrieve the Operations resource that has
// information about the operation.
Name string `json:"name,omitempty"`
// OperationType: The type of the operation. Valid values are CREATE,
// DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME,
// RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE,
// DELETE_DATABASE .
OperationType string `json:"operationType,omitempty"`
// SelfLink: The URI of this resource.
SelfLink string `json:"selfLink,omitempty"`
// StartTime: The time this 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 an operation. Valid values are PENDING,
// RUNNING, DONE, UNKNOWN.
Status string `json:"status,omitempty"`
// TargetId: Name of the database instance related to this operation.
TargetId string `json:"targetId,omitempty"`
// TargetLink: The URI of the instance related to the operation.
TargetLink string `json:"targetLink,omitempty"`
// TargetProject: The project ID of the target instance related to this
// operation.
TargetProject string `json:"targetProject,omitempty"`
// User: The email address of the user who initiated this operation.
User string `json:"user,omitempty"`
}
type OperationError struct {
// Code: Identifies the specific error that occurred.
Code string `json:"code,omitempty"`
// Kind: This is always sql#operationError.
Kind string `json:"kind,omitempty"`
// Message: Additional information about the error encountered.
Message string `json:"message,omitempty"`
}
type OperationErrors struct {
// Errors: The list of errors encountered while processing this
// operation.
Errors []*OperationError `json:"errors,omitempty"`
// Kind: This is always sql#operationErrors.
Kind string `json:"kind,omitempty"`
}
type OperationsListResponse struct {
// Items: List of operation resources.
Items []*Operation `json:"items,omitempty"`
// Kind: This is always sql#operationsList.
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"`
}
type ReplicaConfiguration struct {
// Kind: This is always sql#replicaConfiguration.
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 *MySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"`
}
type RestoreBackupContext struct {
// BackupRunId: The ID of the backup run to restore from.
BackupRunId int64 `json:"backupRunId,omitempty,string"`
// InstanceId: The ID of the instance that the backup was taken from.
InstanceId string `json:"instanceId,omitempty"`
// Kind: This is always sql#restoreBackupContext.
Kind string `json:"kind,omitempty"`
}
type Settings struct {
// ActivationPolicy: The activation policy for this instance. This
// specifies when the instance should be activated and is applicable
// only when the instance state is RUNNABLE. This can be one of the
// following.
// ALWAYS: The instance should always be active.
// NEVER: The instance should never be activated.
// ON_DEMAND: The instance is activated upon receiving requests.
ActivationPolicy string `json:"activationPolicy,omitempty"`
// AuthorizedGaeApplications: The App Engine app IDs that can access
// this instance.
AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"`
// BackupConfiguration: The daily backup configuration for the instance.
BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"`
// CrashSafeReplicationEnabled: Configuration specific to read replica
// instances. Indicates whether database flags for crash-safe
// replication are enabled.
CrashSafeReplicationEnabled bool `json:"crashSafeReplicationEnabled,omitempty"`
// DatabaseFlags: The database flags passed to the instance at startup.
DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"`
// DatabaseReplicationEnabled: Configuration specific to read replica
// instances. Indicates whether replication is enabled or not.
DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,omitempty"`
// IpConfiguration: The settings for IP Management. This allows to
// enable or disable the instance IP and manage which external networks
// can connect to the instance.
IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"`
// Kind: This is always sql#settings.
Kind string `json:"kind,omitempty"`
// LocationPreference: The location preference settings. This allows the
// instance to be located as near as possible to either an App Engine
// app or GCE zone for better performance.
LocationPreference *LocationPreference `json:"locationPreference,omitempty"`
// PricingPlan: The pricing plan for this instance. This can be either
// PER_USE or PACKAGE.
PricingPlan string `json:"pricingPlan,omitempty"`
// ReplicationType: The type of replication this instance uses. This can
// be either ASYNCHRONOUS or SYNCHRONOUS.
ReplicationType string `json:"replicationType,omitempty"`
// SettingsVersion: The version of instance settings. This is a required
// field for update method to make sure concurrent updates are handled
// properly. During update, use the most recent settingsVersion value
// for this instance and do not try to update this value.
SettingsVersion int64 `json:"settingsVersion,omitempty,string"`
// Tier: The tier of service for this instance, for example D1, D2. For
// more information, see pricing.
Tier string `json:"tier,omitempty"`
}
type SslCert struct {
// Cert: PEM representation.
Cert string `json:"cert,omitempty"`
// CertSerialNumber: Serial number, as extracted from the certificate.
CertSerialNumber string `json:"certSerialNumber,omitempty"`
// CommonName: User supplied name. Constrained to [a-zA-Z.-_ ]+.
CommonName string `json:"commonName,omitempty"`
// CreateTime: The time when the certificate was created in RFC 3339
// format, for example 2012-11-15T16:19:00.094Z
CreateTime string `json:"createTime,omitempty"`
// ExpirationTime: The time when the certificate expires in RFC 3339
// format, for example 2012-11-15T16:19:00.094Z.
ExpirationTime string `json:"expirationTime,omitempty"`
// Instance: Name of the database instance.
Instance string `json:"instance,omitempty"`
// Kind: This is always sql#sslCert.
Kind string `json:"kind,omitempty"`
SelfLink string `json:"selfLink,omitempty"`
// Sha1Fingerprint: Sha1 Fingerprint.
Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"`
}
type SslCertDetail struct {
// CertInfo: The public information about the cert.
CertInfo *SslCert `json:"certInfo,omitempty"`
// CertPrivateKey: The private key for the client cert, in pem format.
// Keep private in order to protect your security.
CertPrivateKey string `json:"certPrivateKey,omitempty"`
}
type SslCertsInsertRequest struct {
// CommonName: User supplied name. Must be a distinct name from the
// other certificates for this instance. New certificates will not be
// usable until the instance is restarted.
CommonName string `json:"commonName,omitempty"`
}
type SslCertsInsertResponse struct {
// ClientCert: The new client certificate and private key. The new
// certificate will not work until the instance is restarted.
ClientCert *SslCertDetail `json:"clientCert,omitempty"`
// Kind: This is always sql#sslCertsInsert.
Kind string `json:"kind,omitempty"`
// ServerCaCert: The server Certificate Authority's certificate. If this
// is missing you can force a new one to be generated by calling
// resetSslConfig method on instances resource.
ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
}
type SslCertsListResponse struct {
// Items: List of client certificates for the instance.
Items []*SslCert `json:"items,omitempty"`
// Kind: This is always sql#sslCertsList.
Kind string `json:"kind,omitempty"`
}
type Tier struct {
// DiskQuota: The maximum disk size of this tier in bytes.
DiskQuota int64 `json:"DiskQuota,omitempty,string"`
// RAM: The maximum RAM usage of this tier in bytes.
RAM int64 `json:"RAM,omitempty,string"`
// Kind: This is always sql#tier.
Kind string `json:"kind,omitempty"`
// Region: The applicable regions for this tier. Can be us-east1,
// europe-west1 or asia-east1.
Region []string `json:"region,omitempty"`
// Tier: An identifier for the service tier, for example D1, D2 etc. For
// related information, see Pricing.
Tier string `json:"tier,omitempty"`
}
type TiersListResponse struct {
// Items: List of tiers.
Items []*Tier `json:"items,omitempty"`
// Kind: This is always sql#tiersList.
Kind string `json:"kind,omitempty"`
}
type User struct {
// Etag: HTTP 1.1 Entity tag for the resource.
Etag string `json:"etag,omitempty"`
// Host: The host name from which the user can connect. For insert
// operations, host defaults to an empty string. For update operations,
// host is specified as part of the request URL. The host name is not
// mutable with this API.
Host string `json:"host,omitempty"`
// Instance: The name of the Cloud SQL instance. This does not include
// the project ID. Can be omitted for update since it is already
// specified on the URL.
Instance string `json:"instance,omitempty"`
// Kind: This is always sql#user.
Kind string `json:"kind,omitempty"`
// Name: The name of the user in the Cloud SQL instance. Can be omitted
// for update since it is already specified on the URL.
Name string `json:"name,omitempty"`
// Password: The password for the user.
Password string `json:"password,omitempty"`
// Project: The project ID of the project containing the Cloud SQL
// database. The Google apps domain is prefixed if applicable. Can be
// omitted for update since it is already specified on the URL.
Project string `json:"project,omitempty"`
}
type UsersListResponse struct {
// Items: List of user resources in the instance.
Items []*User `json:"items,omitempty"`
// Kind: This is always sql#usersList.
Kind string `json:"kind,omitempty"`
// NextPageToken: An identifier that uniquely identifies the operation.
// You can use this identifier to retrieve the Operations resource that
// has information about the operation.
NextPageToken string `json:"nextPageToken,omitempty"`
}
// method id "sql.backupRuns.get":
type BackupRunsGetCall struct {
s *Service
project string
instance string
id int64
opt_ map[string]interface{}
}
// Get: Retrieves a resource containing information about a backup run.
func (r *BackupRunsService) Get(project string, instance string, id int64) *BackupRunsGetCall {
c := &BackupRunsGetCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.id = id
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *BackupRunsGetCall) Do() (*BackupRun, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")