1// Copyright 2021 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
16
17package container_test
18
19import (
20	"context"
21
22	container "cloud.google.com/go/container/apiv1"
23	"google.golang.org/api/iterator"
24	containerpb "google.golang.org/genproto/googleapis/container/v1"
25)
26
27func ExampleNewClusterManagerClient() {
28	ctx := context.Background()
29	c, err := container.NewClusterManagerClient(ctx)
30	if err != nil {
31		// TODO: Handle error.
32	}
33	// TODO: Use client.
34	_ = c
35}
36
37func ExampleClusterManagerClient_ListClusters() {
38	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
39
40	ctx := context.Background()
41	c, err := container.NewClusterManagerClient(ctx)
42	if err != nil {
43		// TODO: Handle error.
44	}
45
46	req := &containerpb.ListClustersRequest{
47		// TODO: Fill request struct fields.
48	}
49	resp, err := c.ListClusters(ctx, req)
50	if err != nil {
51		// TODO: Handle error.
52	}
53	// TODO: Use resp.
54	_ = resp
55}
56
57func ExampleClusterManagerClient_GetCluster() {
58	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
59
60	ctx := context.Background()
61	c, err := container.NewClusterManagerClient(ctx)
62	if err != nil {
63		// TODO: Handle error.
64	}
65
66	req := &containerpb.GetClusterRequest{
67		// TODO: Fill request struct fields.
68	}
69	resp, err := c.GetCluster(ctx, req)
70	if err != nil {
71		// TODO: Handle error.
72	}
73	// TODO: Use resp.
74	_ = resp
75}
76
77func ExampleClusterManagerClient_CreateCluster() {
78	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
79
80	ctx := context.Background()
81	c, err := container.NewClusterManagerClient(ctx)
82	if err != nil {
83		// TODO: Handle error.
84	}
85
86	req := &containerpb.CreateClusterRequest{
87		// TODO: Fill request struct fields.
88	}
89	resp, err := c.CreateCluster(ctx, req)
90	if err != nil {
91		// TODO: Handle error.
92	}
93	// TODO: Use resp.
94	_ = resp
95}
96
97func ExampleClusterManagerClient_UpdateCluster() {
98	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
99
100	ctx := context.Background()
101	c, err := container.NewClusterManagerClient(ctx)
102	if err != nil {
103		// TODO: Handle error.
104	}
105
106	req := &containerpb.UpdateClusterRequest{
107		// TODO: Fill request struct fields.
108	}
109	resp, err := c.UpdateCluster(ctx, req)
110	if err != nil {
111		// TODO: Handle error.
112	}
113	// TODO: Use resp.
114	_ = resp
115}
116
117func ExampleClusterManagerClient_UpdateNodePool() {
118	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
119
120	ctx := context.Background()
121	c, err := container.NewClusterManagerClient(ctx)
122	if err != nil {
123		// TODO: Handle error.
124	}
125
126	req := &containerpb.UpdateNodePoolRequest{
127		// TODO: Fill request struct fields.
128	}
129	resp, err := c.UpdateNodePool(ctx, req)
130	if err != nil {
131		// TODO: Handle error.
132	}
133	// TODO: Use resp.
134	_ = resp
135}
136
137func ExampleClusterManagerClient_SetNodePoolAutoscaling() {
138	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
139
140	ctx := context.Background()
141	c, err := container.NewClusterManagerClient(ctx)
142	if err != nil {
143		// TODO: Handle error.
144	}
145
146	req := &containerpb.SetNodePoolAutoscalingRequest{
147		// TODO: Fill request struct fields.
148	}
149	resp, err := c.SetNodePoolAutoscaling(ctx, req)
150	if err != nil {
151		// TODO: Handle error.
152	}
153	// TODO: Use resp.
154	_ = resp
155}
156
157func ExampleClusterManagerClient_SetLoggingService() {
158	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
159
160	ctx := context.Background()
161	c, err := container.NewClusterManagerClient(ctx)
162	if err != nil {
163		// TODO: Handle error.
164	}
165
166	req := &containerpb.SetLoggingServiceRequest{
167		// TODO: Fill request struct fields.
168	}
169	resp, err := c.SetLoggingService(ctx, req)
170	if err != nil {
171		// TODO: Handle error.
172	}
173	// TODO: Use resp.
174	_ = resp
175}
176
177func ExampleClusterManagerClient_SetMonitoringService() {
178	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
179
180	ctx := context.Background()
181	c, err := container.NewClusterManagerClient(ctx)
182	if err != nil {
183		// TODO: Handle error.
184	}
185
186	req := &containerpb.SetMonitoringServiceRequest{
187		// TODO: Fill request struct fields.
188	}
189	resp, err := c.SetMonitoringService(ctx, req)
190	if err != nil {
191		// TODO: Handle error.
192	}
193	// TODO: Use resp.
194	_ = resp
195}
196
197func ExampleClusterManagerClient_SetAddonsConfig() {
198	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
199
200	ctx := context.Background()
201	c, err := container.NewClusterManagerClient(ctx)
202	if err != nil {
203		// TODO: Handle error.
204	}
205
206	req := &containerpb.SetAddonsConfigRequest{
207		// TODO: Fill request struct fields.
208	}
209	resp, err := c.SetAddonsConfig(ctx, req)
210	if err != nil {
211		// TODO: Handle error.
212	}
213	// TODO: Use resp.
214	_ = resp
215}
216
217func ExampleClusterManagerClient_SetLocations() {
218	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
219
220	ctx := context.Background()
221	c, err := container.NewClusterManagerClient(ctx)
222	if err != nil {
223		// TODO: Handle error.
224	}
225
226	req := &containerpb.SetLocationsRequest{
227		// TODO: Fill request struct fields.
228	}
229	resp, err := c.SetLocations(ctx, req)
230	if err != nil {
231		// TODO: Handle error.
232	}
233	// TODO: Use resp.
234	_ = resp
235}
236
237func ExampleClusterManagerClient_UpdateMaster() {
238	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
239
240	ctx := context.Background()
241	c, err := container.NewClusterManagerClient(ctx)
242	if err != nil {
243		// TODO: Handle error.
244	}
245
246	req := &containerpb.UpdateMasterRequest{
247		// TODO: Fill request struct fields.
248	}
249	resp, err := c.UpdateMaster(ctx, req)
250	if err != nil {
251		// TODO: Handle error.
252	}
253	// TODO: Use resp.
254	_ = resp
255}
256
257func ExampleClusterManagerClient_SetMasterAuth() {
258	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
259
260	ctx := context.Background()
261	c, err := container.NewClusterManagerClient(ctx)
262	if err != nil {
263		// TODO: Handle error.
264	}
265
266	req := &containerpb.SetMasterAuthRequest{
267		// TODO: Fill request struct fields.
268	}
269	resp, err := c.SetMasterAuth(ctx, req)
270	if err != nil {
271		// TODO: Handle error.
272	}
273	// TODO: Use resp.
274	_ = resp
275}
276
277func ExampleClusterManagerClient_DeleteCluster() {
278	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
279
280	ctx := context.Background()
281	c, err := container.NewClusterManagerClient(ctx)
282	if err != nil {
283		// TODO: Handle error.
284	}
285
286	req := &containerpb.DeleteClusterRequest{
287		// TODO: Fill request struct fields.
288	}
289	resp, err := c.DeleteCluster(ctx, req)
290	if err != nil {
291		// TODO: Handle error.
292	}
293	// TODO: Use resp.
294	_ = resp
295}
296
297func ExampleClusterManagerClient_ListOperations() {
298	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
299
300	ctx := context.Background()
301	c, err := container.NewClusterManagerClient(ctx)
302	if err != nil {
303		// TODO: Handle error.
304	}
305
306	req := &containerpb.ListOperationsRequest{
307		// TODO: Fill request struct fields.
308	}
309	resp, err := c.ListOperations(ctx, req)
310	if err != nil {
311		// TODO: Handle error.
312	}
313	// TODO: Use resp.
314	_ = resp
315}
316
317func ExampleClusterManagerClient_GetOperation() {
318	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
319
320	ctx := context.Background()
321	c, err := container.NewClusterManagerClient(ctx)
322	if err != nil {
323		// TODO: Handle error.
324	}
325
326	req := &containerpb.GetOperationRequest{
327		// TODO: Fill request struct fields.
328	}
329	resp, err := c.GetOperation(ctx, req)
330	if err != nil {
331		// TODO: Handle error.
332	}
333	// TODO: Use resp.
334	_ = resp
335}
336
337func ExampleClusterManagerClient_CancelOperation() {
338	ctx := context.Background()
339	c, err := container.NewClusterManagerClient(ctx)
340	if err != nil {
341		// TODO: Handle error.
342	}
343
344	req := &containerpb.CancelOperationRequest{
345		// TODO: Fill request struct fields.
346	}
347	err = c.CancelOperation(ctx, req)
348	if err != nil {
349		// TODO: Handle error.
350	}
351}
352
353func ExampleClusterManagerClient_GetServerConfig() {
354	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
355
356	ctx := context.Background()
357	c, err := container.NewClusterManagerClient(ctx)
358	if err != nil {
359		// TODO: Handle error.
360	}
361
362	req := &containerpb.GetServerConfigRequest{
363		// TODO: Fill request struct fields.
364	}
365	resp, err := c.GetServerConfig(ctx, req)
366	if err != nil {
367		// TODO: Handle error.
368	}
369	// TODO: Use resp.
370	_ = resp
371}
372
373func ExampleClusterManagerClient_GetJSONWebKeys() {
374	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
375
376	ctx := context.Background()
377	c, err := container.NewClusterManagerClient(ctx)
378	if err != nil {
379		// TODO: Handle error.
380	}
381
382	req := &containerpb.GetJSONWebKeysRequest{
383		// TODO: Fill request struct fields.
384	}
385	resp, err := c.GetJSONWebKeys(ctx, req)
386	if err != nil {
387		// TODO: Handle error.
388	}
389	// TODO: Use resp.
390	_ = resp
391}
392
393func ExampleClusterManagerClient_ListNodePools() {
394	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
395
396	ctx := context.Background()
397	c, err := container.NewClusterManagerClient(ctx)
398	if err != nil {
399		// TODO: Handle error.
400	}
401
402	req := &containerpb.ListNodePoolsRequest{
403		// TODO: Fill request struct fields.
404	}
405	resp, err := c.ListNodePools(ctx, req)
406	if err != nil {
407		// TODO: Handle error.
408	}
409	// TODO: Use resp.
410	_ = resp
411}
412
413func ExampleClusterManagerClient_GetNodePool() {
414	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
415
416	ctx := context.Background()
417	c, err := container.NewClusterManagerClient(ctx)
418	if err != nil {
419		// TODO: Handle error.
420	}
421
422	req := &containerpb.GetNodePoolRequest{
423		// TODO: Fill request struct fields.
424	}
425	resp, err := c.GetNodePool(ctx, req)
426	if err != nil {
427		// TODO: Handle error.
428	}
429	// TODO: Use resp.
430	_ = resp
431}
432
433func ExampleClusterManagerClient_CreateNodePool() {
434	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
435
436	ctx := context.Background()
437	c, err := container.NewClusterManagerClient(ctx)
438	if err != nil {
439		// TODO: Handle error.
440	}
441
442	req := &containerpb.CreateNodePoolRequest{
443		// TODO: Fill request struct fields.
444	}
445	resp, err := c.CreateNodePool(ctx, req)
446	if err != nil {
447		// TODO: Handle error.
448	}
449	// TODO: Use resp.
450	_ = resp
451}
452
453func ExampleClusterManagerClient_DeleteNodePool() {
454	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
455
456	ctx := context.Background()
457	c, err := container.NewClusterManagerClient(ctx)
458	if err != nil {
459		// TODO: Handle error.
460	}
461
462	req := &containerpb.DeleteNodePoolRequest{
463		// TODO: Fill request struct fields.
464	}
465	resp, err := c.DeleteNodePool(ctx, req)
466	if err != nil {
467		// TODO: Handle error.
468	}
469	// TODO: Use resp.
470	_ = resp
471}
472
473func ExampleClusterManagerClient_RollbackNodePoolUpgrade() {
474	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
475
476	ctx := context.Background()
477	c, err := container.NewClusterManagerClient(ctx)
478	if err != nil {
479		// TODO: Handle error.
480	}
481
482	req := &containerpb.RollbackNodePoolUpgradeRequest{
483		// TODO: Fill request struct fields.
484	}
485	resp, err := c.RollbackNodePoolUpgrade(ctx, req)
486	if err != nil {
487		// TODO: Handle error.
488	}
489	// TODO: Use resp.
490	_ = resp
491}
492
493func ExampleClusterManagerClient_SetNodePoolManagement() {
494	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
495
496	ctx := context.Background()
497	c, err := container.NewClusterManagerClient(ctx)
498	if err != nil {
499		// TODO: Handle error.
500	}
501
502	req := &containerpb.SetNodePoolManagementRequest{
503		// TODO: Fill request struct fields.
504	}
505	resp, err := c.SetNodePoolManagement(ctx, req)
506	if err != nil {
507		// TODO: Handle error.
508	}
509	// TODO: Use resp.
510	_ = resp
511}
512
513func ExampleClusterManagerClient_SetLabels() {
514	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
515
516	ctx := context.Background()
517	c, err := container.NewClusterManagerClient(ctx)
518	if err != nil {
519		// TODO: Handle error.
520	}
521
522	req := &containerpb.SetLabelsRequest{
523		// TODO: Fill request struct fields.
524	}
525	resp, err := c.SetLabels(ctx, req)
526	if err != nil {
527		// TODO: Handle error.
528	}
529	// TODO: Use resp.
530	_ = resp
531}
532
533func ExampleClusterManagerClient_SetLegacyAbac() {
534	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
535
536	ctx := context.Background()
537	c, err := container.NewClusterManagerClient(ctx)
538	if err != nil {
539		// TODO: Handle error.
540	}
541
542	req := &containerpb.SetLegacyAbacRequest{
543		// TODO: Fill request struct fields.
544	}
545	resp, err := c.SetLegacyAbac(ctx, req)
546	if err != nil {
547		// TODO: Handle error.
548	}
549	// TODO: Use resp.
550	_ = resp
551}
552
553func ExampleClusterManagerClient_StartIPRotation() {
554	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
555
556	ctx := context.Background()
557	c, err := container.NewClusterManagerClient(ctx)
558	if err != nil {
559		// TODO: Handle error.
560	}
561
562	req := &containerpb.StartIPRotationRequest{
563		// TODO: Fill request struct fields.
564	}
565	resp, err := c.StartIPRotation(ctx, req)
566	if err != nil {
567		// TODO: Handle error.
568	}
569	// TODO: Use resp.
570	_ = resp
571}
572
573func ExampleClusterManagerClient_CompleteIPRotation() {
574	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
575
576	ctx := context.Background()
577	c, err := container.NewClusterManagerClient(ctx)
578	if err != nil {
579		// TODO: Handle error.
580	}
581
582	req := &containerpb.CompleteIPRotationRequest{
583		// TODO: Fill request struct fields.
584	}
585	resp, err := c.CompleteIPRotation(ctx, req)
586	if err != nil {
587		// TODO: Handle error.
588	}
589	// TODO: Use resp.
590	_ = resp
591}
592
593func ExampleClusterManagerClient_SetNodePoolSize() {
594	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
595
596	ctx := context.Background()
597	c, err := container.NewClusterManagerClient(ctx)
598	if err != nil {
599		// TODO: Handle error.
600	}
601
602	req := &containerpb.SetNodePoolSizeRequest{
603		// TODO: Fill request struct fields.
604	}
605	resp, err := c.SetNodePoolSize(ctx, req)
606	if err != nil {
607		// TODO: Handle error.
608	}
609	// TODO: Use resp.
610	_ = resp
611}
612
613func ExampleClusterManagerClient_SetNetworkPolicy() {
614	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
615
616	ctx := context.Background()
617	c, err := container.NewClusterManagerClient(ctx)
618	if err != nil {
619		// TODO: Handle error.
620	}
621
622	req := &containerpb.SetNetworkPolicyRequest{
623		// TODO: Fill request struct fields.
624	}
625	resp, err := c.SetNetworkPolicy(ctx, req)
626	if err != nil {
627		// TODO: Handle error.
628	}
629	// TODO: Use resp.
630	_ = resp
631}
632
633func ExampleClusterManagerClient_SetMaintenancePolicy() {
634	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
635
636	ctx := context.Background()
637	c, err := container.NewClusterManagerClient(ctx)
638	if err != nil {
639		// TODO: Handle error.
640	}
641
642	req := &containerpb.SetMaintenancePolicyRequest{
643		// TODO: Fill request struct fields.
644	}
645	resp, err := c.SetMaintenancePolicy(ctx, req)
646	if err != nil {
647		// TODO: Handle error.
648	}
649	// TODO: Use resp.
650	_ = resp
651}
652
653func ExampleClusterManagerClient_ListUsableSubnetworks() {
654	// import containerpb "google.golang.org/genproto/googleapis/container/v1"
655	// import "google.golang.org/api/iterator"
656
657	ctx := context.Background()
658	c, err := container.NewClusterManagerClient(ctx)
659	if err != nil {
660		// TODO: Handle error.
661	}
662
663	req := &containerpb.ListUsableSubnetworksRequest{
664		// TODO: Fill request struct fields.
665	}
666	it := c.ListUsableSubnetworks(ctx, req)
667	for {
668		resp, err := it.Next()
669		if err == iterator.Done {
670			break
671		}
672		if err != nil {
673			// TODO: Handle error.
674		}
675		// TODO: Use resp.
676		_ = resp
677	}
678}
679