blob: e8016cc8665c0c5133b19944a7288b34b95d43c5 [file] [log] [blame]
// Package sqladmin provides access to the Cloud SQL Administration API.
//
// See https://developers.google.com/cloud-sql/docs/admin-api/
//
// Usage example:
//
// import "code.google.com/p/google-api-go-client/sqladmin/v1beta3"
// ...
// sqladminService, err := sqladmin.New(oauthHttpClient)
package sqladmin
import (
"bytes"
"code.google.com/p/google-api-go-client/googleapi"
"encoding/json"
"errors"
"fmt"
"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
const apiId = "sqladmin:v1beta3"
const apiName = "sqladmin"
const apiVersion = "v1beta3"
const basePath = "https://www.googleapis.com/sql/v1beta3/projects/"
// 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}
s.BackupRuns = NewBackupRunsService(s)
s.Instances = NewInstancesService(s)
s.Operations = NewOperationsService(s)
s.SslCerts = NewSslCertsService(s)
s.Tiers = NewTiersService(s)
return s, nil
}
type Service struct {
client *http.Client
BackupRuns *BackupRunsService
Instances *InstancesService
Operations *OperationsService
SslCerts *SslCertsService
Tiers *TiersService
}
func NewBackupRunsService(s *Service) *BackupRunsService {
rs := &BackupRunsService{s: s}
return rs
}
type BackupRunsService 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
}
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"`
// Id: Identifier for this configuration. This gets generated
// automatically when a backup configuration is created.
Id string `json:"id,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 {
// BackupConfiguration: Backup Configuration identifier.
BackupConfiguration string `json:"backupConfiguration,omitempty"`
// DueTime: The due time of this run in UTC timezone in RFC 3339 format,
// for example 2012-11-15T16:19:00.094Z.
DueTime string `json:"dueTime,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"`
// Instance: Name of the database instance.
Instance string `json:"instance,omitempty"`
// Kind: This is always sql#backupRun.
Kind string `json:"kind,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 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 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, for example
// MYSQL_5_5 for MySQL 5.5.
DatabaseVersion string `json:"databaseVersion,omitempty"`
// Etag: HTTP 1.1 Entity tag for the resource.
Etag string `json:"etag,omitempty"`
// Instance: Name of the Cloud SQL instance. This does not include the
// project ID.
Instance string `json:"instance,omitempty"`
// IpAddresses: The assigned IP addresses for the instance.
IpAddresses []*IpMapping `json:"ipAddresses,omitempty"`
// Kind: This is always sql#instance.
Kind string `json:"kind,omitempty"`
// MaxDiskSize: The maximum disk size of the instance in bytes.
MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"`
// 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-east1, us-central or
// europe-west1. Defaults to us-central. The region can not be changed
// after instance creation.
Region string `json:"region,omitempty"`
// ServerCaCert: SSL configuration.
ServerCaCert *SslCert `json:"serverCaCert,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 ExportContext struct {
// Database: Databases (for example, guestbook) from which the export is
// made. If unspecified, all databases are exported.
Database []string `json:"database,omitempty"`
// Kind: This is always sql#exportContext.
Kind string `json:"kind,omitempty"`
// Table: Tables to export, or that were exported, from the specified
// database. If you specify tables, specify one and only one database.
Table []string `json:"table,omitempty"`
// Uri: The path to the file in Google Cloud Storage where the export
// will be stored, or where it was already stored. The URI is in the
// form gs://bucketName/fileName. If the file already exists, the
// operation fails. If the filename ends with .gz, the contents are
// compressed.
Uri string `json:"uri,omitempty"`
}
type ImportContext struct {
// Database: The database (for example, guestbook) to which the import
// is made. If not set, it is assumed that the database is specified in
// the file to be imported.
Database string `json:"database,omitempty"`
// Kind: This is always sql#importContext.
Kind string `json:"kind,omitempty"`
// Uri: A path to the MySQL dump 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 also supported.
Uri []string `json:"uri,omitempty"`
}
type InstanceOperation 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"`
// EnqueuedTime: The time this operation was enqueued in UTC timezone in
// RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
EnqueuedTime string `json:"enqueuedTime,omitempty"`
// Error: The error(s) encountered by this operation. Only set if the
// operation results in an error.
Error []*OperationError `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"`
// Instance: Name of the database instance.
Instance string `json:"instance,omitempty"`
// Kind: This is always sql#instanceOperation.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
// OperationType: The type of the operation. Valid values are CREATE,
// DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME,
// RESTORE_VOLUME.
OperationType string `json:"operationType,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"`
// State: The state of an operation. Valid values are PENDING, RUNNING,
// DONE, UNKNOWN.
State string `json:"state,omitempty"`
// UserEmailAddress: The email address of the user who initiated this
// operation.
UserEmailAddress string `json:"userEmailAddress,omitempty"`
}
type InstanceSetRootPasswordRequest struct {
// SetRootPasswordContext: Set Root Password Context.
SetRootPasswordContext *SetRootPasswordContext `json:"setRootPasswordContext,omitempty"`
}
type InstancesDeleteResponse struct {
// Kind: This is always sql#instancesDelete.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
}
type InstancesExportRequest struct {
// ExportContext: Contains details about the export operation.
ExportContext *ExportContext `json:"exportContext,omitempty"`
}
type InstancesExportResponse struct {
// Kind: This is always sql#instancesExport.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
}
type InstancesImportRequest struct {
// ImportContext: Contains details about the import operation.
ImportContext *ImportContext `json:"importContext,omitempty"`
}
type InstancesImportResponse struct {
// Kind: This is always sql#instancesImport.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
}
type InstancesInsertResponse struct {
// Kind: This is always sql#instancesInsert.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,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 InstancesResetSslConfigResponse struct {
// Kind: This is always sql#instancesResetSslConfig.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation. All ssl client certificates will be
// deleted and a new server certificate will be created. Does not take
// effect until the next instance restart.
Operation string `json:"operation,omitempty"`
}
type InstancesRestartResponse struct {
// Kind: This is always sql#instancesRestart.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
}
type InstancesRestoreBackupResponse struct {
// Kind: This is always sql#instancesRestoreBackup.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
}
type InstancesSetRootPasswordResponse struct {
// Kind: This is always sql#instancesSetRootPasswird.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
}
type InstancesUpdateResponse struct {
// Kind: This is always sql#instancesUpdate.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve information about the operation.
Operation string `json:"operation,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 []string `json:"authorizedNetworks,omitempty"`
// Enabled: Whether the instance should be assigned an IP address or
// not.
Enabled bool `json:"enabled,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 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"`
}
type OperationsListResponse struct {
// Items: List of operation resources.
Items []*InstanceOperation `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 SetRootPasswordContext struct {
// Kind: This is always sql#setRootUserContext.
Kind string `json:"kind,omitempty"`
// Password: The password for the root user.
Password string `json:"password,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 AppEngine 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"`
// 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 AppEngine app
// or GCE zone for better perfomance.
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: Time when the certificate was created.
CreateTime string `json:"createTime,omitempty"`
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"`
// 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 SslCertsDeleteResponse struct {
// Kind: This is always sql#sslCertsDelete.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,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 and
// europe-west1.
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"`
}
// method id "sql.backupRuns.get":
type BackupRunsGetCall struct {
s *Service
project string
instance string
backupConfiguration string
dueTime string
opt_ map[string]interface{}
}
// Get: Retrieves a resource containing information about a backup run.
func (r *BackupRunsService) Get(project string, instance string, backupConfiguration string, dueTime string) *BackupRunsGetCall {
c := &BackupRunsGetCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.backupConfiguration = backupConfiguration
c.dueTime = dueTime
return c
}
func (c *BackupRunsGetCall) Do() (*BackupRun, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
params.Set("dueTime", fmt.Sprintf("%v", c.dueTime))
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/backupRuns/{backupConfiguration}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{backupConfiguration}", url.QueryEscape(c.backupConfiguration), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(BackupRun)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a resource containing information about a backup run.",
// "httpMethod": "GET",
// "id": "sql.backupRuns.get",
// "parameterOrder": [
// "project",
// "instance",
// "backupConfiguration",
// "dueTime"
// ],
// "parameters": {
// "backupConfiguration": {
// "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "dueTime": {
// "description": "The time when this run is due to start in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/backupRuns/{backupConfiguration}",
// "response": {
// "$ref": "BackupRun"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.backupRuns.list":
type BackupRunsListCall struct {
s *Service
project string
instance string
backupConfiguration string
opt_ map[string]interface{}
}
// List: Lists all backup runs associated with a given instance and
// configuration in the reverse chronological order of the enqueued
// time.
func (r *BackupRunsService) List(project string, instance string, backupConfiguration string) *BackupRunsListCall {
c := &BackupRunsListCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.backupConfiguration = backupConfiguration
return c
}
// MaxResults sets the optional parameter "maxResults": Maximum number
// of backup runs per response.
func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall {
c.opt_["maxResults"] = maxResults
return c
}
// PageToken sets the optional parameter "pageToken": A
// previously-returned page token representing part of the larger set of
// results to view.
func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall {
c.opt_["pageToken"] = pageToken
return c
}
func (c *BackupRunsListCall) Do() (*BackupRunsListResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
params.Set("backupConfiguration", fmt.Sprintf("%v", c.backupConfiguration))
if v, ok := c.opt_["maxResults"]; ok {
params.Set("maxResults", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/backupRuns")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(BackupRunsListResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the enqueued time.",
// "httpMethod": "GET",
// "id": "sql.backupRuns.list",
// "parameterOrder": [
// "project",
// "instance",
// "backupConfiguration"
// ],
// "parameters": {
// "backupConfiguration": {
// "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "maxResults": {
// "description": "Maximum number of backup runs per response.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A previously-returned page token representing part of the larger set of results to view.",
// "location": "query",
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/backupRuns",
// "response": {
// "$ref": "BackupRunsListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.delete":
type InstancesDeleteCall struct {
s *Service
project string
instance string
opt_ map[string]interface{}
}
// Delete: Deletes a Cloud SQL instance.
func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall {
c := &InstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
return c
}
func (c *InstancesDeleteCall) Do() (*InstancesDeleteResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstancesDeleteResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes a Cloud SQL instance.",
// "httpMethod": "DELETE",
// "id": "sql.instances.delete",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance to be deleted.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}",
// "response": {
// "$ref": "InstancesDeleteResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.export":
type InstancesExportCall struct {
s *Service
project string
instance string
instancesexportrequest *InstancesExportRequest
opt_ map[string]interface{}
}
// Export: Exports data from a Cloud SQL instance to a Google Cloud
// Storage bucket as a MySQL dump file.
func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall {
c := &InstancesExportCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.instancesexportrequest = instancesexportrequest
return c
}
func (c *InstancesExportCall) Do() (*InstancesExportResponse, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/export")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstancesExportResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a MySQL dump file.",
// "httpMethod": "POST",
// "id": "sql.instances.export",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance to be exported.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/export",
// "request": {
// "$ref": "InstancesExportRequest"
// },
// "response": {
// "$ref": "InstancesExportResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "sql.instances.get":
type InstancesGetCall struct {
s *Service
project string
instance string
opt_ map[string]interface{}
}
// Get: Retrieves a resource containing information about a Cloud SQL
// instance.
func (r *InstancesService) Get(project string, instance string) *InstancesGetCall {
c := &InstancesGetCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
return c
}
func (c *InstancesGetCall) Do() (*DatabaseInstance, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(DatabaseInstance)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a resource containing information about a Cloud SQL instance.",
// "httpMethod": "GET",
// "id": "sql.instances.get",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Database instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}",
// "response": {
// "$ref": "DatabaseInstance"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.import":
type InstancesImportCall struct {
s *Service
project string
instance string
instancesimportrequest *InstancesImportRequest
opt_ map[string]interface{}
}
// Import: Imports data into a Cloud SQL instance from a MySQL dump file
// in Google Cloud Storage.
func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall {
c := &InstancesImportCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.instancesimportrequest = instancesimportrequest
return c
}
func (c *InstancesImportCall) Do() (*InstancesImportResponse, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/import")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstancesImportResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Imports data into a Cloud SQL instance from a MySQL dump file in Google Cloud Storage.",
// "httpMethod": "POST",
// "id": "sql.instances.import",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/import",
// "request": {
// "$ref": "InstancesImportRequest"
// },
// "response": {
// "$ref": "InstancesImportResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "sql.instances.insert":
type InstancesInsertCall struct {
s *Service
project string
databaseinstance *DatabaseInstance
opt_ map[string]interface{}
}
// Insert: Creates a new Cloud SQL instance.
func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall {
c := &InstancesInsertCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.databaseinstance = databaseinstance
return c
}
func (c *InstancesInsertCall) Do() (*InstancesInsertResponse, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstancesInsertResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a new Cloud SQL instance.",
// "httpMethod": "POST",
// "id": "sql.instances.insert",
// "parameterOrder": [
// "project"
// ],
// "parameters": {
// "project": {
// "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances",
// "request": {
// "$ref": "DatabaseInstance"
// },
// "response": {
// "$ref": "InstancesInsertResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.list":
type InstancesListCall struct {
s *Service
project string
opt_ map[string]interface{}
}
// List: Lists instances under a given project in the alphabetical order
// of the instance name.
func (r *InstancesService) List(project string) *InstancesListCall {
c := &InstancesListCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
return c
}
// MaxResults sets the optional parameter "maxResults": The maximum
// number of results to return per response.
func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
c.opt_["maxResults"] = maxResults
return c
}
// PageToken sets the optional parameter "pageToken": A
// previously-returned page token representing part of the larger set of
// results to view.
func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
c.opt_["pageToken"] = pageToken
return c
}
func (c *InstancesListCall) Do() (*InstancesListResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["maxResults"]; ok {
params.Set("maxResults", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstancesListResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists instances under a given project in the alphabetical order of the instance name.",
// "httpMethod": "GET",
// "id": "sql.instances.list",
// "parameterOrder": [
// "project"
// ],
// "parameters": {
// "maxResults": {
// "description": "The maximum number of results to return per response.",
// "format": "uint32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A previously-returned page token representing part of the larger set of results to view.",
// "location": "query",
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project for which to list Cloud SQL instances.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances",
// "response": {
// "$ref": "InstancesListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.patch":
type InstancesPatchCall struct {
s *Service
project string
instance string
databaseinstance *DatabaseInstance
opt_ map[string]interface{}
}
// Patch: Updates settings of a Cloud SQL instance. Caution: This is not
// a partial update, so you must include values for all the settings
// that you want to retain. For partial updates, use patch.. This method
// supports patch semantics.
func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall {
c := &InstancesPatchCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.databaseinstance = databaseinstance
return c
}
func (c *InstancesPatchCall) Do() (*InstancesUpdateResponse, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PATCH", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstancesUpdateResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics.",
// "httpMethod": "PATCH",
// "id": "sql.instances.patch",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}",
// "request": {
// "$ref": "DatabaseInstance"
// },
// "response": {
// "$ref": "InstancesUpdateResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.resetSslConfig":
type InstancesResetSslConfigCall struct {
s *Service
project string
instance string
opt_ map[string]interface{}
}
// ResetSslConfig: Deletes all client certificates and generates a new
// server SSL certificate for the instance. The changes will not take
// effect until the instance is restarted. Existing instances without a
// server certificate will need to call this once to set a server
// certificate.
func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall {
c := &InstancesResetSslConfigCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
return c
}
func (c *InstancesResetSslConfigCall) Do() (*InstancesResetSslConfigResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/resetSslConfig")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstancesResetSslConfigResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes all client certificates and generates a new server SSL certificate for the instance. The changes will not take effect until the instance is restarted. Existing instances without a server certificate will need to call this once to set a server certificate.",
// "httpMethod": "POST",
// "id": "sql.instances.resetSslConfig",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/resetSslConfig",
// "response": {
// "$ref": "InstancesResetSslConfigResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.restart":
type InstancesRestartCall struct {
s *Service
project string
instance string
opt_ map[string]interface{}
}
// Restart: Restarts a Cloud SQL instance.
func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall {
c := &InstancesRestartCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
return c
}
func (c *InstancesRestartCall) Do() (*InstancesRestartResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/restart")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstancesRestartResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Restarts a Cloud SQL instance.",
// "httpMethod": "POST",
// "id": "sql.instances.restart",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance to be restarted.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/restart",
// "response": {
// "$ref": "InstancesRestartResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.restoreBackup":
type InstancesRestoreBackupCall struct {
s *Service
project string
instance string
backupConfigurationid string
dueTime string
opt_ map[string]interface{}
}
// RestoreBackup: Restores a backup of a Cloud SQL instance.
func (r *InstancesService) RestoreBackup(project string, instance string, backupConfigurationid string, dueTime string) *InstancesRestoreBackupCall {
c := &InstancesRestoreBackupCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.backupConfigurationid = backupConfigurationid
c.dueTime = dueTime
return c
}
func (c *InstancesRestoreBackupCall) Do() (*InstancesRestoreBackupResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
params.Set("backupConfiguration", fmt.Sprintf("%v", c.backupConfigurationid))
params.Set("dueTime", fmt.Sprintf("%v", c.dueTime))
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/restoreBackup")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstancesRestoreBackupResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Restores a backup of a Cloud SQL instance.",
// "httpMethod": "POST",
// "id": "sql.instances.restoreBackup",
// "parameterOrder": [
// "project",
// "instance",
// "backupConfiguration",
// "dueTime"
// ],
// "parameters": {
// "backupConfiguration": {
// "description": "The identifier of the backup configuration. This gets generated automatically when a backup configuration is created.",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "dueTime": {
// "description": "The time when this run is due to start in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/restoreBackup",
// "response": {
// "$ref": "InstancesRestoreBackupResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.setRootPassword":
type InstancesSetRootPasswordCall struct {
s *Service
project string
instance string
instancesetrootpasswordrequest *InstanceSetRootPasswordRequest
opt_ map[string]interface{}
}
// SetRootPassword: Sets the password for the root user.
func (r *InstancesService) SetRootPassword(project string, instance string, instancesetrootpasswordrequest *InstanceSetRootPasswordRequest) *InstancesSetRootPasswordCall {
c := &InstancesSetRootPasswordCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.instancesetrootpasswordrequest = instancesetrootpasswordrequest
return c
}
func (c *InstancesSetRootPasswordCall) Do() (*InstancesSetRootPasswordResponse, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesetrootpasswordrequest)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/setRootPassword")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstancesSetRootPasswordResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Sets the password for the root user.",
// "httpMethod": "POST",
// "id": "sql.instances.setRootPassword",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/setRootPassword",
// "request": {
// "$ref": "InstanceSetRootPasswordRequest"
// },
// "response": {
// "$ref": "InstancesSetRootPasswordResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.update":
type InstancesUpdateCall struct {
s *Service
project string
instance string
databaseinstance *DatabaseInstance
opt_ map[string]interface{}
}
// Update: Updates settings of a Cloud SQL instance. Caution: This is
// not a partial update, so you must include values for all the settings
// that you want to retain. For partial updates, use patch.
func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall {
c := &InstancesUpdateCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.databaseinstance = databaseinstance
return c
}
func (c *InstancesUpdateCall) Do() (*InstancesUpdateResponse, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PUT", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstancesUpdateResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.",
// "etagRequired": true,
// "httpMethod": "PUT",
// "id": "sql.instances.update",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}",
// "request": {
// "$ref": "DatabaseInstance"
// },
// "response": {
// "$ref": "InstancesUpdateResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.operations.get":
type OperationsGetCall struct {
s *Service
project string
instance string
operation string
opt_ map[string]interface{}
}
// Get: Retrieves an instance operation that has been performed on an
// instance.
func (r *OperationsService) Get(project string, instance string, operation string) *OperationsGetCall {
c := &OperationsGetCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.operation = operation
return c
}
func (c *OperationsGetCall) Do() (*InstanceOperation, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/operations/{operation}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(InstanceOperation)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves an instance operation that has been performed on an instance.",
// "httpMethod": "GET",
// "id": "sql.operations.get",
// "parameterOrder": [
// "project",
// "instance",
// "operation"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "operation": {
// "description": "Instance operation ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/operations/{operation}",
// "response": {
// "$ref": "InstanceOperation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.operations.list":
type OperationsListCall struct {
s *Service
project string
instance string
opt_ map[string]interface{}
}
// List: Lists all instance operations that have been performed on the
// given Cloud SQL instance in the reverse chronological order of the
// start time.
func (r *OperationsService) List(project string, instance string) *OperationsListCall {
c := &OperationsListCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
return c
}
// MaxResults sets the optional parameter "maxResults": Maximum number
// of operations per response.
func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall {
c.opt_["maxResults"] = maxResults
return c
}
// PageToken sets the optional parameter "pageToken": A
// previously-returned page token representing part of the larger set of
// results to view.
func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
c.opt_["pageToken"] = pageToken
return c
}
func (c *OperationsListCall) Do() (*OperationsListResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["maxResults"]; ok {
params.Set("maxResults", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/operations")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(OperationsListResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.",
// "httpMethod": "GET",
// "id": "sql.operations.list",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "maxResults": {
// "description": "Maximum number of operations per response.",
// "format": "uint32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A previously-returned page token representing part of the larger set of results to view.",
// "location": "query",
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/operations",
// "response": {
// "$ref": "OperationsListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.sslCerts.delete":
type SslCertsDeleteCall struct {
s *Service
project string
instance string
sha1Fingerprint string
opt_ map[string]interface{}
}
// Delete: Deletes the SSL certificate. The change will not take effect
// until the instance is restarted.
func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall {
c := &SslCertsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.sha1Fingerprint = sha1Fingerprint
return c
}
func (c *SslCertsDeleteCall) Do() (*SslCertsDeleteResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{sha1Fingerprint}", url.QueryEscape(c.sha1Fingerprint), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(SslCertsDeleteResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes the SSL certificate. The change will not take effect until the instance is restarted.",
// "httpMethod": "DELETE",
// "id": "sql.sslCerts.delete",
// "parameterOrder": [
// "project",
// "instance",
// "sha1Fingerprint"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance to be deleted.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "sha1Fingerprint": {
// "description": "Sha1 FingerPrint.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
// "response": {
// "$ref": "SslCertsDeleteResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.sslCerts.get":
type SslCertsGetCall struct {
s *Service
project string
instance string
sha1Fingerprint string
opt_ map[string]interface{}
}
// Get: Retrieves a particular SSL certificate. Does not include the
// private key (required for usage). The private key must be saved from
// the response to initial creation.
func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall {
c := &SslCertsGetCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.sha1Fingerprint = sha1Fingerprint
return c
}
func (c *SslCertsGetCall) Do() (*SslCert, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{sha1Fingerprint}", url.QueryEscape(c.sha1Fingerprint), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(SslCert)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.",
// "httpMethod": "GET",
// "id": "sql.sslCerts.get",
// "parameterOrder": [
// "project",
// "instance",
// "sha1Fingerprint"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "sha1Fingerprint": {
// "description": "Sha1 FingerPrint.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
// "response": {
// "$ref": "SslCert"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.sslCerts.insert":
type SslCertsInsertCall struct {
s *Service
project string
instance string
sslcertsinsertrequest *SslCertsInsertRequest
opt_ map[string]interface{}
}
// Insert: Creates an SSL certificate and returns it along with the
// private key and server certificate authority. The new certificate
// will not be usable until the instance is restarted.
func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall {
c := &SslCertsInsertCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
c.sslcertsinsertrequest = sslcertsinsertrequest
return c
}
func (c *SslCertsInsertCall) Do() (*SslCertsInsertResponse, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/sslCerts")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(SslCertsInsertResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.",
// "httpMethod": "POST",
// "id": "sql.sslCerts.insert",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/sslCerts",
// "request": {
// "$ref": "SslCertsInsertRequest"
// },
// "response": {
// "$ref": "SslCertsInsertResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.sslCerts.list":
type SslCertsListCall struct {
s *Service
project string
instance string
opt_ map[string]interface{}
}
// List: Lists all of the current SSL certificates for the instance.
func (r *SslCertsService) List(project string, instance string) *SslCertsListCall {
c := &SslCertsListCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.instance = instance
return c
}
func (c *SslCertsListCall) Do() (*SslCertsListResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/instances/{instance}/sslCerts")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(SslCertsListResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists all of the current SSL certificates for the instance.",
// "httpMethod": "GET",
// "id": "sql.sslCerts.list",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project for which to list Cloud SQL instances.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/instances/{instance}/sslCerts",
// "response": {
// "$ref": "SslCertsListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.tiers.list":
type TiersListCall struct {
s *Service
project string
opt_ map[string]interface{}
}
// List: Lists all available service tiers for Google Cloud SQL, for
// example D1, D2. For related information, see Pricing.
func (r *TiersService) List(project string) *TiersListCall {
c := &TiersListCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
return c
}
func (c *TiersListCall) Do() (*TiersListResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/sql/v1beta3/projects/", "{project}/tiers")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := new(TiersListResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists all available service tiers for Google Cloud SQL, for example D1, D2. For related information, see Pricing.",
// "httpMethod": "GET",
// "id": "sql.tiers.list",
// "parameterOrder": [
// "project"
// ],
// "parameters": {
// "project": {
// "description": "Project ID of the project for which to list tiers.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/tiers",
// "response": {
// "$ref": "TiersListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}