~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/replicapool/v1beta2/replicapool-gen.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Package replicapool provides access to the Google Compute Engine Instance Group Manager API.
 
2
//
 
3
// See https://developers.google.com/compute/docs/instance-groups/manager/v1beta2
 
4
//
 
5
// Usage example:
 
6
//
 
7
//   import "google.golang.org/api/replicapool/v1beta2"
 
8
//   ...
 
9
//   replicapoolService, err := replicapool.New(oauthHttpClient)
 
10
package replicapool
 
11
 
 
12
import (
 
13
        "bytes"
 
14
        "encoding/json"
 
15
        "errors"
 
16
        "fmt"
 
17
        "google.golang.org/api/googleapi"
 
18
        "io"
 
19
        "net/http"
 
20
        "net/url"
 
21
        "strconv"
 
22
        "strings"
 
23
)
 
24
 
 
25
// Always reference these packages, just in case the auto-generated code
 
26
// below doesn't.
 
27
var _ = bytes.NewBuffer
 
28
var _ = strconv.Itoa
 
29
var _ = fmt.Sprintf
 
30
var _ = json.NewDecoder
 
31
var _ = io.Copy
 
32
var _ = url.Parse
 
33
var _ = googleapi.Version
 
34
var _ = errors.New
 
35
var _ = strings.Replace
 
36
 
 
37
const apiId = "replicapool:v1beta2"
 
38
const apiName = "replicapool"
 
39
const apiVersion = "v1beta2"
 
40
const basePath = "https://www.googleapis.com/replicapool/v1beta2/projects/"
 
41
 
 
42
// OAuth2 scopes used by this API.
 
43
const (
 
44
        // View and manage your data across Google Cloud Platform services
 
45
        CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
 
46
 
 
47
        // View and manage your Google Compute Engine resources
 
48
        ComputeScope = "https://www.googleapis.com/auth/compute"
 
49
 
 
50
        // View your Google Compute Engine resources
 
51
        ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
 
52
)
 
53
 
 
54
func New(client *http.Client) (*Service, error) {
 
55
        if client == nil {
 
56
                return nil, errors.New("client is nil")
 
57
        }
 
58
        s := &Service{client: client, BasePath: basePath}
 
59
        s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
 
60
        s.ZoneOperations = NewZoneOperationsService(s)
 
61
        return s, nil
 
62
}
 
63
 
 
64
type Service struct {
 
65
        client   *http.Client
 
66
        BasePath string // API endpoint base URL
 
67
 
 
68
        InstanceGroupManagers *InstanceGroupManagersService
 
69
 
 
70
        ZoneOperations *ZoneOperationsService
 
71
}
 
72
 
 
73
func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
 
74
        rs := &InstanceGroupManagersService{s: s}
 
75
        return rs
 
76
}
 
77
 
 
78
type InstanceGroupManagersService struct {
 
79
        s *Service
 
80
}
 
81
 
 
82
func NewZoneOperationsService(s *Service) *ZoneOperationsService {
 
83
        rs := &ZoneOperationsService{s: s}
 
84
        return rs
 
85
}
 
86
 
 
87
type ZoneOperationsService struct {
 
88
        s *Service
 
89
}
 
90
 
 
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
 
96
        // instance name.
 
97
        BaseInstanceName string `json:"baseInstanceName,omitempty"`
 
98
 
 
99
        // CreationTimestamp: [Output only] The time the instance group manager
 
100
        // was created, in RFC3339 text format.
 
101
        CreationTimestamp string `json:"creationTimestamp,omitempty"`
 
102
 
 
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"`
 
108
 
 
109
        // Description: An optional textual description of the instance group
 
110
        // manager.
 
111
        Description string `json:"description,omitempty"`
 
112
 
 
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
 
116
        // resource.
 
117
        Fingerprint string `json:"fingerprint,omitempty"`
 
118
 
 
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"`
 
123
 
 
124
        // Id: [Output only] A server-assigned unique identifier for the
 
125
        // resource.
 
126
        Id uint64 `json:"id,omitempty,string"`
 
127
 
 
128
        // InstanceTemplate: The full URL to an instance template from which all
 
129
        // new instances will be created.
 
130
        InstanceTemplate string `json:"instanceTemplate,omitempty"`
 
131
 
 
132
        // Kind: [Output only] The resource type. Always
 
133
        // replicapool#instanceGroupManager.
 
134
        Kind string `json:"kind,omitempty"`
 
135
 
 
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"`
 
140
 
 
141
        // SelfLink: [Output only] The fully qualified URL for this resource.
 
142
        SelfLink string `json:"selfLink,omitempty"`
 
143
 
 
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"`
 
148
 
 
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"`
 
153
}
 
154
 
 
155
type InstanceGroupManagerList struct {
 
156
        // Id: Unique identifier for the resource; defined by the server (output
 
157
        // only).
 
158
        Id string `json:"id,omitempty"`
 
159
 
 
160
        // Items: A list of instance resources.
 
161
        Items []*InstanceGroupManager `json:"items,omitempty"`
 
162
 
 
163
        // Kind: Type of resource.
 
164
        Kind string `json:"kind,omitempty"`
 
165
 
 
166
        // NextPageToken: A token used to continue a truncated list request
 
167
        // (output only).
 
168
        NextPageToken string `json:"nextPageToken,omitempty"`
 
169
 
 
170
        // SelfLink: Server defined URL for this resource (output only).
 
171
        SelfLink string `json:"selfLink,omitempty"`
 
172
}
 
173
 
 
174
type InstanceGroupManagersAbandonInstancesRequest struct {
 
175
        // Instances: The names of one or more instances to abandon. For
 
176
        // example:
 
177
        // { 'instances': [ 'instance-c3po', 'instance-r2d2' ] }
 
178
        Instances []string `json:"instances,omitempty"`
 
179
}
 
180
 
 
181
type InstanceGroupManagersDeleteInstancesRequest struct {
 
182
        // Instances: Names of instances to delete.
 
183
        //
 
184
        // Example: 'instance-foo',
 
185
        // 'instance-bar'
 
186
        Instances []string `json:"instances,omitempty"`
 
187
}
 
188
 
 
189
type InstanceGroupManagersRecreateInstancesRequest struct {
 
190
        // Instances: The names of one or more instances to recreate. For
 
191
        // example:
 
192
        // { 'instances': [ 'instance-c3po', 'instance-r2d2' ] }
 
193
        Instances []string `json:"instances,omitempty"`
 
194
}
 
195
 
 
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"`
 
200
}
 
201
 
 
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"`
 
207
 
 
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"`
 
212
}
 
213
 
 
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"`
 
219
 
 
220
        // CreationTimestamp: [Output Only] The time that this operation was
 
221
        // requested, in RFC3339 text format.
 
222
        CreationTimestamp string `json:"creationTimestamp,omitempty"`
 
223
 
 
224
        // EndTime: [Output Only] The time that this operation was completed, in
 
225
        // RFC3339 text format.
 
226
        EndTime string `json:"endTime,omitempty"`
 
227
 
 
228
        // Error: [Output Only] If errors occurred during processing of this
 
229
        // operation, this field will be populated.
 
230
        Error *OperationError `json:"error,omitempty"`
 
231
 
 
232
        // HttpErrorMessage: [Output only] If operation fails, the HTTP error
 
233
        // message returned.
 
234
        HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
 
235
 
 
236
        // HttpErrorStatusCode: [Output only] If operation fails, the HTTP error
 
237
        // status code returned.
 
238
        HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
 
239
 
 
240
        // Id: [Output Only] Unique identifier for the resource, generated by
 
241
        // the server.
 
242
        Id uint64 `json:"id,omitempty,string"`
 
243
 
 
244
        // InsertTime: [Output Only] The time that this operation was requested,
 
245
        // in RFC3339 text format.
 
246
        InsertTime string `json:"insertTime,omitempty"`
 
247
 
 
248
        // Kind: [Output only] Type of the resource.
 
249
        Kind string `json:"kind,omitempty"`
 
250
 
 
251
        // Name: [Output Only] Name of the resource.
 
252
        Name string `json:"name,omitempty"`
 
253
 
 
254
        // OperationType: [Output only] Type of the operation. Operations
 
255
        // include insert, update, and delete.
 
256
        OperationType string `json:"operationType,omitempty"`
 
257
 
 
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"`
 
264
 
 
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"`
 
268
 
 
269
        // SelfLink: [Output Only] Server-defined fully-qualified URL for this
 
270
        // resource.
 
271
        SelfLink string `json:"selfLink,omitempty"`
 
272
 
 
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"`
 
276
 
 
277
        // Status: [Output Only] Status of the operation.
 
278
        Status string `json:"status,omitempty"`
 
279
 
 
280
        // StatusMessage: [Output Only] An optional textual description of the
 
281
        // current status of the operation.
 
282
        StatusMessage string `json:"statusMessage,omitempty"`
 
283
 
 
284
        // TargetId: [Output Only] Unique target ID which identifies a
 
285
        // particular incarnation of the target.
 
286
        TargetId uint64 `json:"targetId,omitempty,string"`
 
287
 
 
288
        // TargetLink: [Output only] URL of the resource the operation is
 
289
        // mutating.
 
290
        TargetLink string `json:"targetLink,omitempty"`
 
291
 
 
292
        // User: [Output Only] User who requested the operation, for example:
 
293
        // user@example.com.
 
294
        User string `json:"user,omitempty"`
 
295
 
 
296
        // Warnings: [Output Only] If there are issues with this operation, a
 
297
        // warning is returned.
 
298
        Warnings []*OperationWarnings `json:"warnings,omitempty"`
 
299
 
 
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"`
 
303
}
 
304
 
 
305
type OperationError struct {
 
306
        // Errors: [Output Only] The array of errors encountered while
 
307
        // processing this operation.
 
308
        Errors []*OperationErrorErrors `json:"errors,omitempty"`
 
309
}
 
310
 
 
311
type OperationErrorErrors struct {
 
312
        // Code: [Output Only] The error type identifier for this error.
 
313
        Code string `json:"code,omitempty"`
 
314
 
 
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"`
 
318
 
 
319
        // Message: [Output Only] An optional, human-readable error message.
 
320
        Message string `json:"message,omitempty"`
 
321
}
 
322
 
 
323
type OperationWarnings struct {
 
324
        // Code: [Output only] The warning type identifier for this warning.
 
325
        Code string `json:"code,omitempty"`
 
326
 
 
327
        // Data: [Output only] Metadata for this warning in key:value format.
 
328
        Data []*OperationWarningsData `json:"data,omitempty"`
 
329
 
 
330
        // Message: [Output only] Optional human-readable details for this
 
331
        // warning.
 
332
        Message string `json:"message,omitempty"`
 
333
}
 
334
 
 
335
type OperationWarningsData struct {
 
336
        // Key: [Output Only] Metadata key for this warning.
 
337
        Key string `json:"key,omitempty"`
 
338
 
 
339
        // Value: [Output Only] Metadata value for this warning.
 
340
        Value string `json:"value,omitempty"`
 
341
}
 
342
 
 
343
type OperationList struct {
 
344
        // Id: Unique identifier for the resource; defined by the server (output
 
345
        // only).
 
346
        Id string `json:"id,omitempty"`
 
347
 
 
348
        // Items: The operation resources.
 
349
        Items []*Operation `json:"items,omitempty"`
 
350
 
 
351
        // Kind: Type of resource.
 
352
        Kind string `json:"kind,omitempty"`
 
353
 
 
354
        // NextPageToken: A token used to continue a truncated list request
 
355
        // (output only).
 
356
        NextPageToken string `json:"nextPageToken,omitempty"`
 
357
 
 
358
        // SelfLink: Server defined URL for this resource (output only).
 
359
        SelfLink string `json:"selfLink,omitempty"`
 
360
}
 
361
 
 
362
// method id "replicapool.instanceGroupManagers.abandonInstances":
 
363
 
 
364
type InstanceGroupManagersAbandonInstancesCall struct {
 
365
        s                                            *Service
 
366
        project                                      string
 
367
        zone                                         string
 
368
        instanceGroupManager                         string
 
369
        instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
 
370
        opt_                                         map[string]interface{}
 
371
}
 
372
 
 
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{})}
 
378
        c.project = project
 
379
        c.zone = zone
 
380
        c.instanceGroupManager = instanceGroupManager
 
381
        c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
 
382
        return c
 
383
}
 
384
 
 
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)
 
390
        return c
 
391
}
 
392
 
 
393
func (c *InstanceGroupManagersAbandonInstancesCall) Do() (*Operation, error) {
 
394
        var body io.Reader = nil
 
395
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
 
396
        if err != nil {
 
397
                return nil, err
 
398
        }
 
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))
 
404
        }
 
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,
 
410
                "zone":                 c.zone,
 
411
                "instanceGroupManager": c.instanceGroupManager,
 
412
        })
 
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)
 
416
        if err != nil {
 
417
                return nil, err
 
418
        }
 
419
        defer googleapi.CloseBody(res)
 
420
        if err := googleapi.CheckResponse(res); err != nil {
 
421
                return nil, err
 
422
        }
 
423
        var ret *Operation
 
424
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
425
                return nil, err
 
426
        }
 
427
        return ret, nil
 
428
        // {
 
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": [
 
433
        //     "project",
 
434
        //     "zone",
 
435
        //     "instanceGroupManager"
 
436
        //   ],
 
437
        //   "parameters": {
 
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])?",
 
442
        //       "required": true,
 
443
        //       "type": "string"
 
444
        //     },
 
445
        //     "project": {
 
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])?))",
 
449
        //       "required": true,
 
450
        //       "type": "string"
 
451
        //     },
 
452
        //     "zone": {
 
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])?",
 
456
        //       "required": true,
 
457
        //       "type": "string"
 
458
        //     }
 
459
        //   },
 
460
        //   "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
 
461
        //   "request": {
 
462
        //     "$ref": "InstanceGroupManagersAbandonInstancesRequest"
 
463
        //   },
 
464
        //   "response": {
 
465
        //     "$ref": "Operation"
 
466
        //   },
 
467
        //   "scopes": [
 
468
        //     "https://www.googleapis.com/auth/cloud-platform",
 
469
        //     "https://www.googleapis.com/auth/compute"
 
470
        //   ]
 
471
        // }
 
472
 
 
473
}
 
474
 
 
475
// method id "replicapool.instanceGroupManagers.delete":
 
476
 
 
477
type InstanceGroupManagersDeleteCall struct {
 
478
        s                    *Service
 
479
        project              string
 
480
        zone                 string
 
481
        instanceGroupManager string
 
482
        opt_                 map[string]interface{}
 
483
}
 
484
 
 
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{})}
 
491
        c.project = project
 
492
        c.zone = zone
 
493
        c.instanceGroupManager = instanceGroupManager
 
494
        return c
 
495
}
 
496
 
 
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)
 
502
        return c
 
503
}
 
504
 
 
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))
 
511
        }
 
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,
 
517
                "zone":                 c.zone,
 
518
                "instanceGroupManager": c.instanceGroupManager,
 
519
        })
 
520
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
521
        res, err := c.s.client.Do(req)
 
522
        if err != nil {
 
523
                return nil, err
 
524
        }
 
525
        defer googleapi.CloseBody(res)
 
526
        if err := googleapi.CheckResponse(res); err != nil {
 
527
                return nil, err
 
528
        }
 
529
        var ret *Operation
 
530
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
531
                return nil, err
 
532
        }
 
533
        return ret, nil
 
534
        // {
 
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": [
 
539
        //     "project",
 
540
        //     "zone",
 
541
        //     "instanceGroupManager"
 
542
        //   ],
 
543
        //   "parameters": {
 
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])?",
 
548
        //       "required": true,
 
549
        //       "type": "string"
 
550
        //     },
 
551
        //     "project": {
 
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])?))",
 
555
        //       "required": true,
 
556
        //       "type": "string"
 
557
        //     },
 
558
        //     "zone": {
 
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])?",
 
562
        //       "required": true,
 
563
        //       "type": "string"
 
564
        //     }
 
565
        //   },
 
566
        //   "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
 
567
        //   "response": {
 
568
        //     "$ref": "Operation"
 
569
        //   },
 
570
        //   "scopes": [
 
571
        //     "https://www.googleapis.com/auth/cloud-platform",
 
572
        //     "https://www.googleapis.com/auth/compute"
 
573
        //   ]
 
574
        // }
 
575
 
 
576
}
 
577
 
 
578
// method id "replicapool.instanceGroupManagers.deleteInstances":
 
579
 
 
580
type InstanceGroupManagersDeleteInstancesCall struct {
 
581
        s                                           *Service
 
582
        project                                     string
 
583
        zone                                        string
 
584
        instanceGroupManager                        string
 
585
        instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
 
586
        opt_                                        map[string]interface{}
 
587
}
 
588
 
 
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{})}
 
595
        c.project = project
 
596
        c.zone = zone
 
597
        c.instanceGroupManager = instanceGroupManager
 
598
        c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
 
599
        return c
 
600
}
 
601
 
 
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)
 
607
        return c
 
608
}
 
609
 
 
610
func (c *InstanceGroupManagersDeleteInstancesCall) Do() (*Operation, error) {
 
611
        var body io.Reader = nil
 
612
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
 
613
        if err != nil {
 
614
                return nil, err
 
615
        }
 
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))
 
621
        }
 
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,
 
627
                "zone":                 c.zone,
 
628
                "instanceGroupManager": c.instanceGroupManager,
 
629
        })
 
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)
 
633
        if err != nil {
 
634
                return nil, err
 
635
        }
 
636
        defer googleapi.CloseBody(res)
 
637
        if err := googleapi.CheckResponse(res); err != nil {
 
638
                return nil, err
 
639
        }
 
640
        var ret *Operation
 
641
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
642
                return nil, err
 
643
        }
 
644
        return ret, nil
 
645
        // {
 
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": [
 
650
        //     "project",
 
651
        //     "zone",
 
652
        //     "instanceGroupManager"
 
653
        //   ],
 
654
        //   "parameters": {
 
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])?",
 
659
        //       "required": true,
 
660
        //       "type": "string"
 
661
        //     },
 
662
        //     "project": {
 
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])?))",
 
666
        //       "required": true,
 
667
        //       "type": "string"
 
668
        //     },
 
669
        //     "zone": {
 
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])?",
 
673
        //       "required": true,
 
674
        //       "type": "string"
 
675
        //     }
 
676
        //   },
 
677
        //   "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
 
678
        //   "request": {
 
679
        //     "$ref": "InstanceGroupManagersDeleteInstancesRequest"
 
680
        //   },
 
681
        //   "response": {
 
682
        //     "$ref": "Operation"
 
683
        //   },
 
684
        //   "scopes": [
 
685
        //     "https://www.googleapis.com/auth/cloud-platform",
 
686
        //     "https://www.googleapis.com/auth/compute"
 
687
        //   ]
 
688
        // }
 
689
 
 
690
}
 
691
 
 
692
// method id "replicapool.instanceGroupManagers.get":
 
693
 
 
694
type InstanceGroupManagersGetCall struct {
 
695
        s                    *Service
 
696
        project              string
 
697
        zone                 string
 
698
        instanceGroupManager string
 
699
        opt_                 map[string]interface{}
 
700
}
 
701
 
 
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{})}
 
705
        c.project = project
 
706
        c.zone = zone
 
707
        c.instanceGroupManager = instanceGroupManager
 
708
        return c
 
709
}
 
710
 
 
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)
 
716
        return c
 
717
}
 
718
 
 
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))
 
725
        }
 
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,
 
731
                "zone":                 c.zone,
 
732
                "instanceGroupManager": c.instanceGroupManager,
 
733
        })
 
734
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
735
        res, err := c.s.client.Do(req)
 
736
        if err != nil {
 
737
                return nil, err
 
738
        }
 
739
        defer googleapi.CloseBody(res)
 
740
        if err := googleapi.CheckResponse(res); err != nil {
 
741
                return nil, err
 
742
        }
 
743
        var ret *InstanceGroupManager
 
744
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
745
                return nil, err
 
746
        }
 
747
        return ret, nil
 
748
        // {
 
749
        //   "description": "Returns the specified Instance Group Manager resource.",
 
750
        //   "httpMethod": "GET",
 
751
        //   "id": "replicapool.instanceGroupManagers.get",
 
752
        //   "parameterOrder": [
 
753
        //     "project",
 
754
        //     "zone",
 
755
        //     "instanceGroupManager"
 
756
        //   ],
 
757
        //   "parameters": {
 
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])?",
 
762
        //       "required": true,
 
763
        //       "type": "string"
 
764
        //     },
 
765
        //     "project": {
 
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])?))",
 
769
        //       "required": true,
 
770
        //       "type": "string"
 
771
        //     },
 
772
        //     "zone": {
 
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])?",
 
776
        //       "required": true,
 
777
        //       "type": "string"
 
778
        //     }
 
779
        //   },
 
780
        //   "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
 
781
        //   "response": {
 
782
        //     "$ref": "InstanceGroupManager"
 
783
        //   },
 
784
        //   "scopes": [
 
785
        //     "https://www.googleapis.com/auth/cloud-platform",
 
786
        //     "https://www.googleapis.com/auth/compute",
 
787
        //     "https://www.googleapis.com/auth/compute.readonly"
 
788
        //   ]
 
789
        // }
 
790
 
 
791
}
 
792
 
 
793
// method id "replicapool.instanceGroupManagers.insert":
 
794
 
 
795
type InstanceGroupManagersInsertCall struct {
 
796
        s                    *Service
 
797
        project              string
 
798
        zone                 string
 
799
        size                 int64
 
800
        instancegroupmanager *InstanceGroupManager
 
801
        opt_                 map[string]interface{}
 
802
}
 
803
 
 
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{})}
 
808
        c.project = project
 
809
        c.zone = zone
 
810
        c.size = size
 
811
        c.instancegroupmanager = instancegroupmanager
 
812
        return c
 
813
}
 
814
 
 
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)
 
820
        return c
 
821
}
 
822
 
 
823
func (c *InstanceGroupManagersInsertCall) Do() (*Operation, error) {
 
824
        var body io.Reader = nil
 
825
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
 
826
        if err != nil {
 
827
                return nil, err
 
828
        }
 
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))
 
835
        }
 
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,
 
841
                "zone":    c.zone,
 
842
        })
 
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)
 
846
        if err != nil {
 
847
                return nil, err
 
848
        }
 
849
        defer googleapi.CloseBody(res)
 
850
        if err := googleapi.CheckResponse(res); err != nil {
 
851
                return nil, err
 
852
        }
 
853
        var ret *Operation
 
854
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
855
                return nil, err
 
856
        }
 
857
        return ret, nil
 
858
        // {
 
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": [
 
863
        //     "project",
 
864
        //     "zone",
 
865
        //     "size"
 
866
        //   ],
 
867
        //   "parameters": {
 
868
        //     "project": {
 
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])?))",
 
872
        //       "required": true,
 
873
        //       "type": "string"
 
874
        //     },
 
875
        //     "size": {
 
876
        //       "description": "Number of instances that should exist.",
 
877
        //       "format": "int32",
 
878
        //       "location": "query",
 
879
        //       "minimum": "0",
 
880
        //       "required": true,
 
881
        //       "type": "integer"
 
882
        //     },
 
883
        //     "zone": {
 
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])?",
 
887
        //       "required": true,
 
888
        //       "type": "string"
 
889
        //     }
 
890
        //   },
 
891
        //   "path": "{project}/zones/{zone}/instanceGroupManagers",
 
892
        //   "request": {
 
893
        //     "$ref": "InstanceGroupManager"
 
894
        //   },
 
895
        //   "response": {
 
896
        //     "$ref": "Operation"
 
897
        //   },
 
898
        //   "scopes": [
 
899
        //     "https://www.googleapis.com/auth/cloud-platform",
 
900
        //     "https://www.googleapis.com/auth/compute"
 
901
        //   ]
 
902
        // }
 
903
 
 
904
}
 
905
 
 
906
// method id "replicapool.instanceGroupManagers.list":
 
907
 
 
908
type InstanceGroupManagersListCall struct {
 
909
        s       *Service
 
910
        project string
 
911
        zone    string
 
912
        opt_    map[string]interface{}
 
913
}
 
914
 
 
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{})}
 
919
        c.project = project
 
920
        c.zone = zone
 
921
        return c
 
922
}
 
923
 
 
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
 
928
        return c
 
929
}
 
930
 
 
931
// MaxResults sets the optional parameter "maxResults": Maximum count of
 
932
// results to be returned. Maximum value is 500 and default value is
 
933
// 500.
 
934
func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
 
935
        c.opt_["maxResults"] = maxResults
 
936
        return c
 
937
}
 
938
 
 
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
 
944
        return c
 
945
}
 
946
 
 
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)
 
952
        return c
 
953
}
 
954
 
 
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))
 
961
        }
 
962
        if v, ok := c.opt_["maxResults"]; ok {
 
963
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
964
        }
 
965
        if v, ok := c.opt_["pageToken"]; ok {
 
966
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
967
        }
 
968
        if v, ok := c.opt_["fields"]; ok {
 
969
                params.Set("fields", fmt.Sprintf("%v", v))
 
970
        }
 
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,
 
976
                "zone":    c.zone,
 
977
        })
 
978
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
979
        res, err := c.s.client.Do(req)
 
980
        if err != nil {
 
981
                return nil, err
 
982
        }
 
983
        defer googleapi.CloseBody(res)
 
984
        if err := googleapi.CheckResponse(res); err != nil {
 
985
                return nil, err
 
986
        }
 
987
        var ret *InstanceGroupManagerList
 
988
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
989
                return nil, err
 
990
        }
 
991
        return ret, nil
 
992
        // {
 
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": [
 
997
        //     "project",
 
998
        //     "zone"
 
999
        //   ],
 
1000
        //   "parameters": {
 
1001
        //     "filter": {
 
1002
        //       "description": "Optional. Filter expression for filtering listed resources.",
 
1003
        //       "location": "query",
 
1004
        //       "type": "string"
 
1005
        //     },
 
1006
        //     "maxResults": {
 
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",
 
1012
        //       "minimum": "0",
 
1013
        //       "type": "integer"
 
1014
        //     },
 
1015
        //     "pageToken": {
 
1016
        //       "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.",
 
1017
        //       "location": "query",
 
1018
        //       "type": "string"
 
1019
        //     },
 
1020
        //     "project": {
 
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,
 
1025
        //       "type": "string"
 
1026
        //     },
 
1027
        //     "zone": {
 
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,
 
1032
        //       "type": "string"
 
1033
        //     }
 
1034
        //   },
 
1035
        //   "path": "{project}/zones/{zone}/instanceGroupManagers",
 
1036
        //   "response": {
 
1037
        //     "$ref": "InstanceGroupManagerList"
 
1038
        //   },
 
1039
        //   "scopes": [
 
1040
        //     "https://www.googleapis.com/auth/cloud-platform",
 
1041
        //     "https://www.googleapis.com/auth/compute",
 
1042
        //     "https://www.googleapis.com/auth/compute.readonly"
 
1043
        //   ]
 
1044
        // }
 
1045
 
 
1046
}
 
1047
 
 
1048
// method id "replicapool.instanceGroupManagers.recreateInstances":
 
1049
 
 
1050
type InstanceGroupManagersRecreateInstancesCall struct {
 
1051
        s                                             *Service
 
1052
        project                                       string
 
1053
        zone                                          string
 
1054
        instanceGroupManager                          string
 
1055
        instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
 
1056
        opt_                                          map[string]interface{}
 
1057
}
 
1058
 
 
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{})}
 
1064
        c.project = project
 
1065
        c.zone = zone
 
1066
        c.instanceGroupManager = instanceGroupManager
 
1067
        c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
 
1068
        return c
 
1069
}
 
1070
 
 
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)
 
1076
        return c
 
1077
}
 
1078
 
 
1079
func (c *InstanceGroupManagersRecreateInstancesCall) Do() (*Operation, error) {
 
1080
        var body io.Reader = nil
 
1081
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
 
1082
        if err != nil {
 
1083
                return nil, err
 
1084
        }
 
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))
 
1090
        }
 
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,
 
1096
                "zone":                 c.zone,
 
1097
                "instanceGroupManager": c.instanceGroupManager,
 
1098
        })
 
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)
 
1102
        if err != nil {
 
1103
                return nil, err
 
1104
        }
 
1105
        defer googleapi.CloseBody(res)
 
1106
        if err := googleapi.CheckResponse(res); err != nil {
 
1107
                return nil, err
 
1108
        }
 
1109
        var ret *Operation
 
1110
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1111
                return nil, err
 
1112
        }
 
1113
        return ret, nil
 
1114
        // {
 
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": [
 
1119
        //     "project",
 
1120
        //     "zone",
 
1121
        //     "instanceGroupManager"
 
1122
        //   ],
 
1123
        //   "parameters": {
 
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,
 
1129
        //       "type": "string"
 
1130
        //     },
 
1131
        //     "project": {
 
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,
 
1136
        //       "type": "string"
 
1137
        //     },
 
1138
        //     "zone": {
 
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,
 
1143
        //       "type": "string"
 
1144
        //     }
 
1145
        //   },
 
1146
        //   "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
 
1147
        //   "request": {
 
1148
        //     "$ref": "InstanceGroupManagersRecreateInstancesRequest"
 
1149
        //   },
 
1150
        //   "response": {
 
1151
        //     "$ref": "Operation"
 
1152
        //   },
 
1153
        //   "scopes": [
 
1154
        //     "https://www.googleapis.com/auth/cloud-platform",
 
1155
        //     "https://www.googleapis.com/auth/compute"
 
1156
        //   ]
 
1157
        // }
 
1158
 
 
1159
}
 
1160
 
 
1161
// method id "replicapool.instanceGroupManagers.resize":
 
1162
 
 
1163
type InstanceGroupManagersResizeCall struct {
 
1164
        s                    *Service
 
1165
        project              string
 
1166
        zone                 string
 
1167
        instanceGroupManager string
 
1168
        size                 int64
 
1169
        opt_                 map[string]interface{}
 
1170
}
 
1171
 
 
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{})}
 
1178
        c.project = project
 
1179
        c.zone = zone
 
1180
        c.instanceGroupManager = instanceGroupManager
 
1181
        c.size = size
 
1182
        return c
 
1183
}
 
1184
 
 
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)
 
1190
        return c
 
1191
}
 
1192
 
 
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))
 
1200
        }
 
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,
 
1206
                "zone":                 c.zone,
 
1207
                "instanceGroupManager": c.instanceGroupManager,
 
1208
        })
 
1209
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1210
        res, err := c.s.client.Do(req)
 
1211
        if err != nil {
 
1212
                return nil, err
 
1213
        }
 
1214
        defer googleapi.CloseBody(res)
 
1215
        if err := googleapi.CheckResponse(res); err != nil {
 
1216
                return nil, err
 
1217
        }
 
1218
        var ret *Operation
 
1219
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1220
                return nil, err
 
1221
        }
 
1222
        return ret, nil
 
1223
        // {
 
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": [
 
1228
        //     "project",
 
1229
        //     "zone",
 
1230
        //     "instanceGroupManager",
 
1231
        //     "size"
 
1232
        //   ],
 
1233
        //   "parameters": {
 
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,
 
1239
        //       "type": "string"
 
1240
        //     },
 
1241
        //     "project": {
 
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,
 
1246
        //       "type": "string"
 
1247
        //     },
 
1248
        //     "size": {
 
1249
        //       "description": "Number of instances that should exist in this Instance Group Manager.",
 
1250
        //       "format": "int32",
 
1251
        //       "location": "query",
 
1252
        //       "minimum": "0",
 
1253
        //       "required": true,
 
1254
        //       "type": "integer"
 
1255
        //     },
 
1256
        //     "zone": {
 
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,
 
1261
        //       "type": "string"
 
1262
        //     }
 
1263
        //   },
 
1264
        //   "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
 
1265
        //   "response": {
 
1266
        //     "$ref": "Operation"
 
1267
        //   },
 
1268
        //   "scopes": [
 
1269
        //     "https://www.googleapis.com/auth/cloud-platform",
 
1270
        //     "https://www.googleapis.com/auth/compute"
 
1271
        //   ]
 
1272
        // }
 
1273
 
 
1274
}
 
1275
 
 
1276
// method id "replicapool.instanceGroupManagers.setInstanceTemplate":
 
1277
 
 
1278
type InstanceGroupManagersSetInstanceTemplateCall struct {
 
1279
        s                                               *Service
 
1280
        project                                         string
 
1281
        zone                                            string
 
1282
        instanceGroupManager                            string
 
1283
        instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
 
1284
        opt_                                            map[string]interface{}
 
1285
}
 
1286
 
 
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{})}
 
1291
        c.project = project
 
1292
        c.zone = zone
 
1293
        c.instanceGroupManager = instanceGroupManager
 
1294
        c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
 
1295
        return c
 
1296
}
 
1297
 
 
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)
 
1303
        return c
 
1304
}
 
1305
 
 
1306
func (c *InstanceGroupManagersSetInstanceTemplateCall) Do() (*Operation, error) {
 
1307
        var body io.Reader = nil
 
1308
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
 
1309
        if err != nil {
 
1310
                return nil, err
 
1311
        }
 
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))
 
1317
        }
 
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,
 
1323
                "zone":                 c.zone,
 
1324
                "instanceGroupManager": c.instanceGroupManager,
 
1325
        })
 
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)
 
1329
        if err != nil {
 
1330
                return nil, err
 
1331
        }
 
1332
        defer googleapi.CloseBody(res)
 
1333
        if err := googleapi.CheckResponse(res); err != nil {
 
1334
                return nil, err
 
1335
        }
 
1336
        var ret *Operation
 
1337
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1338
                return nil, err
 
1339
        }
 
1340
        return ret, nil
 
1341
        // {
 
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": [
 
1346
        //     "project",
 
1347
        //     "zone",
 
1348
        //     "instanceGroupManager"
 
1349
        //   ],
 
1350
        //   "parameters": {
 
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,
 
1356
        //       "type": "string"
 
1357
        //     },
 
1358
        //     "project": {
 
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,
 
1363
        //       "type": "string"
 
1364
        //     },
 
1365
        //     "zone": {
 
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,
 
1370
        //       "type": "string"
 
1371
        //     }
 
1372
        //   },
 
1373
        //   "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
 
1374
        //   "request": {
 
1375
        //     "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
 
1376
        //   },
 
1377
        //   "response": {
 
1378
        //     "$ref": "Operation"
 
1379
        //   },
 
1380
        //   "scopes": [
 
1381
        //     "https://www.googleapis.com/auth/cloud-platform",
 
1382
        //     "https://www.googleapis.com/auth/compute"
 
1383
        //   ]
 
1384
        // }
 
1385
 
 
1386
}
 
1387
 
 
1388
// method id "replicapool.instanceGroupManagers.setTargetPools":
 
1389
 
 
1390
type InstanceGroupManagersSetTargetPoolsCall struct {
 
1391
        s                                          *Service
 
1392
        project                                    string
 
1393
        zone                                       string
 
1394
        instanceGroupManager                       string
 
1395
        instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
 
1396
        opt_                                       map[string]interface{}
 
1397
}
 
1398
 
 
1399
// SetTargetPools: Modifies the target pools to which all new instances
 
1400
// in this group are assigned. Existing instances in the group are not
 
1401
// affected.
 
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{})}
 
1404
        c.project = project
 
1405
        c.zone = zone
 
1406
        c.instanceGroupManager = instanceGroupManager
 
1407
        c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
 
1408
        return c
 
1409
}
 
1410
 
 
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)
 
1416
        return c
 
1417
}
 
1418
 
 
1419
func (c *InstanceGroupManagersSetTargetPoolsCall) Do() (*Operation, error) {
 
1420
        var body io.Reader = nil
 
1421
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
 
1422
        if err != nil {
 
1423
                return nil, err
 
1424
        }
 
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))
 
1430
        }
 
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,
 
1436
                "zone":                 c.zone,
 
1437
                "instanceGroupManager": c.instanceGroupManager,
 
1438
        })
 
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)
 
1442
        if err != nil {
 
1443
                return nil, err
 
1444
        }
 
1445
        defer googleapi.CloseBody(res)
 
1446
        if err := googleapi.CheckResponse(res); err != nil {
 
1447
                return nil, err
 
1448
        }
 
1449
        var ret *Operation
 
1450
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1451
                return nil, err
 
1452
        }
 
1453
        return ret, nil
 
1454
        // {
 
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": [
 
1459
        //     "project",
 
1460
        //     "zone",
 
1461
        //     "instanceGroupManager"
 
1462
        //   ],
 
1463
        //   "parameters": {
 
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,
 
1469
        //       "type": "string"
 
1470
        //     },
 
1471
        //     "project": {
 
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,
 
1476
        //       "type": "string"
 
1477
        //     },
 
1478
        //     "zone": {
 
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,
 
1483
        //       "type": "string"
 
1484
        //     }
 
1485
        //   },
 
1486
        //   "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
 
1487
        //   "request": {
 
1488
        //     "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
 
1489
        //   },
 
1490
        //   "response": {
 
1491
        //     "$ref": "Operation"
 
1492
        //   },
 
1493
        //   "scopes": [
 
1494
        //     "https://www.googleapis.com/auth/cloud-platform",
 
1495
        //     "https://www.googleapis.com/auth/compute"
 
1496
        //   ]
 
1497
        // }
 
1498
 
 
1499
}
 
1500
 
 
1501
// method id "replicapool.zoneOperations.get":
 
1502
 
 
1503
type ZoneOperationsGetCall struct {
 
1504
        s         *Service
 
1505
        project   string
 
1506
        zone      string
 
1507
        operation string
 
1508
        opt_      map[string]interface{}
 
1509
}
 
1510
 
 
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{})}
 
1514
        c.project = project
 
1515
        c.zone = zone
 
1516
        c.operation = operation
 
1517
        return c
 
1518
}
 
1519
 
 
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)
 
1525
        return c
 
1526
}
 
1527
 
 
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))
 
1534
        }
 
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,
 
1540
                "zone":      c.zone,
 
1541
                "operation": c.operation,
 
1542
        })
 
1543
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1544
        res, err := c.s.client.Do(req)
 
1545
        if err != nil {
 
1546
                return nil, err
 
1547
        }
 
1548
        defer googleapi.CloseBody(res)
 
1549
        if err := googleapi.CheckResponse(res); err != nil {
 
1550
                return nil, err
 
1551
        }
 
1552
        var ret *Operation
 
1553
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1554
                return nil, err
 
1555
        }
 
1556
        return ret, nil
 
1557
        // {
 
1558
        //   "description": "Retrieves the specified zone-specific operation resource.",
 
1559
        //   "httpMethod": "GET",
 
1560
        //   "id": "replicapool.zoneOperations.get",
 
1561
        //   "parameterOrder": [
 
1562
        //     "project",
 
1563
        //     "zone",
 
1564
        //     "operation"
 
1565
        //   ],
 
1566
        //   "parameters": {
 
1567
        //     "operation": {
 
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,
 
1572
        //       "type": "string"
 
1573
        //     },
 
1574
        //     "project": {
 
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,
 
1579
        //       "type": "string"
 
1580
        //     },
 
1581
        //     "zone": {
 
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,
 
1586
        //       "type": "string"
 
1587
        //     }
 
1588
        //   },
 
1589
        //   "path": "{project}/zones/{zone}/operations/{operation}",
 
1590
        //   "response": {
 
1591
        //     "$ref": "Operation"
 
1592
        //   },
 
1593
        //   "scopes": [
 
1594
        //     "https://www.googleapis.com/auth/cloud-platform",
 
1595
        //     "https://www.googleapis.com/auth/compute"
 
1596
        //   ]
 
1597
        // }
 
1598
 
 
1599
}
 
1600
 
 
1601
// method id "replicapool.zoneOperations.list":
 
1602
 
 
1603
type ZoneOperationsListCall struct {
 
1604
        s       *Service
 
1605
        project string
 
1606
        zone    string
 
1607
        opt_    map[string]interface{}
 
1608
}
 
1609
 
 
1610
// List: Retrieves the list of operation resources contained within the
 
1611
// specified zone.
 
1612
func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
 
1613
        c := &ZoneOperationsListCall{s: r.s, opt_: make(map[string]interface{})}
 
1614
        c.project = project
 
1615
        c.zone = zone
 
1616
        return c
 
1617
}
 
1618
 
 
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
 
1623
        return c
 
1624
}
 
1625
 
 
1626
// MaxResults sets the optional parameter "maxResults": Maximum count of
 
1627
// results to be returned. Maximum value is 500 and default value is
 
1628
// 500.
 
1629
func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
 
1630
        c.opt_["maxResults"] = maxResults
 
1631
        return c
 
1632
}
 
1633
 
 
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
 
1639
        return c
 
1640
}
 
1641
 
 
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)
 
1647
        return c
 
1648
}
 
1649
 
 
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))
 
1656
        }
 
1657
        if v, ok := c.opt_["maxResults"]; ok {
 
1658
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
1659
        }
 
1660
        if v, ok := c.opt_["pageToken"]; ok {
 
1661
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
1662
        }
 
1663
        if v, ok := c.opt_["fields"]; ok {
 
1664
                params.Set("fields", fmt.Sprintf("%v", v))
 
1665
        }
 
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,
 
1671
                "zone":    c.zone,
 
1672
        })
 
1673
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1674
        res, err := c.s.client.Do(req)
 
1675
        if err != nil {
 
1676
                return nil, err
 
1677
        }
 
1678
        defer googleapi.CloseBody(res)
 
1679
        if err := googleapi.CheckResponse(res); err != nil {
 
1680
                return nil, err
 
1681
        }
 
1682
        var ret *OperationList
 
1683
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1684
                return nil, err
 
1685
        }
 
1686
        return ret, nil
 
1687
        // {
 
1688
        //   "description": "Retrieves the list of operation resources contained within the specified zone.",
 
1689
        //   "httpMethod": "GET",
 
1690
        //   "id": "replicapool.zoneOperations.list",
 
1691
        //   "parameterOrder": [
 
1692
        //     "project",
 
1693
        //     "zone"
 
1694
        //   ],
 
1695
        //   "parameters": {
 
1696
        //     "filter": {
 
1697
        //       "description": "Optional. Filter expression for filtering listed resources.",
 
1698
        //       "location": "query",
 
1699
        //       "type": "string"
 
1700
        //     },
 
1701
        //     "maxResults": {
 
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",
 
1707
        //       "minimum": "0",
 
1708
        //       "type": "integer"
 
1709
        //     },
 
1710
        //     "pageToken": {
 
1711
        //       "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.",
 
1712
        //       "location": "query",
 
1713
        //       "type": "string"
 
1714
        //     },
 
1715
        //     "project": {
 
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,
 
1720
        //       "type": "string"
 
1721
        //     },
 
1722
        //     "zone": {
 
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,
 
1727
        //       "type": "string"
 
1728
        //     }
 
1729
        //   },
 
1730
        //   "path": "{project}/zones/{zone}/operations",
 
1731
        //   "response": {
 
1732
        //     "$ref": "OperationList"
 
1733
        //   },
 
1734
        //   "scopes": [
 
1735
        //     "https://www.googleapis.com/auth/cloud-platform",
 
1736
        //     "https://www.googleapis.com/auth/compute"
 
1737
        //   ]
 
1738
        // }
 
1739
 
 
1740
}