~ubuntu-branches/ubuntu/vivid/juju-core/vivid-proposed

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/container/v1beta1/container-gen.go

  • Committer: Package Import Robot
  • Author(s): Curtis C. Hovey
  • Date: 2015-09-29 19:43:29 UTC
  • mfrom: (47.1.4 wily-proposed)
  • Revision ID: package-import@ubuntu.com-20150929194329-9y496tbic30hc7vp
Tags: 1.24.6-0ubuntu1~15.04.1
Backport of 1.24.6 from wily. (LP: #1500916, #1497087)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Package container provides access to the Google Container Engine API.
 
2
//
 
3
// Usage example:
 
4
//
 
5
//   import "google.golang.org/api/container/v1beta1"
 
6
//   ...
 
7
//   containerService, err := container.New(oauthHttpClient)
 
8
package container
 
9
 
 
10
import (
 
11
        "bytes"
 
12
        "encoding/json"
 
13
        "errors"
 
14
        "fmt"
 
15
        "google.golang.org/api/googleapi"
 
16
        "io"
 
17
        "net/http"
 
18
        "net/url"
 
19
        "strconv"
 
20
        "strings"
 
21
)
 
22
 
 
23
// Always reference these packages, just in case the auto-generated code
 
24
// below doesn't.
 
25
var _ = bytes.NewBuffer
 
26
var _ = strconv.Itoa
 
27
var _ = fmt.Sprintf
 
28
var _ = json.NewDecoder
 
29
var _ = io.Copy
 
30
var _ = url.Parse
 
31
var _ = googleapi.Version
 
32
var _ = errors.New
 
33
var _ = strings.Replace
 
34
 
 
35
const apiId = "container:v1beta1"
 
36
const apiName = "container"
 
37
const apiVersion = "v1beta1"
 
38
const basePath = "https://www.googleapis.com/container/v1beta1/projects/"
 
39
 
 
40
// OAuth2 scopes used by this API.
 
41
const (
 
42
        // View and manage your data across Google Cloud Platform services
 
43
        CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
 
44
)
 
45
 
 
46
func New(client *http.Client) (*Service, error) {
 
47
        if client == nil {
 
48
                return nil, errors.New("client is nil")
 
49
        }
 
50
        s := &Service{client: client, BasePath: basePath}
 
51
        s.Projects = NewProjectsService(s)
 
52
        return s, nil
 
53
}
 
54
 
 
55
type Service struct {
 
56
        client   *http.Client
 
57
        BasePath string // API endpoint base URL
 
58
 
 
59
        Projects *ProjectsService
 
60
}
 
61
 
 
62
func NewProjectsService(s *Service) *ProjectsService {
 
63
        rs := &ProjectsService{s: s}
 
64
        rs.Clusters = NewProjectsClustersService(s)
 
65
        rs.Operations = NewProjectsOperationsService(s)
 
66
        rs.Zones = NewProjectsZonesService(s)
 
67
        return rs
 
68
}
 
69
 
 
70
type ProjectsService struct {
 
71
        s *Service
 
72
 
 
73
        Clusters *ProjectsClustersService
 
74
 
 
75
        Operations *ProjectsOperationsService
 
76
 
 
77
        Zones *ProjectsZonesService
 
78
}
 
79
 
 
80
func NewProjectsClustersService(s *Service) *ProjectsClustersService {
 
81
        rs := &ProjectsClustersService{s: s}
 
82
        return rs
 
83
}
 
84
 
 
85
type ProjectsClustersService struct {
 
86
        s *Service
 
87
}
 
88
 
 
89
func NewProjectsOperationsService(s *Service) *ProjectsOperationsService {
 
90
        rs := &ProjectsOperationsService{s: s}
 
91
        return rs
 
92
}
 
93
 
 
94
type ProjectsOperationsService struct {
 
95
        s *Service
 
96
}
 
97
 
 
98
func NewProjectsZonesService(s *Service) *ProjectsZonesService {
 
99
        rs := &ProjectsZonesService{s: s}
 
100
        rs.Clusters = NewProjectsZonesClustersService(s)
 
101
        rs.Operations = NewProjectsZonesOperationsService(s)
 
102
        return rs
 
103
}
 
104
 
 
105
type ProjectsZonesService struct {
 
106
        s *Service
 
107
 
 
108
        Clusters *ProjectsZonesClustersService
 
109
 
 
110
        Operations *ProjectsZonesOperationsService
 
111
}
 
112
 
 
113
func NewProjectsZonesClustersService(s *Service) *ProjectsZonesClustersService {
 
114
        rs := &ProjectsZonesClustersService{s: s}
 
115
        return rs
 
116
}
 
117
 
 
118
type ProjectsZonesClustersService struct {
 
119
        s *Service
 
120
}
 
121
 
 
122
func NewProjectsZonesOperationsService(s *Service) *ProjectsZonesOperationsService {
 
123
        rs := &ProjectsZonesOperationsService{s: s}
 
124
        return rs
 
125
}
 
126
 
 
127
type ProjectsZonesOperationsService struct {
 
128
        s *Service
 
129
}
 
130
 
 
131
type Cluster struct {
 
132
        // ClusterApiVersion: The API version of the Kubernetes master and
 
133
        // kubelets running in this cluster. Allowed value is 0.4.2, or leave
 
134
        // blank to pick up the latest stable release.
 
135
        ClusterApiVersion string `json:"clusterApiVersion,omitempty"`
 
136
 
 
137
        // ContainerIpv4Cidr: [Output only] The IP addresses of the container
 
138
        // pods in this cluster, in  CIDR notation (e.g. 1.2.3.4/29).
 
139
        ContainerIpv4Cidr string `json:"containerIpv4Cidr,omitempty"`
 
140
 
 
141
        // CreationTimestamp: [Output only] The time the cluster was created, in
 
142
        // RFC3339 text format.
 
143
        CreationTimestamp string `json:"creationTimestamp,omitempty"`
 
144
 
 
145
        // Description: An optional description of this cluster.
 
146
        Description string `json:"description,omitempty"`
 
147
 
 
148
        // Endpoint: [Output only] The IP address of this cluster's Kubernetes
 
149
        // master. The endpoint can be accessed from the internet at
 
150
        // https://username:password@endpoint/.
 
151
        //
 
152
        // See the masterAuth property of
 
153
        // this resource for username and password information.
 
154
        Endpoint string `json:"endpoint,omitempty"`
 
155
 
 
156
        // MasterAuth: The HTTP basic authentication information for accessing
 
157
        // the master. Because the master endpoint is open to the internet, you
 
158
        // should create a strong password.
 
159
        MasterAuth *MasterAuth `json:"masterAuth,omitempty"`
 
160
 
 
161
        // Name: The name of this cluster. The name must be unique within this
 
162
        // project and zone, and can be up to 40 characters with the following
 
163
        // restrictions:
 
164
        // - Lowercase letters, numbers, and hyphens only.
 
165
        // -
 
166
        // Must start with a letter.
 
167
        // - Must end with a number or a letter.
 
168
        Name string `json:"name,omitempty"`
 
169
 
 
170
        // NodeConfig: The machine type and image to use for all nodes in this
 
171
        // cluster. See the descriptions of the child properties of nodeConfig.
 
172
        NodeConfig *NodeConfig `json:"nodeConfig,omitempty"`
 
173
 
 
174
        // NodeRoutingPrefixSize: [Output only] The size of the address space on
 
175
        // each node for hosting containers.
 
176
        NodeRoutingPrefixSize int64 `json:"nodeRoutingPrefixSize,omitempty"`
 
177
 
 
178
        // NumNodes: The number of nodes to create in this cluster. You must
 
179
        // ensure that your Compute Engine resource quota is sufficient for this
 
180
        // number of instances plus one (to include the master). You must also
 
181
        // have available firewall and routes quota.
 
182
        NumNodes int64 `json:"numNodes,omitempty"`
 
183
 
 
184
        // ServicesIpv4Cidr: [Output only] The IP addresses of the Kubernetes
 
185
        // services in this cluster, in  CIDR notation (e.g. 1.2.3.4/29).
 
186
        // Service addresses are always in the 10.0.0.0/16 range.
 
187
        ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
 
188
 
 
189
        // Status: [Output only] The current status of this cluster.
 
190
        Status string `json:"status,omitempty"`
 
191
 
 
192
        // StatusMessage: [Output only] Additional information about the current
 
193
        // status of this cluster, if available.
 
194
        StatusMessage string `json:"statusMessage,omitempty"`
 
195
 
 
196
        // Zone: [Output only] The name of the Google Compute Engine zone in
 
197
        // which the cluster resides.
 
198
        Zone string `json:"zone,omitempty"`
 
199
}
 
200
 
 
201
type CreateClusterRequest struct {
 
202
        // Cluster: A cluster resource.
 
203
        Cluster *Cluster `json:"cluster,omitempty"`
 
204
}
 
205
 
 
206
type ListAggregatedClustersResponse struct {
 
207
        // Clusters: A list of clusters in the project, across all zones.
 
208
        Clusters []*Cluster `json:"clusters,omitempty"`
 
209
}
 
210
 
 
211
type ListAggregatedOperationsResponse struct {
 
212
        // Operations: A list of operations in the project, across all zones.
 
213
        Operations []*Operation `json:"operations,omitempty"`
 
214
}
 
215
 
 
216
type ListClustersResponse struct {
 
217
        // Clusters: A list of clusters in the project in the specified zone.
 
218
        Clusters []*Cluster `json:"clusters,omitempty"`
 
219
}
 
220
 
 
221
type ListOperationsResponse struct {
 
222
        // Operations: A list of operations in the project in the specified
 
223
        // zone.
 
224
        Operations []*Operation `json:"operations,omitempty"`
 
225
}
 
226
 
 
227
type MasterAuth struct {
 
228
        // Password: The password to use when accessing the Kubernetes master
 
229
        // endpoint.
 
230
        Password string `json:"password,omitempty"`
 
231
 
 
232
        // User: The username to use when accessing the Kubernetes master
 
233
        // endpoint.
 
234
        User string `json:"user,omitempty"`
 
235
}
 
236
 
 
237
type NodeConfig struct {
 
238
        // MachineType: The name of a Google Compute Engine machine type (e.g.
 
239
        // n1-standard-1).
 
240
        //
 
241
        // If unspecified, the default machine type is
 
242
        // n1-standard-1.
 
243
        MachineType string `json:"machineType,omitempty"`
 
244
 
 
245
        // SourceImage: The fully-specified name of a Google Compute Engine
 
246
        // image. For example:
 
247
        // https://www.googleapis.com/compute/v1/projects/debian-cloud/global/ima
 
248
        // ges/backports-debian-7-wheezy-vYYYYMMDD (where YYYMMDD is the version
 
249
        // date).
 
250
        //
 
251
        // If specifying an image, you are responsible for ensuring its
 
252
        // compatibility with the Debian 7 backports image. We recommend leaving
 
253
        // this field blank to accept the default backports-debian-7-wheezy
 
254
        // value.
 
255
        SourceImage string `json:"sourceImage,omitempty"`
 
256
}
 
257
 
 
258
type Operation struct {
 
259
        // ErrorMessage: If an error has occurred, a textual description of the
 
260
        // error.
 
261
        ErrorMessage string `json:"errorMessage,omitempty"`
 
262
 
 
263
        // Name: The server-assigned ID for this operation. If the operation is
 
264
        // fulfilled upfront, it may not have a resource name.
 
265
        Name string `json:"name,omitempty"`
 
266
 
 
267
        // OperationType: The operation type.
 
268
        OperationType string `json:"operationType,omitempty"`
 
269
 
 
270
        // Status: The current status of the operation.
 
271
        Status string `json:"status,omitempty"`
 
272
 
 
273
        // Target: [Optional] The URL of the cluster resource that this
 
274
        // operation is associated with.
 
275
        Target string `json:"target,omitempty"`
 
276
 
 
277
        // Zone: The name of the Google Compute Engine zone in which the
 
278
        // operation is taking place.
 
279
        Zone string `json:"zone,omitempty"`
 
280
}
 
281
 
 
282
// method id "container.projects.clusters.list":
 
283
 
 
284
type ProjectsClustersListCall struct {
 
285
        s         *Service
 
286
        projectId string
 
287
        opt_      map[string]interface{}
 
288
}
 
289
 
 
290
// List: Lists all clusters owned by a project across all zones.
 
291
func (r *ProjectsClustersService) List(projectId string) *ProjectsClustersListCall {
 
292
        c := &ProjectsClustersListCall{s: r.s, opt_: make(map[string]interface{})}
 
293
        c.projectId = projectId
 
294
        return c
 
295
}
 
296
 
 
297
// Fields allows partial responses to be retrieved.
 
298
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
299
// for more information.
 
300
func (c *ProjectsClustersListCall) Fields(s ...googleapi.Field) *ProjectsClustersListCall {
 
301
        c.opt_["fields"] = googleapi.CombineFields(s)
 
302
        return c
 
303
}
 
304
 
 
305
func (c *ProjectsClustersListCall) Do() (*ListAggregatedClustersResponse, error) {
 
306
        var body io.Reader = nil
 
307
        params := make(url.Values)
 
308
        params.Set("alt", "json")
 
309
        if v, ok := c.opt_["fields"]; ok {
 
310
                params.Set("fields", fmt.Sprintf("%v", v))
 
311
        }
 
312
        urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/clusters")
 
313
        urls += "?" + params.Encode()
 
314
        req, _ := http.NewRequest("GET", urls, body)
 
315
        googleapi.Expand(req.URL, map[string]string{
 
316
                "projectId": c.projectId,
 
317
        })
 
318
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
319
        res, err := c.s.client.Do(req)
 
320
        if err != nil {
 
321
                return nil, err
 
322
        }
 
323
        defer googleapi.CloseBody(res)
 
324
        if err := googleapi.CheckResponse(res); err != nil {
 
325
                return nil, err
 
326
        }
 
327
        var ret *ListAggregatedClustersResponse
 
328
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
329
                return nil, err
 
330
        }
 
331
        return ret, nil
 
332
        // {
 
333
        //   "description": "Lists all clusters owned by a project across all zones.",
 
334
        //   "httpMethod": "GET",
 
335
        //   "id": "container.projects.clusters.list",
 
336
        //   "parameterOrder": [
 
337
        //     "projectId"
 
338
        //   ],
 
339
        //   "parameters": {
 
340
        //     "projectId": {
 
341
        //       "description": "The Google Developers Console project ID or  project number.",
 
342
        //       "location": "path",
 
343
        //       "required": true,
 
344
        //       "type": "string"
 
345
        //     }
 
346
        //   },
 
347
        //   "path": "{projectId}/clusters",
 
348
        //   "response": {
 
349
        //     "$ref": "ListAggregatedClustersResponse"
 
350
        //   },
 
351
        //   "scopes": [
 
352
        //     "https://www.googleapis.com/auth/cloud-platform"
 
353
        //   ]
 
354
        // }
 
355
 
 
356
}
 
357
 
 
358
// method id "container.projects.operations.list":
 
359
 
 
360
type ProjectsOperationsListCall struct {
 
361
        s         *Service
 
362
        projectId string
 
363
        opt_      map[string]interface{}
 
364
}
 
365
 
 
366
// List: Lists all operations in a project, across all zones.
 
367
func (r *ProjectsOperationsService) List(projectId string) *ProjectsOperationsListCall {
 
368
        c := &ProjectsOperationsListCall{s: r.s, opt_: make(map[string]interface{})}
 
369
        c.projectId = projectId
 
370
        return c
 
371
}
 
372
 
 
373
// Fields allows partial responses to be retrieved.
 
374
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
375
// for more information.
 
376
func (c *ProjectsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsOperationsListCall {
 
377
        c.opt_["fields"] = googleapi.CombineFields(s)
 
378
        return c
 
379
}
 
380
 
 
381
func (c *ProjectsOperationsListCall) Do() (*ListAggregatedOperationsResponse, error) {
 
382
        var body io.Reader = nil
 
383
        params := make(url.Values)
 
384
        params.Set("alt", "json")
 
385
        if v, ok := c.opt_["fields"]; ok {
 
386
                params.Set("fields", fmt.Sprintf("%v", v))
 
387
        }
 
388
        urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/operations")
 
389
        urls += "?" + params.Encode()
 
390
        req, _ := http.NewRequest("GET", urls, body)
 
391
        googleapi.Expand(req.URL, map[string]string{
 
392
                "projectId": c.projectId,
 
393
        })
 
394
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
395
        res, err := c.s.client.Do(req)
 
396
        if err != nil {
 
397
                return nil, err
 
398
        }
 
399
        defer googleapi.CloseBody(res)
 
400
        if err := googleapi.CheckResponse(res); err != nil {
 
401
                return nil, err
 
402
        }
 
403
        var ret *ListAggregatedOperationsResponse
 
404
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
405
                return nil, err
 
406
        }
 
407
        return ret, nil
 
408
        // {
 
409
        //   "description": "Lists all operations in a project, across all zones.",
 
410
        //   "httpMethod": "GET",
 
411
        //   "id": "container.projects.operations.list",
 
412
        //   "parameterOrder": [
 
413
        //     "projectId"
 
414
        //   ],
 
415
        //   "parameters": {
 
416
        //     "projectId": {
 
417
        //       "description": "The Google Developers Console project ID or  project number.",
 
418
        //       "location": "path",
 
419
        //       "required": true,
 
420
        //       "type": "string"
 
421
        //     }
 
422
        //   },
 
423
        //   "path": "{projectId}/operations",
 
424
        //   "response": {
 
425
        //     "$ref": "ListAggregatedOperationsResponse"
 
426
        //   },
 
427
        //   "scopes": [
 
428
        //     "https://www.googleapis.com/auth/cloud-platform"
 
429
        //   ]
 
430
        // }
 
431
 
 
432
}
 
433
 
 
434
// method id "container.projects.zones.clusters.create":
 
435
 
 
436
type ProjectsZonesClustersCreateCall struct {
 
437
        s                    *Service
 
438
        projectId            string
 
439
        zoneId               string
 
440
        createclusterrequest *CreateClusterRequest
 
441
        opt_                 map[string]interface{}
 
442
}
 
443
 
 
444
// Create: Creates a cluster, consisting of the specified number and
 
445
// type of Google Compute Engine instances, plus a Kubernetes master
 
446
// instance.
 
447
//
 
448
// The cluster is created in the project's default
 
449
// network.
 
450
//
 
451
// A firewall is added that allows traffic into port 443 on
 
452
// the master, which enables HTTPS. A firewall and a route is added for
 
453
// each node to allow the containers on that node to communicate with
 
454
// all other instances in the cluster.
 
455
//
 
456
// Finally, a route named
 
457
// k8s-iproute-10-xx-0-0 is created to track that the cluster's
 
458
// 10.xx.0.0/16 CIDR has been assigned.
 
459
func (r *ProjectsZonesClustersService) Create(projectId string, zoneId string, createclusterrequest *CreateClusterRequest) *ProjectsZonesClustersCreateCall {
 
460
        c := &ProjectsZonesClustersCreateCall{s: r.s, opt_: make(map[string]interface{})}
 
461
        c.projectId = projectId
 
462
        c.zoneId = zoneId
 
463
        c.createclusterrequest = createclusterrequest
 
464
        return c
 
465
}
 
466
 
 
467
// Fields allows partial responses to be retrieved.
 
468
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
469
// for more information.
 
470
func (c *ProjectsZonesClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCreateCall {
 
471
        c.opt_["fields"] = googleapi.CombineFields(s)
 
472
        return c
 
473
}
 
474
 
 
475
func (c *ProjectsZonesClustersCreateCall) Do() (*Operation, error) {
 
476
        var body io.Reader = nil
 
477
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
 
478
        if err != nil {
 
479
                return nil, err
 
480
        }
 
481
        ctype := "application/json"
 
482
        params := make(url.Values)
 
483
        params.Set("alt", "json")
 
484
        if v, ok := c.opt_["fields"]; ok {
 
485
                params.Set("fields", fmt.Sprintf("%v", v))
 
486
        }
 
487
        urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/clusters")
 
488
        urls += "?" + params.Encode()
 
489
        req, _ := http.NewRequest("POST", urls, body)
 
490
        googleapi.Expand(req.URL, map[string]string{
 
491
                "projectId": c.projectId,
 
492
                "zoneId":    c.zoneId,
 
493
        })
 
494
        req.Header.Set("Content-Type", ctype)
 
495
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
496
        res, err := c.s.client.Do(req)
 
497
        if err != nil {
 
498
                return nil, err
 
499
        }
 
500
        defer googleapi.CloseBody(res)
 
501
        if err := googleapi.CheckResponse(res); err != nil {
 
502
                return nil, err
 
503
        }
 
504
        var ret *Operation
 
505
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
506
                return nil, err
 
507
        }
 
508
        return ret, nil
 
509
        // {
 
510
        //   "description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master instance.\n\nThe cluster is created in the project's default network.\n\nA firewall is added that allows traffic into port 443 on the master, which enables HTTPS. A firewall and a route is added for each node to allow the containers on that node to communicate with all other instances in the cluster.\n\nFinally, a route named k8s-iproute-10-xx-0-0 is created to track that the cluster's 10.xx.0.0/16 CIDR has been assigned.",
 
511
        //   "httpMethod": "POST",
 
512
        //   "id": "container.projects.zones.clusters.create",
 
513
        //   "parameterOrder": [
 
514
        //     "projectId",
 
515
        //     "zoneId"
 
516
        //   ],
 
517
        //   "parameters": {
 
518
        //     "projectId": {
 
519
        //       "description": "The Google Developers Console project ID or  project number.",
 
520
        //       "location": "path",
 
521
        //       "required": true,
 
522
        //       "type": "string"
 
523
        //     },
 
524
        //     "zoneId": {
 
525
        //       "description": "The name of the Google Compute Engine zone in which the cluster resides.",
 
526
        //       "location": "path",
 
527
        //       "required": true,
 
528
        //       "type": "string"
 
529
        //     }
 
530
        //   },
 
531
        //   "path": "{projectId}/zones/{zoneId}/clusters",
 
532
        //   "request": {
 
533
        //     "$ref": "CreateClusterRequest"
 
534
        //   },
 
535
        //   "response": {
 
536
        //     "$ref": "Operation"
 
537
        //   },
 
538
        //   "scopes": [
 
539
        //     "https://www.googleapis.com/auth/cloud-platform"
 
540
        //   ]
 
541
        // }
 
542
 
 
543
}
 
544
 
 
545
// method id "container.projects.zones.clusters.delete":
 
546
 
 
547
type ProjectsZonesClustersDeleteCall struct {
 
548
        s         *Service
 
549
        projectId string
 
550
        zoneId    string
 
551
        clusterId string
 
552
        opt_      map[string]interface{}
 
553
}
 
554
 
 
555
// Delete: Deletes the cluster, including the Kubernetes master and all
 
556
// worker nodes.
 
557
//
 
558
// Firewalls and routes that were configured at cluster
 
559
// creation are also deleted.
 
560
func (r *ProjectsZonesClustersService) Delete(projectId string, zoneId string, clusterId string) *ProjectsZonesClustersDeleteCall {
 
561
        c := &ProjectsZonesClustersDeleteCall{s: r.s, opt_: make(map[string]interface{})}
 
562
        c.projectId = projectId
 
563
        c.zoneId = zoneId
 
564
        c.clusterId = clusterId
 
565
        return c
 
566
}
 
567
 
 
568
// Fields allows partial responses to be retrieved.
 
569
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
570
// for more information.
 
571
func (c *ProjectsZonesClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersDeleteCall {
 
572
        c.opt_["fields"] = googleapi.CombineFields(s)
 
573
        return c
 
574
}
 
575
 
 
576
func (c *ProjectsZonesClustersDeleteCall) Do() (*Operation, error) {
 
577
        var body io.Reader = nil
 
578
        params := make(url.Values)
 
579
        params.Set("alt", "json")
 
580
        if v, ok := c.opt_["fields"]; ok {
 
581
                params.Set("fields", fmt.Sprintf("%v", v))
 
582
        }
 
583
        urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/clusters/{clusterId}")
 
584
        urls += "?" + params.Encode()
 
585
        req, _ := http.NewRequest("DELETE", urls, body)
 
586
        googleapi.Expand(req.URL, map[string]string{
 
587
                "projectId": c.projectId,
 
588
                "zoneId":    c.zoneId,
 
589
                "clusterId": c.clusterId,
 
590
        })
 
591
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
592
        res, err := c.s.client.Do(req)
 
593
        if err != nil {
 
594
                return nil, err
 
595
        }
 
596
        defer googleapi.CloseBody(res)
 
597
        if err := googleapi.CheckResponse(res); err != nil {
 
598
                return nil, err
 
599
        }
 
600
        var ret *Operation
 
601
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
602
                return nil, err
 
603
        }
 
604
        return ret, nil
 
605
        // {
 
606
        //   "description": "Deletes the cluster, including the Kubernetes master and all worker nodes.\n\nFirewalls and routes that were configured at cluster creation are also deleted.",
 
607
        //   "httpMethod": "DELETE",
 
608
        //   "id": "container.projects.zones.clusters.delete",
 
609
        //   "parameterOrder": [
 
610
        //     "projectId",
 
611
        //     "zoneId",
 
612
        //     "clusterId"
 
613
        //   ],
 
614
        //   "parameters": {
 
615
        //     "clusterId": {
 
616
        //       "description": "The name of the cluster to delete.",
 
617
        //       "location": "path",
 
618
        //       "required": true,
 
619
        //       "type": "string"
 
620
        //     },
 
621
        //     "projectId": {
 
622
        //       "description": "The Google Developers Console project ID or  project number.",
 
623
        //       "location": "path",
 
624
        //       "required": true,
 
625
        //       "type": "string"
 
626
        //     },
 
627
        //     "zoneId": {
 
628
        //       "description": "The name of the Google Compute Engine zone in which the cluster resides.",
 
629
        //       "location": "path",
 
630
        //       "required": true,
 
631
        //       "type": "string"
 
632
        //     }
 
633
        //   },
 
634
        //   "path": "{projectId}/zones/{zoneId}/clusters/{clusterId}",
 
635
        //   "response": {
 
636
        //     "$ref": "Operation"
 
637
        //   },
 
638
        //   "scopes": [
 
639
        //     "https://www.googleapis.com/auth/cloud-platform"
 
640
        //   ]
 
641
        // }
 
642
 
 
643
}
 
644
 
 
645
// method id "container.projects.zones.clusters.get":
 
646
 
 
647
type ProjectsZonesClustersGetCall struct {
 
648
        s         *Service
 
649
        projectId string
 
650
        zoneId    string
 
651
        clusterId string
 
652
        opt_      map[string]interface{}
 
653
}
 
654
 
 
655
// Get: Gets a specific cluster.
 
656
func (r *ProjectsZonesClustersService) Get(projectId string, zoneId string, clusterId string) *ProjectsZonesClustersGetCall {
 
657
        c := &ProjectsZonesClustersGetCall{s: r.s, opt_: make(map[string]interface{})}
 
658
        c.projectId = projectId
 
659
        c.zoneId = zoneId
 
660
        c.clusterId = clusterId
 
661
        return c
 
662
}
 
663
 
 
664
// Fields allows partial responses to be retrieved.
 
665
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
666
// for more information.
 
667
func (c *ProjectsZonesClustersGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersGetCall {
 
668
        c.opt_["fields"] = googleapi.CombineFields(s)
 
669
        return c
 
670
}
 
671
 
 
672
func (c *ProjectsZonesClustersGetCall) Do() (*Cluster, error) {
 
673
        var body io.Reader = nil
 
674
        params := make(url.Values)
 
675
        params.Set("alt", "json")
 
676
        if v, ok := c.opt_["fields"]; ok {
 
677
                params.Set("fields", fmt.Sprintf("%v", v))
 
678
        }
 
679
        urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/clusters/{clusterId}")
 
680
        urls += "?" + params.Encode()
 
681
        req, _ := http.NewRequest("GET", urls, body)
 
682
        googleapi.Expand(req.URL, map[string]string{
 
683
                "projectId": c.projectId,
 
684
                "zoneId":    c.zoneId,
 
685
                "clusterId": c.clusterId,
 
686
        })
 
687
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
688
        res, err := c.s.client.Do(req)
 
689
        if err != nil {
 
690
                return nil, err
 
691
        }
 
692
        defer googleapi.CloseBody(res)
 
693
        if err := googleapi.CheckResponse(res); err != nil {
 
694
                return nil, err
 
695
        }
 
696
        var ret *Cluster
 
697
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
698
                return nil, err
 
699
        }
 
700
        return ret, nil
 
701
        // {
 
702
        //   "description": "Gets a specific cluster.",
 
703
        //   "httpMethod": "GET",
 
704
        //   "id": "container.projects.zones.clusters.get",
 
705
        //   "parameterOrder": [
 
706
        //     "projectId",
 
707
        //     "zoneId",
 
708
        //     "clusterId"
 
709
        //   ],
 
710
        //   "parameters": {
 
711
        //     "clusterId": {
 
712
        //       "description": "The name of the cluster to retrieve.",
 
713
        //       "location": "path",
 
714
        //       "required": true,
 
715
        //       "type": "string"
 
716
        //     },
 
717
        //     "projectId": {
 
718
        //       "description": "The Google Developers Console project ID or  project number.",
 
719
        //       "location": "path",
 
720
        //       "required": true,
 
721
        //       "type": "string"
 
722
        //     },
 
723
        //     "zoneId": {
 
724
        //       "description": "The name of the Google Compute Engine zone in which the cluster resides.",
 
725
        //       "location": "path",
 
726
        //       "required": true,
 
727
        //       "type": "string"
 
728
        //     }
 
729
        //   },
 
730
        //   "path": "{projectId}/zones/{zoneId}/clusters/{clusterId}",
 
731
        //   "response": {
 
732
        //     "$ref": "Cluster"
 
733
        //   },
 
734
        //   "scopes": [
 
735
        //     "https://www.googleapis.com/auth/cloud-platform"
 
736
        //   ]
 
737
        // }
 
738
 
 
739
}
 
740
 
 
741
// method id "container.projects.zones.clusters.list":
 
742
 
 
743
type ProjectsZonesClustersListCall struct {
 
744
        s         *Service
 
745
        projectId string
 
746
        zoneId    string
 
747
        opt_      map[string]interface{}
 
748
}
 
749
 
 
750
// List: Lists all clusters owned by a project in the specified zone.
 
751
func (r *ProjectsZonesClustersService) List(projectId string, zoneId string) *ProjectsZonesClustersListCall {
 
752
        c := &ProjectsZonesClustersListCall{s: r.s, opt_: make(map[string]interface{})}
 
753
        c.projectId = projectId
 
754
        c.zoneId = zoneId
 
755
        return c
 
756
}
 
757
 
 
758
// Fields allows partial responses to be retrieved.
 
759
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
760
// for more information.
 
761
func (c *ProjectsZonesClustersListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersListCall {
 
762
        c.opt_["fields"] = googleapi.CombineFields(s)
 
763
        return c
 
764
}
 
765
 
 
766
func (c *ProjectsZonesClustersListCall) Do() (*ListClustersResponse, error) {
 
767
        var body io.Reader = nil
 
768
        params := make(url.Values)
 
769
        params.Set("alt", "json")
 
770
        if v, ok := c.opt_["fields"]; ok {
 
771
                params.Set("fields", fmt.Sprintf("%v", v))
 
772
        }
 
773
        urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/clusters")
 
774
        urls += "?" + params.Encode()
 
775
        req, _ := http.NewRequest("GET", urls, body)
 
776
        googleapi.Expand(req.URL, map[string]string{
 
777
                "projectId": c.projectId,
 
778
                "zoneId":    c.zoneId,
 
779
        })
 
780
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
781
        res, err := c.s.client.Do(req)
 
782
        if err != nil {
 
783
                return nil, err
 
784
        }
 
785
        defer googleapi.CloseBody(res)
 
786
        if err := googleapi.CheckResponse(res); err != nil {
 
787
                return nil, err
 
788
        }
 
789
        var ret *ListClustersResponse
 
790
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
791
                return nil, err
 
792
        }
 
793
        return ret, nil
 
794
        // {
 
795
        //   "description": "Lists all clusters owned by a project in the specified zone.",
 
796
        //   "httpMethod": "GET",
 
797
        //   "id": "container.projects.zones.clusters.list",
 
798
        //   "parameterOrder": [
 
799
        //     "projectId",
 
800
        //     "zoneId"
 
801
        //   ],
 
802
        //   "parameters": {
 
803
        //     "projectId": {
 
804
        //       "description": "The Google Developers Console project ID or  project number.",
 
805
        //       "location": "path",
 
806
        //       "required": true,
 
807
        //       "type": "string"
 
808
        //     },
 
809
        //     "zoneId": {
 
810
        //       "description": "The name of the Google Compute Engine zone in which the cluster resides.",
 
811
        //       "location": "path",
 
812
        //       "required": true,
 
813
        //       "type": "string"
 
814
        //     }
 
815
        //   },
 
816
        //   "path": "{projectId}/zones/{zoneId}/clusters",
 
817
        //   "response": {
 
818
        //     "$ref": "ListClustersResponse"
 
819
        //   },
 
820
        //   "scopes": [
 
821
        //     "https://www.googleapis.com/auth/cloud-platform"
 
822
        //   ]
 
823
        // }
 
824
 
 
825
}
 
826
 
 
827
// method id "container.projects.zones.operations.get":
 
828
 
 
829
type ProjectsZonesOperationsGetCall struct {
 
830
        s           *Service
 
831
        projectId   string
 
832
        zoneId      string
 
833
        operationId string
 
834
        opt_        map[string]interface{}
 
835
}
 
836
 
 
837
// Get: Gets the specified operation.
 
838
func (r *ProjectsZonesOperationsService) Get(projectId string, zoneId string, operationId string) *ProjectsZonesOperationsGetCall {
 
839
        c := &ProjectsZonesOperationsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
840
        c.projectId = projectId
 
841
        c.zoneId = zoneId
 
842
        c.operationId = operationId
 
843
        return c
 
844
}
 
845
 
 
846
// Fields allows partial responses to be retrieved.
 
847
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
848
// for more information.
 
849
func (c *ProjectsZonesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsGetCall {
 
850
        c.opt_["fields"] = googleapi.CombineFields(s)
 
851
        return c
 
852
}
 
853
 
 
854
func (c *ProjectsZonesOperationsGetCall) Do() (*Operation, error) {
 
855
        var body io.Reader = nil
 
856
        params := make(url.Values)
 
857
        params.Set("alt", "json")
 
858
        if v, ok := c.opt_["fields"]; ok {
 
859
                params.Set("fields", fmt.Sprintf("%v", v))
 
860
        }
 
861
        urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/operations/{operationId}")
 
862
        urls += "?" + params.Encode()
 
863
        req, _ := http.NewRequest("GET", urls, body)
 
864
        googleapi.Expand(req.URL, map[string]string{
 
865
                "projectId":   c.projectId,
 
866
                "zoneId":      c.zoneId,
 
867
                "operationId": c.operationId,
 
868
        })
 
869
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
870
        res, err := c.s.client.Do(req)
 
871
        if err != nil {
 
872
                return nil, err
 
873
        }
 
874
        defer googleapi.CloseBody(res)
 
875
        if err := googleapi.CheckResponse(res); err != nil {
 
876
                return nil, err
 
877
        }
 
878
        var ret *Operation
 
879
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
880
                return nil, err
 
881
        }
 
882
        return ret, nil
 
883
        // {
 
884
        //   "description": "Gets the specified operation.",
 
885
        //   "httpMethod": "GET",
 
886
        //   "id": "container.projects.zones.operations.get",
 
887
        //   "parameterOrder": [
 
888
        //     "projectId",
 
889
        //     "zoneId",
 
890
        //     "operationId"
 
891
        //   ],
 
892
        //   "parameters": {
 
893
        //     "operationId": {
 
894
        //       "description": "The server-assigned name of the operation.",
 
895
        //       "location": "path",
 
896
        //       "required": true,
 
897
        //       "type": "string"
 
898
        //     },
 
899
        //     "projectId": {
 
900
        //       "description": "The Google Developers Console project ID or  project number.",
 
901
        //       "location": "path",
 
902
        //       "required": true,
 
903
        //       "type": "string"
 
904
        //     },
 
905
        //     "zoneId": {
 
906
        //       "description": "The name of the Google Compute Engine zone in which the operation resides. This is always the same zone as the cluster with which the operation is associated.",
 
907
        //       "location": "path",
 
908
        //       "required": true,
 
909
        //       "type": "string"
 
910
        //     }
 
911
        //   },
 
912
        //   "path": "{projectId}/zones/{zoneId}/operations/{operationId}",
 
913
        //   "response": {
 
914
        //     "$ref": "Operation"
 
915
        //   },
 
916
        //   "scopes": [
 
917
        //     "https://www.googleapis.com/auth/cloud-platform"
 
918
        //   ]
 
919
        // }
 
920
 
 
921
}
 
922
 
 
923
// method id "container.projects.zones.operations.list":
 
924
 
 
925
type ProjectsZonesOperationsListCall struct {
 
926
        s         *Service
 
927
        projectId string
 
928
        zoneId    string
 
929
        opt_      map[string]interface{}
 
930
}
 
931
 
 
932
// List: Lists all operations in a project in a specific zone.
 
933
func (r *ProjectsZonesOperationsService) List(projectId string, zoneId string) *ProjectsZonesOperationsListCall {
 
934
        c := &ProjectsZonesOperationsListCall{s: r.s, opt_: make(map[string]interface{})}
 
935
        c.projectId = projectId
 
936
        c.zoneId = zoneId
 
937
        return c
 
938
}
 
939
 
 
940
// Fields allows partial responses to be retrieved.
 
941
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
942
// for more information.
 
943
func (c *ProjectsZonesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsListCall {
 
944
        c.opt_["fields"] = googleapi.CombineFields(s)
 
945
        return c
 
946
}
 
947
 
 
948
func (c *ProjectsZonesOperationsListCall) Do() (*ListOperationsResponse, error) {
 
949
        var body io.Reader = nil
 
950
        params := make(url.Values)
 
951
        params.Set("alt", "json")
 
952
        if v, ok := c.opt_["fields"]; ok {
 
953
                params.Set("fields", fmt.Sprintf("%v", v))
 
954
        }
 
955
        urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/operations")
 
956
        urls += "?" + params.Encode()
 
957
        req, _ := http.NewRequest("GET", urls, body)
 
958
        googleapi.Expand(req.URL, map[string]string{
 
959
                "projectId": c.projectId,
 
960
                "zoneId":    c.zoneId,
 
961
        })
 
962
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
963
        res, err := c.s.client.Do(req)
 
964
        if err != nil {
 
965
                return nil, err
 
966
        }
 
967
        defer googleapi.CloseBody(res)
 
968
        if err := googleapi.CheckResponse(res); err != nil {
 
969
                return nil, err
 
970
        }
 
971
        var ret *ListOperationsResponse
 
972
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
973
                return nil, err
 
974
        }
 
975
        return ret, nil
 
976
        // {
 
977
        //   "description": "Lists all operations in a project in a specific zone.",
 
978
        //   "httpMethod": "GET",
 
979
        //   "id": "container.projects.zones.operations.list",
 
980
        //   "parameterOrder": [
 
981
        //     "projectId",
 
982
        //     "zoneId"
 
983
        //   ],
 
984
        //   "parameters": {
 
985
        //     "projectId": {
 
986
        //       "description": "The Google Developers Console project ID or  project number.",
 
987
        //       "location": "path",
 
988
        //       "required": true,
 
989
        //       "type": "string"
 
990
        //     },
 
991
        //     "zoneId": {
 
992
        //       "description": "The name of the Google Compute Engine zone to return operations for.",
 
993
        //       "location": "path",
 
994
        //       "required": true,
 
995
        //       "type": "string"
 
996
        //     }
 
997
        //   },
 
998
        //   "path": "{projectId}/zones/{zoneId}/operations",
 
999
        //   "response": {
 
1000
        //     "$ref": "ListOperationsResponse"
 
1001
        //   },
 
1002
        //   "scopes": [
 
1003
        //     "https://www.googleapis.com/auth/cloud-platform"
 
1004
        //   ]
 
1005
        // }
 
1006
 
 
1007
}