1
// Package replicapool provides access to the Google Compute Engine Instance Group Manager API.
3
// See https://developers.google.com/compute/docs/instance-groups/manager/v1beta2
7
// import "google.golang.org/api/replicapool/v1beta2"
9
// replicapoolService, err := replicapool.New(oauthHttpClient)
17
"google.golang.org/api/googleapi"
25
// Always reference these packages, just in case the auto-generated code
27
var _ = bytes.NewBuffer
30
var _ = json.NewDecoder
33
var _ = googleapi.Version
35
var _ = strings.Replace
37
const apiId = "replicapool:v1beta2"
38
const apiName = "replicapool"
39
const apiVersion = "v1beta2"
40
const basePath = "https://www.googleapis.com/replicapool/v1beta2/projects/"
42
// OAuth2 scopes used by this API.
44
// View and manage your data across Google Cloud Platform services
45
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
47
// View and manage your Google Compute Engine resources
48
ComputeScope = "https://www.googleapis.com/auth/compute"
50
// View your Google Compute Engine resources
51
ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
54
func New(client *http.Client) (*Service, error) {
56
return nil, errors.New("client is nil")
58
s := &Service{client: client, BasePath: basePath}
59
s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
60
s.ZoneOperations = NewZoneOperationsService(s)
66
BasePath string // API endpoint base URL
68
InstanceGroupManagers *InstanceGroupManagersService
70
ZoneOperations *ZoneOperationsService
73
func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
74
rs := &InstanceGroupManagersService{s: s}
78
type InstanceGroupManagersService struct {
82
func NewZoneOperationsService(s *Service) *ZoneOperationsService {
83
rs := &ZoneOperationsService{s: s}
87
type ZoneOperationsService struct {
91
type InstanceGroupManager struct {
92
// BaseInstanceName: The base instance name to use for instances in this
93
// group. The value must be a valid RFC1035 name. Supported characters
94
// are lowercase letters, numbers, and hyphens (-). Instances are named
95
// by appending a hyphen and a random four-character string to the base
97
BaseInstanceName string `json:"baseInstanceName,omitempty"`
99
// CreationTimestamp: [Output only] The time the instance group manager
100
// was created, in RFC3339 text format.
101
CreationTimestamp string `json:"creationTimestamp,omitempty"`
103
// CurrentSize: [Output only] The number of instances that currently
104
// exist and are a part of this group. This includes instances that are
105
// starting but are not yet RUNNING, and instances that are in the
106
// process of being deleted or abandoned.
107
CurrentSize int64 `json:"currentSize,omitempty"`
109
// Description: An optional textual description of the instance group
111
Description string `json:"description,omitempty"`
113
// Fingerprint: [Output only] Fingerprint of the instance group manager.
114
// This field is used for optimistic locking. An up-to-date fingerprint
115
// must be provided in order to modify the Instance Group Manager
117
Fingerprint string `json:"fingerprint,omitempty"`
119
// Group: [Output only] The full URL of the instance group created by
120
// the manager. This group contains all of the instances being managed,
121
// and cannot contain non-managed instances.
122
Group string `json:"group,omitempty"`
124
// Id: [Output only] A server-assigned unique identifier for the
126
Id uint64 `json:"id,omitempty,string"`
128
// InstanceTemplate: The full URL to an instance template from which all
129
// new instances will be created.
130
InstanceTemplate string `json:"instanceTemplate,omitempty"`
132
// Kind: [Output only] The resource type. Always
133
// replicapool#instanceGroupManager.
134
Kind string `json:"kind,omitempty"`
136
// Name: The name of the instance group manager. Must be 1-63 characters
137
// long and comply with RFC1035. Supported characters include lowercase
138
// letters, numbers, and hyphens.
139
Name string `json:"name,omitempty"`
141
// SelfLink: [Output only] The fully qualified URL for this resource.
142
SelfLink string `json:"selfLink,omitempty"`
144
// TargetPools: The full URL of all target pools to which new instances
145
// in the group are added. Updating the target pool values does not
146
// affect existing instances.
147
TargetPools []string `json:"targetPools,omitempty"`
149
// TargetSize: [Output only] The number of instances that the manager is
150
// attempting to maintain. Deleting or abandoning instances affects this
151
// number, as does resizing the group.
152
TargetSize int64 `json:"targetSize,omitempty"`
155
type InstanceGroupManagerList struct {
156
// Id: Unique identifier for the resource; defined by the server (output
158
Id string `json:"id,omitempty"`
160
// Items: A list of instance resources.
161
Items []*InstanceGroupManager `json:"items,omitempty"`
163
// Kind: Type of resource.
164
Kind string `json:"kind,omitempty"`
166
// NextPageToken: A token used to continue a truncated list request
168
NextPageToken string `json:"nextPageToken,omitempty"`
170
// SelfLink: Server defined URL for this resource (output only).
171
SelfLink string `json:"selfLink,omitempty"`
174
type InstanceGroupManagersAbandonInstancesRequest struct {
175
// Instances: The names of one or more instances to abandon. For
177
// { 'instances': [ 'instance-c3po', 'instance-r2d2' ] }
178
Instances []string `json:"instances,omitempty"`
181
type InstanceGroupManagersDeleteInstancesRequest struct {
182
// Instances: Names of instances to delete.
184
// Example: 'instance-foo',
186
Instances []string `json:"instances,omitempty"`
189
type InstanceGroupManagersRecreateInstancesRequest struct {
190
// Instances: The names of one or more instances to recreate. For
192
// { 'instances': [ 'instance-c3po', 'instance-r2d2' ] }
193
Instances []string `json:"instances,omitempty"`
196
type InstanceGroupManagersSetInstanceTemplateRequest struct {
197
// InstanceTemplate: The full URL to an Instance Template from which all
198
// new instances will be created.
199
InstanceTemplate string `json:"instanceTemplate,omitempty"`
202
type InstanceGroupManagersSetTargetPoolsRequest struct {
203
// Fingerprint: The current fingerprint of the Instance Group Manager
204
// resource. If this does not match the server-side fingerprint of the
205
// resource, then the request will be rejected.
206
Fingerprint string `json:"fingerprint,omitempty"`
208
// TargetPools: A list of fully-qualified URLs to existing Target Pool
209
// resources. New instances in the Instance Group Manager will be added
210
// to the specified target pools; existing instances are not affected.
211
TargetPools []string `json:"targetPools,omitempty"`
214
type Operation struct {
215
// ClientOperationId: [Output only] An optional identifier specified by
216
// the client when the mutation was initiated. Must be unique for all
217
// operation resources in the project.
218
ClientOperationId string `json:"clientOperationId,omitempty"`
220
// CreationTimestamp: [Output Only] The time that this operation was
221
// requested, in RFC3339 text format.
222
CreationTimestamp string `json:"creationTimestamp,omitempty"`
224
// EndTime: [Output Only] The time that this operation was completed, in
225
// RFC3339 text format.
226
EndTime string `json:"endTime,omitempty"`
228
// Error: [Output Only] If errors occurred during processing of this
229
// operation, this field will be populated.
230
Error *OperationError `json:"error,omitempty"`
232
// HttpErrorMessage: [Output only] If operation fails, the HTTP error
234
HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
236
// HttpErrorStatusCode: [Output only] If operation fails, the HTTP error
237
// status code returned.
238
HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
240
// Id: [Output Only] Unique identifier for the resource, generated by
242
Id uint64 `json:"id,omitempty,string"`
244
// InsertTime: [Output Only] The time that this operation was requested,
245
// in RFC3339 text format.
246
InsertTime string `json:"insertTime,omitempty"`
248
// Kind: [Output only] Type of the resource.
249
Kind string `json:"kind,omitempty"`
251
// Name: [Output Only] Name of the resource.
252
Name string `json:"name,omitempty"`
254
// OperationType: [Output only] Type of the operation. Operations
255
// include insert, update, and delete.
256
OperationType string `json:"operationType,omitempty"`
258
// Progress: [Output only] An optional progress indicator that ranges
259
// from 0 to 100. There is no requirement that this be linear or support
260
// any granularity of operations. This should not be used to guess at
261
// when the operation will be complete. This number should be
262
// monotonically increasing as the operation progresses.
263
Progress int64 `json:"progress,omitempty"`
265
// Region: [Output Only] URL of the region where the operation resides.
266
// Only available when performing regional operations.
267
Region string `json:"region,omitempty"`
269
// SelfLink: [Output Only] Server-defined fully-qualified URL for this
271
SelfLink string `json:"selfLink,omitempty"`
273
// StartTime: [Output Only] The time that this operation was started by
274
// the server, in RFC3339 text format.
275
StartTime string `json:"startTime,omitempty"`
277
// Status: [Output Only] Status of the operation.
278
Status string `json:"status,omitempty"`
280
// StatusMessage: [Output Only] An optional textual description of the
281
// current status of the operation.
282
StatusMessage string `json:"statusMessage,omitempty"`
284
// TargetId: [Output Only] Unique target ID which identifies a
285
// particular incarnation of the target.
286
TargetId uint64 `json:"targetId,omitempty,string"`
288
// TargetLink: [Output only] URL of the resource the operation is
290
TargetLink string `json:"targetLink,omitempty"`
292
// User: [Output Only] User who requested the operation, for example:
294
User string `json:"user,omitempty"`
296
// Warnings: [Output Only] If there are issues with this operation, a
297
// warning is returned.
298
Warnings []*OperationWarnings `json:"warnings,omitempty"`
300
// Zone: [Output Only] URL of the zone where the operation resides. Only
301
// available when performing per-zone operations.
302
Zone string `json:"zone,omitempty"`
305
type OperationError struct {
306
// Errors: [Output Only] The array of errors encountered while
307
// processing this operation.
308
Errors []*OperationErrorErrors `json:"errors,omitempty"`
311
type OperationErrorErrors struct {
312
// Code: [Output Only] The error type identifier for this error.
313
Code string `json:"code,omitempty"`
315
// Location: [Output Only] Indicates the field in the request which
316
// caused the error. This property is optional.
317
Location string `json:"location,omitempty"`
319
// Message: [Output Only] An optional, human-readable error message.
320
Message string `json:"message,omitempty"`
323
type OperationWarnings struct {
324
// Code: [Output only] The warning type identifier for this warning.
325
Code string `json:"code,omitempty"`
327
// Data: [Output only] Metadata for this warning in key:value format.
328
Data []*OperationWarningsData `json:"data,omitempty"`
330
// Message: [Output only] Optional human-readable details for this
332
Message string `json:"message,omitempty"`
335
type OperationWarningsData struct {
336
// Key: [Output Only] Metadata key for this warning.
337
Key string `json:"key,omitempty"`
339
// Value: [Output Only] Metadata value for this warning.
340
Value string `json:"value,omitempty"`
343
type OperationList struct {
344
// Id: Unique identifier for the resource; defined by the server (output
346
Id string `json:"id,omitempty"`
348
// Items: The operation resources.
349
Items []*Operation `json:"items,omitempty"`
351
// Kind: Type of resource.
352
Kind string `json:"kind,omitempty"`
354
// NextPageToken: A token used to continue a truncated list request
356
NextPageToken string `json:"nextPageToken,omitempty"`
358
// SelfLink: Server defined URL for this resource (output only).
359
SelfLink string `json:"selfLink,omitempty"`
362
// method id "replicapool.instanceGroupManagers.abandonInstances":
364
type InstanceGroupManagersAbandonInstancesCall struct {
368
instanceGroupManager string
369
instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
370
opt_ map[string]interface{}
373
// AbandonInstances: Removes the specified instances from the managed
374
// instance group, and from any target pools of which they were members,
375
// without deleting the instances.
376
func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
377
c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, opt_: make(map[string]interface{})}
380
c.instanceGroupManager = instanceGroupManager
381
c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
385
// Fields allows partial responses to be retrieved.
386
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
387
// for more information.
388
func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
389
c.opt_["fields"] = googleapi.CombineFields(s)
393
func (c *InstanceGroupManagersAbandonInstancesCall) Do() (*Operation, error) {
394
var body io.Reader = nil
395
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
399
ctype := "application/json"
400
params := make(url.Values)
401
params.Set("alt", "json")
402
if v, ok := c.opt_["fields"]; ok {
403
params.Set("fields", fmt.Sprintf("%v", v))
405
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
406
urls += "?" + params.Encode()
407
req, _ := http.NewRequest("POST", urls, body)
408
googleapi.Expand(req.URL, map[string]string{
409
"project": c.project,
411
"instanceGroupManager": c.instanceGroupManager,
413
req.Header.Set("Content-Type", ctype)
414
req.Header.Set("User-Agent", "google-api-go-client/0.5")
415
res, err := c.s.client.Do(req)
419
defer googleapi.CloseBody(res)
420
if err := googleapi.CheckResponse(res); err != nil {
424
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
429
// "description": "Removes the specified instances from the managed instance group, and from any target pools of which they were members, without deleting the instances.",
430
// "httpMethod": "POST",
431
// "id": "replicapool.instanceGroupManagers.abandonInstances",
432
// "parameterOrder": [
435
// "instanceGroupManager"
438
// "instanceGroupManager": {
439
// "description": "The name of the instance group manager.",
440
// "location": "path",
441
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
446
// "description": "The Google Developers Console project name.",
447
// "location": "path",
448
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
453
// "description": "The name of the zone in which the instance group manager resides.",
454
// "location": "path",
455
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
460
// "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
462
// "$ref": "InstanceGroupManagersAbandonInstancesRequest"
465
// "$ref": "Operation"
468
// "https://www.googleapis.com/auth/cloud-platform",
469
// "https://www.googleapis.com/auth/compute"
475
// method id "replicapool.instanceGroupManagers.delete":
477
type InstanceGroupManagersDeleteCall struct {
481
instanceGroupManager string
482
opt_ map[string]interface{}
485
// Delete: Deletes the instance group manager and all instances
486
// contained within. If you'd like to delete the manager without
487
// deleting the instances, you must first abandon the instances to
488
// remove them from the group.
489
func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
490
c := &InstanceGroupManagersDeleteCall{s: r.s, opt_: make(map[string]interface{})}
493
c.instanceGroupManager = instanceGroupManager
497
// Fields allows partial responses to be retrieved.
498
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
499
// for more information.
500
func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
501
c.opt_["fields"] = googleapi.CombineFields(s)
505
func (c *InstanceGroupManagersDeleteCall) Do() (*Operation, error) {
506
var body io.Reader = nil
507
params := make(url.Values)
508
params.Set("alt", "json")
509
if v, ok := c.opt_["fields"]; ok {
510
params.Set("fields", fmt.Sprintf("%v", v))
512
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
513
urls += "?" + params.Encode()
514
req, _ := http.NewRequest("DELETE", urls, body)
515
googleapi.Expand(req.URL, map[string]string{
516
"project": c.project,
518
"instanceGroupManager": c.instanceGroupManager,
520
req.Header.Set("User-Agent", "google-api-go-client/0.5")
521
res, err := c.s.client.Do(req)
525
defer googleapi.CloseBody(res)
526
if err := googleapi.CheckResponse(res); err != nil {
530
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
535
// "description": "Deletes the instance group manager and all instances contained within. If you'd like to delete the manager without deleting the instances, you must first abandon the instances to remove them from the group.",
536
// "httpMethod": "DELETE",
537
// "id": "replicapool.instanceGroupManagers.delete",
538
// "parameterOrder": [
541
// "instanceGroupManager"
544
// "instanceGroupManager": {
545
// "description": "Name of the Instance Group Manager resource to delete.",
546
// "location": "path",
547
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
552
// "description": "The Google Developers Console project name.",
553
// "location": "path",
554
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
559
// "description": "The name of the zone in which the instance group manager resides.",
560
// "location": "path",
561
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
566
// "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
568
// "$ref": "Operation"
571
// "https://www.googleapis.com/auth/cloud-platform",
572
// "https://www.googleapis.com/auth/compute"
578
// method id "replicapool.instanceGroupManagers.deleteInstances":
580
type InstanceGroupManagersDeleteInstancesCall struct {
584
instanceGroupManager string
585
instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
586
opt_ map[string]interface{}
589
// DeleteInstances: Deletes the specified instances. The instances are
590
// removed from the instance group and any target pools of which they
591
// are a member, then deleted. The targetSize of the instance group
592
// manager is reduced by the number of instances deleted.
593
func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
594
c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, opt_: make(map[string]interface{})}
597
c.instanceGroupManager = instanceGroupManager
598
c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
602
// Fields allows partial responses to be retrieved.
603
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
604
// for more information.
605
func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
606
c.opt_["fields"] = googleapi.CombineFields(s)
610
func (c *InstanceGroupManagersDeleteInstancesCall) Do() (*Operation, error) {
611
var body io.Reader = nil
612
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
616
ctype := "application/json"
617
params := make(url.Values)
618
params.Set("alt", "json")
619
if v, ok := c.opt_["fields"]; ok {
620
params.Set("fields", fmt.Sprintf("%v", v))
622
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
623
urls += "?" + params.Encode()
624
req, _ := http.NewRequest("POST", urls, body)
625
googleapi.Expand(req.URL, map[string]string{
626
"project": c.project,
628
"instanceGroupManager": c.instanceGroupManager,
630
req.Header.Set("Content-Type", ctype)
631
req.Header.Set("User-Agent", "google-api-go-client/0.5")
632
res, err := c.s.client.Do(req)
636
defer googleapi.CloseBody(res)
637
if err := googleapi.CheckResponse(res); err != nil {
641
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
646
// "description": "Deletes the specified instances. The instances are removed from the instance group and any target pools of which they are a member, then deleted. The targetSize of the instance group manager is reduced by the number of instances deleted.",
647
// "httpMethod": "POST",
648
// "id": "replicapool.instanceGroupManagers.deleteInstances",
649
// "parameterOrder": [
652
// "instanceGroupManager"
655
// "instanceGroupManager": {
656
// "description": "The name of the instance group manager.",
657
// "location": "path",
658
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
663
// "description": "The Google Developers Console project name.",
664
// "location": "path",
665
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
670
// "description": "The name of the zone in which the instance group manager resides.",
671
// "location": "path",
672
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
677
// "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
679
// "$ref": "InstanceGroupManagersDeleteInstancesRequest"
682
// "$ref": "Operation"
685
// "https://www.googleapis.com/auth/cloud-platform",
686
// "https://www.googleapis.com/auth/compute"
692
// method id "replicapool.instanceGroupManagers.get":
694
type InstanceGroupManagersGetCall struct {
698
instanceGroupManager string
699
opt_ map[string]interface{}
702
// Get: Returns the specified Instance Group Manager resource.
703
func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
704
c := &InstanceGroupManagersGetCall{s: r.s, opt_: make(map[string]interface{})}
707
c.instanceGroupManager = instanceGroupManager
711
// Fields allows partial responses to be retrieved.
712
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
713
// for more information.
714
func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
715
c.opt_["fields"] = googleapi.CombineFields(s)
719
func (c *InstanceGroupManagersGetCall) Do() (*InstanceGroupManager, error) {
720
var body io.Reader = nil
721
params := make(url.Values)
722
params.Set("alt", "json")
723
if v, ok := c.opt_["fields"]; ok {
724
params.Set("fields", fmt.Sprintf("%v", v))
726
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
727
urls += "?" + params.Encode()
728
req, _ := http.NewRequest("GET", urls, body)
729
googleapi.Expand(req.URL, map[string]string{
730
"project": c.project,
732
"instanceGroupManager": c.instanceGroupManager,
734
req.Header.Set("User-Agent", "google-api-go-client/0.5")
735
res, err := c.s.client.Do(req)
739
defer googleapi.CloseBody(res)
740
if err := googleapi.CheckResponse(res); err != nil {
743
var ret *InstanceGroupManager
744
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
749
// "description": "Returns the specified Instance Group Manager resource.",
750
// "httpMethod": "GET",
751
// "id": "replicapool.instanceGroupManagers.get",
752
// "parameterOrder": [
755
// "instanceGroupManager"
758
// "instanceGroupManager": {
759
// "description": "Name of the instance resource to return.",
760
// "location": "path",
761
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
766
// "description": "The Google Developers Console project name.",
767
// "location": "path",
768
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
773
// "description": "The name of the zone in which the instance group manager resides.",
774
// "location": "path",
775
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
780
// "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
782
// "$ref": "InstanceGroupManager"
785
// "https://www.googleapis.com/auth/cloud-platform",
786
// "https://www.googleapis.com/auth/compute",
787
// "https://www.googleapis.com/auth/compute.readonly"
793
// method id "replicapool.instanceGroupManagers.insert":
795
type InstanceGroupManagersInsertCall struct {
800
instancegroupmanager *InstanceGroupManager
801
opt_ map[string]interface{}
804
// Insert: Creates an instance group manager, as well as the instance
805
// group and the specified number of instances.
806
func (r *InstanceGroupManagersService) Insert(project string, zone string, size int64, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
807
c := &InstanceGroupManagersInsertCall{s: r.s, opt_: make(map[string]interface{})}
811
c.instancegroupmanager = instancegroupmanager
815
// Fields allows partial responses to be retrieved.
816
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
817
// for more information.
818
func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
819
c.opt_["fields"] = googleapi.CombineFields(s)
823
func (c *InstanceGroupManagersInsertCall) Do() (*Operation, error) {
824
var body io.Reader = nil
825
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
829
ctype := "application/json"
830
params := make(url.Values)
831
params.Set("alt", "json")
832
params.Set("size", fmt.Sprintf("%v", c.size))
833
if v, ok := c.opt_["fields"]; ok {
834
params.Set("fields", fmt.Sprintf("%v", v))
836
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
837
urls += "?" + params.Encode()
838
req, _ := http.NewRequest("POST", urls, body)
839
googleapi.Expand(req.URL, map[string]string{
840
"project": c.project,
843
req.Header.Set("Content-Type", ctype)
844
req.Header.Set("User-Agent", "google-api-go-client/0.5")
845
res, err := c.s.client.Do(req)
849
defer googleapi.CloseBody(res)
850
if err := googleapi.CheckResponse(res); err != nil {
854
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
859
// "description": "Creates an instance group manager, as well as the instance group and the specified number of instances.",
860
// "httpMethod": "POST",
861
// "id": "replicapool.instanceGroupManagers.insert",
862
// "parameterOrder": [
869
// "description": "The Google Developers Console project name.",
870
// "location": "path",
871
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
876
// "description": "Number of instances that should exist.",
877
// "format": "int32",
878
// "location": "query",
884
// "description": "The name of the zone in which the instance group manager resides.",
885
// "location": "path",
886
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
891
// "path": "{project}/zones/{zone}/instanceGroupManagers",
893
// "$ref": "InstanceGroupManager"
896
// "$ref": "Operation"
899
// "https://www.googleapis.com/auth/cloud-platform",
900
// "https://www.googleapis.com/auth/compute"
906
// method id "replicapool.instanceGroupManagers.list":
908
type InstanceGroupManagersListCall struct {
912
opt_ map[string]interface{}
915
// List: Retrieves the list of Instance Group Manager resources
916
// contained within the specified zone.
917
func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
918
c := &InstanceGroupManagersListCall{s: r.s, opt_: make(map[string]interface{})}
924
// Filter sets the optional parameter "filter": Filter expression for
925
// filtering listed resources.
926
func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
927
c.opt_["filter"] = filter
931
// MaxResults sets the optional parameter "maxResults": Maximum count of
932
// results to be returned. Maximum value is 500 and default value is
934
func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
935
c.opt_["maxResults"] = maxResults
939
// PageToken sets the optional parameter "pageToken": Tag returned by a
940
// previous list request truncated by maxResults. Used to continue a
941
// previous list request.
942
func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
943
c.opt_["pageToken"] = pageToken
947
// Fields allows partial responses to be retrieved.
948
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
949
// for more information.
950
func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
951
c.opt_["fields"] = googleapi.CombineFields(s)
955
func (c *InstanceGroupManagersListCall) Do() (*InstanceGroupManagerList, error) {
956
var body io.Reader = nil
957
params := make(url.Values)
958
params.Set("alt", "json")
959
if v, ok := c.opt_["filter"]; ok {
960
params.Set("filter", fmt.Sprintf("%v", v))
962
if v, ok := c.opt_["maxResults"]; ok {
963
params.Set("maxResults", fmt.Sprintf("%v", v))
965
if v, ok := c.opt_["pageToken"]; ok {
966
params.Set("pageToken", fmt.Sprintf("%v", v))
968
if v, ok := c.opt_["fields"]; ok {
969
params.Set("fields", fmt.Sprintf("%v", v))
971
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
972
urls += "?" + params.Encode()
973
req, _ := http.NewRequest("GET", urls, body)
974
googleapi.Expand(req.URL, map[string]string{
975
"project": c.project,
978
req.Header.Set("User-Agent", "google-api-go-client/0.5")
979
res, err := c.s.client.Do(req)
983
defer googleapi.CloseBody(res)
984
if err := googleapi.CheckResponse(res); err != nil {
987
var ret *InstanceGroupManagerList
988
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
993
// "description": "Retrieves the list of Instance Group Manager resources contained within the specified zone.",
994
// "httpMethod": "GET",
995
// "id": "replicapool.instanceGroupManagers.list",
996
// "parameterOrder": [
1002
// "description": "Optional. Filter expression for filtering listed resources.",
1003
// "location": "query",
1007
// "default": "500",
1008
// "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.",
1009
// "format": "uint32",
1010
// "location": "query",
1011
// "maximum": "500",
1013
// "type": "integer"
1016
// "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.",
1017
// "location": "query",
1021
// "description": "The Google Developers Console project name.",
1022
// "location": "path",
1023
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
1024
// "required": true,
1028
// "description": "The name of the zone in which the instance group manager resides.",
1029
// "location": "path",
1030
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1031
// "required": true,
1035
// "path": "{project}/zones/{zone}/instanceGroupManagers",
1037
// "$ref": "InstanceGroupManagerList"
1040
// "https://www.googleapis.com/auth/cloud-platform",
1041
// "https://www.googleapis.com/auth/compute",
1042
// "https://www.googleapis.com/auth/compute.readonly"
1048
// method id "replicapool.instanceGroupManagers.recreateInstances":
1050
type InstanceGroupManagersRecreateInstancesCall struct {
1054
instanceGroupManager string
1055
instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
1056
opt_ map[string]interface{}
1059
// RecreateInstances: Recreates the specified instances. The instances
1060
// are deleted, then recreated using the instance group manager's
1061
// current instance template.
1062
func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
1063
c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, opt_: make(map[string]interface{})}
1066
c.instanceGroupManager = instanceGroupManager
1067
c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
1071
// Fields allows partial responses to be retrieved.
1072
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1073
// for more information.
1074
func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
1075
c.opt_["fields"] = googleapi.CombineFields(s)
1079
func (c *InstanceGroupManagersRecreateInstancesCall) Do() (*Operation, error) {
1080
var body io.Reader = nil
1081
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
1085
ctype := "application/json"
1086
params := make(url.Values)
1087
params.Set("alt", "json")
1088
if v, ok := c.opt_["fields"]; ok {
1089
params.Set("fields", fmt.Sprintf("%v", v))
1091
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
1092
urls += "?" + params.Encode()
1093
req, _ := http.NewRequest("POST", urls, body)
1094
googleapi.Expand(req.URL, map[string]string{
1095
"project": c.project,
1097
"instanceGroupManager": c.instanceGroupManager,
1099
req.Header.Set("Content-Type", ctype)
1100
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1101
res, err := c.s.client.Do(req)
1105
defer googleapi.CloseBody(res)
1106
if err := googleapi.CheckResponse(res); err != nil {
1110
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1115
// "description": "Recreates the specified instances. The instances are deleted, then recreated using the instance group manager's current instance template.",
1116
// "httpMethod": "POST",
1117
// "id": "replicapool.instanceGroupManagers.recreateInstances",
1118
// "parameterOrder": [
1121
// "instanceGroupManager"
1124
// "instanceGroupManager": {
1125
// "description": "The name of the instance group manager.",
1126
// "location": "path",
1127
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1128
// "required": true,
1132
// "description": "The Google Developers Console project name.",
1133
// "location": "path",
1134
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
1135
// "required": true,
1139
// "description": "The name of the zone in which the instance group manager resides.",
1140
// "location": "path",
1141
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1142
// "required": true,
1146
// "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
1148
// "$ref": "InstanceGroupManagersRecreateInstancesRequest"
1151
// "$ref": "Operation"
1154
// "https://www.googleapis.com/auth/cloud-platform",
1155
// "https://www.googleapis.com/auth/compute"
1161
// method id "replicapool.instanceGroupManagers.resize":
1163
type InstanceGroupManagersResizeCall struct {
1167
instanceGroupManager string
1169
opt_ map[string]interface{}
1172
// Resize: Resizes the managed instance group up or down. If resized up,
1173
// new instances are created using the current instance template. If
1174
// resized down, instances are removed in the order outlined in Resizing
1175
// a managed instance group.
1176
func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
1177
c := &InstanceGroupManagersResizeCall{s: r.s, opt_: make(map[string]interface{})}
1180
c.instanceGroupManager = instanceGroupManager
1185
// Fields allows partial responses to be retrieved.
1186
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1187
// for more information.
1188
func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
1189
c.opt_["fields"] = googleapi.CombineFields(s)
1193
func (c *InstanceGroupManagersResizeCall) Do() (*Operation, error) {
1194
var body io.Reader = nil
1195
params := make(url.Values)
1196
params.Set("alt", "json")
1197
params.Set("size", fmt.Sprintf("%v", c.size))
1198
if v, ok := c.opt_["fields"]; ok {
1199
params.Set("fields", fmt.Sprintf("%v", v))
1201
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
1202
urls += "?" + params.Encode()
1203
req, _ := http.NewRequest("POST", urls, body)
1204
googleapi.Expand(req.URL, map[string]string{
1205
"project": c.project,
1207
"instanceGroupManager": c.instanceGroupManager,
1209
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1210
res, err := c.s.client.Do(req)
1214
defer googleapi.CloseBody(res)
1215
if err := googleapi.CheckResponse(res); err != nil {
1219
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1224
// "description": "Resizes the managed instance group up or down. If resized up, new instances are created using the current instance template. If resized down, instances are removed in the order outlined in Resizing a managed instance group.",
1225
// "httpMethod": "POST",
1226
// "id": "replicapool.instanceGroupManagers.resize",
1227
// "parameterOrder": [
1230
// "instanceGroupManager",
1234
// "instanceGroupManager": {
1235
// "description": "The name of the instance group manager.",
1236
// "location": "path",
1237
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1238
// "required": true,
1242
// "description": "The Google Developers Console project name.",
1243
// "location": "path",
1244
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
1245
// "required": true,
1249
// "description": "Number of instances that should exist in this Instance Group Manager.",
1250
// "format": "int32",
1251
// "location": "query",
1253
// "required": true,
1254
// "type": "integer"
1257
// "description": "The name of the zone in which the instance group manager resides.",
1258
// "location": "path",
1259
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1260
// "required": true,
1264
// "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
1266
// "$ref": "Operation"
1269
// "https://www.googleapis.com/auth/cloud-platform",
1270
// "https://www.googleapis.com/auth/compute"
1276
// method id "replicapool.instanceGroupManagers.setInstanceTemplate":
1278
type InstanceGroupManagersSetInstanceTemplateCall struct {
1282
instanceGroupManager string
1283
instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
1284
opt_ map[string]interface{}
1287
// SetInstanceTemplate: Sets the instance template to use when creating
1288
// new instances in this group. Existing instances are not affected.
1289
func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
1290
c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, opt_: make(map[string]interface{})}
1293
c.instanceGroupManager = instanceGroupManager
1294
c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
1298
// Fields allows partial responses to be retrieved.
1299
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1300
// for more information.
1301
func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
1302
c.opt_["fields"] = googleapi.CombineFields(s)
1306
func (c *InstanceGroupManagersSetInstanceTemplateCall) Do() (*Operation, error) {
1307
var body io.Reader = nil
1308
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
1312
ctype := "application/json"
1313
params := make(url.Values)
1314
params.Set("alt", "json")
1315
if v, ok := c.opt_["fields"]; ok {
1316
params.Set("fields", fmt.Sprintf("%v", v))
1318
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
1319
urls += "?" + params.Encode()
1320
req, _ := http.NewRequest("POST", urls, body)
1321
googleapi.Expand(req.URL, map[string]string{
1322
"project": c.project,
1324
"instanceGroupManager": c.instanceGroupManager,
1326
req.Header.Set("Content-Type", ctype)
1327
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1328
res, err := c.s.client.Do(req)
1332
defer googleapi.CloseBody(res)
1333
if err := googleapi.CheckResponse(res); err != nil {
1337
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1342
// "description": "Sets the instance template to use when creating new instances in this group. Existing instances are not affected.",
1343
// "httpMethod": "POST",
1344
// "id": "replicapool.instanceGroupManagers.setInstanceTemplate",
1345
// "parameterOrder": [
1348
// "instanceGroupManager"
1351
// "instanceGroupManager": {
1352
// "description": "The name of the instance group manager.",
1353
// "location": "path",
1354
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1355
// "required": true,
1359
// "description": "The Google Developers Console project name.",
1360
// "location": "path",
1361
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
1362
// "required": true,
1366
// "description": "The name of the zone in which the instance group manager resides.",
1367
// "location": "path",
1368
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1369
// "required": true,
1373
// "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
1375
// "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
1378
// "$ref": "Operation"
1381
// "https://www.googleapis.com/auth/cloud-platform",
1382
// "https://www.googleapis.com/auth/compute"
1388
// method id "replicapool.instanceGroupManagers.setTargetPools":
1390
type InstanceGroupManagersSetTargetPoolsCall struct {
1394
instanceGroupManager string
1395
instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
1396
opt_ map[string]interface{}
1399
// SetTargetPools: Modifies the target pools to which all new instances
1400
// in this group are assigned. Existing instances in the group are not
1402
func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
1403
c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, opt_: make(map[string]interface{})}
1406
c.instanceGroupManager = instanceGroupManager
1407
c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
1411
// Fields allows partial responses to be retrieved.
1412
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1413
// for more information.
1414
func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
1415
c.opt_["fields"] = googleapi.CombineFields(s)
1419
func (c *InstanceGroupManagersSetTargetPoolsCall) Do() (*Operation, error) {
1420
var body io.Reader = nil
1421
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
1425
ctype := "application/json"
1426
params := make(url.Values)
1427
params.Set("alt", "json")
1428
if v, ok := c.opt_["fields"]; ok {
1429
params.Set("fields", fmt.Sprintf("%v", v))
1431
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
1432
urls += "?" + params.Encode()
1433
req, _ := http.NewRequest("POST", urls, body)
1434
googleapi.Expand(req.URL, map[string]string{
1435
"project": c.project,
1437
"instanceGroupManager": c.instanceGroupManager,
1439
req.Header.Set("Content-Type", ctype)
1440
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1441
res, err := c.s.client.Do(req)
1445
defer googleapi.CloseBody(res)
1446
if err := googleapi.CheckResponse(res); err != nil {
1450
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1455
// "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
1456
// "httpMethod": "POST",
1457
// "id": "replicapool.instanceGroupManagers.setTargetPools",
1458
// "parameterOrder": [
1461
// "instanceGroupManager"
1464
// "instanceGroupManager": {
1465
// "description": "The name of the instance group manager.",
1466
// "location": "path",
1467
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1468
// "required": true,
1472
// "description": "The Google Developers Console project name.",
1473
// "location": "path",
1474
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
1475
// "required": true,
1479
// "description": "The name of the zone in which the instance group manager resides.",
1480
// "location": "path",
1481
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1482
// "required": true,
1486
// "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
1488
// "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
1491
// "$ref": "Operation"
1494
// "https://www.googleapis.com/auth/cloud-platform",
1495
// "https://www.googleapis.com/auth/compute"
1501
// method id "replicapool.zoneOperations.get":
1503
type ZoneOperationsGetCall struct {
1508
opt_ map[string]interface{}
1511
// Get: Retrieves the specified zone-specific operation resource.
1512
func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
1513
c := &ZoneOperationsGetCall{s: r.s, opt_: make(map[string]interface{})}
1516
c.operation = operation
1520
// Fields allows partial responses to be retrieved.
1521
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1522
// for more information.
1523
func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
1524
c.opt_["fields"] = googleapi.CombineFields(s)
1528
func (c *ZoneOperationsGetCall) Do() (*Operation, error) {
1529
var body io.Reader = nil
1530
params := make(url.Values)
1531
params.Set("alt", "json")
1532
if v, ok := c.opt_["fields"]; ok {
1533
params.Set("fields", fmt.Sprintf("%v", v))
1535
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
1536
urls += "?" + params.Encode()
1537
req, _ := http.NewRequest("GET", urls, body)
1538
googleapi.Expand(req.URL, map[string]string{
1539
"project": c.project,
1541
"operation": c.operation,
1543
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1544
res, err := c.s.client.Do(req)
1548
defer googleapi.CloseBody(res)
1549
if err := googleapi.CheckResponse(res); err != nil {
1553
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1558
// "description": "Retrieves the specified zone-specific operation resource.",
1559
// "httpMethod": "GET",
1560
// "id": "replicapool.zoneOperations.get",
1561
// "parameterOrder": [
1568
// "description": "Name of the operation resource to return.",
1569
// "location": "path",
1570
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1571
// "required": true,
1575
// "description": "Name of the project scoping this request.",
1576
// "location": "path",
1577
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
1578
// "required": true,
1582
// "description": "Name of the zone scoping this request.",
1583
// "location": "path",
1584
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1585
// "required": true,
1589
// "path": "{project}/zones/{zone}/operations/{operation}",
1591
// "$ref": "Operation"
1594
// "https://www.googleapis.com/auth/cloud-platform",
1595
// "https://www.googleapis.com/auth/compute"
1601
// method id "replicapool.zoneOperations.list":
1603
type ZoneOperationsListCall struct {
1607
opt_ map[string]interface{}
1610
// List: Retrieves the list of operation resources contained within the
1612
func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
1613
c := &ZoneOperationsListCall{s: r.s, opt_: make(map[string]interface{})}
1619
// Filter sets the optional parameter "filter": Filter expression for
1620
// filtering listed resources.
1621
func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
1622
c.opt_["filter"] = filter
1626
// MaxResults sets the optional parameter "maxResults": Maximum count of
1627
// results to be returned. Maximum value is 500 and default value is
1629
func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
1630
c.opt_["maxResults"] = maxResults
1634
// PageToken sets the optional parameter "pageToken": Tag returned by a
1635
// previous list request truncated by maxResults. Used to continue a
1636
// previous list request.
1637
func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
1638
c.opt_["pageToken"] = pageToken
1642
// Fields allows partial responses to be retrieved.
1643
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1644
// for more information.
1645
func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
1646
c.opt_["fields"] = googleapi.CombineFields(s)
1650
func (c *ZoneOperationsListCall) Do() (*OperationList, error) {
1651
var body io.Reader = nil
1652
params := make(url.Values)
1653
params.Set("alt", "json")
1654
if v, ok := c.opt_["filter"]; ok {
1655
params.Set("filter", fmt.Sprintf("%v", v))
1657
if v, ok := c.opt_["maxResults"]; ok {
1658
params.Set("maxResults", fmt.Sprintf("%v", v))
1660
if v, ok := c.opt_["pageToken"]; ok {
1661
params.Set("pageToken", fmt.Sprintf("%v", v))
1663
if v, ok := c.opt_["fields"]; ok {
1664
params.Set("fields", fmt.Sprintf("%v", v))
1666
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
1667
urls += "?" + params.Encode()
1668
req, _ := http.NewRequest("GET", urls, body)
1669
googleapi.Expand(req.URL, map[string]string{
1670
"project": c.project,
1673
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1674
res, err := c.s.client.Do(req)
1678
defer googleapi.CloseBody(res)
1679
if err := googleapi.CheckResponse(res); err != nil {
1682
var ret *OperationList
1683
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1688
// "description": "Retrieves the list of operation resources contained within the specified zone.",
1689
// "httpMethod": "GET",
1690
// "id": "replicapool.zoneOperations.list",
1691
// "parameterOrder": [
1697
// "description": "Optional. Filter expression for filtering listed resources.",
1698
// "location": "query",
1702
// "default": "500",
1703
// "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.",
1704
// "format": "uint32",
1705
// "location": "query",
1706
// "maximum": "500",
1708
// "type": "integer"
1711
// "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.",
1712
// "location": "query",
1716
// "description": "Name of the project scoping this request.",
1717
// "location": "path",
1718
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
1719
// "required": true,
1723
// "description": "Name of the zone scoping this request.",
1724
// "location": "path",
1725
// "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
1726
// "required": true,
1730
// "path": "{project}/zones/{zone}/operations",
1732
// "$ref": "OperationList"
1735
// "https://www.googleapis.com/auth/cloud-platform",
1736
// "https://www.googleapis.com/auth/compute"