123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869 |
- // Package sqladmin provides access to the Cloud SQL Administration API.
- //
- // See https://cloud.google.com/sql/docs/reference/latest
- //
- // Usage example:
- //
- // import "google.golang.org/api/sqladmin/v1beta3"
- // ...
- // sqladminService, err := sqladmin.New(oauthHttpClient)
- package sqladmin // import "google.golang.org/api/sqladmin/v1beta3"
- import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- context "golang.org/x/net/context"
- ctxhttp "golang.org/x/net/context/ctxhttp"
- gensupport "google.golang.org/api/gensupport"
- googleapi "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 _ = gensupport.MarshalJSON
- var _ = googleapi.Version
- var _ = errors.New
- var _ = strings.Replace
- var _ = context.Canceled
- var _ = ctxhttp.Do
- const apiId = "sqladmin:v1beta3"
- const apiName = "sqladmin"
- const apiVersion = "v1beta3"
- const basePath = "https://www.googleapis.com/sql/v1beta3/"
- // 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.Flags = NewFlagsService(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
- BasePath string // API endpoint base URL
- UserAgent string // optional additional User-Agent fragment
- BackupRuns *BackupRunsService
- Flags *FlagsService
- Instances *InstancesService
- Operations *OperationsService
- SslCerts *SslCertsService
- Tiers *TiersService
- }
- 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 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
- }
- // BackupConfiguration: Database instance backup configuration.
- type BackupConfiguration struct {
- // BinaryLogEnabled: Whether binary log is enabled. If backup
- // configuration is disabled, binary log must be disabled as well.
- BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"`
- // Enabled: Whether this configuration is enabled.
- Enabled bool `json:"enabled,omitempty"`
- // 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"`
- // ForceSendFields is a list of field names (e.g. "BinaryLogEnabled") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *BackupConfiguration) MarshalJSON() ([]byte, error) {
- type noMethod BackupConfiguration
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // BackupRun: A database instance backup run resource.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "BackupConfiguration")
- // to unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *BackupRun) MarshalJSON() ([]byte, error) {
- type noMethod BackupRun
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // BackupRunsListResponse: Backup run list results.
- type BackupRunsListResponse struct {
- // Items: A list of backup runs in reverse chronological order of the
- // enqueued time.
- Items []*BackupRun `json:"items,omitempty"`
- // Kind: This is always sql#backupRunsList.
- Kind string `json:"kind,omitempty"`
- // NextPageToken: The continuation token, used to page through large
- // result sets. Provide this value in a subsequent request to return the
- // next page of results.
- NextPageToken string `json:"nextPageToken,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) {
- type noMethod BackupRunsListResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // BinLogCoordinates: Binary log coordinates.
- type BinLogCoordinates struct {
- // BinLogFileName: Name of the binary log file for a Cloud SQL instance.
- BinLogFileName string `json:"binLogFileName,omitempty"`
- // BinLogPosition: Position (offset) within the binary log file.
- BinLogPosition int64 `json:"binLogPosition,omitempty,string"`
- // Kind: This is always sql#binLogCoordinates.
- Kind string `json:"kind,omitempty"`
- // ForceSendFields is a list of field names (e.g. "BinLogFileName") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) {
- type noMethod BinLogCoordinates
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // CloneContext: Database instance clone context.
- type CloneContext struct {
- // BinLogCoordinates: Binary log coordinates, if specified, indentify
- // the position up to which the source instance should be cloned. If not
- // specified, the source instance is cloned up to the most recent binary
- // log coordinates.
- BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"`
- // DestinationInstanceName: Name of the Cloud SQL instance to be created
- // as a clone.
- DestinationInstanceName string `json:"destinationInstanceName,omitempty"`
- // Kind: This is always sql#cloneContext.
- Kind string `json:"kind,omitempty"`
- // SourceInstanceName: Name of the Cloud SQL instance to be cloned.
- SourceInstanceName string `json:"sourceInstanceName,omitempty"`
- // ForceSendFields is a list of field names (e.g. "BinLogCoordinates")
- // to unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *CloneContext) MarshalJSON() ([]byte, error) {
- type noMethod CloneContext
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // DatabaseFlags: MySQL flags for Cloud SQL instances.
- 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"`
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *DatabaseFlags) MarshalJSON() ([]byte, error) {
- type noMethod DatabaseFlags
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // DatabaseInstance: A Cloud SQL instance resource.
- 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
- // cannot be changed after instance creation.
- 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"`
- // InstanceType: The instance type. This can be one of the
- // following.
- // CLOUD_SQL_INSTANCE: Regular Cloud SQL
- // instance.
- // READ_REPLICA_INSTANCE: Cloud SQL instance acting 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"`
- // 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"`
- // ReplicaNames: The replicas of the instance.
- ReplicaNames []string `json:"replicaNames,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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "CurrentDiskSize") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *DatabaseInstance) MarshalJSON() ([]byte, error) {
- type noMethod DatabaseInstance
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // ExportContext: Database instance export context.
- 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"`
- // ForceSendFields is a list of field names (e.g. "Database") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *ExportContext) MarshalJSON() ([]byte, error) {
- type noMethod ExportContext
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // Flag: A Google Cloud SQL service flag resource.
- 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"`
- // ForceSendFields is a list of field names (e.g. "AllowedStringValues")
- // to unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Flag) MarshalJSON() ([]byte, error) {
- type noMethod Flag
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // FlagsListResponse: Flags list response.
- type FlagsListResponse struct {
- // Items: List of flags.
- Items []*Flag `json:"items,omitempty"`
- // Kind: This is always sql#flagsList.
- Kind string `json:"kind,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *FlagsListResponse) MarshalJSON() ([]byte, error) {
- type noMethod FlagsListResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // ImportContext: Database instance import context.
- 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"`
- // ForceSendFields is a list of field names (e.g. "Database") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *ImportContext) MarshalJSON() ([]byte, error) {
- type noMethod ImportContext
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstanceOperation: An Operations resource contains information about
- // database instance operations such as create, delete, and restart.
- // Operations resources are created in response to operations that were
- // initiated; you never create them directly.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "EndTime") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstanceOperation) MarshalJSON() ([]byte, error) {
- type noMethod InstanceOperation
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstanceSetRootPasswordRequest: Database instance set root password
- // request.
- type InstanceSetRootPasswordRequest struct {
- // SetRootPasswordContext: Set Root Password Context.
- SetRootPasswordContext *SetRootPasswordContext `json:"setRootPasswordContext,omitempty"`
- // ForceSendFields is a list of field names (e.g.
- // "SetRootPasswordContext") to unconditionally include in API requests.
- // By default, fields with empty values are omitted from API requests.
- // However, any non-pointer, non-interface field appearing in
- // ForceSendFields will be sent to the server regardless of whether the
- // field is empty or not. This may be used to include empty fields in
- // Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstanceSetRootPasswordRequest) MarshalJSON() ([]byte, error) {
- type noMethod InstanceSetRootPasswordRequest
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesCloneRequest: Database instance clone request.
- type InstancesCloneRequest struct {
- // CloneContext: Contains details about the clone operation.
- CloneContext *CloneContext `json:"cloneContext,omitempty"`
- // ForceSendFields is a list of field names (e.g. "CloneContext") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) {
- type noMethod InstancesCloneRequest
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesCloneResponse: Database instance clone response.
- type InstancesCloneResponse struct {
- // Kind: This is always sql#instancesClone.
- Kind string `json:"kind,omitempty"`
- // Operation: An unique identifier for the operation associated with the
- // cloned instance. You can use this identifier to retrieve the
- // Operations resource, which has information about the operation.
- Operation string `json:"operation,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesCloneResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesCloneResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesDeleteResponse: Database instance delete response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesDeleteResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesDeleteResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesExportRequest: Database instance export request.
- type InstancesExportRequest struct {
- // ExportContext: Contains details about the export operation.
- ExportContext *ExportContext `json:"exportContext,omitempty"`
- // ForceSendFields is a list of field names (e.g. "ExportContext") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) {
- type noMethod InstancesExportRequest
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesExportResponse: Database instance export response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesExportResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesExportResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesImportRequest: Database instance import request.
- type InstancesImportRequest struct {
- // ImportContext: Contains details about the import operation.
- ImportContext *ImportContext `json:"importContext,omitempty"`
- // ForceSendFields is a list of field names (e.g. "ImportContext") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) {
- type noMethod InstancesImportRequest
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesImportResponse: Database instance import response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesImportResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesImportResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesInsertResponse: Database instance insert response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesInsertResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesInsertResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesListResponse: Database instances list response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesListResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesListResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesPromoteReplicaResponse: Database promote read replica
- // response.
- type InstancesPromoteReplicaResponse struct {
- // Kind: This is always sql#instancesPromoteReplica.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesPromoteReplicaResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesPromoteReplicaResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesResetSslConfigResponse: Database instance resetSslConfig
- // response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesResetSslConfigResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesResetSslConfigResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesRestartResponse: Database instance restart response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesRestartResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesRestartResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesRestoreBackupResponse: Database instance restore backup
- // response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesRestoreBackupResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesRestoreBackupResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesSetRootPasswordResponse: Database instance set root password
- // response.
- type InstancesSetRootPasswordResponse struct {
- // Kind: This is always sql#instancesSetRootPassword.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesSetRootPasswordResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesSetRootPasswordResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // InstancesUpdateResponse: Database instance update response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *InstancesUpdateResponse) MarshalJSON() ([]byte, error) {
- type noMethod InstancesUpdateResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // IpConfiguration: IP Management configuration.
- 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"`
- // Kind: This is always sql#ipConfiguration.
- Kind string `json:"kind,omitempty"`
- // RequireSsl: Whether the mysqld should default to 'REQUIRE X509' for
- // users connecting over IP.
- RequireSsl bool `json:"requireSsl,omitempty"`
- // ForceSendFields is a list of field names (e.g. "AuthorizedNetworks")
- // to unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *IpConfiguration) MarshalJSON() ([]byte, error) {
- type noMethod IpConfiguration
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // IpMapping: Database instance IP Mapping.
- 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"`
- // ForceSendFields is a list of field names (e.g. "IpAddress") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *IpMapping) MarshalJSON() ([]byte, error) {
- type noMethod IpMapping
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // LocationPreference: Preferred location. This specifies where a Cloud
- // SQL instance should preferably be located, either in a specific
- // Compute Engine zone, or co-located with an App Engine application.
- // Note that if the preferred location is not available, the instance
- // will be located as close as possible within the region. Only one
- // location may be specified.
- type LocationPreference struct {
- // FollowGaeApplication: The App Engine 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"`
- // ForceSendFields is a list of field names (e.g.
- // "FollowGaeApplication") to unconditionally include in API requests.
- // By default, fields with empty values are omitted from API requests.
- // However, any non-pointer, non-interface field appearing in
- // ForceSendFields will be sent to the server regardless of whether the
- // field is empty or not. This may be used to include empty fields in
- // Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *LocationPreference) MarshalJSON() ([]byte, error) {
- type noMethod LocationPreference
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // OperationError: Database instance operation error.
- 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"`
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *OperationError) MarshalJSON() ([]byte, error) {
- type noMethod OperationError
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // OperationsListResponse: Database instance list operations response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *OperationsListResponse) MarshalJSON() ([]byte, error) {
- type noMethod OperationsListResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // SetRootPasswordContext: Database instance set root password context.
- 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"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *SetRootPasswordContext) MarshalJSON() ([]byte, error) {
- type noMethod SetRootPasswordContext
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // Settings: Database instance settings.
- 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"`
- // DatabaseFlags: The database flags passed to the instance at startup.
- DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"`
- // DatabaseReplicationEnabled: Configuration specific to read replica
- // instance. 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"`
- // ForceSendFields is a list of field names (e.g. "ActivationPolicy") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Settings) MarshalJSON() ([]byte, error) {
- type noMethod Settings
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // SslCert: SslCerts Resource
- 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: Time when the certificate expires.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Cert") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *SslCert) MarshalJSON() ([]byte, error) {
- type noMethod SslCert
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // SslCertDetail: SslCertDetail.
- 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"`
- // ForceSendFields is a list of field names (e.g. "CertInfo") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *SslCertDetail) MarshalJSON() ([]byte, error) {
- type noMethod SslCertDetail
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // SslCertsDeleteResponse: SslCert delete response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *SslCertsDeleteResponse) MarshalJSON() ([]byte, error) {
- type noMethod SslCertsDeleteResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // SslCertsInsertRequest: SslCerts insert request.
- 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"`
- // ForceSendFields is a list of field names (e.g. "CommonName") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) {
- type noMethod SslCertsInsertRequest
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // SslCertsInsertResponse: SslCert insert response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "ClientCert") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) {
- type noMethod SslCertsInsertResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // SslCertsListResponse: SslCerts list response.
- 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"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) {
- type noMethod SslCertsListResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // Tier: A Google Cloud SQL service tier resource.
- 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"`
- // ForceSendFields is a list of field names (e.g. "DiskQuota") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Tier) MarshalJSON() ([]byte, error) {
- type noMethod Tier
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // TiersListResponse: Tiers list response.
- type TiersListResponse struct {
- // Items: List of tiers.
- Items []*Tier `json:"items,omitempty"`
- // Kind: This is always sql#tiersList.
- Kind string `json:"kind,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *TiersListResponse) MarshalJSON() ([]byte, error) {
- type noMethod TiersListResponse
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // method id "sql.backupRuns.get":
- type BackupRunsGetCall struct {
- s *Service
- project string
- instance string
- backupConfiguration string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // Get: Retrieves information about a specified backup run for a Cloud
- // SQL instance.
- func (r *BackupRunsService) Get(project string, instance string, backupConfiguration string, dueTime string) *BackupRunsGetCall {
- c := &BackupRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.backupConfiguration = backupConfiguration
- c.urlParams_.Set("dueTime", dueTime)
- 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.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall {
- c.ctx_ = ctx
- return c
- }
- func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "backupConfiguration": c.backupConfiguration,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.backupRuns.get" call.
- // Exactly one of *BackupRun or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *BackupRun.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &BackupRun{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves information about a specified backup run for a Cloud SQL instance.",
- // "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 start time of the four-hour backup window. The backup can occur any time in the window. The time is 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": "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}",
- // "response": {
- // "$ref": "BackupRun"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.backupRuns.list":
- type BackupRunsListCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: Lists all backup runs associated with a Cloud SQL instance.
- func (r *BackupRunsService) List(project string, instance string, backupConfiguration string) *BackupRunsListCall {
- c := &BackupRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.urlParams_.Set("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.urlParams_.Set("maxResults", fmt.Sprint(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.urlParams_.Set("pageToken", pageToken)
- 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 *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.backupRuns.list" call.
- // Exactly one of *BackupRunsListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *BackupRunsListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &BackupRunsListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists all backup runs associated with a Cloud SQL instance.",
- // "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": "projects/{project}/instances/{instance}/backupRuns",
- // "response": {
- // "$ref": "BackupRunsListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
- // method id "sql.flags.list":
- type FlagsListCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: Lists all database flags that can be set for Google Cloud SQL
- // instances.
- func (r *FlagsService) List() *FlagsListCall {
- c := &FlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- 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 *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "flags")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.SetOpaque(req.URL)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.flags.list" call.
- // Exactly one of *FlagsListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *FlagsListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &FlagsListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists all database flags that can be set for Google Cloud SQL instances.",
- // "httpMethod": "GET",
- // "id": "sql.flags.list",
- // "path": "flags",
- // "response": {
- // "$ref": "FlagsListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.instances.clone":
- type InstancesCloneCall struct {
- s *Service
- project string
- instancesclonerequest *InstancesCloneRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Clone: Creates a Cloud SQL instance as a clone of a source instance.
- func (r *InstancesService) Clone(project string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall {
- c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instancesclonerequest = instancesclonerequest
- 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 *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/clone")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.clone" call.
- // Exactly one of *InstancesCloneResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *InstancesCloneResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*InstancesCloneResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesCloneResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a Cloud SQL instance as a clone of a source instance.",
- // "httpMethod": "POST",
- // "id": "sql.instances.clone",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID of the source as well as the clone Cloud SQL instance.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/clone",
- // "request": {
- // "$ref": "InstancesCloneRequest"
- // },
- // "response": {
- // "$ref": "InstancesCloneResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.instances.delete":
- type InstancesDeleteCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Delete: Deletes a Cloud SQL instance.
- func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall {
- c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- 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 *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.delete" call.
- // Exactly one of *InstancesDeleteResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *InstancesDeleteResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*InstancesDeleteResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesDeleteResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- 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": "projects/{project}/instances/{instance}",
- // "response": {
- // "$ref": "InstancesDeleteResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.instances.export":
- type InstancesExportCall struct {
- s *Service
- project string
- instance string
- instancesexportrequest *InstancesExportRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // 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, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.instancesexportrequest = instancesexportrequest
- 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 *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/export")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.export" call.
- // Exactly one of *InstancesExportResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *InstancesExportResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*InstancesExportResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesExportResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- 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": "projects/{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
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // Get: Retrieves information about a Cloud SQL instance.
- func (r *InstancesService) Get(project string, instance string) *InstancesGetCall {
- c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- 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 *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.get" call.
- // Exactly one of *DatabaseInstance or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *DatabaseInstance.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &DatabaseInstance{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves 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": "projects/{project}/instances/{instance}",
- // "response": {
- // "$ref": "DatabaseInstance"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.instances.import":
- type InstancesImportCall struct {
- s *Service
- project string
- instance string
- instancesimportrequest *InstancesImportRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Import: Imports data into a Cloud SQL instance from a MySQL dump file
- // stored in a Google Cloud Storage bucket.
- func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall {
- c := &InstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.instancesimportrequest = instancesimportrequest
- 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 *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/import")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.import" call.
- // Exactly one of *InstancesImportResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *InstancesImportResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*InstancesImportResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesImportResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- 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 stored in a Google Cloud Storage bucket.",
- // "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": "projects/{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
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Insert: Creates a new Cloud SQL instance.
- func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall {
- c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.databaseinstance = databaseinstance
- 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 *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.insert" call.
- // Exactly one of *InstancesInsertResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *InstancesInsertResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*InstancesInsertResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesInsertResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- 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": "projects/{project}/instances",
- // "request": {
- // "$ref": "DatabaseInstance"
- // },
- // "response": {
- // "$ref": "InstancesInsertResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.instances.list":
- type InstancesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: Lists instances for a given project, in alphabetical order by
- // instance name.
- func (r *InstancesService) List(project string) *InstancesListCall {
- c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- 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.urlParams_.Set("maxResults", fmt.Sprint(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.urlParams_.Set("pageToken", pageToken)
- 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 *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.list" call.
- // Exactly one of *InstancesListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *InstancesListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists instances for a given project, in alphabetical order by 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": "projects/{project}/instances",
- // "response": {
- // "$ref": "InstancesListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
- // method id "sql.instances.patch":
- type InstancesPatchCall struct {
- s *Service
- project string
- instance string
- databaseinstance *DatabaseInstance
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Patch: Updates the settings of a Cloud SQL instance. This method
- // supports patch semantics.
- func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall {
- c := &InstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.databaseinstance = databaseinstance
- 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 *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PATCH", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.patch" call.
- // Exactly one of *InstancesUpdateResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *InstancesUpdateResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*InstancesUpdateResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesUpdateResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates the settings of a Cloud SQL instance. 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": "projects/{project}/instances/{instance}",
- // "request": {
- // "$ref": "DatabaseInstance"
- // },
- // "response": {
- // "$ref": "InstancesUpdateResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.instances.promoteReplica":
- type InstancesPromoteReplicaCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // PromoteReplica: Promotes the read replica instance to be a
- // stand-alone Cloud SQL instance.
- func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall {
- c := &InstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- 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 *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/promoteReplica")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.promoteReplica" call.
- // Exactly one of *InstancesPromoteReplicaResponse or error will be
- // non-nil. Any non-2xx status code is an error. Response headers are in
- // either *InstancesPromoteReplicaResponse.ServerResponse.Header or (if
- // a response was returned at all) in error.(*googleapi.Error).Header.
- // Use googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*InstancesPromoteReplicaResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesPromoteReplicaResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance.",
- // "httpMethod": "POST",
- // "id": "sql.instances.promoteReplica",
- // "parameterOrder": [
- // "project",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Cloud SQL read replica instance name.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "ID of the project that contains the read replica.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/instances/{instance}/promoteReplica",
- // "response": {
- // "$ref": "InstancesPromoteReplicaResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.instances.resetSslConfig":
- type InstancesResetSslConfigCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // ResetSslConfig: Deletes all client certificates and generates a new
- // server SSL certificate for a Cloud SQL instance.
- func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall {
- c := &InstancesResetSslConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- 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 *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/resetSslConfig")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.resetSslConfig" call.
- // Exactly one of *InstancesResetSslConfigResponse or error will be
- // non-nil. Any non-2xx status code is an error. Response headers are in
- // either *InstancesResetSslConfigResponse.ServerResponse.Header or (if
- // a response was returned at all) in error.(*googleapi.Error).Header.
- // Use googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*InstancesResetSslConfigResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesResetSslConfigResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- 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 a Cloud SQL instance.",
- // "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": "projects/{project}/instances/{instance}/resetSslConfig",
- // "response": {
- // "$ref": "InstancesResetSslConfigResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.instances.restart":
- type InstancesRestartCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Restart: Restarts a Cloud SQL instance.
- func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall {
- c := &InstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- 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 *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restart")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.restart" call.
- // Exactly one of *InstancesRestartResponse or error will be non-nil.
- // Any non-2xx status code is an error. Response headers are in either
- // *InstancesRestartResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*InstancesRestartResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesRestartResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- 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": "projects/{project}/instances/{instance}/restart",
- // "response": {
- // "$ref": "InstancesRestartResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.instances.restoreBackup":
- type InstancesRestoreBackupCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // 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, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.urlParams_.Set("backupConfiguration", backupConfigurationid)
- c.urlParams_.Set("dueTime", dueTime)
- 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 *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restoreBackup")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.restoreBackup" call.
- // Exactly one of *InstancesRestoreBackupResponse or error will be
- // non-nil. Any non-2xx status code is an error. Response headers are in
- // either *InstancesRestoreBackupResponse.ServerResponse.Header or (if a
- // response was returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*InstancesRestoreBackupResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesRestoreBackupResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- 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 start time of the four-hour backup window. The backup can occur any time in the window. The time is 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": "projects/{project}/instances/{instance}/restoreBackup",
- // "response": {
- // "$ref": "InstancesRestoreBackupResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.instances.setRootPassword":
- type InstancesSetRootPasswordCall struct {
- s *Service
- project string
- instance string
- instancesetrootpasswordrequest *InstanceSetRootPasswordRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // SetRootPassword: Sets the password for the root user of the specified
- // Cloud SQL instance.
- func (r *InstancesService) SetRootPassword(project string, instance string, instancesetrootpasswordrequest *InstanceSetRootPasswordRequest) *InstancesSetRootPasswordCall {
- c := &InstancesSetRootPasswordCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.instancesetrootpasswordrequest = instancesetrootpasswordrequest
- 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 *InstancesSetRootPasswordCall) Fields(s ...googleapi.Field) *InstancesSetRootPasswordCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesSetRootPasswordCall) Context(ctx context.Context) *InstancesSetRootPasswordCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesSetRootPasswordCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesetrootpasswordrequest)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/setRootPassword")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.setRootPassword" call.
- // Exactly one of *InstancesSetRootPasswordResponse or error will be
- // non-nil. Any non-2xx status code is an error. Response headers are in
- // either *InstancesSetRootPasswordResponse.ServerResponse.Header or (if
- // a response was returned at all) in error.(*googleapi.Error).Header.
- // Use googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesSetRootPasswordCall) Do(opts ...googleapi.CallOption) (*InstancesSetRootPasswordResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesSetRootPasswordResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Sets the password for the root user of the specified Cloud SQL instance.",
- // "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": "projects/{project}/instances/{instance}/setRootPassword",
- // "request": {
- // "$ref": "InstanceSetRootPasswordRequest"
- // },
- // "response": {
- // "$ref": "InstancesSetRootPasswordResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.instances.update":
- type InstancesUpdateCall struct {
- s *Service
- project string
- instance string
- databaseinstance *DatabaseInstance
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Update: Updates the settings of a Cloud SQL instance.
- func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall {
- c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.databaseinstance = databaseinstance
- 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 *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall {
- c.ctx_ = ctx
- return c
- }
- func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PUT", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.instances.update" call.
- // Exactly one of *InstancesUpdateResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *InstancesUpdateResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*InstancesUpdateResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstancesUpdateResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates the settings of a Cloud SQL instance.",
- // "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": "projects/{project}/instances/{instance}",
- // "request": {
- // "$ref": "DatabaseInstance"
- // },
- // "response": {
- // "$ref": "InstancesUpdateResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.operations.get":
- type OperationsGetCall struct {
- s *Service
- project string
- instance string
- operation string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // Get: Retrieves information about a specific operation that was
- // performed on a Cloud SQL instance.
- func (r *OperationsService) Get(project string, instance string, operation string) *OperationsGetCall {
- c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.operation = operation
- 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 *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
- c.ctx_ = ctx
- return c
- }
- func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations/{operation}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "operation": c.operation,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.operations.get" call.
- // Exactly one of *InstanceOperation or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *InstanceOperation.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*InstanceOperation, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &InstanceOperation{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves information about a specific operation that was performed on a Cloud SQL 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": "projects/{project}/instances/{instance}/operations/{operation}",
- // "response": {
- // "$ref": "InstanceOperation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.operations.list":
- type OperationsListCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: Lists all operations that have been performed on a Cloud SQL
- // instance.
- func (r *OperationsService) List(project string, instance string) *OperationsListCall {
- c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- 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.urlParams_.Set("maxResults", fmt.Sprint(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.urlParams_.Set("pageToken", pageToken)
- 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 *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.operations.list" call.
- // Exactly one of *OperationsListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *OperationsListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &OperationsListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists all operations that have been performed on a Cloud SQL instance.",
- // "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": "projects/{project}/instances/{instance}/operations",
- // "response": {
- // "$ref": "OperationsListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
- // method id "sql.sslCerts.delete":
- type SslCertsDeleteCall struct {
- s *Service
- project string
- instance string
- sha1Fingerprint string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Delete: Deletes an SSL certificate from a Cloud SQL instance.
- func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall {
- c := &SslCertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.sha1Fingerprint = sha1Fingerprint
- 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 *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall {
- c.ctx_ = ctx
- return c
- }
- func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "sha1Fingerprint": c.sha1Fingerprint,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.sslCerts.delete" call.
- // Exactly one of *SslCertsDeleteResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *SslCertsDeleteResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*SslCertsDeleteResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &SslCertsDeleteResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Deletes an SSL certificate from a Cloud SQL instance.",
- // "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": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
- // "response": {
- // "$ref": "SslCertsDeleteResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.sslCerts.get":
- type SslCertsGetCall struct {
- s *Service
- project string
- instance string
- sha1Fingerprint string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // Get: Retrieves an SSL certificate as specified by its SHA-1
- // fingerprint.
- func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall {
- c := &SslCertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.sha1Fingerprint = sha1Fingerprint
- 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 *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall {
- c.ctx_ = ctx
- return c
- }
- func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- "sha1Fingerprint": c.sha1Fingerprint,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.sslCerts.get" call.
- // Exactly one of *SslCert or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *SslCert.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &SslCert{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves an SSL certificate as specified by its SHA-1 fingerprint.",
- // "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": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
- // "response": {
- // "$ref": "SslCert"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.sslCerts.insert":
- type SslCertsInsertCall struct {
- s *Service
- project string
- instance string
- sslcertsinsertrequest *SslCertsInsertRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Insert: Creates an SSL certificate and returns the certificate, the
- // associated private key, and the server certificate authority.
- func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall {
- c := &SslCertsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- c.sslcertsinsertrequest = sslcertsinsertrequest
- 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 *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall {
- c.ctx_ = ctx
- return c
- }
- func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.sslCerts.insert" call.
- // Exactly one of *SslCertsInsertResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *SslCertsInsertResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &SslCertsInsertResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates an SSL certificate and returns the certificate, the associated private key, and the server certificate authority.",
- // "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": "projects/{project}/instances/{instance}/sslCerts",
- // "request": {
- // "$ref": "SslCertsInsertRequest"
- // },
- // "response": {
- // "$ref": "SslCertsInsertResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.sslCerts.list":
- type SslCertsListCall struct {
- s *Service
- project string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: Lists all of the current SSL certificates defined for a Cloud
- // SQL instance.
- func (r *SslCertsService) List(project string, instance string) *SslCertsListCall {
- c := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instance = instance
- 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 *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instance": c.instance,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.sslCerts.list" call.
- // Exactly one of *SslCertsListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *SslCertsListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &SslCertsListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists all of the current SSL certificates defined for a Cloud SQL 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": "projects/{project}/instances/{instance}/sslCerts",
- // "response": {
- // "$ref": "SslCertsListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
- // method id "sql.tiers.list":
- type TiersListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: Lists service tiers that can be used to create Google Cloud SQL
- // instances.
- func (r *TiersService) List(project string) *TiersListCall {
- c := &TiersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- 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 *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *TiersListCall) Context(ctx context.Context) *TiersListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *TiersListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/tiers")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "sql.tiers.list" call.
- // Exactly one of *TiersListResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *TiersListResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &TiersListResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists service tiers that can be used to create Google Cloud SQL instances.",
- // "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": "projects/{project}/tiers",
- // "response": {
- // "$ref": "TiersListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/sqlservice.admin"
- // ]
- // }
- }
|