blob: 3728bb87319b05222c71dd541c3a1a636af01640 [file] [log] [blame]
// Copyright 2021 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 compute_test
import (
"context"
compute "cloud.google.com/go/compute/apiv1"
computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)
func ExampleNewInstancesRESTClient() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func ExampleInstancesClient_AddAccessConfig() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddAccessConfigInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.AddAccessConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_AddResourcePolicies() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddResourcePoliciesInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.AddResourcePolicies(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_AggregatedList() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInstancesRequest{
// TODO: Fill request struct fields.
}
resp, err := c.AggregatedList(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_AttachDisk() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AttachDiskInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.AttachDisk(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_BulkInsert() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.BulkInsertInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.BulkInsert(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_Delete() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_DeleteAccessConfig() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteAccessConfigInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.DeleteAccessConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_DetachDisk() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DetachDiskInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.DetachDisk(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_Get() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_GetEffectiveFirewalls() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetEffectiveFirewallsInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetEffectiveFirewalls(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_GetGuestAttributes() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetGuestAttributesInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetGuestAttributes(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_GetIamPolicy() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_GetScreenshot() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetScreenshotInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetScreenshot(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_GetSerialPortOutput() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetSerialPortOutputInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetSerialPortOutput(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_GetShieldedInstanceIdentity() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetShieldedInstanceIdentityInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetShieldedInstanceIdentity(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_Insert() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_List() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstancesRequest{
// TODO: Fill request struct fields.
}
resp, err := c.List(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_ListReferrers() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListReferrersInstancesRequest{
// TODO: Fill request struct fields.
}
resp, err := c.ListReferrers(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_RemoveResourcePolicies() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveResourcePoliciesInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.RemoveResourcePolicies(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_Reset() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResetInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Reset(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetDeletionProtection() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetDeletionProtectionInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetDeletionProtection(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetDiskAutoDelete() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetDiskAutoDeleteInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetDiskAutoDelete(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetIamPolicy() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetLabels() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetMachineResources() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetMachineResourcesInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetMachineResources(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetMachineType() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetMachineTypeInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetMachineType(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetMetadata() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetMetadataInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetMetadata(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetMinCpuPlatform() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetMinCpuPlatformInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetMinCpuPlatform(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetScheduling() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSchedulingInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetScheduling(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetServiceAccount() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetServiceAccountInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetServiceAccount(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetShieldedInstanceIntegrityPolicy() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetShieldedInstanceIntegrityPolicyInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetShieldedInstanceIntegrityPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SetTags() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetTagsInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetTags(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_SimulateMaintenanceEvent() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SimulateMaintenanceEventInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SimulateMaintenanceEvent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_Start() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StartInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Start(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_StartWithEncryptionKey() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StartWithEncryptionKeyInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.StartWithEncryptionKey(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_Stop() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StopInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Stop(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_TestIamPermissions() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_Update() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_UpdateAccessConfig() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateAccessConfigInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateAccessConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_UpdateDisplayDevice() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateDisplayDeviceInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateDisplayDevice(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_UpdateNetworkInterface() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateNetworkInterfaceInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateNetworkInterface(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleInstancesClient_UpdateShieldedInstanceConfig() {
ctx := context.Background()
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateShieldedInstanceConfigInstanceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateShieldedInstanceConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}