| // Copyright 2022 Google LLC |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // https://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| // Code generated by protoc-gen-go_gapic. DO NOT EDIT. |
| |
| package baremetalsolution_test |
| |
| import ( |
| "context" |
| |
| baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2" |
| "google.golang.org/api/iterator" |
| baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2" |
| locationpb "google.golang.org/genproto/googleapis/cloud/location" |
| ) |
| |
| func ExampleNewClient() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleClient_ListInstances() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListInstancesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListInstancesRequest. |
| } |
| it := c.ListInstances(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_GetInstance() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.GetInstanceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetInstanceRequest. |
| } |
| resp, err := c.GetInstance(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateInstance() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.UpdateInstanceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#UpdateInstanceRequest. |
| } |
| op, err := c.UpdateInstance(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ResetInstance() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ResetInstanceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ResetInstanceRequest. |
| } |
| op, err := c.ResetInstance(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_StartInstance() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.StartInstanceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#StartInstanceRequest. |
| } |
| op, err := c.StartInstance(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_StopInstance() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.StopInstanceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#StopInstanceRequest. |
| } |
| op, err := c.StopInstance(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_DetachLun() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.DetachLunRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#DetachLunRequest. |
| } |
| op, err := c.DetachLun(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ListVolumes() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListVolumesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListVolumesRequest. |
| } |
| it := c.ListVolumes(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_GetVolume() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.GetVolumeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetVolumeRequest. |
| } |
| resp, err := c.GetVolume(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateVolume() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.UpdateVolumeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#UpdateVolumeRequest. |
| } |
| op, err := c.UpdateVolume(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ResizeVolume() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ResizeVolumeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ResizeVolumeRequest. |
| } |
| op, err := c.ResizeVolume(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ListNetworks() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListNetworksRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListNetworksRequest. |
| } |
| it := c.ListNetworks(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_ListNetworkUsage() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListNetworkUsageRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListNetworkUsageRequest. |
| } |
| resp, err := c.ListNetworkUsage(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetNetwork() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.GetNetworkRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetNetworkRequest. |
| } |
| resp, err := c.GetNetwork(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateNetwork() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.UpdateNetworkRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#UpdateNetworkRequest. |
| } |
| op, err := c.UpdateNetwork(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetLun() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.GetLunRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetLunRequest. |
| } |
| resp, err := c.GetLun(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ListLuns() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListLunsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListLunsRequest. |
| } |
| it := c.ListLuns(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_GetNfsShare() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.GetNfsShareRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetNfsShareRequest. |
| } |
| resp, err := c.GetNfsShare(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ListNfsShares() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListNfsSharesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListNfsSharesRequest. |
| } |
| it := c.ListNfsShares(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_UpdateNfsShare() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.UpdateNfsShareRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#UpdateNfsShareRequest. |
| } |
| op, err := c.UpdateNfsShare(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetLocation() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &locationpb.GetLocationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest. |
| } |
| resp, err := c.GetLocation(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ListLocations() { |
| ctx := context.Background() |
| c, err := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &locationpb.ListLocationsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. |
| } |
| it := c.ListLocations(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |