1
// Package container provides access to the Google Container Engine API.
5
// import "google.golang.org/api/container/v1beta1"
7
// containerService, err := container.New(oauthHttpClient)
15
"google.golang.org/api/googleapi"
23
// Always reference these packages, just in case the auto-generated code
25
var _ = bytes.NewBuffer
28
var _ = json.NewDecoder
31
var _ = googleapi.Version
33
var _ = strings.Replace
35
const apiId = "container:v1beta1"
36
const apiName = "container"
37
const apiVersion = "v1beta1"
38
const basePath = "https://www.googleapis.com/container/v1beta1/projects/"
40
// OAuth2 scopes used by this API.
42
// View and manage your data across Google Cloud Platform services
43
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
46
func New(client *http.Client) (*Service, error) {
48
return nil, errors.New("client is nil")
50
s := &Service{client: client, BasePath: basePath}
51
s.Projects = NewProjectsService(s)
57
BasePath string // API endpoint base URL
59
Projects *ProjectsService
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)
70
type ProjectsService struct {
73
Clusters *ProjectsClustersService
75
Operations *ProjectsOperationsService
77
Zones *ProjectsZonesService
80
func NewProjectsClustersService(s *Service) *ProjectsClustersService {
81
rs := &ProjectsClustersService{s: s}
85
type ProjectsClustersService struct {
89
func NewProjectsOperationsService(s *Service) *ProjectsOperationsService {
90
rs := &ProjectsOperationsService{s: s}
94
type ProjectsOperationsService struct {
98
func NewProjectsZonesService(s *Service) *ProjectsZonesService {
99
rs := &ProjectsZonesService{s: s}
100
rs.Clusters = NewProjectsZonesClustersService(s)
101
rs.Operations = NewProjectsZonesOperationsService(s)
105
type ProjectsZonesService struct {
108
Clusters *ProjectsZonesClustersService
110
Operations *ProjectsZonesOperationsService
113
func NewProjectsZonesClustersService(s *Service) *ProjectsZonesClustersService {
114
rs := &ProjectsZonesClustersService{s: s}
118
type ProjectsZonesClustersService struct {
122
func NewProjectsZonesOperationsService(s *Service) *ProjectsZonesOperationsService {
123
rs := &ProjectsZonesOperationsService{s: s}
127
type ProjectsZonesOperationsService struct {
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"`
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"`
141
// CreationTimestamp: [Output only] The time the cluster was created, in
142
// RFC3339 text format.
143
CreationTimestamp string `json:"creationTimestamp,omitempty"`
145
// Description: An optional description of this cluster.
146
Description string `json:"description,omitempty"`
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/.
152
// See the masterAuth property of
153
// this resource for username and password information.
154
Endpoint string `json:"endpoint,omitempty"`
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"`
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
164
// - Lowercase letters, numbers, and hyphens only.
166
// Must start with a letter.
167
// - Must end with a number or a letter.
168
Name string `json:"name,omitempty"`
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"`
174
// NodeRoutingPrefixSize: [Output only] The size of the address space on
175
// each node for hosting containers.
176
NodeRoutingPrefixSize int64 `json:"nodeRoutingPrefixSize,omitempty"`
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"`
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"`
189
// Status: [Output only] The current status of this cluster.
190
Status string `json:"status,omitempty"`
192
// StatusMessage: [Output only] Additional information about the current
193
// status of this cluster, if available.
194
StatusMessage string `json:"statusMessage,omitempty"`
196
// Zone: [Output only] The name of the Google Compute Engine zone in
197
// which the cluster resides.
198
Zone string `json:"zone,omitempty"`
201
type CreateClusterRequest struct {
202
// Cluster: A cluster resource.
203
Cluster *Cluster `json:"cluster,omitempty"`
206
type ListAggregatedClustersResponse struct {
207
// Clusters: A list of clusters in the project, across all zones.
208
Clusters []*Cluster `json:"clusters,omitempty"`
211
type ListAggregatedOperationsResponse struct {
212
// Operations: A list of operations in the project, across all zones.
213
Operations []*Operation `json:"operations,omitempty"`
216
type ListClustersResponse struct {
217
// Clusters: A list of clusters in the project in the specified zone.
218
Clusters []*Cluster `json:"clusters,omitempty"`
221
type ListOperationsResponse struct {
222
// Operations: A list of operations in the project in the specified
224
Operations []*Operation `json:"operations,omitempty"`
227
type MasterAuth struct {
228
// Password: The password to use when accessing the Kubernetes master
230
Password string `json:"password,omitempty"`
232
// User: The username to use when accessing the Kubernetes master
234
User string `json:"user,omitempty"`
237
type NodeConfig struct {
238
// MachineType: The name of a Google Compute Engine machine type (e.g.
241
// If unspecified, the default machine type is
243
MachineType string `json:"machineType,omitempty"`
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
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
255
SourceImage string `json:"sourceImage,omitempty"`
258
type Operation struct {
259
// ErrorMessage: If an error has occurred, a textual description of the
261
ErrorMessage string `json:"errorMessage,omitempty"`
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"`
267
// OperationType: The operation type.
268
OperationType string `json:"operationType,omitempty"`
270
// Status: The current status of the operation.
271
Status string `json:"status,omitempty"`
273
// Target: [Optional] The URL of the cluster resource that this
274
// operation is associated with.
275
Target string `json:"target,omitempty"`
277
// Zone: The name of the Google Compute Engine zone in which the
278
// operation is taking place.
279
Zone string `json:"zone,omitempty"`
282
// method id "container.projects.clusters.list":
284
type ProjectsClustersListCall struct {
287
opt_ map[string]interface{}
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
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)
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))
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,
318
req.Header.Set("User-Agent", "google-api-go-client/0.5")
319
res, err := c.s.client.Do(req)
323
defer googleapi.CloseBody(res)
324
if err := googleapi.CheckResponse(res); err != nil {
327
var ret *ListAggregatedClustersResponse
328
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
333
// "description": "Lists all clusters owned by a project across all zones.",
334
// "httpMethod": "GET",
335
// "id": "container.projects.clusters.list",
336
// "parameterOrder": [
341
// "description": "The Google Developers Console project ID or project number.",
342
// "location": "path",
347
// "path": "{projectId}/clusters",
349
// "$ref": "ListAggregatedClustersResponse"
352
// "https://www.googleapis.com/auth/cloud-platform"
358
// method id "container.projects.operations.list":
360
type ProjectsOperationsListCall struct {
363
opt_ map[string]interface{}
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
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)
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))
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,
394
req.Header.Set("User-Agent", "google-api-go-client/0.5")
395
res, err := c.s.client.Do(req)
399
defer googleapi.CloseBody(res)
400
if err := googleapi.CheckResponse(res); err != nil {
403
var ret *ListAggregatedOperationsResponse
404
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
409
// "description": "Lists all operations in a project, across all zones.",
410
// "httpMethod": "GET",
411
// "id": "container.projects.operations.list",
412
// "parameterOrder": [
417
// "description": "The Google Developers Console project ID or project number.",
418
// "location": "path",
423
// "path": "{projectId}/operations",
425
// "$ref": "ListAggregatedOperationsResponse"
428
// "https://www.googleapis.com/auth/cloud-platform"
434
// method id "container.projects.zones.clusters.create":
436
type ProjectsZonesClustersCreateCall struct {
440
createclusterrequest *CreateClusterRequest
441
opt_ map[string]interface{}
444
// Create: Creates a cluster, consisting of the specified number and
445
// type of Google Compute Engine instances, plus a Kubernetes master
448
// The cluster is created in the project's default
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.
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
463
c.createclusterrequest = createclusterrequest
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)
475
func (c *ProjectsZonesClustersCreateCall) Do() (*Operation, error) {
476
var body io.Reader = nil
477
body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
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))
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,
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)
500
defer googleapi.CloseBody(res)
501
if err := googleapi.CheckResponse(res); err != nil {
505
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
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": [
519
// "description": "The Google Developers Console project ID or project number.",
520
// "location": "path",
525
// "description": "The name of the Google Compute Engine zone in which the cluster resides.",
526
// "location": "path",
531
// "path": "{projectId}/zones/{zoneId}/clusters",
533
// "$ref": "CreateClusterRequest"
536
// "$ref": "Operation"
539
// "https://www.googleapis.com/auth/cloud-platform"
545
// method id "container.projects.zones.clusters.delete":
547
type ProjectsZonesClustersDeleteCall struct {
552
opt_ map[string]interface{}
555
// Delete: Deletes the cluster, including the Kubernetes master and all
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
564
c.clusterId = clusterId
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)
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))
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,
589
"clusterId": c.clusterId,
591
req.Header.Set("User-Agent", "google-api-go-client/0.5")
592
res, err := c.s.client.Do(req)
596
defer googleapi.CloseBody(res)
597
if err := googleapi.CheckResponse(res); err != nil {
601
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
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": [
616
// "description": "The name of the cluster to delete.",
617
// "location": "path",
622
// "description": "The Google Developers Console project ID or project number.",
623
// "location": "path",
628
// "description": "The name of the Google Compute Engine zone in which the cluster resides.",
629
// "location": "path",
634
// "path": "{projectId}/zones/{zoneId}/clusters/{clusterId}",
636
// "$ref": "Operation"
639
// "https://www.googleapis.com/auth/cloud-platform"
645
// method id "container.projects.zones.clusters.get":
647
type ProjectsZonesClustersGetCall struct {
652
opt_ map[string]interface{}
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
660
c.clusterId = clusterId
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)
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))
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,
685
"clusterId": c.clusterId,
687
req.Header.Set("User-Agent", "google-api-go-client/0.5")
688
res, err := c.s.client.Do(req)
692
defer googleapi.CloseBody(res)
693
if err := googleapi.CheckResponse(res); err != nil {
697
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
702
// "description": "Gets a specific cluster.",
703
// "httpMethod": "GET",
704
// "id": "container.projects.zones.clusters.get",
705
// "parameterOrder": [
712
// "description": "The name of the cluster to retrieve.",
713
// "location": "path",
718
// "description": "The Google Developers Console project ID or project number.",
719
// "location": "path",
724
// "description": "The name of the Google Compute Engine zone in which the cluster resides.",
725
// "location": "path",
730
// "path": "{projectId}/zones/{zoneId}/clusters/{clusterId}",
735
// "https://www.googleapis.com/auth/cloud-platform"
741
// method id "container.projects.zones.clusters.list":
743
type ProjectsZonesClustersListCall struct {
747
opt_ map[string]interface{}
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
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)
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))
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,
780
req.Header.Set("User-Agent", "google-api-go-client/0.5")
781
res, err := c.s.client.Do(req)
785
defer googleapi.CloseBody(res)
786
if err := googleapi.CheckResponse(res); err != nil {
789
var ret *ListClustersResponse
790
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
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": [
804
// "description": "The Google Developers Console project ID or project number.",
805
// "location": "path",
810
// "description": "The name of the Google Compute Engine zone in which the cluster resides.",
811
// "location": "path",
816
// "path": "{projectId}/zones/{zoneId}/clusters",
818
// "$ref": "ListClustersResponse"
821
// "https://www.googleapis.com/auth/cloud-platform"
827
// method id "container.projects.zones.operations.get":
829
type ProjectsZonesOperationsGetCall struct {
834
opt_ map[string]interface{}
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
842
c.operationId = operationId
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)
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))
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,
867
"operationId": c.operationId,
869
req.Header.Set("User-Agent", "google-api-go-client/0.5")
870
res, err := c.s.client.Do(req)
874
defer googleapi.CloseBody(res)
875
if err := googleapi.CheckResponse(res); err != nil {
879
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
884
// "description": "Gets the specified operation.",
885
// "httpMethod": "GET",
886
// "id": "container.projects.zones.operations.get",
887
// "parameterOrder": [
894
// "description": "The server-assigned name of the operation.",
895
// "location": "path",
900
// "description": "The Google Developers Console project ID or project number.",
901
// "location": "path",
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",
912
// "path": "{projectId}/zones/{zoneId}/operations/{operationId}",
914
// "$ref": "Operation"
917
// "https://www.googleapis.com/auth/cloud-platform"
923
// method id "container.projects.zones.operations.list":
925
type ProjectsZonesOperationsListCall struct {
929
opt_ map[string]interface{}
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
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)
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))
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,
962
req.Header.Set("User-Agent", "google-api-go-client/0.5")
963
res, err := c.s.client.Do(req)
967
defer googleapi.CloseBody(res)
968
if err := googleapi.CheckResponse(res); err != nil {
971
var ret *ListOperationsResponse
972
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
977
// "description": "Lists all operations in a project in a specific zone.",
978
// "httpMethod": "GET",
979
// "id": "container.projects.zones.operations.list",
980
// "parameterOrder": [
986
// "description": "The Google Developers Console project ID or project number.",
987
// "location": "path",
992
// "description": "The name of the Google Compute Engine zone to return operations for.",
993
// "location": "path",
998
// "path": "{projectId}/zones/{zoneId}/operations",
1000
// "$ref": "ListOperationsResponse"
1003
// "https://www.googleapis.com/auth/cloud-platform"