Documentation
¶
Overview ¶
Package compute is an auto-generated package for the Google Compute Engine API.
General documentation ¶
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage ¶
To get started with this package, create a client.
// go get cloud.google.com/go/compute/apiv1beta@latest
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAcceleratorTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client ¶
The following is an example of making an API call with the newly created client, mentioned above.
req := &computepb.AggregatedListAcceleratorTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListAcceleratorTypesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.AcceleratorTypeAggregatedList)
}
Use of Context ¶
The ctx passed to NewAcceleratorTypesClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Index ¶
- func DefaultAuthScopes() []string
- type AcceleratorTypeIterator
- type AcceleratorTypesCallOptions
- type AcceleratorTypesClient
- func (c *AcceleratorTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAcceleratorTypesRequest, ...) *AcceleratorTypesScopedListPairIterator
- func (c *AcceleratorTypesClient) Close() error
- func (c *AcceleratorTypesClient) Connection() *grpc.ClientConndeprecated
- func (c *AcceleratorTypesClient) Get(ctx context.Context, req *computepb.GetAcceleratorTypeRequest, ...) (*computepb.AcceleratorType, error)
- func (c *AcceleratorTypesClient) List(ctx context.Context, req *computepb.ListAcceleratorTypesRequest, ...) *AcceleratorTypeIterator
- type AcceleratorTypesScopedListPair
- type AcceleratorTypesScopedListPairIterator
- type AddressIterator
- type AddressesCallOptions
- type AddressesClient
- func (c *AddressesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAddressesRequest, ...) *AddressesScopedListPairIterator
- func (c *AddressesClient) Close() error
- func (c *AddressesClient) Connection() *grpc.ClientConndeprecated
- func (c *AddressesClient) Delete(ctx context.Context, req *computepb.DeleteAddressRequest, ...) (*Operation, error)
- func (c *AddressesClient) Get(ctx context.Context, req *computepb.GetAddressRequest, opts ...gax.CallOption) (*computepb.Address, error)
- func (c *AddressesClient) Insert(ctx context.Context, req *computepb.InsertAddressRequest, ...) (*Operation, error)
- func (c *AddressesClient) List(ctx context.Context, req *computepb.ListAddressesRequest, ...) *AddressIterator
- func (c *AddressesClient) Move(ctx context.Context, req *computepb.MoveAddressRequest, opts ...gax.CallOption) (*Operation, error)
- func (c *AddressesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsAddressRequest, ...) (*Operation, error)
- func (c *AddressesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsAddressRequest, ...) (*computepb.TestPermissionsResponse, error)
- type AddressesScopedListPair
- type AddressesScopedListPairIterator
- type AdviceCallOptions
- type AdviceClient
- type AutoscalerIterator
- type AutoscalersCallOptions
- type AutoscalersClient
- func (c *AutoscalersClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAutoscalersRequest, ...) *AutoscalersScopedListPairIterator
- func (c *AutoscalersClient) Close() error
- func (c *AutoscalersClient) Connection() *grpc.ClientConndeprecated
- func (c *AutoscalersClient) Delete(ctx context.Context, req *computepb.DeleteAutoscalerRequest, ...) (*Operation, error)
- func (c *AutoscalersClient) Get(ctx context.Context, req *computepb.GetAutoscalerRequest, ...) (*computepb.Autoscaler, error)
- func (c *AutoscalersClient) Insert(ctx context.Context, req *computepb.InsertAutoscalerRequest, ...) (*Operation, error)
- func (c *AutoscalersClient) List(ctx context.Context, req *computepb.ListAutoscalersRequest, ...) *AutoscalerIterator
- func (c *AutoscalersClient) Patch(ctx context.Context, req *computepb.PatchAutoscalerRequest, ...) (*Operation, error)
- func (c *AutoscalersClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsAutoscalerRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *AutoscalersClient) Update(ctx context.Context, req *computepb.UpdateAutoscalerRequest, ...) (*Operation, error)
- type AutoscalersScopedListPair
- type AutoscalersScopedListPairIterator
- type BackendBucketIterator
- type BackendBucketsCallOptions
- type BackendBucketsClient
- func (c *BackendBucketsClient) AddSignedUrlKey(ctx context.Context, req *computepb.AddSignedUrlKeyBackendBucketRequest, ...) (*Operation, error)
- func (c *BackendBucketsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListBackendBucketsRequest, ...) *BackendBucketsScopedListPairIterator
- func (c *BackendBucketsClient) Close() error
- func (c *BackendBucketsClient) Connection() *grpc.ClientConndeprecated
- func (c *BackendBucketsClient) Delete(ctx context.Context, req *computepb.DeleteBackendBucketRequest, ...) (*Operation, error)
- func (c *BackendBucketsClient) DeleteSignedUrlKey(ctx context.Context, req *computepb.DeleteSignedUrlKeyBackendBucketRequest, ...) (*Operation, error)
- func (c *BackendBucketsClient) Get(ctx context.Context, req *computepb.GetBackendBucketRequest, ...) (*computepb.BackendBucket, error)
- func (c *BackendBucketsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyBackendBucketRequest, ...) (*computepb.Policy, error)
- func (c *BackendBucketsClient) Insert(ctx context.Context, req *computepb.InsertBackendBucketRequest, ...) (*Operation, error)
- func (c *BackendBucketsClient) List(ctx context.Context, req *computepb.ListBackendBucketsRequest, ...) *BackendBucketIterator
- func (c *BackendBucketsClient) ListUsable(ctx context.Context, req *computepb.ListUsableBackendBucketsRequest, ...) *BackendBucketIterator
- func (c *BackendBucketsClient) Patch(ctx context.Context, req *computepb.PatchBackendBucketRequest, ...) (*Operation, error)
- func (c *BackendBucketsClient) SetEdgeSecurityPolicy(ctx context.Context, req *computepb.SetEdgeSecurityPolicyBackendBucketRequest, ...) (*Operation, error)
- func (c *BackendBucketsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyBackendBucketRequest, ...) (*computepb.Policy, error)
- func (c *BackendBucketsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsBackendBucketRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *BackendBucketsClient) Update(ctx context.Context, req *computepb.UpdateBackendBucketRequest, ...) (*Operation, error)
- type BackendBucketsScopedListPair
- type BackendBucketsScopedListPairIterator
- type BackendServiceIterator
- type BackendServicesCallOptions
- type BackendServicesClient
- func (c *BackendServicesClient) AddSignedUrlKey(ctx context.Context, req *computepb.AddSignedUrlKeyBackendServiceRequest, ...) (*Operation, error)
- func (c *BackendServicesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListBackendServicesRequest, ...) *BackendServicesScopedListPairIterator
- func (c *BackendServicesClient) Close() error
- func (c *BackendServicesClient) Connection() *grpc.ClientConndeprecated
- func (c *BackendServicesClient) Delete(ctx context.Context, req *computepb.DeleteBackendServiceRequest, ...) (*Operation, error)
- func (c *BackendServicesClient) DeleteSignedUrlKey(ctx context.Context, req *computepb.DeleteSignedUrlKeyBackendServiceRequest, ...) (*Operation, error)
- func (c *BackendServicesClient) Get(ctx context.Context, req *computepb.GetBackendServiceRequest, ...) (*computepb.BackendService, error)
- func (c *BackendServicesClient) GetEffectiveSecurityPolicies(ctx context.Context, ...) (*computepb.BackendServicesGetEffectiveSecurityPoliciesResponse, error)
- func (c *BackendServicesClient) GetHealth(ctx context.Context, req *computepb.GetHealthBackendServiceRequest, ...) (*computepb.BackendServiceGroupHealth, error)
- func (c *BackendServicesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyBackendServiceRequest, ...) (*computepb.Policy, error)
- func (c *BackendServicesClient) Insert(ctx context.Context, req *computepb.InsertBackendServiceRequest, ...) (*Operation, error)
- func (c *BackendServicesClient) List(ctx context.Context, req *computepb.ListBackendServicesRequest, ...) *BackendServiceIterator
- func (c *BackendServicesClient) ListUsable(ctx context.Context, req *computepb.ListUsableBackendServicesRequest, ...) *BackendServiceIterator
- func (c *BackendServicesClient) Patch(ctx context.Context, req *computepb.PatchBackendServiceRequest, ...) (*Operation, error)
- func (c *BackendServicesClient) SetEdgeSecurityPolicy(ctx context.Context, req *computepb.SetEdgeSecurityPolicyBackendServiceRequest, ...) (*Operation, error)
- func (c *BackendServicesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyBackendServiceRequest, ...) (*computepb.Policy, error)
- func (c *BackendServicesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyBackendServiceRequest, ...) (*Operation, error)
- func (c *BackendServicesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsBackendServiceRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *BackendServicesClient) Update(ctx context.Context, req *computepb.UpdateBackendServiceRequest, ...) (*Operation, error)
- type BackendServicesScopedListPair
- type BackendServicesScopedListPairIterator
- type BgpRouteIterator
- type CommitmentIterator
- type CommitmentsScopedListPair
- type CommitmentsScopedListPairIterator
- type CompositeHealthCheckIterator
- type CompositeHealthChecksScopedListPair
- type CompositeHealthChecksScopedListPairIterator
- func (it *CompositeHealthChecksScopedListPairIterator) All() iter.Seq2[CompositeHealthChecksScopedListPair, error]
- func (it *CompositeHealthChecksScopedListPairIterator) Next() (CompositeHealthChecksScopedListPair, error)
- func (it *CompositeHealthChecksScopedListPairIterator) PageInfo() *iterator.PageInfo
- type CrossSiteNetworkIterator
- type CrossSiteNetworksCallOptions
- type CrossSiteNetworksClient
- func (c *CrossSiteNetworksClient) Close() error
- func (c *CrossSiteNetworksClient) Connection() *grpc.ClientConndeprecated
- func (c *CrossSiteNetworksClient) Delete(ctx context.Context, req *computepb.DeleteCrossSiteNetworkRequest, ...) (*Operation, error)
- func (c *CrossSiteNetworksClient) Get(ctx context.Context, req *computepb.GetCrossSiteNetworkRequest, ...) (*computepb.CrossSiteNetwork, error)
- func (c *CrossSiteNetworksClient) Insert(ctx context.Context, req *computepb.InsertCrossSiteNetworkRequest, ...) (*Operation, error)
- func (c *CrossSiteNetworksClient) List(ctx context.Context, req *computepb.ListCrossSiteNetworksRequest, ...) *CrossSiteNetworkIterator
- func (c *CrossSiteNetworksClient) Patch(ctx context.Context, req *computepb.PatchCrossSiteNetworkRequest, ...) (*Operation, error)
- type DiskIterator
- type DiskSettingsCallOptions
- type DiskSettingsClient
- func (c *DiskSettingsClient) Close() error
- func (c *DiskSettingsClient) Connection() *grpc.ClientConndeprecated
- func (c *DiskSettingsClient) Get(ctx context.Context, req *computepb.GetDiskSettingRequest, ...) (*computepb.DiskSettings, error)
- func (c *DiskSettingsClient) Patch(ctx context.Context, req *computepb.PatchDiskSettingRequest, ...) (*Operation, error)
- type DiskTypeIterator
- type DiskTypesCallOptions
- type DiskTypesClient
- func (c *DiskTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListDiskTypesRequest, ...) *DiskTypesScopedListPairIterator
- func (c *DiskTypesClient) Close() error
- func (c *DiskTypesClient) Connection() *grpc.ClientConndeprecated
- func (c *DiskTypesClient) Get(ctx context.Context, req *computepb.GetDiskTypeRequest, opts ...gax.CallOption) (*computepb.DiskType, error)
- func (c *DiskTypesClient) List(ctx context.Context, req *computepb.ListDiskTypesRequest, ...) *DiskTypeIterator
- type DiskTypesScopedListPair
- type DiskTypesScopedListPairIterator
- type DisksCallOptions
- type DisksClient
- func (c *DisksClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesDiskRequest, ...) (*Operation, error)
- func (c *DisksClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListDisksRequest, ...) *DisksScopedListPairIterator
- func (c *DisksClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertDiskRequest, ...) (*Operation, error)
- func (c *DisksClient) BulkSetLabels(ctx context.Context, req *computepb.BulkSetLabelsDiskRequest, ...) (*Operation, error)
- func (c *DisksClient) Close() error
- func (c *DisksClient) Connection() *grpc.ClientConndeprecated
- func (c *DisksClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotDiskRequest, ...) (*Operation, error)
- func (c *DisksClient) Delete(ctx context.Context, req *computepb.DeleteDiskRequest, opts ...gax.CallOption) (*Operation, error)
- func (c *DisksClient) Get(ctx context.Context, req *computepb.GetDiskRequest, opts ...gax.CallOption) (*computepb.Disk, error)
- func (c *DisksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyDiskRequest, ...) (*computepb.Policy, error)
- func (c *DisksClient) Insert(ctx context.Context, req *computepb.InsertDiskRequest, opts ...gax.CallOption) (*Operation, error)
- func (c *DisksClient) List(ctx context.Context, req *computepb.ListDisksRequest, opts ...gax.CallOption) *DiskIterator
- func (c *DisksClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesDiskRequest, ...) (*Operation, error)
- func (c *DisksClient) Resize(ctx context.Context, req *computepb.ResizeDiskRequest, opts ...gax.CallOption) (*Operation, error)
- func (c *DisksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyDiskRequest, ...) (*computepb.Policy, error)
- func (c *DisksClient) SetLabels(ctx context.Context, req *computepb.SetLabelsDiskRequest, ...) (*Operation, error)
- func (c *DisksClient) StartAsyncReplication(ctx context.Context, req *computepb.StartAsyncReplicationDiskRequest, ...) (*Operation, error)
- func (c *DisksClient) StopAsyncReplication(ctx context.Context, req *computepb.StopAsyncReplicationDiskRequest, ...) (*Operation, error)
- func (c *DisksClient) StopGroupAsyncReplication(ctx context.Context, req *computepb.StopGroupAsyncReplicationDiskRequest, ...) (*Operation, error)
- func (c *DisksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsDiskRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *DisksClient) Update(ctx context.Context, req *computepb.UpdateDiskRequest, opts ...gax.CallOption) (*Operation, error)
- type DisksScopedListPair
- type DisksScopedListPairIterator
- type ExchangedPeeringRouteIterator
- type ExternalVpnGatewayIterator
- type ExternalVpnGatewaysCallOptions
- type ExternalVpnGatewaysClient
- func (c *ExternalVpnGatewaysClient) Close() error
- func (c *ExternalVpnGatewaysClient) Connection() *grpc.ClientConndeprecated
- func (c *ExternalVpnGatewaysClient) Delete(ctx context.Context, req *computepb.DeleteExternalVpnGatewayRequest, ...) (*Operation, error)
- func (c *ExternalVpnGatewaysClient) Get(ctx context.Context, req *computepb.GetExternalVpnGatewayRequest, ...) (*computepb.ExternalVpnGateway, error)
- func (c *ExternalVpnGatewaysClient) Insert(ctx context.Context, req *computepb.InsertExternalVpnGatewayRequest, ...) (*Operation, error)
- func (c *ExternalVpnGatewaysClient) List(ctx context.Context, req *computepb.ListExternalVpnGatewaysRequest, ...) *ExternalVpnGatewayIterator
- func (c *ExternalVpnGatewaysClient) SetLabels(ctx context.Context, req *computepb.SetLabelsExternalVpnGatewayRequest, ...) (*Operation, error)
- func (c *ExternalVpnGatewaysClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type FirewallIterator
- type FirewallPoliciesCallOptions
- type FirewallPoliciesClient
- func (c *FirewallPoliciesClient) AddAssociation(ctx context.Context, req *computepb.AddAssociationFirewallPolicyRequest, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) AddPacketMirroringRule(ctx context.Context, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleFirewallPolicyRequest, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) CloneRules(ctx context.Context, req *computepb.CloneRulesFirewallPolicyRequest, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) Close() error
- func (c *FirewallPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *FirewallPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteFirewallPolicyRequest, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) Get(ctx context.Context, req *computepb.GetFirewallPolicyRequest, ...) (*computepb.FirewallPolicy, error)
- func (c *FirewallPoliciesClient) GetAssociation(ctx context.Context, req *computepb.GetAssociationFirewallPolicyRequest, ...) (*computepb.FirewallPolicyAssociation, error)
- func (c *FirewallPoliciesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyFirewallPolicyRequest, ...) (*computepb.Policy, error)
- func (c *FirewallPoliciesClient) GetPacketMirroringRule(ctx context.Context, ...) (*computepb.FirewallPolicyRule, error)
- func (c *FirewallPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleFirewallPolicyRequest, ...) (*computepb.FirewallPolicyRule, error)
- func (c *FirewallPoliciesClient) Insert(ctx context.Context, req *computepb.InsertFirewallPolicyRequest, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) List(ctx context.Context, req *computepb.ListFirewallPoliciesRequest, ...) *FirewallPolicyIterator
- func (c *FirewallPoliciesClient) ListAssociations(ctx context.Context, req *computepb.ListAssociationsFirewallPolicyRequest, ...) (*computepb.FirewallPoliciesListAssociationsResponse, error)
- func (c *FirewallPoliciesClient) Move(ctx context.Context, req *computepb.MoveFirewallPolicyRequest, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) Patch(ctx context.Context, req *computepb.PatchFirewallPolicyRequest, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) PatchPacketMirroringRule(ctx context.Context, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleFirewallPolicyRequest, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) RemoveAssociation(ctx context.Context, req *computepb.RemoveAssociationFirewallPolicyRequest, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) RemovePacketMirroringRule(ctx context.Context, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleFirewallPolicyRequest, ...) (*Operation, error)
- func (c *FirewallPoliciesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyFirewallPolicyRequest, ...) (*computepb.Policy, error)
- func (c *FirewallPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsFirewallPolicyRequest, ...) (*computepb.TestPermissionsResponse, error)
- type FirewallPoliciesScopedListPair
- type FirewallPoliciesScopedListPairIterator
- type FirewallPolicyIterator
- type FirewallsCallOptions
- type FirewallsClient
- func (c *FirewallsClient) Close() error
- func (c *FirewallsClient) Connection() *grpc.ClientConndeprecated
- func (c *FirewallsClient) Delete(ctx context.Context, req *computepb.DeleteFirewallRequest, ...) (*Operation, error)
- func (c *FirewallsClient) Get(ctx context.Context, req *computepb.GetFirewallRequest, opts ...gax.CallOption) (*computepb.Firewall, error)
- func (c *FirewallsClient) Insert(ctx context.Context, req *computepb.InsertFirewallRequest, ...) (*Operation, error)
- func (c *FirewallsClient) List(ctx context.Context, req *computepb.ListFirewallsRequest, ...) *FirewallIterator
- func (c *FirewallsClient) Patch(ctx context.Context, req *computepb.PatchFirewallRequest, ...) (*Operation, error)
- func (c *FirewallsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsFirewallRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *FirewallsClient) Update(ctx context.Context, req *computepb.UpdateFirewallRequest, ...) (*Operation, error)
- type ForwardingRuleIterator
- type ForwardingRulesCallOptions
- type ForwardingRulesClient
- func (c *ForwardingRulesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListForwardingRulesRequest, ...) *ForwardingRulesScopedListPairIterator
- func (c *ForwardingRulesClient) Close() error
- func (c *ForwardingRulesClient) Connection() *grpc.ClientConndeprecated
- func (c *ForwardingRulesClient) Delete(ctx context.Context, req *computepb.DeleteForwardingRuleRequest, ...) (*Operation, error)
- func (c *ForwardingRulesClient) Get(ctx context.Context, req *computepb.GetForwardingRuleRequest, ...) (*computepb.ForwardingRule, error)
- func (c *ForwardingRulesClient) Insert(ctx context.Context, req *computepb.InsertForwardingRuleRequest, ...) (*Operation, error)
- func (c *ForwardingRulesClient) List(ctx context.Context, req *computepb.ListForwardingRulesRequest, ...) *ForwardingRuleIterator
- func (c *ForwardingRulesClient) Patch(ctx context.Context, req *computepb.PatchForwardingRuleRequest, ...) (*Operation, error)
- func (c *ForwardingRulesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsForwardingRuleRequest, ...) (*Operation, error)
- func (c *ForwardingRulesClient) SetTarget(ctx context.Context, req *computepb.SetTargetForwardingRuleRequest, ...) (*Operation, error)
- func (c *ForwardingRulesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsForwardingRuleRequest, ...) (*computepb.TestPermissionsResponse, error)
- type ForwardingRulesScopedListPair
- type ForwardingRulesScopedListPairIterator
- type FutureReservationIterator
- type FutureReservationsCallOptions
- type FutureReservationsClient
- func (c *FutureReservationsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListFutureReservationsRequest, ...) *FutureReservationsScopedListPairIterator
- func (c *FutureReservationsClient) Cancel(ctx context.Context, req *computepb.CancelFutureReservationRequest, ...) (*Operation, error)
- func (c *FutureReservationsClient) Close() error
- func (c *FutureReservationsClient) Connection() *grpc.ClientConndeprecated
- func (c *FutureReservationsClient) Delete(ctx context.Context, req *computepb.DeleteFutureReservationRequest, ...) (*Operation, error)
- func (c *FutureReservationsClient) Get(ctx context.Context, req *computepb.GetFutureReservationRequest, ...) (*computepb.FutureReservation, error)
- func (c *FutureReservationsClient) Insert(ctx context.Context, req *computepb.InsertFutureReservationRequest, ...) (*Operation, error)
- func (c *FutureReservationsClient) List(ctx context.Context, req *computepb.ListFutureReservationsRequest, ...) *FutureReservationIterator
- func (c *FutureReservationsClient) Update(ctx context.Context, req *computepb.UpdateFutureReservationRequest, ...) (*Operation, error)
- type FutureReservationsScopedListPair
- type FutureReservationsScopedListPairIterator
- type GlobalAddressesCallOptions
- type GlobalAddressesClient
- func (c *GlobalAddressesClient) Close() error
- func (c *GlobalAddressesClient) Connection() *grpc.ClientConndeprecated
- func (c *GlobalAddressesClient) Delete(ctx context.Context, req *computepb.DeleteGlobalAddressRequest, ...) (*Operation, error)
- func (c *GlobalAddressesClient) Get(ctx context.Context, req *computepb.GetGlobalAddressRequest, ...) (*computepb.Address, error)
- func (c *GlobalAddressesClient) Insert(ctx context.Context, req *computepb.InsertGlobalAddressRequest, ...) (*Operation, error)
- func (c *GlobalAddressesClient) List(ctx context.Context, req *computepb.ListGlobalAddressesRequest, ...) *AddressIterator
- func (c *GlobalAddressesClient) Move(ctx context.Context, req *computepb.MoveGlobalAddressRequest, ...) (*Operation, error)
- func (c *GlobalAddressesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsGlobalAddressRequest, ...) (*Operation, error)
- func (c *GlobalAddressesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsGlobalAddressRequest, ...) (*computepb.TestPermissionsResponse, error)
- type GlobalForwardingRulesCallOptions
- type GlobalForwardingRulesClient
- func (c *GlobalForwardingRulesClient) Close() error
- func (c *GlobalForwardingRulesClient) Connection() *grpc.ClientConndeprecated
- func (c *GlobalForwardingRulesClient) Delete(ctx context.Context, req *computepb.DeleteGlobalForwardingRuleRequest, ...) (*Operation, error)
- func (c *GlobalForwardingRulesClient) Get(ctx context.Context, req *computepb.GetGlobalForwardingRuleRequest, ...) (*computepb.ForwardingRule, error)
- func (c *GlobalForwardingRulesClient) Insert(ctx context.Context, req *computepb.InsertGlobalForwardingRuleRequest, ...) (*Operation, error)
- func (c *GlobalForwardingRulesClient) List(ctx context.Context, req *computepb.ListGlobalForwardingRulesRequest, ...) *ForwardingRuleIterator
- func (c *GlobalForwardingRulesClient) Patch(ctx context.Context, req *computepb.PatchGlobalForwardingRuleRequest, ...) (*Operation, error)
- func (c *GlobalForwardingRulesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsGlobalForwardingRuleRequest, ...) (*Operation, error)
- func (c *GlobalForwardingRulesClient) SetTarget(ctx context.Context, req *computepb.SetTargetGlobalForwardingRuleRequest, ...) (*Operation, error)
- func (c *GlobalForwardingRulesClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type GlobalNetworkEndpointGroupsCallOptions
- type GlobalNetworkEndpointGroupsClient
- func (c *GlobalNetworkEndpointGroupsClient) AttachNetworkEndpoints(ctx context.Context, ...) (*Operation, error)
- func (c *GlobalNetworkEndpointGroupsClient) Close() error
- func (c *GlobalNetworkEndpointGroupsClient) Connection() *grpc.ClientConndeprecated
- func (c *GlobalNetworkEndpointGroupsClient) Delete(ctx context.Context, req *computepb.DeleteGlobalNetworkEndpointGroupRequest, ...) (*Operation, error)
- func (c *GlobalNetworkEndpointGroupsClient) DetachNetworkEndpoints(ctx context.Context, ...) (*Operation, error)
- func (c *GlobalNetworkEndpointGroupsClient) Get(ctx context.Context, req *computepb.GetGlobalNetworkEndpointGroupRequest, ...) (*computepb.NetworkEndpointGroup, error)
- func (c *GlobalNetworkEndpointGroupsClient) Insert(ctx context.Context, req *computepb.InsertGlobalNetworkEndpointGroupRequest, ...) (*Operation, error)
- func (c *GlobalNetworkEndpointGroupsClient) List(ctx context.Context, req *computepb.ListGlobalNetworkEndpointGroupsRequest, ...) *NetworkEndpointGroupIterator
- func (c *GlobalNetworkEndpointGroupsClient) ListNetworkEndpoints(ctx context.Context, ...) *NetworkEndpointWithHealthStatusIterator
- type GlobalOperationsCallOptions
- type GlobalOperationsClient
- func (c *GlobalOperationsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListGlobalOperationsRequest, ...) *OperationsScopedListPairIterator
- func (c *GlobalOperationsClient) Close() error
- func (c *GlobalOperationsClient) Connection() *grpc.ClientConndeprecated
- func (c *GlobalOperationsClient) Delete(ctx context.Context, req *computepb.DeleteGlobalOperationRequest, ...) (*computepb.DeleteGlobalOperationResponse, error)
- func (c *GlobalOperationsClient) Get(ctx context.Context, req *computepb.GetGlobalOperationRequest, ...) (*computepb.Operation, error)
- func (c *GlobalOperationsClient) List(ctx context.Context, req *computepb.ListGlobalOperationsRequest, ...) *OperationIterator
- func (c *GlobalOperationsClient) Wait(ctx context.Context, req *computepb.WaitGlobalOperationRequest, ...) (*computepb.Operation, error)
- type GlobalOrganizationOperationsCallOptions
- type GlobalOrganizationOperationsClient
- func (c *GlobalOrganizationOperationsClient) Close() error
- func (c *GlobalOrganizationOperationsClient) Connection() *grpc.ClientConndeprecated
- func (c *GlobalOrganizationOperationsClient) Delete(ctx context.Context, req *computepb.DeleteGlobalOrganizationOperationRequest, ...) (*computepb.DeleteGlobalOrganizationOperationResponse, error)
- func (c *GlobalOrganizationOperationsClient) Get(ctx context.Context, req *computepb.GetGlobalOrganizationOperationRequest, ...) (*computepb.Operation, error)
- func (c *GlobalOrganizationOperationsClient) List(ctx context.Context, req *computepb.ListGlobalOrganizationOperationsRequest, ...) *OperationIterator
- type GlobalPublicDelegatedPrefixesCallOptions
- type GlobalPublicDelegatedPrefixesClient
- func (c *GlobalPublicDelegatedPrefixesClient) Close() error
- func (c *GlobalPublicDelegatedPrefixesClient) Connection() *grpc.ClientConndeprecated
- func (c *GlobalPublicDelegatedPrefixesClient) Delete(ctx context.Context, req *computepb.DeleteGlobalPublicDelegatedPrefixeRequest, ...) (*Operation, error)
- func (c *GlobalPublicDelegatedPrefixesClient) Get(ctx context.Context, req *computepb.GetGlobalPublicDelegatedPrefixeRequest, ...) (*computepb.PublicDelegatedPrefix, error)
- func (c *GlobalPublicDelegatedPrefixesClient) Insert(ctx context.Context, req *computepb.InsertGlobalPublicDelegatedPrefixeRequest, ...) (*Operation, error)
- func (c *GlobalPublicDelegatedPrefixesClient) List(ctx context.Context, req *computepb.ListGlobalPublicDelegatedPrefixesRequest, ...) *PublicDelegatedPrefixIterator
- func (c *GlobalPublicDelegatedPrefixesClient) Patch(ctx context.Context, req *computepb.PatchGlobalPublicDelegatedPrefixeRequest, ...) (*Operation, error)
- type GlobalVmExtensionPoliciesCallOptions
- type GlobalVmExtensionPoliciesClient
- func (c *GlobalVmExtensionPoliciesClient) AggregatedList(ctx context.Context, ...) *VmExtensionPoliciesScopedListPairIterator
- func (c *GlobalVmExtensionPoliciesClient) Close() error
- func (c *GlobalVmExtensionPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *GlobalVmExtensionPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteGlobalVmExtensionPolicyRequest, ...) (*Operation, error)
- func (c *GlobalVmExtensionPoliciesClient) Get(ctx context.Context, req *computepb.GetGlobalVmExtensionPolicyRequest, ...) (*computepb.GlobalVmExtensionPolicy, error)
- func (c *GlobalVmExtensionPoliciesClient) Insert(ctx context.Context, req *computepb.InsertGlobalVmExtensionPolicyRequest, ...) (*Operation, error)
- func (c *GlobalVmExtensionPoliciesClient) List(ctx context.Context, req *computepb.ListGlobalVmExtensionPoliciesRequest, ...) *GlobalVmExtensionPolicyIterator
- func (c *GlobalVmExtensionPoliciesClient) Update(ctx context.Context, req *computepb.UpdateGlobalVmExtensionPolicyRequest, ...) (*Operation, error)
- type GlobalVmExtensionPolicyIterator
- type HealthAggregationPoliciesScopedListPair
- type HealthAggregationPoliciesScopedListPairIterator
- func (it *HealthAggregationPoliciesScopedListPairIterator) All() iter.Seq2[HealthAggregationPoliciesScopedListPair, error]
- func (it *HealthAggregationPoliciesScopedListPairIterator) Next() (HealthAggregationPoliciesScopedListPair, error)
- func (it *HealthAggregationPoliciesScopedListPairIterator) PageInfo() *iterator.PageInfo
- type HealthAggregationPolicyIterator
- type HealthCheckIterator
- type HealthCheckServiceIterator
- type HealthChecksCallOptions
- type HealthChecksClient
- func (c *HealthChecksClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListHealthChecksRequest, ...) *HealthChecksScopedListPairIterator
- func (c *HealthChecksClient) Close() error
- func (c *HealthChecksClient) Connection() *grpc.ClientConndeprecated
- func (c *HealthChecksClient) Delete(ctx context.Context, req *computepb.DeleteHealthCheckRequest, ...) (*Operation, error)
- func (c *HealthChecksClient) Get(ctx context.Context, req *computepb.GetHealthCheckRequest, ...) (*computepb.HealthCheck, error)
- func (c *HealthChecksClient) Insert(ctx context.Context, req *computepb.InsertHealthCheckRequest, ...) (*Operation, error)
- func (c *HealthChecksClient) List(ctx context.Context, req *computepb.ListHealthChecksRequest, ...) *HealthCheckIterator
- func (c *HealthChecksClient) Patch(ctx context.Context, req *computepb.PatchHealthCheckRequest, ...) (*Operation, error)
- func (c *HealthChecksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsHealthCheckRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *HealthChecksClient) Update(ctx context.Context, req *computepb.UpdateHealthCheckRequest, ...) (*Operation, error)
- type HealthChecksScopedListPair
- type HealthChecksScopedListPairIterator
- type HealthSourceIterator
- type HealthSourcesScopedListPair
- type HealthSourcesScopedListPairIterator
- type ImageFamilyViewsCallOptions
- type ImageFamilyViewsClient
- type ImageIterator
- type ImagesCallOptions
- type ImagesClient
- func (c *ImagesClient) Close() error
- func (c *ImagesClient) Connection() *grpc.ClientConndeprecated
- func (c *ImagesClient) Delete(ctx context.Context, req *computepb.DeleteImageRequest, opts ...gax.CallOption) (*Operation, error)
- func (c *ImagesClient) Deprecate(ctx context.Context, req *computepb.DeprecateImageRequest, ...) (*Operation, error)
- func (c *ImagesClient) Get(ctx context.Context, req *computepb.GetImageRequest, opts ...gax.CallOption) (*computepb.Image, error)
- func (c *ImagesClient) GetFromFamily(ctx context.Context, req *computepb.GetFromFamilyImageRequest, ...) (*computepb.Image, error)
- func (c *ImagesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyImageRequest, ...) (*computepb.Policy, error)
- func (c *ImagesClient) Insert(ctx context.Context, req *computepb.InsertImageRequest, opts ...gax.CallOption) (*Operation, error)
- func (c *ImagesClient) List(ctx context.Context, req *computepb.ListImagesRequest, opts ...gax.CallOption) *ImageIterator
- func (c *ImagesClient) Patch(ctx context.Context, req *computepb.PatchImageRequest, opts ...gax.CallOption) (*Operation, error)
- func (c *ImagesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyImageRequest, ...) (*computepb.Policy, error)
- func (c *ImagesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsImageRequest, ...) (*Operation, error)
- func (c *ImagesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsImageRequest, ...) (*computepb.TestPermissionsResponse, error)
- type InstanceGroupIterator
- type InstanceGroupManagerIterator
- type InstanceGroupManagerResizeRequestIterator
- func (it *InstanceGroupManagerResizeRequestIterator) All() iter.Seq2[*computepb.InstanceGroupManagerResizeRequest, error]
- func (it *InstanceGroupManagerResizeRequestIterator) Next() (*computepb.InstanceGroupManagerResizeRequest, error)
- func (it *InstanceGroupManagerResizeRequestIterator) PageInfo() *iterator.PageInfo
- type InstanceGroupManagerResizeRequestsCallOptions
- type InstanceGroupManagerResizeRequestsClient
- func (c *InstanceGroupManagerResizeRequestsClient) Cancel(ctx context.Context, ...) (*Operation, error)
- func (c *InstanceGroupManagerResizeRequestsClient) Close() error
- func (c *InstanceGroupManagerResizeRequestsClient) Connection() *grpc.ClientConndeprecated
- func (c *InstanceGroupManagerResizeRequestsClient) Delete(ctx context.Context, ...) (*Operation, error)
- func (c *InstanceGroupManagerResizeRequestsClient) Get(ctx context.Context, ...) (*computepb.InstanceGroupManagerResizeRequest, error)
- func (c *InstanceGroupManagerResizeRequestsClient) Insert(ctx context.Context, ...) (*Operation, error)
- func (c *InstanceGroupManagerResizeRequestsClient) List(ctx context.Context, ...) *InstanceGroupManagerResizeRequestIterator
- type InstanceGroupManagersCallOptions
- type InstanceGroupManagersClient
- func (c *InstanceGroupManagersClient) AbandonInstances(ctx context.Context, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstanceGroupManagersRequest, ...) *InstanceGroupManagersScopedListPairIterator
- func (c *InstanceGroupManagersClient) ApplyUpdatesToInstances(ctx context.Context, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) Close() error
- func (c *InstanceGroupManagersClient) Connection() *grpc.ClientConndeprecated
- func (c *InstanceGroupManagersClient) CreateInstances(ctx context.Context, req *computepb.CreateInstancesInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) Delete(ctx context.Context, req *computepb.DeleteInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) DeleteInstances(ctx context.Context, req *computepb.DeleteInstancesInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) DeletePerInstanceConfigs(ctx context.Context, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) Get(ctx context.Context, req *computepb.GetInstanceGroupManagerRequest, ...) (*computepb.InstanceGroupManager, error)
- func (c *InstanceGroupManagersClient) GetAvailableAcceleratorTopologies(ctx context.Context, ...) (*computepb.InstanceGroupManagersGetAvailableAcceleratorTopologiesResponse, ...)
- func (c *InstanceGroupManagersClient) Insert(ctx context.Context, req *computepb.InsertInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) List(ctx context.Context, req *computepb.ListInstanceGroupManagersRequest, ...) *InstanceGroupManagerIterator
- func (c *InstanceGroupManagersClient) ListErrors(ctx context.Context, req *computepb.ListErrorsInstanceGroupManagersRequest, ...) *InstanceManagedByIgmErrorIterator
- func (c *InstanceGroupManagersClient) ListManagedInstances(ctx context.Context, ...) *ManagedInstanceIterator
- func (c *InstanceGroupManagersClient) ListPerInstanceConfigs(ctx context.Context, ...) *PerInstanceConfigIterator
- func (c *InstanceGroupManagersClient) Patch(ctx context.Context, req *computepb.PatchInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) PatchPerInstanceConfigs(ctx context.Context, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) RecreateInstances(ctx context.Context, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) Resize(ctx context.Context, req *computepb.ResizeInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) ResizeAdvanced(ctx context.Context, req *computepb.ResizeAdvancedInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) ResumeInstances(ctx context.Context, req *computepb.ResumeInstancesInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) SetAutoHealingPolicies(ctx context.Context, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) SetInstanceTemplate(ctx context.Context, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) SetTargetPools(ctx context.Context, req *computepb.SetTargetPoolsInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) StartInstances(ctx context.Context, req *computepb.StartInstancesInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) StopInstances(ctx context.Context, req *computepb.StopInstancesInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) SuspendInstances(ctx context.Context, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- func (c *InstanceGroupManagersClient) Update(ctx context.Context, req *computepb.UpdateInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *InstanceGroupManagersClient) UpdatePerInstanceConfigs(ctx context.Context, ...) (*Operation, error)
- type InstanceGroupManagersScopedListPair
- type InstanceGroupManagersScopedListPairIterator
- func (it *InstanceGroupManagersScopedListPairIterator) All() iter.Seq2[InstanceGroupManagersScopedListPair, error]
- func (it *InstanceGroupManagersScopedListPairIterator) Next() (InstanceGroupManagersScopedListPair, error)
- func (it *InstanceGroupManagersScopedListPairIterator) PageInfo() *iterator.PageInfo
- type InstanceGroupsCallOptions
- type InstanceGroupsClient
- func (c *InstanceGroupsClient) AddInstances(ctx context.Context, req *computepb.AddInstancesInstanceGroupRequest, ...) (*Operation, error)
- func (c *InstanceGroupsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstanceGroupsRequest, ...) *InstanceGroupsScopedListPairIterator
- func (c *InstanceGroupsClient) Close() error
- func (c *InstanceGroupsClient) Connection() *grpc.ClientConndeprecated
- func (c *InstanceGroupsClient) Delete(ctx context.Context, req *computepb.DeleteInstanceGroupRequest, ...) (*Operation, error)
- func (c *InstanceGroupsClient) Get(ctx context.Context, req *computepb.GetInstanceGroupRequest, ...) (*computepb.InstanceGroup, error)
- func (c *InstanceGroupsClient) Insert(ctx context.Context, req *computepb.InsertInstanceGroupRequest, ...) (*Operation, error)
- func (c *InstanceGroupsClient) List(ctx context.Context, req *computepb.ListInstanceGroupsRequest, ...) *InstanceGroupIterator
- func (c *InstanceGroupsClient) ListInstances(ctx context.Context, req *computepb.ListInstancesInstanceGroupsRequest, ...) *InstanceWithNamedPortsIterator
- func (c *InstanceGroupsClient) RemoveInstances(ctx context.Context, req *computepb.RemoveInstancesInstanceGroupRequest, ...) (*Operation, error)
- func (c *InstanceGroupsClient) SetNamedPorts(ctx context.Context, req *computepb.SetNamedPortsInstanceGroupRequest, ...) (*Operation, error)
- func (c *InstanceGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstanceGroupRequest, ...) (*computepb.TestPermissionsResponse, error)
- type InstanceGroupsScopedListPair
- type InstanceGroupsScopedListPairIterator
- type InstanceIterator
- type InstanceManagedByIgmErrorIterator
- type InstanceSettingsCallOptions
- type InstanceSettingsClient
- func (c *InstanceSettingsClient) Close() error
- func (c *InstanceSettingsClient) Connection() *grpc.ClientConndeprecated
- func (c *InstanceSettingsClient) Get(ctx context.Context, req *computepb.GetInstanceSettingRequest, ...) (*computepb.InstanceSettings, error)
- func (c *InstanceSettingsClient) Patch(ctx context.Context, req *computepb.PatchInstanceSettingRequest, ...) (*Operation, error)
- type InstanceTemplateIterator
- type InstanceTemplatesCallOptions
- type InstanceTemplatesClient
- func (c *InstanceTemplatesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstanceTemplatesRequest, ...) *InstanceTemplatesScopedListPairIterator
- func (c *InstanceTemplatesClient) Close() error
- func (c *InstanceTemplatesClient) Connection() *grpc.ClientConndeprecated
- func (c *InstanceTemplatesClient) Delete(ctx context.Context, req *computepb.DeleteInstanceTemplateRequest, ...) (*Operation, error)
- func (c *InstanceTemplatesClient) Get(ctx context.Context, req *computepb.GetInstanceTemplateRequest, ...) (*computepb.InstanceTemplate, error)
- func (c *InstanceTemplatesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstanceTemplateRequest, ...) (*computepb.Policy, error)
- func (c *InstanceTemplatesClient) Insert(ctx context.Context, req *computepb.InsertInstanceTemplateRequest, ...) (*Operation, error)
- func (c *InstanceTemplatesClient) List(ctx context.Context, req *computepb.ListInstanceTemplatesRequest, ...) *InstanceTemplateIterator
- func (c *InstanceTemplatesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstanceTemplateRequest, ...) (*computepb.Policy, error)
- func (c *InstanceTemplatesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstanceTemplateRequest, ...) (*computepb.TestPermissionsResponse, error)
- type InstanceTemplatesScopedListPair
- type InstanceTemplatesScopedListPairIterator
- type InstanceWithNamedPortsIterator
- type InstancesCallOptions
- type InstancesClient
- func (c *InstancesClient) AddAccessConfig(ctx context.Context, req *computepb.AddAccessConfigInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) AddNetworkInterface(ctx context.Context, req *computepb.AddNetworkInterfaceInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstancesRequest, ...) *InstancesScopedListPairIterator
- func (c *InstancesClient) AttachDisk(ctx context.Context, req *computepb.AttachDiskInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) Close() error
- func (c *InstancesClient) Connection() *grpc.ClientConndeprecated
- func (c *InstancesClient) Delete(ctx context.Context, req *computepb.DeleteInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) DeleteAccessConfig(ctx context.Context, req *computepb.DeleteAccessConfigInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) DeleteNetworkInterface(ctx context.Context, req *computepb.DeleteNetworkInterfaceInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) DetachDisk(ctx context.Context, req *computepb.DetachDiskInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) Get(ctx context.Context, req *computepb.GetInstanceRequest, opts ...gax.CallOption) (*computepb.Instance, error)
- func (c *InstancesClient) GetEffectiveFirewalls(ctx context.Context, req *computepb.GetEffectiveFirewallsInstanceRequest, ...) (*computepb.InstancesGetEffectiveFirewallsResponse, error)
- func (c *InstancesClient) GetGuestAttributes(ctx context.Context, req *computepb.GetGuestAttributesInstanceRequest, ...) (*computepb.GuestAttributes, error)
- func (c *InstancesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstanceRequest, ...) (*computepb.Policy, error)
- func (c *InstancesClient) GetPartnerMetadata(ctx context.Context, req *computepb.GetPartnerMetadataInstanceRequest, ...) (*computepb.PartnerMetadata, error)
- func (c *InstancesClient) GetScreenshot(ctx context.Context, req *computepb.GetScreenshotInstanceRequest, ...) (*computepb.Screenshot, error)
- func (c *InstancesClient) GetSerialPortOutput(ctx context.Context, req *computepb.GetSerialPortOutputInstanceRequest, ...) (*computepb.SerialPortOutput, error)
- func (c *InstancesClient) GetShieldedInstanceIdentity(ctx context.Context, req *computepb.GetShieldedInstanceIdentityInstanceRequest, ...) (*computepb.ShieldedInstanceIdentity, error)
- func (c *InstancesClient) GetShieldedVmIdentity(ctx context.Context, req *computepb.GetShieldedVmIdentityInstanceRequest, ...) (*computepb.ShieldedVmIdentity, error)
- func (c *InstancesClient) Insert(ctx context.Context, req *computepb.InsertInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) List(ctx context.Context, req *computepb.ListInstancesRequest, ...) *InstanceIterator
- func (c *InstancesClient) ListReferrers(ctx context.Context, req *computepb.ListReferrersInstancesRequest, ...) *ReferenceIterator
- func (c *InstancesClient) PatchPartnerMetadata(ctx context.Context, req *computepb.PatchPartnerMetadataInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) PerformMaintenance(ctx context.Context, req *computepb.PerformMaintenanceInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) ReportHostAsFaulty(ctx context.Context, req *computepb.ReportHostAsFaultyInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) Reset(ctx context.Context, req *computepb.ResetInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) Resume(ctx context.Context, req *computepb.ResumeInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SendDiagnosticInterrupt(ctx context.Context, req *computepb.SendDiagnosticInterruptInstanceRequest, ...) (*computepb.SendDiagnosticInterruptInstanceResponse, error)
- func (c *InstancesClient) SetDeletionProtection(ctx context.Context, req *computepb.SetDeletionProtectionInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SetDiskAutoDelete(ctx context.Context, req *computepb.SetDiskAutoDeleteInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstanceRequest, ...) (*computepb.Policy, error)
- func (c *InstancesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SetMachineResources(ctx context.Context, req *computepb.SetMachineResourcesInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SetMachineType(ctx context.Context, req *computepb.SetMachineTypeInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SetMetadata(ctx context.Context, req *computepb.SetMetadataInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SetMinCpuPlatform(ctx context.Context, req *computepb.SetMinCpuPlatformInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SetName(ctx context.Context, req *computepb.SetNameInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SetScheduling(ctx context.Context, req *computepb.SetSchedulingInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SetServiceAccount(ctx context.Context, req *computepb.SetServiceAccountInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SetShieldedInstanceIntegrityPolicy(ctx context.Context, ...) (*Operation, error)
- func (c *InstancesClient) SetShieldedVmIntegrityPolicy(ctx context.Context, ...) (*Operation, error)
- func (c *InstancesClient) SetTags(ctx context.Context, req *computepb.SetTagsInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) SimulateMaintenanceEvent(ctx context.Context, req *computepb.SimulateMaintenanceEventInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) Start(ctx context.Context, req *computepb.StartInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) StartWithEncryptionKey(ctx context.Context, req *computepb.StartWithEncryptionKeyInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) Stop(ctx context.Context, req *computepb.StopInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) Suspend(ctx context.Context, req *computepb.SuspendInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstanceRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *InstancesClient) Update(ctx context.Context, req *computepb.UpdateInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) UpdateAccessConfig(ctx context.Context, req *computepb.UpdateAccessConfigInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) UpdateDisplayDevice(ctx context.Context, req *computepb.UpdateDisplayDeviceInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) UpdateNetworkInterface(ctx context.Context, req *computepb.UpdateNetworkInterfaceInstanceRequest, ...) (*Operation, error)
- func (c *InstancesClient) UpdateShieldedInstanceConfig(ctx context.Context, ...) (*Operation, error)
- func (c *InstancesClient) UpdateShieldedVmConfig(ctx context.Context, req *computepb.UpdateShieldedVmConfigInstanceRequest, ...) (*Operation, error)
- type InstancesScopedListPair
- type InstancesScopedListPairIterator
- type InstantSnapshotGroupIterator
- type InstantSnapshotGroupsCallOptions
- type InstantSnapshotGroupsClient
- func (c *InstantSnapshotGroupsClient) Close() error
- func (c *InstantSnapshotGroupsClient) Connection() *grpc.ClientConndeprecated
- func (c *InstantSnapshotGroupsClient) Delete(ctx context.Context, req *computepb.DeleteInstantSnapshotGroupRequest, ...) (*Operation, error)
- func (c *InstantSnapshotGroupsClient) Get(ctx context.Context, req *computepb.GetInstantSnapshotGroupRequest, ...) (*computepb.InstantSnapshotGroup, error)
- func (c *InstantSnapshotGroupsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstantSnapshotGroupRequest, ...) (*computepb.Policy, error)
- func (c *InstantSnapshotGroupsClient) Insert(ctx context.Context, req *computepb.InsertInstantSnapshotGroupRequest, ...) (*Operation, error)
- func (c *InstantSnapshotGroupsClient) List(ctx context.Context, req *computepb.ListInstantSnapshotGroupsRequest, ...) *InstantSnapshotGroupIterator
- func (c *InstantSnapshotGroupsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstantSnapshotGroupRequest, ...) (*computepb.Policy, error)
- func (c *InstantSnapshotGroupsClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type InstantSnapshotIterator
- type InstantSnapshotsCallOptions
- type InstantSnapshotsClient
- func (c *InstantSnapshotsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstantSnapshotsRequest, ...) *InstantSnapshotsScopedListPairIterator
- func (c *InstantSnapshotsClient) Close() error
- func (c *InstantSnapshotsClient) Connection() *grpc.ClientConndeprecated
- func (c *InstantSnapshotsClient) Delete(ctx context.Context, req *computepb.DeleteInstantSnapshotRequest, ...) (*Operation, error)
- func (c *InstantSnapshotsClient) Get(ctx context.Context, req *computepb.GetInstantSnapshotRequest, ...) (*computepb.InstantSnapshot, error)
- func (c *InstantSnapshotsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstantSnapshotRequest, ...) (*computepb.Policy, error)
- func (c *InstantSnapshotsClient) Insert(ctx context.Context, req *computepb.InsertInstantSnapshotRequest, ...) (*Operation, error)
- func (c *InstantSnapshotsClient) List(ctx context.Context, req *computepb.ListInstantSnapshotsRequest, ...) *InstantSnapshotIterator
- func (c *InstantSnapshotsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstantSnapshotRequest, ...) (*computepb.Policy, error)
- func (c *InstantSnapshotsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInstantSnapshotRequest, ...) (*Operation, error)
- func (c *InstantSnapshotsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstantSnapshotRequest, ...) (*computepb.TestPermissionsResponse, error)
- type InstantSnapshotsScopedListPair
- type InstantSnapshotsScopedListPairIterator
- type InterconnectAttachmentGroupIterator
- type InterconnectAttachmentGroupsCallOptions
- type InterconnectAttachmentGroupsClient
- func (c *InterconnectAttachmentGroupsClient) Close() error
- func (c *InterconnectAttachmentGroupsClient) Connection() *grpc.ClientConndeprecated
- func (c *InterconnectAttachmentGroupsClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectAttachmentGroupRequest, ...) (*Operation, error)
- func (c *InterconnectAttachmentGroupsClient) Get(ctx context.Context, req *computepb.GetInterconnectAttachmentGroupRequest, ...) (*computepb.InterconnectAttachmentGroup, error)
- func (c *InterconnectAttachmentGroupsClient) GetIamPolicy(ctx context.Context, ...) (*computepb.Policy, error)
- func (c *InterconnectAttachmentGroupsClient) GetOperationalStatus(ctx context.Context, ...) (*computepb.InterconnectAttachmentGroupsGetOperationalStatusResponse, error)
- func (c *InterconnectAttachmentGroupsClient) Insert(ctx context.Context, req *computepb.InsertInterconnectAttachmentGroupRequest, ...) (*Operation, error)
- func (c *InterconnectAttachmentGroupsClient) List(ctx context.Context, req *computepb.ListInterconnectAttachmentGroupsRequest, ...) *InterconnectAttachmentGroupIterator
- func (c *InterconnectAttachmentGroupsClient) Patch(ctx context.Context, req *computepb.PatchInterconnectAttachmentGroupRequest, ...) (*Operation, error)
- func (c *InterconnectAttachmentGroupsClient) SetIamPolicy(ctx context.Context, ...) (*computepb.Policy, error)
- func (c *InterconnectAttachmentGroupsClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type InterconnectAttachmentIterator
- type InterconnectAttachmentsCallOptions
- type InterconnectAttachmentsClient
- func (c *InterconnectAttachmentsClient) AggregatedList(ctx context.Context, ...) *InterconnectAttachmentsScopedListPairIterator
- func (c *InterconnectAttachmentsClient) Close() error
- func (c *InterconnectAttachmentsClient) Connection() *grpc.ClientConndeprecated
- func (c *InterconnectAttachmentsClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectAttachmentRequest, ...) (*Operation, error)
- func (c *InterconnectAttachmentsClient) Get(ctx context.Context, req *computepb.GetInterconnectAttachmentRequest, ...) (*computepb.InterconnectAttachment, error)
- func (c *InterconnectAttachmentsClient) Insert(ctx context.Context, req *computepb.InsertInterconnectAttachmentRequest, ...) (*Operation, error)
- func (c *InterconnectAttachmentsClient) List(ctx context.Context, req *computepb.ListInterconnectAttachmentsRequest, ...) *InterconnectAttachmentIterator
- func (c *InterconnectAttachmentsClient) Patch(ctx context.Context, req *computepb.PatchInterconnectAttachmentRequest, ...) (*Operation, error)
- func (c *InterconnectAttachmentsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInterconnectAttachmentRequest, ...) (*Operation, error)
- func (c *InterconnectAttachmentsClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type InterconnectAttachmentsScopedListPair
- type InterconnectAttachmentsScopedListPairIterator
- func (it *InterconnectAttachmentsScopedListPairIterator) All() iter.Seq2[InterconnectAttachmentsScopedListPair, error]
- func (it *InterconnectAttachmentsScopedListPairIterator) Next() (InterconnectAttachmentsScopedListPair, error)
- func (it *InterconnectAttachmentsScopedListPairIterator) PageInfo() *iterator.PageInfo
- type InterconnectGroupIterator
- type InterconnectGroupsCallOptions
- type InterconnectGroupsClient
- func (c *InterconnectGroupsClient) Close() error
- func (c *InterconnectGroupsClient) Connection() *grpc.ClientConndeprecated
- func (c *InterconnectGroupsClient) CreateMembers(ctx context.Context, req *computepb.CreateMembersInterconnectGroupRequest, ...) (*Operation, error)
- func (c *InterconnectGroupsClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectGroupRequest, ...) (*Operation, error)
- func (c *InterconnectGroupsClient) Get(ctx context.Context, req *computepb.GetInterconnectGroupRequest, ...) (*computepb.InterconnectGroup, error)
- func (c *InterconnectGroupsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInterconnectGroupRequest, ...) (*computepb.Policy, error)
- func (c *InterconnectGroupsClient) GetOperationalStatus(ctx context.Context, ...) (*computepb.InterconnectGroupsGetOperationalStatusResponse, error)
- func (c *InterconnectGroupsClient) Insert(ctx context.Context, req *computepb.InsertInterconnectGroupRequest, ...) (*Operation, error)
- func (c *InterconnectGroupsClient) List(ctx context.Context, req *computepb.ListInterconnectGroupsRequest, ...) *InterconnectGroupIterator
- func (c *InterconnectGroupsClient) Patch(ctx context.Context, req *computepb.PatchInterconnectGroupRequest, ...) (*Operation, error)
- func (c *InterconnectGroupsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInterconnectGroupRequest, ...) (*computepb.Policy, error)
- func (c *InterconnectGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInterconnectGroupRequest, ...) (*computepb.TestPermissionsResponse, error)
- type InterconnectIterator
- type InterconnectLocationIterator
- type InterconnectLocationsCallOptions
- type InterconnectLocationsClient
- func (c *InterconnectLocationsClient) Close() error
- func (c *InterconnectLocationsClient) Connection() *grpc.ClientConndeprecated
- func (c *InterconnectLocationsClient) Get(ctx context.Context, req *computepb.GetInterconnectLocationRequest, ...) (*computepb.InterconnectLocation, error)
- func (c *InterconnectLocationsClient) List(ctx context.Context, req *computepb.ListInterconnectLocationsRequest, ...) *InterconnectLocationIterator
- type InterconnectRemoteLocationIterator
- type InterconnectRemoteLocationsCallOptions
- type InterconnectRemoteLocationsClient
- func (c *InterconnectRemoteLocationsClient) Close() error
- func (c *InterconnectRemoteLocationsClient) Connection() *grpc.ClientConndeprecated
- func (c *InterconnectRemoteLocationsClient) Get(ctx context.Context, req *computepb.GetInterconnectRemoteLocationRequest, ...) (*computepb.InterconnectRemoteLocation, error)
- func (c *InterconnectRemoteLocationsClient) List(ctx context.Context, req *computepb.ListInterconnectRemoteLocationsRequest, ...) *InterconnectRemoteLocationIterator
- type InterconnectsCallOptions
- type InterconnectsClient
- func (c *InterconnectsClient) Close() error
- func (c *InterconnectsClient) Connection() *grpc.ClientConndeprecated
- func (c *InterconnectsClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectRequest, ...) (*Operation, error)
- func (c *InterconnectsClient) Get(ctx context.Context, req *computepb.GetInterconnectRequest, ...) (*computepb.Interconnect, error)
- func (c *InterconnectsClient) GetDiagnostics(ctx context.Context, req *computepb.GetDiagnosticsInterconnectRequest, ...) (*computepb.InterconnectsGetDiagnosticsResponse, error)
- func (c *InterconnectsClient) GetMacsecConfig(ctx context.Context, req *computepb.GetMacsecConfigInterconnectRequest, ...) (*computepb.InterconnectsGetMacsecConfigResponse, error)
- func (c *InterconnectsClient) Insert(ctx context.Context, req *computepb.InsertInterconnectRequest, ...) (*Operation, error)
- func (c *InterconnectsClient) List(ctx context.Context, req *computepb.ListInterconnectsRequest, ...) *InterconnectIterator
- func (c *InterconnectsClient) Patch(ctx context.Context, req *computepb.PatchInterconnectRequest, ...) (*Operation, error)
- func (c *InterconnectsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInterconnectRequest, ...) (*Operation, error)
- func (c *InterconnectsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInterconnectRequest, ...) (*computepb.TestPermissionsResponse, error)
- type LicenseCodesCallOptions
- type LicenseCodesClient
- func (c *LicenseCodesClient) Close() error
- func (c *LicenseCodesClient) Connection() *grpc.ClientConndeprecated
- func (c *LicenseCodesClient) Get(ctx context.Context, req *computepb.GetLicenseCodeRequest, ...) (*computepb.LicenseCode, error)
- func (c *LicenseCodesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsLicenseCodeRequest, ...) (*computepb.TestPermissionsResponse, error)
- type LicenseIterator
- type LicensesCallOptions
- type LicensesClient
- func (c *LicensesClient) Close() error
- func (c *LicensesClient) Connection() *grpc.ClientConndeprecated
- func (c *LicensesClient) Delete(ctx context.Context, req *computepb.DeleteLicenseRequest, ...) (*Operation, error)
- func (c *LicensesClient) Get(ctx context.Context, req *computepb.GetLicenseRequest, opts ...gax.CallOption) (*computepb.License, error)
- func (c *LicensesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyLicenseRequest, ...) (*computepb.Policy, error)
- func (c *LicensesClient) Insert(ctx context.Context, req *computepb.InsertLicenseRequest, ...) (*Operation, error)
- func (c *LicensesClient) List(ctx context.Context, req *computepb.ListLicensesRequest, ...) *LicenseIterator
- func (c *LicensesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyLicenseRequest, ...) (*computepb.Policy, error)
- func (c *LicensesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsLicenseRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *LicensesClient) Update(ctx context.Context, req *computepb.UpdateLicenseRequest, ...) (*Operation, error)
- type MachineImageIterator
- type MachineImagesCallOptions
- type MachineImagesClient
- func (c *MachineImagesClient) Close() error
- func (c *MachineImagesClient) Connection() *grpc.ClientConndeprecated
- func (c *MachineImagesClient) Delete(ctx context.Context, req *computepb.DeleteMachineImageRequest, ...) (*Operation, error)
- func (c *MachineImagesClient) Get(ctx context.Context, req *computepb.GetMachineImageRequest, ...) (*computepb.MachineImage, error)
- func (c *MachineImagesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyMachineImageRequest, ...) (*computepb.Policy, error)
- func (c *MachineImagesClient) Insert(ctx context.Context, req *computepb.InsertMachineImageRequest, ...) (*Operation, error)
- func (c *MachineImagesClient) List(ctx context.Context, req *computepb.ListMachineImagesRequest, ...) *MachineImageIterator
- func (c *MachineImagesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyMachineImageRequest, ...) (*computepb.Policy, error)
- func (c *MachineImagesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsMachineImageRequest, ...) (*Operation, error)
- func (c *MachineImagesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsMachineImageRequest, ...) (*computepb.TestPermissionsResponse, error)
- type MachineTypeIterator
- type MachineTypesCallOptions
- type MachineTypesClient
- func (c *MachineTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListMachineTypesRequest, ...) *MachineTypesScopedListPairIterator
- func (c *MachineTypesClient) Close() error
- func (c *MachineTypesClient) Connection() *grpc.ClientConndeprecated
- func (c *MachineTypesClient) Get(ctx context.Context, req *computepb.GetMachineTypeRequest, ...) (*computepb.MachineType, error)
- func (c *MachineTypesClient) List(ctx context.Context, req *computepb.ListMachineTypesRequest, ...) *MachineTypeIterator
- type MachineTypesScopedListPair
- type MachineTypesScopedListPairIterator
- type ManagedInstanceIterator
- type MultiMigIterator
- type MultiMigMemberIterator
- type NetworkAttachmentIterator
- type NetworkAttachmentsCallOptions
- type NetworkAttachmentsClient
- func (c *NetworkAttachmentsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNetworkAttachmentsRequest, ...) *NetworkAttachmentsScopedListPairIterator
- func (c *NetworkAttachmentsClient) Close() error
- func (c *NetworkAttachmentsClient) Connection() *grpc.ClientConndeprecated
- func (c *NetworkAttachmentsClient) Delete(ctx context.Context, req *computepb.DeleteNetworkAttachmentRequest, ...) (*Operation, error)
- func (c *NetworkAttachmentsClient) Get(ctx context.Context, req *computepb.GetNetworkAttachmentRequest, ...) (*computepb.NetworkAttachment, error)
- func (c *NetworkAttachmentsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNetworkAttachmentRequest, ...) (*computepb.Policy, error)
- func (c *NetworkAttachmentsClient) Insert(ctx context.Context, req *computepb.InsertNetworkAttachmentRequest, ...) (*Operation, error)
- func (c *NetworkAttachmentsClient) List(ctx context.Context, req *computepb.ListNetworkAttachmentsRequest, ...) *NetworkAttachmentIterator
- func (c *NetworkAttachmentsClient) Patch(ctx context.Context, req *computepb.PatchNetworkAttachmentRequest, ...) (*Operation, error)
- func (c *NetworkAttachmentsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNetworkAttachmentRequest, ...) (*computepb.Policy, error)
- func (c *NetworkAttachmentsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNetworkAttachmentRequest, ...) (*computepb.TestPermissionsResponse, error)
- type NetworkAttachmentsScopedListPair
- type NetworkAttachmentsScopedListPairIterator
- type NetworkEdgeSecurityServicesCallOptions
- type NetworkEdgeSecurityServicesClient
- func (c *NetworkEdgeSecurityServicesClient) AggregatedList(ctx context.Context, ...) *NetworkEdgeSecurityServicesScopedListPairIterator
- func (c *NetworkEdgeSecurityServicesClient) Close() error
- func (c *NetworkEdgeSecurityServicesClient) Connection() *grpc.ClientConndeprecated
- func (c *NetworkEdgeSecurityServicesClient) Delete(ctx context.Context, req *computepb.DeleteNetworkEdgeSecurityServiceRequest, ...) (*Operation, error)
- func (c *NetworkEdgeSecurityServicesClient) Get(ctx context.Context, req *computepb.GetNetworkEdgeSecurityServiceRequest, ...) (*computepb.NetworkEdgeSecurityService, error)
- func (c *NetworkEdgeSecurityServicesClient) Insert(ctx context.Context, req *computepb.InsertNetworkEdgeSecurityServiceRequest, ...) (*Operation, error)
- func (c *NetworkEdgeSecurityServicesClient) Patch(ctx context.Context, req *computepb.PatchNetworkEdgeSecurityServiceRequest, ...) (*Operation, error)
- type NetworkEdgeSecurityServicesScopedListPair
- type NetworkEdgeSecurityServicesScopedListPairIterator
- func (it *NetworkEdgeSecurityServicesScopedListPairIterator) All() iter.Seq2[NetworkEdgeSecurityServicesScopedListPair, error]
- func (it *NetworkEdgeSecurityServicesScopedListPairIterator) Next() (NetworkEdgeSecurityServicesScopedListPair, error)
- func (it *NetworkEdgeSecurityServicesScopedListPairIterator) PageInfo() *iterator.PageInfo
- type NetworkEndpointGroupIterator
- type NetworkEndpointGroupsCallOptions
- type NetworkEndpointGroupsClient
- func (c *NetworkEndpointGroupsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNetworkEndpointGroupsRequest, ...) *NetworkEndpointGroupsScopedListPairIterator
- func (c *NetworkEndpointGroupsClient) AttachNetworkEndpoints(ctx context.Context, ...) (*Operation, error)
- func (c *NetworkEndpointGroupsClient) Close() error
- func (c *NetworkEndpointGroupsClient) Connection() *grpc.ClientConndeprecated
- func (c *NetworkEndpointGroupsClient) Delete(ctx context.Context, req *computepb.DeleteNetworkEndpointGroupRequest, ...) (*Operation, error)
- func (c *NetworkEndpointGroupsClient) DetachNetworkEndpoints(ctx context.Context, ...) (*Operation, error)
- func (c *NetworkEndpointGroupsClient) Get(ctx context.Context, req *computepb.GetNetworkEndpointGroupRequest, ...) (*computepb.NetworkEndpointGroup, error)
- func (c *NetworkEndpointGroupsClient) Insert(ctx context.Context, req *computepb.InsertNetworkEndpointGroupRequest, ...) (*Operation, error)
- func (c *NetworkEndpointGroupsClient) List(ctx context.Context, req *computepb.ListNetworkEndpointGroupsRequest, ...) *NetworkEndpointGroupIterator
- func (c *NetworkEndpointGroupsClient) ListNetworkEndpoints(ctx context.Context, ...) *NetworkEndpointWithHealthStatusIterator
- func (c *NetworkEndpointGroupsClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type NetworkEndpointGroupsScopedListPair
- type NetworkEndpointGroupsScopedListPairIterator
- func (it *NetworkEndpointGroupsScopedListPairIterator) All() iter.Seq2[NetworkEndpointGroupsScopedListPair, error]
- func (it *NetworkEndpointGroupsScopedListPairIterator) Next() (NetworkEndpointGroupsScopedListPair, error)
- func (it *NetworkEndpointGroupsScopedListPairIterator) PageInfo() *iterator.PageInfo
- type NetworkEndpointWithHealthStatusIterator
- func (it *NetworkEndpointWithHealthStatusIterator) All() iter.Seq2[*computepb.NetworkEndpointWithHealthStatus, error]
- func (it *NetworkEndpointWithHealthStatusIterator) Next() (*computepb.NetworkEndpointWithHealthStatus, error)
- func (it *NetworkEndpointWithHealthStatusIterator) PageInfo() *iterator.PageInfo
- type NetworkFirewallPoliciesCallOptions
- type NetworkFirewallPoliciesClient
- func (c *NetworkFirewallPoliciesClient) AddAssociation(ctx context.Context, req *computepb.AddAssociationNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) AddPacketMirroringRule(ctx context.Context, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) AggregatedList(ctx context.Context, ...) *FirewallPoliciesScopedListPairIterator
- func (c *NetworkFirewallPoliciesClient) CloneRules(ctx context.Context, req *computepb.CloneRulesNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) Close() error
- func (c *NetworkFirewallPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *NetworkFirewallPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) Get(ctx context.Context, req *computepb.GetNetworkFirewallPolicyRequest, ...) (*computepb.FirewallPolicy, error)
- func (c *NetworkFirewallPoliciesClient) GetAssociation(ctx context.Context, req *computepb.GetAssociationNetworkFirewallPolicyRequest, ...) (*computepb.FirewallPolicyAssociation, error)
- func (c *NetworkFirewallPoliciesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNetworkFirewallPolicyRequest, ...) (*computepb.Policy, error)
- func (c *NetworkFirewallPoliciesClient) GetPacketMirroringRule(ctx context.Context, ...) (*computepb.FirewallPolicyRule, error)
- func (c *NetworkFirewallPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleNetworkFirewallPolicyRequest, ...) (*computepb.FirewallPolicyRule, error)
- func (c *NetworkFirewallPoliciesClient) Insert(ctx context.Context, req *computepb.InsertNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) List(ctx context.Context, req *computepb.ListNetworkFirewallPoliciesRequest, ...) *FirewallPolicyIterator
- func (c *NetworkFirewallPoliciesClient) Patch(ctx context.Context, req *computepb.PatchNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) PatchPacketMirroringRule(ctx context.Context, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) RemoveAssociation(ctx context.Context, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) RemovePacketMirroringRule(ctx context.Context, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *NetworkFirewallPoliciesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNetworkFirewallPolicyRequest, ...) (*computepb.Policy, error)
- func (c *NetworkFirewallPoliciesClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type NetworkIterator
- type NetworkPoliciesScopedListPair
- type NetworkPoliciesScopedListPairIterator
- type NetworkPolicyIterator
- type NetworkProfileIterator
- type NetworkProfilesCallOptions
- type NetworkProfilesClient
- func (c *NetworkProfilesClient) Close() error
- func (c *NetworkProfilesClient) Connection() *grpc.ClientConndeprecated
- func (c *NetworkProfilesClient) Get(ctx context.Context, req *computepb.GetNetworkProfileRequest, ...) (*computepb.NetworkProfile, error)
- func (c *NetworkProfilesClient) List(ctx context.Context, req *computepb.ListNetworkProfilesRequest, ...) *NetworkProfileIterator
- type NetworksCallOptions
- type NetworksClient
- func (c *NetworksClient) AddPeering(ctx context.Context, req *computepb.AddPeeringNetworkRequest, ...) (*Operation, error)
- func (c *NetworksClient) CancelRequestRemovePeering(ctx context.Context, req *computepb.CancelRequestRemovePeeringNetworkRequest, ...) (*Operation, error)
- func (c *NetworksClient) Close() error
- func (c *NetworksClient) Connection() *grpc.ClientConndeprecated
- func (c *NetworksClient) Delete(ctx context.Context, req *computepb.DeleteNetworkRequest, ...) (*Operation, error)
- func (c *NetworksClient) Get(ctx context.Context, req *computepb.GetNetworkRequest, opts ...gax.CallOption) (*computepb.Network, error)
- func (c *NetworksClient) GetEffectiveFirewalls(ctx context.Context, req *computepb.GetEffectiveFirewallsNetworkRequest, ...) (*computepb.NetworksGetEffectiveFirewallsResponse, error)
- func (c *NetworksClient) Insert(ctx context.Context, req *computepb.InsertNetworkRequest, ...) (*Operation, error)
- func (c *NetworksClient) List(ctx context.Context, req *computepb.ListNetworksRequest, ...) *NetworkIterator
- func (c *NetworksClient) ListPeeringRoutes(ctx context.Context, req *computepb.ListPeeringRoutesNetworksRequest, ...) *ExchangedPeeringRouteIterator
- func (c *NetworksClient) Patch(ctx context.Context, req *computepb.PatchNetworkRequest, ...) (*Operation, error)
- func (c *NetworksClient) RemovePeering(ctx context.Context, req *computepb.RemovePeeringNetworkRequest, ...) (*Operation, error)
- func (c *NetworksClient) RequestRemovePeering(ctx context.Context, req *computepb.RequestRemovePeeringNetworkRequest, ...) (*Operation, error)
- func (c *NetworksClient) SwitchToCustomMode(ctx context.Context, req *computepb.SwitchToCustomModeNetworkRequest, ...) (*Operation, error)
- func (c *NetworksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNetworkRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *NetworksClient) UpdatePeering(ctx context.Context, req *computepb.UpdatePeeringNetworkRequest, ...) (*Operation, error)
- type NodeGroupIterator
- type NodeGroupNodeIterator
- type NodeGroupsCallOptions
- type NodeGroupsClient
- func (c *NodeGroupsClient) AddNodes(ctx context.Context, req *computepb.AddNodesNodeGroupRequest, ...) (*Operation, error)
- func (c *NodeGroupsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeGroupsRequest, ...) *NodeGroupsScopedListPairIterator
- func (c *NodeGroupsClient) Close() error
- func (c *NodeGroupsClient) Connection() *grpc.ClientConndeprecated
- func (c *NodeGroupsClient) Delete(ctx context.Context, req *computepb.DeleteNodeGroupRequest, ...) (*Operation, error)
- func (c *NodeGroupsClient) DeleteNodes(ctx context.Context, req *computepb.DeleteNodesNodeGroupRequest, ...) (*Operation, error)
- func (c *NodeGroupsClient) Get(ctx context.Context, req *computepb.GetNodeGroupRequest, ...) (*computepb.NodeGroup, error)
- func (c *NodeGroupsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNodeGroupRequest, ...) (*computepb.Policy, error)
- func (c *NodeGroupsClient) Insert(ctx context.Context, req *computepb.InsertNodeGroupRequest, ...) (*Operation, error)
- func (c *NodeGroupsClient) List(ctx context.Context, req *computepb.ListNodeGroupsRequest, ...) *NodeGroupIterator
- func (c *NodeGroupsClient) ListNodes(ctx context.Context, req *computepb.ListNodesNodeGroupsRequest, ...) *NodeGroupNodeIterator
- func (c *NodeGroupsClient) Patch(ctx context.Context, req *computepb.PatchNodeGroupRequest, ...) (*Operation, error)
- func (c *NodeGroupsClient) PerformMaintenance(ctx context.Context, req *computepb.PerformMaintenanceNodeGroupRequest, ...) (*Operation, error)
- func (c *NodeGroupsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNodeGroupRequest, ...) (*computepb.Policy, error)
- func (c *NodeGroupsClient) SetNodeTemplate(ctx context.Context, req *computepb.SetNodeTemplateNodeGroupRequest, ...) (*Operation, error)
- func (c *NodeGroupsClient) SimulateMaintenanceEvent(ctx context.Context, req *computepb.SimulateMaintenanceEventNodeGroupRequest, ...) (*Operation, error)
- func (c *NodeGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNodeGroupRequest, ...) (*computepb.TestPermissionsResponse, error)
- type NodeGroupsScopedListPair
- type NodeGroupsScopedListPairIterator
- type NodeTemplateIterator
- type NodeTemplatesCallOptions
- type NodeTemplatesClient
- func (c *NodeTemplatesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeTemplatesRequest, ...) *NodeTemplatesScopedListPairIterator
- func (c *NodeTemplatesClient) Close() error
- func (c *NodeTemplatesClient) Connection() *grpc.ClientConndeprecated
- func (c *NodeTemplatesClient) Delete(ctx context.Context, req *computepb.DeleteNodeTemplateRequest, ...) (*Operation, error)
- func (c *NodeTemplatesClient) Get(ctx context.Context, req *computepb.GetNodeTemplateRequest, ...) (*computepb.NodeTemplate, error)
- func (c *NodeTemplatesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNodeTemplateRequest, ...) (*computepb.Policy, error)
- func (c *NodeTemplatesClient) Insert(ctx context.Context, req *computepb.InsertNodeTemplateRequest, ...) (*Operation, error)
- func (c *NodeTemplatesClient) List(ctx context.Context, req *computepb.ListNodeTemplatesRequest, ...) *NodeTemplateIterator
- func (c *NodeTemplatesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNodeTemplateRequest, ...) (*computepb.Policy, error)
- func (c *NodeTemplatesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNodeTemplateRequest, ...) (*computepb.TestPermissionsResponse, error)
- type NodeTemplatesScopedListPair
- type NodeTemplatesScopedListPairIterator
- type NodeTypeIterator
- type NodeTypesCallOptions
- type NodeTypesClient
- func (c *NodeTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeTypesRequest, ...) *NodeTypesScopedListPairIterator
- func (c *NodeTypesClient) Close() error
- func (c *NodeTypesClient) Connection() *grpc.ClientConndeprecated
- func (c *NodeTypesClient) Get(ctx context.Context, req *computepb.GetNodeTypeRequest, opts ...gax.CallOption) (*computepb.NodeType, error)
- func (c *NodeTypesClient) List(ctx context.Context, req *computepb.ListNodeTypesRequest, ...) *NodeTypeIterator
- type NodeTypesScopedListPair
- type NodeTypesScopedListPairIterator
- type NotificationEndpointIterator
- type Operation
- type OperationIterator
- type OperationsScopedListPair
- type OperationsScopedListPairIterator
- type OrganizationSecurityPoliciesCallOptions
- type OrganizationSecurityPoliciesClient
- func (c *OrganizationSecurityPoliciesClient) AddAssociation(ctx context.Context, ...) (*Operation, error)
- func (c *OrganizationSecurityPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleOrganizationSecurityPolicyRequest, ...) (*Operation, error)
- func (c *OrganizationSecurityPoliciesClient) Close() error
- func (c *OrganizationSecurityPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *OrganizationSecurityPoliciesClient) CopyRules(ctx context.Context, req *computepb.CopyRulesOrganizationSecurityPolicyRequest, ...) (*Operation, error)
- func (c *OrganizationSecurityPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteOrganizationSecurityPolicyRequest, ...) (*Operation, error)
- func (c *OrganizationSecurityPoliciesClient) Get(ctx context.Context, req *computepb.GetOrganizationSecurityPolicyRequest, ...) (*computepb.SecurityPolicy, error)
- func (c *OrganizationSecurityPoliciesClient) GetAssociation(ctx context.Context, ...) (*computepb.SecurityPolicyAssociation, error)
- func (c *OrganizationSecurityPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleOrganizationSecurityPolicyRequest, ...) (*computepb.SecurityPolicyRule, error)
- func (c *OrganizationSecurityPoliciesClient) Insert(ctx context.Context, req *computepb.InsertOrganizationSecurityPolicyRequest, ...) (*Operation, error)
- func (c *OrganizationSecurityPoliciesClient) List(ctx context.Context, req *computepb.ListOrganizationSecurityPoliciesRequest, ...) *SecurityPolicyIterator
- func (c *OrganizationSecurityPoliciesClient) ListAssociations(ctx context.Context, ...) (*computepb.OrganizationSecurityPoliciesListAssociationsResponse, error)
- func (c *OrganizationSecurityPoliciesClient) ListPreconfiguredExpressionSets(ctx context.Context, ...) (*computepb.SecurityPoliciesListPreconfiguredExpressionSetsResponse, error)
- func (c *OrganizationSecurityPoliciesClient) Move(ctx context.Context, req *computepb.MoveOrganizationSecurityPolicyRequest, ...) (*Operation, error)
- func (c *OrganizationSecurityPoliciesClient) Patch(ctx context.Context, req *computepb.PatchOrganizationSecurityPolicyRequest, ...) (*Operation, error)
- func (c *OrganizationSecurityPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleOrganizationSecurityPolicyRequest, ...) (*Operation, error)
- func (c *OrganizationSecurityPoliciesClient) RemoveAssociation(ctx context.Context, ...) (*Operation, error)
- func (c *OrganizationSecurityPoliciesClient) RemoveRule(ctx context.Context, ...) (*Operation, error)
- type PacketMirroringIterator
- type PacketMirroringsCallOptions
- type PacketMirroringsClient
- func (c *PacketMirroringsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListPacketMirroringsRequest, ...) *PacketMirroringsScopedListPairIterator
- func (c *PacketMirroringsClient) Close() error
- func (c *PacketMirroringsClient) Connection() *grpc.ClientConndeprecated
- func (c *PacketMirroringsClient) Delete(ctx context.Context, req *computepb.DeletePacketMirroringRequest, ...) (*Operation, error)
- func (c *PacketMirroringsClient) Get(ctx context.Context, req *computepb.GetPacketMirroringRequest, ...) (*computepb.PacketMirroring, error)
- func (c *PacketMirroringsClient) Insert(ctx context.Context, req *computepb.InsertPacketMirroringRequest, ...) (*Operation, error)
- func (c *PacketMirroringsClient) List(ctx context.Context, req *computepb.ListPacketMirroringsRequest, ...) *PacketMirroringIterator
- func (c *PacketMirroringsClient) Patch(ctx context.Context, req *computepb.PatchPacketMirroringRequest, ...) (*Operation, error)
- func (c *PacketMirroringsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsPacketMirroringRequest, ...) (*computepb.TestPermissionsResponse, error)
- type PacketMirroringsScopedListPair
- type PacketMirroringsScopedListPairIterator
- type PerInstanceConfigIterator
- type PreviewFeatureIterator
- type PreviewFeaturesCallOptions
- type PreviewFeaturesClient
- func (c *PreviewFeaturesClient) Close() error
- func (c *PreviewFeaturesClient) Connection() *grpc.ClientConndeprecated
- func (c *PreviewFeaturesClient) Get(ctx context.Context, req *computepb.GetPreviewFeatureRequest, ...) (*computepb.PreviewFeature, error)
- func (c *PreviewFeaturesClient) List(ctx context.Context, req *computepb.ListPreviewFeaturesRequest, ...) *PreviewFeatureIterator
- func (c *PreviewFeaturesClient) Update(ctx context.Context, req *computepb.UpdatePreviewFeatureRequest, ...) (*Operation, error)
- type ProjectIterator
- type ProjectsCallOptions
- type ProjectsClient
- func (c *ProjectsClient) Close() error
- func (c *ProjectsClient) Connection() *grpc.ClientConndeprecated
- func (c *ProjectsClient) DisableXpnHost(ctx context.Context, req *computepb.DisableXpnHostProjectRequest, ...) (*Operation, error)
- func (c *ProjectsClient) DisableXpnResource(ctx context.Context, req *computepb.DisableXpnResourceProjectRequest, ...) (*Operation, error)
- func (c *ProjectsClient) EnableXpnHost(ctx context.Context, req *computepb.EnableXpnHostProjectRequest, ...) (*Operation, error)
- func (c *ProjectsClient) EnableXpnResource(ctx context.Context, req *computepb.EnableXpnResourceProjectRequest, ...) (*Operation, error)
- func (c *ProjectsClient) Get(ctx context.Context, req *computepb.GetProjectRequest, opts ...gax.CallOption) (*computepb.Project, error)
- func (c *ProjectsClient) GetXpnHost(ctx context.Context, req *computepb.GetXpnHostProjectRequest, ...) (*computepb.Project, error)
- func (c *ProjectsClient) GetXpnResources(ctx context.Context, req *computepb.GetXpnResourcesProjectsRequest, ...) *XpnResourceIdIterator
- func (c *ProjectsClient) ListXpnHosts(ctx context.Context, req *computepb.ListXpnHostsProjectsRequest, ...) *ProjectIterator
- func (c *ProjectsClient) MoveDisk(ctx context.Context, req *computepb.MoveDiskProjectRequest, ...) (*Operation, error)
- func (c *ProjectsClient) MoveInstance(ctx context.Context, req *computepb.MoveInstanceProjectRequest, ...) (*Operation, error)
- func (c *ProjectsClient) SetCloudArmorTier(ctx context.Context, req *computepb.SetCloudArmorTierProjectRequest, ...) (*Operation, error)
- func (c *ProjectsClient) SetCommonInstanceMetadata(ctx context.Context, req *computepb.SetCommonInstanceMetadataProjectRequest, ...) (*Operation, error)
- func (c *ProjectsClient) SetDefaultNetworkTier(ctx context.Context, req *computepb.SetDefaultNetworkTierProjectRequest, ...) (*Operation, error)
- func (c *ProjectsClient) SetManagedProtectionTier(ctx context.Context, req *computepb.SetManagedProtectionTierProjectRequest, ...) (*Operation, error)
- func (c *ProjectsClient) SetUsageExportBucket(ctx context.Context, req *computepb.SetUsageExportBucketProjectRequest, ...) (*Operation, error)
- type PublicAdvertisedPrefixIterator
- type PublicAdvertisedPrefixesCallOptions
- type PublicAdvertisedPrefixesClient
- func (c *PublicAdvertisedPrefixesClient) Announce(ctx context.Context, req *computepb.AnnouncePublicAdvertisedPrefixeRequest, ...) (*Operation, error)
- func (c *PublicAdvertisedPrefixesClient) Close() error
- func (c *PublicAdvertisedPrefixesClient) Connection() *grpc.ClientConndeprecated
- func (c *PublicAdvertisedPrefixesClient) Delete(ctx context.Context, req *computepb.DeletePublicAdvertisedPrefixeRequest, ...) (*Operation, error)
- func (c *PublicAdvertisedPrefixesClient) Get(ctx context.Context, req *computepb.GetPublicAdvertisedPrefixeRequest, ...) (*computepb.PublicAdvertisedPrefix, error)
- func (c *PublicAdvertisedPrefixesClient) Insert(ctx context.Context, req *computepb.InsertPublicAdvertisedPrefixeRequest, ...) (*Operation, error)
- func (c *PublicAdvertisedPrefixesClient) List(ctx context.Context, req *computepb.ListPublicAdvertisedPrefixesRequest, ...) *PublicAdvertisedPrefixIterator
- func (c *PublicAdvertisedPrefixesClient) Patch(ctx context.Context, req *computepb.PatchPublicAdvertisedPrefixeRequest, ...) (*Operation, error)
- func (c *PublicAdvertisedPrefixesClient) Withdraw(ctx context.Context, req *computepb.WithdrawPublicAdvertisedPrefixeRequest, ...) (*Operation, error)
- type PublicDelegatedPrefixIterator
- type PublicDelegatedPrefixesCallOptions
- type PublicDelegatedPrefixesClient
- func (c *PublicDelegatedPrefixesClient) AggregatedList(ctx context.Context, ...) *PublicDelegatedPrefixesScopedListPairIterator
- func (c *PublicDelegatedPrefixesClient) Announce(ctx context.Context, req *computepb.AnnouncePublicDelegatedPrefixeRequest, ...) (*Operation, error)
- func (c *PublicDelegatedPrefixesClient) Close() error
- func (c *PublicDelegatedPrefixesClient) Connection() *grpc.ClientConndeprecated
- func (c *PublicDelegatedPrefixesClient) Delete(ctx context.Context, req *computepb.DeletePublicDelegatedPrefixeRequest, ...) (*Operation, error)
- func (c *PublicDelegatedPrefixesClient) Get(ctx context.Context, req *computepb.GetPublicDelegatedPrefixeRequest, ...) (*computepb.PublicDelegatedPrefix, error)
- func (c *PublicDelegatedPrefixesClient) Insert(ctx context.Context, req *computepb.InsertPublicDelegatedPrefixeRequest, ...) (*Operation, error)
- func (c *PublicDelegatedPrefixesClient) List(ctx context.Context, req *computepb.ListPublicDelegatedPrefixesRequest, ...) *PublicDelegatedPrefixIterator
- func (c *PublicDelegatedPrefixesClient) Patch(ctx context.Context, req *computepb.PatchPublicDelegatedPrefixeRequest, ...) (*Operation, error)
- func (c *PublicDelegatedPrefixesClient) Withdraw(ctx context.Context, req *computepb.WithdrawPublicDelegatedPrefixeRequest, ...) (*Operation, error)
- type PublicDelegatedPrefixesScopedListPair
- type PublicDelegatedPrefixesScopedListPairIterator
- func (it *PublicDelegatedPrefixesScopedListPairIterator) All() iter.Seq2[PublicDelegatedPrefixesScopedListPair, error]
- func (it *PublicDelegatedPrefixesScopedListPairIterator) Next() (PublicDelegatedPrefixesScopedListPair, error)
- func (it *PublicDelegatedPrefixesScopedListPairIterator) PageInfo() *iterator.PageInfo
- type ReferenceIterator
- type RegionAutoscalersCallOptions
- type RegionAutoscalersClient
- func (c *RegionAutoscalersClient) Close() error
- func (c *RegionAutoscalersClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionAutoscalersClient) Delete(ctx context.Context, req *computepb.DeleteRegionAutoscalerRequest, ...) (*Operation, error)
- func (c *RegionAutoscalersClient) Get(ctx context.Context, req *computepb.GetRegionAutoscalerRequest, ...) (*computepb.Autoscaler, error)
- func (c *RegionAutoscalersClient) Insert(ctx context.Context, req *computepb.InsertRegionAutoscalerRequest, ...) (*Operation, error)
- func (c *RegionAutoscalersClient) List(ctx context.Context, req *computepb.ListRegionAutoscalersRequest, ...) *AutoscalerIterator
- func (c *RegionAutoscalersClient) Patch(ctx context.Context, req *computepb.PatchRegionAutoscalerRequest, ...) (*Operation, error)
- func (c *RegionAutoscalersClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionAutoscalerRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *RegionAutoscalersClient) Update(ctx context.Context, req *computepb.UpdateRegionAutoscalerRequest, ...) (*Operation, error)
- type RegionBackendBucketsCallOptions
- type RegionBackendBucketsClient
- func (c *RegionBackendBucketsClient) Close() error
- func (c *RegionBackendBucketsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionBackendBucketsClient) Delete(ctx context.Context, req *computepb.DeleteRegionBackendBucketRequest, ...) (*Operation, error)
- func (c *RegionBackendBucketsClient) Get(ctx context.Context, req *computepb.GetRegionBackendBucketRequest, ...) (*computepb.BackendBucket, error)
- func (c *RegionBackendBucketsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionBackendBucketRequest, ...) (*computepb.Policy, error)
- func (c *RegionBackendBucketsClient) Insert(ctx context.Context, req *computepb.InsertRegionBackendBucketRequest, ...) (*Operation, error)
- func (c *RegionBackendBucketsClient) List(ctx context.Context, req *computepb.ListRegionBackendBucketsRequest, ...) *BackendBucketIterator
- func (c *RegionBackendBucketsClient) ListUsable(ctx context.Context, req *computepb.ListUsableRegionBackendBucketsRequest, ...) *BackendBucketIterator
- func (c *RegionBackendBucketsClient) Patch(ctx context.Context, req *computepb.PatchRegionBackendBucketRequest, ...) (*Operation, error)
- func (c *RegionBackendBucketsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionBackendBucketRequest, ...) (*computepb.Policy, error)
- func (c *RegionBackendBucketsClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionBackendServicesCallOptions
- type RegionBackendServicesClient
- func (c *RegionBackendServicesClient) Close() error
- func (c *RegionBackendServicesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionBackendServicesClient) Delete(ctx context.Context, req *computepb.DeleteRegionBackendServiceRequest, ...) (*Operation, error)
- func (c *RegionBackendServicesClient) Get(ctx context.Context, req *computepb.GetRegionBackendServiceRequest, ...) (*computepb.BackendService, error)
- func (c *RegionBackendServicesClient) GetHealth(ctx context.Context, req *computepb.GetHealthRegionBackendServiceRequest, ...) (*computepb.BackendServiceGroupHealth, error)
- func (c *RegionBackendServicesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionBackendServiceRequest, ...) (*computepb.Policy, error)
- func (c *RegionBackendServicesClient) Insert(ctx context.Context, req *computepb.InsertRegionBackendServiceRequest, ...) (*Operation, error)
- func (c *RegionBackendServicesClient) List(ctx context.Context, req *computepb.ListRegionBackendServicesRequest, ...) *BackendServiceIterator
- func (c *RegionBackendServicesClient) ListUsable(ctx context.Context, req *computepb.ListUsableRegionBackendServicesRequest, ...) *BackendServiceIterator
- func (c *RegionBackendServicesClient) Patch(ctx context.Context, req *computepb.PatchRegionBackendServiceRequest, ...) (*Operation, error)
- func (c *RegionBackendServicesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionBackendServiceRequest, ...) (*computepb.Policy, error)
- func (c *RegionBackendServicesClient) SetSecurityPolicy(ctx context.Context, ...) (*Operation, error)
- func (c *RegionBackendServicesClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- func (c *RegionBackendServicesClient) Update(ctx context.Context, req *computepb.UpdateRegionBackendServiceRequest, ...) (*Operation, error)
- type RegionCommitmentsCallOptions
- type RegionCommitmentsClient
- func (c *RegionCommitmentsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRegionCommitmentsRequest, ...) *CommitmentsScopedListPairIterator
- func (c *RegionCommitmentsClient) Close() error
- func (c *RegionCommitmentsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionCommitmentsClient) Get(ctx context.Context, req *computepb.GetRegionCommitmentRequest, ...) (*computepb.Commitment, error)
- func (c *RegionCommitmentsClient) Insert(ctx context.Context, req *computepb.InsertRegionCommitmentRequest, ...) (*Operation, error)
- func (c *RegionCommitmentsClient) List(ctx context.Context, req *computepb.ListRegionCommitmentsRequest, ...) *CommitmentIterator
- func (c *RegionCommitmentsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionCommitmentRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *RegionCommitmentsClient) Update(ctx context.Context, req *computepb.UpdateRegionCommitmentRequest, ...) (*Operation, error)
- func (c *RegionCommitmentsClient) UpdateReservations(ctx context.Context, req *computepb.UpdateReservationsRegionCommitmentRequest, ...) (*Operation, error)
- type RegionCompositeHealthChecksCallOptions
- type RegionCompositeHealthChecksClient
- func (c *RegionCompositeHealthChecksClient) AggregatedList(ctx context.Context, ...) *CompositeHealthChecksScopedListPairIterator
- func (c *RegionCompositeHealthChecksClient) Close() error
- func (c *RegionCompositeHealthChecksClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionCompositeHealthChecksClient) Delete(ctx context.Context, req *computepb.DeleteRegionCompositeHealthCheckRequest, ...) (*Operation, error)
- func (c *RegionCompositeHealthChecksClient) Get(ctx context.Context, req *computepb.GetRegionCompositeHealthCheckRequest, ...) (*computepb.CompositeHealthCheck, error)
- func (c *RegionCompositeHealthChecksClient) Insert(ctx context.Context, req *computepb.InsertRegionCompositeHealthCheckRequest, ...) (*Operation, error)
- func (c *RegionCompositeHealthChecksClient) List(ctx context.Context, req *computepb.ListRegionCompositeHealthChecksRequest, ...) *CompositeHealthCheckIterator
- func (c *RegionCompositeHealthChecksClient) Patch(ctx context.Context, req *computepb.PatchRegionCompositeHealthCheckRequest, ...) (*Operation, error)
- func (c *RegionCompositeHealthChecksClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionDiskSettingsCallOptions
- type RegionDiskSettingsClient
- func (c *RegionDiskSettingsClient) Close() error
- func (c *RegionDiskSettingsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionDiskSettingsClient) Get(ctx context.Context, req *computepb.GetRegionDiskSettingRequest, ...) (*computepb.DiskSettings, error)
- func (c *RegionDiskSettingsClient) Patch(ctx context.Context, req *computepb.PatchRegionDiskSettingRequest, ...) (*Operation, error)
- type RegionDiskTypesCallOptions
- type RegionDiskTypesClient
- func (c *RegionDiskTypesClient) Close() error
- func (c *RegionDiskTypesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionDiskTypesClient) Get(ctx context.Context, req *computepb.GetRegionDiskTypeRequest, ...) (*computepb.DiskType, error)
- func (c *RegionDiskTypesClient) List(ctx context.Context, req *computepb.ListRegionDiskTypesRequest, ...) *DiskTypeIterator
- type RegionDisksCallOptions
- type RegionDisksClient
- func (c *RegionDisksClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesRegionDiskRequest, ...) (*Operation, error)
- func (c *RegionDisksClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertRegionDiskRequest, ...) (*Operation, error)
- func (c *RegionDisksClient) Close() error
- func (c *RegionDisksClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionDisksClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotRegionDiskRequest, ...) (*Operation, error)
- func (c *RegionDisksClient) Delete(ctx context.Context, req *computepb.DeleteRegionDiskRequest, ...) (*Operation, error)
- func (c *RegionDisksClient) Get(ctx context.Context, req *computepb.GetRegionDiskRequest, ...) (*computepb.Disk, error)
- func (c *RegionDisksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionDiskRequest, ...) (*computepb.Policy, error)
- func (c *RegionDisksClient) Insert(ctx context.Context, req *computepb.InsertRegionDiskRequest, ...) (*Operation, error)
- func (c *RegionDisksClient) List(ctx context.Context, req *computepb.ListRegionDisksRequest, ...) *DiskIterator
- func (c *RegionDisksClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesRegionDiskRequest, ...) (*Operation, error)
- func (c *RegionDisksClient) Resize(ctx context.Context, req *computepb.ResizeRegionDiskRequest, ...) (*Operation, error)
- func (c *RegionDisksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionDiskRequest, ...) (*computepb.Policy, error)
- func (c *RegionDisksClient) SetLabels(ctx context.Context, req *computepb.SetLabelsRegionDiskRequest, ...) (*Operation, error)
- func (c *RegionDisksClient) StartAsyncReplication(ctx context.Context, req *computepb.StartAsyncReplicationRegionDiskRequest, ...) (*Operation, error)
- func (c *RegionDisksClient) StopAsyncReplication(ctx context.Context, req *computepb.StopAsyncReplicationRegionDiskRequest, ...) (*Operation, error)
- func (c *RegionDisksClient) StopGroupAsyncReplication(ctx context.Context, req *computepb.StopGroupAsyncReplicationRegionDiskRequest, ...) (*Operation, error)
- func (c *RegionDisksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionDiskRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *RegionDisksClient) Update(ctx context.Context, req *computepb.UpdateRegionDiskRequest, ...) (*Operation, error)
- type RegionHealthAggregationPoliciesCallOptions
- type RegionHealthAggregationPoliciesClient
- func (c *RegionHealthAggregationPoliciesClient) AggregatedList(ctx context.Context, ...) *HealthAggregationPoliciesScopedListPairIterator
- func (c *RegionHealthAggregationPoliciesClient) Close() error
- func (c *RegionHealthAggregationPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionHealthAggregationPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthAggregationPolicyRequest, ...) (*Operation, error)
- func (c *RegionHealthAggregationPoliciesClient) Get(ctx context.Context, req *computepb.GetRegionHealthAggregationPolicyRequest, ...) (*computepb.HealthAggregationPolicy, error)
- func (c *RegionHealthAggregationPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthAggregationPolicyRequest, ...) (*Operation, error)
- func (c *RegionHealthAggregationPoliciesClient) List(ctx context.Context, req *computepb.ListRegionHealthAggregationPoliciesRequest, ...) *HealthAggregationPolicyIterator
- func (c *RegionHealthAggregationPoliciesClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthAggregationPolicyRequest, ...) (*Operation, error)
- func (c *RegionHealthAggregationPoliciesClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionHealthCheckServicesCallOptions
- type RegionHealthCheckServicesClient
- func (c *RegionHealthCheckServicesClient) Close() error
- func (c *RegionHealthCheckServicesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionHealthCheckServicesClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthCheckServiceRequest, ...) (*Operation, error)
- func (c *RegionHealthCheckServicesClient) Get(ctx context.Context, req *computepb.GetRegionHealthCheckServiceRequest, ...) (*computepb.HealthCheckService, error)
- func (c *RegionHealthCheckServicesClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthCheckServiceRequest, ...) (*Operation, error)
- func (c *RegionHealthCheckServicesClient) List(ctx context.Context, req *computepb.ListRegionHealthCheckServicesRequest, ...) *HealthCheckServiceIterator
- func (c *RegionHealthCheckServicesClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthCheckServiceRequest, ...) (*Operation, error)
- func (c *RegionHealthCheckServicesClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionHealthChecksCallOptions
- type RegionHealthChecksClient
- func (c *RegionHealthChecksClient) Close() error
- func (c *RegionHealthChecksClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionHealthChecksClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthCheckRequest, ...) (*Operation, error)
- func (c *RegionHealthChecksClient) Get(ctx context.Context, req *computepb.GetRegionHealthCheckRequest, ...) (*computepb.HealthCheck, error)
- func (c *RegionHealthChecksClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthCheckRequest, ...) (*Operation, error)
- func (c *RegionHealthChecksClient) List(ctx context.Context, req *computepb.ListRegionHealthChecksRequest, ...) *HealthCheckIterator
- func (c *RegionHealthChecksClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthCheckRequest, ...) (*Operation, error)
- func (c *RegionHealthChecksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionHealthCheckRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *RegionHealthChecksClient) Update(ctx context.Context, req *computepb.UpdateRegionHealthCheckRequest, ...) (*Operation, error)
- type RegionHealthSourcesCallOptions
- type RegionHealthSourcesClient
- func (c *RegionHealthSourcesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRegionHealthSourcesRequest, ...) *HealthSourcesScopedListPairIterator
- func (c *RegionHealthSourcesClient) Close() error
- func (c *RegionHealthSourcesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionHealthSourcesClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthSourceRequest, ...) (*Operation, error)
- func (c *RegionHealthSourcesClient) Get(ctx context.Context, req *computepb.GetRegionHealthSourceRequest, ...) (*computepb.HealthSource, error)
- func (c *RegionHealthSourcesClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthSourceRequest, ...) (*Operation, error)
- func (c *RegionHealthSourcesClient) List(ctx context.Context, req *computepb.ListRegionHealthSourcesRequest, ...) *HealthSourceIterator
- func (c *RegionHealthSourcesClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthSourceRequest, ...) (*Operation, error)
- func (c *RegionHealthSourcesClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionInstanceGroupManagerResizeRequestsCallOptions
- type RegionInstanceGroupManagerResizeRequestsClient
- func (c *RegionInstanceGroupManagerResizeRequestsClient) Cancel(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagerResizeRequestsClient) Close() error
- func (c *RegionInstanceGroupManagerResizeRequestsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionInstanceGroupManagerResizeRequestsClient) Delete(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagerResizeRequestsClient) Get(ctx context.Context, ...) (*computepb.InstanceGroupManagerResizeRequest, error)
- func (c *RegionInstanceGroupManagerResizeRequestsClient) Insert(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagerResizeRequestsClient) List(ctx context.Context, ...) *InstanceGroupManagerResizeRequestIterator
- type RegionInstanceGroupManagersCallOptions
- type RegionInstanceGroupManagersClient
- func (c *RegionInstanceGroupManagersClient) AbandonInstances(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) AdoptInstances(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) ApplyUpdatesToInstances(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) Close() error
- func (c *RegionInstanceGroupManagersClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionInstanceGroupManagersClient) CreateInstances(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) Delete(ctx context.Context, req *computepb.DeleteRegionInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) DeleteInstances(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) DeletePerInstanceConfigs(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) Get(ctx context.Context, req *computepb.GetRegionInstanceGroupManagerRequest, ...) (*computepb.InstanceGroupManager, error)
- func (c *RegionInstanceGroupManagersClient) Insert(ctx context.Context, req *computepb.InsertRegionInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) List(ctx context.Context, req *computepb.ListRegionInstanceGroupManagersRequest, ...) *InstanceGroupManagerIterator
- func (c *RegionInstanceGroupManagersClient) ListErrors(ctx context.Context, ...) *InstanceManagedByIgmErrorIterator
- func (c *RegionInstanceGroupManagersClient) ListManagedInstances(ctx context.Context, ...) *ManagedInstanceIterator
- func (c *RegionInstanceGroupManagersClient) ListPerInstanceConfigs(ctx context.Context, ...) *PerInstanceConfigIterator
- func (c *RegionInstanceGroupManagersClient) Patch(ctx context.Context, req *computepb.PatchRegionInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) PatchPerInstanceConfigs(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) RecreateInstances(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) Resize(ctx context.Context, req *computepb.ResizeRegionInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) ResizeAdvanced(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) ResumeInstances(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) SetAutoHealingPolicies(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) SetInstanceTemplate(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) SetTargetPools(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) StartInstances(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) StopInstances(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) SuspendInstances(ctx context.Context, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- func (c *RegionInstanceGroupManagersClient) Update(ctx context.Context, req *computepb.UpdateRegionInstanceGroupManagerRequest, ...) (*Operation, error)
- func (c *RegionInstanceGroupManagersClient) UpdatePerInstanceConfigs(ctx context.Context, ...) (*Operation, error)
- type RegionInstanceGroupsCallOptions
- type RegionInstanceGroupsClient
- func (c *RegionInstanceGroupsClient) Close() error
- func (c *RegionInstanceGroupsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionInstanceGroupsClient) Get(ctx context.Context, req *computepb.GetRegionInstanceGroupRequest, ...) (*computepb.InstanceGroup, error)
- func (c *RegionInstanceGroupsClient) List(ctx context.Context, req *computepb.ListRegionInstanceGroupsRequest, ...) *InstanceGroupIterator
- func (c *RegionInstanceGroupsClient) ListInstances(ctx context.Context, req *computepb.ListInstancesRegionInstanceGroupsRequest, ...) *InstanceWithNamedPortsIterator
- func (c *RegionInstanceGroupsClient) SetNamedPorts(ctx context.Context, req *computepb.SetNamedPortsRegionInstanceGroupRequest, ...) (*Operation, error)
- func (c *RegionInstanceGroupsClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionInstanceTemplatesCallOptions
- type RegionInstanceTemplatesClient
- func (c *RegionInstanceTemplatesClient) Close() error
- func (c *RegionInstanceTemplatesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionInstanceTemplatesClient) Delete(ctx context.Context, req *computepb.DeleteRegionInstanceTemplateRequest, ...) (*Operation, error)
- func (c *RegionInstanceTemplatesClient) Get(ctx context.Context, req *computepb.GetRegionInstanceTemplateRequest, ...) (*computepb.InstanceTemplate, error)
- func (c *RegionInstanceTemplatesClient) Insert(ctx context.Context, req *computepb.InsertRegionInstanceTemplateRequest, ...) (*Operation, error)
- func (c *RegionInstanceTemplatesClient) List(ctx context.Context, req *computepb.ListRegionInstanceTemplatesRequest, ...) *InstanceTemplateIterator
- type RegionInstancesCallOptions
- type RegionInstancesClient
- type RegionInstantSnapshotGroupsCallOptions
- type RegionInstantSnapshotGroupsClient
- func (c *RegionInstantSnapshotGroupsClient) Close() error
- func (c *RegionInstantSnapshotGroupsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionInstantSnapshotGroupsClient) Delete(ctx context.Context, req *computepb.DeleteRegionInstantSnapshotGroupRequest, ...) (*Operation, error)
- func (c *RegionInstantSnapshotGroupsClient) Get(ctx context.Context, req *computepb.GetRegionInstantSnapshotGroupRequest, ...) (*computepb.InstantSnapshotGroup, error)
- func (c *RegionInstantSnapshotGroupsClient) GetIamPolicy(ctx context.Context, ...) (*computepb.Policy, error)
- func (c *RegionInstantSnapshotGroupsClient) Insert(ctx context.Context, req *computepb.InsertRegionInstantSnapshotGroupRequest, ...) (*Operation, error)
- func (c *RegionInstantSnapshotGroupsClient) List(ctx context.Context, req *computepb.ListRegionInstantSnapshotGroupsRequest, ...) *InstantSnapshotGroupIterator
- func (c *RegionInstantSnapshotGroupsClient) SetIamPolicy(ctx context.Context, ...) (*computepb.Policy, error)
- func (c *RegionInstantSnapshotGroupsClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionInstantSnapshotsCallOptions
- type RegionInstantSnapshotsClient
- func (c *RegionInstantSnapshotsClient) Close() error
- func (c *RegionInstantSnapshotsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionInstantSnapshotsClient) Delete(ctx context.Context, req *computepb.DeleteRegionInstantSnapshotRequest, ...) (*Operation, error)
- func (c *RegionInstantSnapshotsClient) Get(ctx context.Context, req *computepb.GetRegionInstantSnapshotRequest, ...) (*computepb.InstantSnapshot, error)
- func (c *RegionInstantSnapshotsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionInstantSnapshotRequest, ...) (*computepb.Policy, error)
- func (c *RegionInstantSnapshotsClient) Insert(ctx context.Context, req *computepb.InsertRegionInstantSnapshotRequest, ...) (*Operation, error)
- func (c *RegionInstantSnapshotsClient) List(ctx context.Context, req *computepb.ListRegionInstantSnapshotsRequest, ...) *InstantSnapshotIterator
- func (c *RegionInstantSnapshotsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionInstantSnapshotRequest, ...) (*computepb.Policy, error)
- func (c *RegionInstantSnapshotsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsRegionInstantSnapshotRequest, ...) (*Operation, error)
- func (c *RegionInstantSnapshotsClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionIterator
- type RegionMultiMigMembersCallOptions
- type RegionMultiMigMembersClient
- func (c *RegionMultiMigMembersClient) Close() error
- func (c *RegionMultiMigMembersClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionMultiMigMembersClient) Get(ctx context.Context, req *computepb.GetRegionMultiMigMemberRequest, ...) (*computepb.MultiMigMember, error)
- func (c *RegionMultiMigMembersClient) List(ctx context.Context, req *computepb.ListRegionMultiMigMembersRequest, ...) *MultiMigMemberIterator
- type RegionMultiMigsCallOptions
- type RegionMultiMigsClient
- func (c *RegionMultiMigsClient) Close() error
- func (c *RegionMultiMigsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionMultiMigsClient) Delete(ctx context.Context, req *computepb.DeleteRegionMultiMigRequest, ...) (*Operation, error)
- func (c *RegionMultiMigsClient) Get(ctx context.Context, req *computepb.GetRegionMultiMigRequest, ...) (*computepb.MultiMig, error)
- func (c *RegionMultiMigsClient) Insert(ctx context.Context, req *computepb.InsertRegionMultiMigRequest, ...) (*Operation, error)
- func (c *RegionMultiMigsClient) List(ctx context.Context, req *computepb.ListRegionMultiMigsRequest, ...) *MultiMigIterator
- type RegionNetworkEndpointGroupsCallOptions
- type RegionNetworkEndpointGroupsClient
- func (c *RegionNetworkEndpointGroupsClient) AttachNetworkEndpoints(ctx context.Context, ...) (*Operation, error)
- func (c *RegionNetworkEndpointGroupsClient) Close() error
- func (c *RegionNetworkEndpointGroupsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionNetworkEndpointGroupsClient) Delete(ctx context.Context, req *computepb.DeleteRegionNetworkEndpointGroupRequest, ...) (*Operation, error)
- func (c *RegionNetworkEndpointGroupsClient) DetachNetworkEndpoints(ctx context.Context, ...) (*Operation, error)
- func (c *RegionNetworkEndpointGroupsClient) Get(ctx context.Context, req *computepb.GetRegionNetworkEndpointGroupRequest, ...) (*computepb.NetworkEndpointGroup, error)
- func (c *RegionNetworkEndpointGroupsClient) Insert(ctx context.Context, req *computepb.InsertRegionNetworkEndpointGroupRequest, ...) (*Operation, error)
- func (c *RegionNetworkEndpointGroupsClient) List(ctx context.Context, req *computepb.ListRegionNetworkEndpointGroupsRequest, ...) *NetworkEndpointGroupIterator
- func (c *RegionNetworkEndpointGroupsClient) ListNetworkEndpoints(ctx context.Context, ...) *NetworkEndpointWithHealthStatusIterator
- type RegionNetworkFirewallPoliciesCallOptions
- type RegionNetworkFirewallPoliciesClient
- func (c *RegionNetworkFirewallPoliciesClient) AddAssociation(ctx context.Context, ...) (*Operation, error)
- func (c *RegionNetworkFirewallPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleRegionNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *RegionNetworkFirewallPoliciesClient) CloneRules(ctx context.Context, ...) (*Operation, error)
- func (c *RegionNetworkFirewallPoliciesClient) Close() error
- func (c *RegionNetworkFirewallPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionNetworkFirewallPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *RegionNetworkFirewallPoliciesClient) Get(ctx context.Context, req *computepb.GetRegionNetworkFirewallPolicyRequest, ...) (*computepb.FirewallPolicy, error)
- func (c *RegionNetworkFirewallPoliciesClient) GetAssociation(ctx context.Context, ...) (*computepb.FirewallPolicyAssociation, error)
- func (c *RegionNetworkFirewallPoliciesClient) GetEffectiveFirewalls(ctx context.Context, ...) (*computepb.RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse, error)
- func (c *RegionNetworkFirewallPoliciesClient) GetIamPolicy(ctx context.Context, ...) (*computepb.Policy, error)
- func (c *RegionNetworkFirewallPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleRegionNetworkFirewallPolicyRequest, ...) (*computepb.FirewallPolicyRule, error)
- func (c *RegionNetworkFirewallPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *RegionNetworkFirewallPoliciesClient) List(ctx context.Context, req *computepb.ListRegionNetworkFirewallPoliciesRequest, ...) *FirewallPolicyIterator
- func (c *RegionNetworkFirewallPoliciesClient) Patch(ctx context.Context, req *computepb.PatchRegionNetworkFirewallPolicyRequest, ...) (*Operation, error)
- func (c *RegionNetworkFirewallPoliciesClient) PatchAssociation(ctx context.Context, ...) (*Operation, error)
- func (c *RegionNetworkFirewallPoliciesClient) PatchRule(ctx context.Context, ...) (*Operation, error)
- func (c *RegionNetworkFirewallPoliciesClient) RemoveAssociation(ctx context.Context, ...) (*Operation, error)
- func (c *RegionNetworkFirewallPoliciesClient) RemoveRule(ctx context.Context, ...) (*Operation, error)
- func (c *RegionNetworkFirewallPoliciesClient) SetIamPolicy(ctx context.Context, ...) (*computepb.Policy, error)
- func (c *RegionNetworkFirewallPoliciesClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionNetworkPoliciesCallOptions
- type RegionNetworkPoliciesClient
- func (c *RegionNetworkPoliciesClient) AddAssociation(ctx context.Context, req *computepb.AddAssociationRegionNetworkPolicyRequest, ...) (*Operation, error)
- func (c *RegionNetworkPoliciesClient) AddTrafficClassificationRule(ctx context.Context, ...) (*Operation, error)
- func (c *RegionNetworkPoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRegionNetworkPoliciesRequest, ...) *NetworkPoliciesScopedListPairIterator
- func (c *RegionNetworkPoliciesClient) Close() error
- func (c *RegionNetworkPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionNetworkPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionNetworkPolicyRequest, ...) (*Operation, error)
- func (c *RegionNetworkPoliciesClient) Get(ctx context.Context, req *computepb.GetRegionNetworkPolicyRequest, ...) (*computepb.NetworkPolicy, error)
- func (c *RegionNetworkPoliciesClient) GetAssociation(ctx context.Context, req *computepb.GetAssociationRegionNetworkPolicyRequest, ...) (*computepb.NetworkPolicyAssociation, error)
- func (c *RegionNetworkPoliciesClient) GetTrafficClassificationRule(ctx context.Context, ...) (*computepb.NetworkPolicyTrafficClassificationRule, error)
- func (c *RegionNetworkPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionNetworkPolicyRequest, ...) (*Operation, error)
- func (c *RegionNetworkPoliciesClient) List(ctx context.Context, req *computepb.ListRegionNetworkPoliciesRequest, ...) *NetworkPolicyIterator
- func (c *RegionNetworkPoliciesClient) Patch(ctx context.Context, req *computepb.PatchRegionNetworkPolicyRequest, ...) (*Operation, error)
- func (c *RegionNetworkPoliciesClient) PatchTrafficClassificationRule(ctx context.Context, ...) (*Operation, error)
- func (c *RegionNetworkPoliciesClient) RemoveAssociation(ctx context.Context, ...) (*Operation, error)
- func (c *RegionNetworkPoliciesClient) RemoveTrafficClassificationRule(ctx context.Context, ...) (*Operation, error)
- type RegionNotificationEndpointsCallOptions
- type RegionNotificationEndpointsClient
- func (c *RegionNotificationEndpointsClient) Close() error
- func (c *RegionNotificationEndpointsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionNotificationEndpointsClient) Delete(ctx context.Context, req *computepb.DeleteRegionNotificationEndpointRequest, ...) (*Operation, error)
- func (c *RegionNotificationEndpointsClient) Get(ctx context.Context, req *computepb.GetRegionNotificationEndpointRequest, ...) (*computepb.NotificationEndpoint, error)
- func (c *RegionNotificationEndpointsClient) Insert(ctx context.Context, req *computepb.InsertRegionNotificationEndpointRequest, ...) (*Operation, error)
- func (c *RegionNotificationEndpointsClient) List(ctx context.Context, req *computepb.ListRegionNotificationEndpointsRequest, ...) *NotificationEndpointIterator
- func (c *RegionNotificationEndpointsClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionOperationsCallOptions
- type RegionOperationsClient
- func (c *RegionOperationsClient) Close() error
- func (c *RegionOperationsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionOperationsClient) Delete(ctx context.Context, req *computepb.DeleteRegionOperationRequest, ...) (*computepb.DeleteRegionOperationResponse, error)
- func (c *RegionOperationsClient) Get(ctx context.Context, req *computepb.GetRegionOperationRequest, ...) (*computepb.Operation, error)
- func (c *RegionOperationsClient) List(ctx context.Context, req *computepb.ListRegionOperationsRequest, ...) *OperationIterator
- func (c *RegionOperationsClient) Wait(ctx context.Context, req *computepb.WaitRegionOperationRequest, ...) (*computepb.Operation, error)
- type RegionSecurityPoliciesCallOptions
- type RegionSecurityPoliciesClient
- func (c *RegionSecurityPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleRegionSecurityPolicyRequest, ...) (*Operation, error)
- func (c *RegionSecurityPoliciesClient) Close() error
- func (c *RegionSecurityPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionSecurityPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionSecurityPolicyRequest, ...) (*Operation, error)
- func (c *RegionSecurityPoliciesClient) Get(ctx context.Context, req *computepb.GetRegionSecurityPolicyRequest, ...) (*computepb.SecurityPolicy, error)
- func (c *RegionSecurityPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleRegionSecurityPolicyRequest, ...) (*computepb.SecurityPolicyRule, error)
- func (c *RegionSecurityPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionSecurityPolicyRequest, ...) (*Operation, error)
- func (c *RegionSecurityPoliciesClient) List(ctx context.Context, req *computepb.ListRegionSecurityPoliciesRequest, ...) *SecurityPolicyIterator
- func (c *RegionSecurityPoliciesClient) Patch(ctx context.Context, req *computepb.PatchRegionSecurityPolicyRequest, ...) (*Operation, error)
- func (c *RegionSecurityPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleRegionSecurityPolicyRequest, ...) (*Operation, error)
- func (c *RegionSecurityPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleRegionSecurityPolicyRequest, ...) (*Operation, error)
- func (c *RegionSecurityPoliciesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsRegionSecurityPolicyRequest, ...) (*Operation, error)
- type RegionSnapshotSettingsCallOptions
- type RegionSnapshotSettingsClient
- func (c *RegionSnapshotSettingsClient) Close() error
- func (c *RegionSnapshotSettingsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionSnapshotSettingsClient) Get(ctx context.Context, req *computepb.GetRegionSnapshotSettingRequest, ...) (*computepb.SnapshotSettings, error)
- func (c *RegionSnapshotSettingsClient) Patch(ctx context.Context, req *computepb.PatchRegionSnapshotSettingRequest, ...) (*Operation, error)
- type RegionSnapshotsCallOptions
- type RegionSnapshotsClient
- func (c *RegionSnapshotsClient) Close() error
- func (c *RegionSnapshotsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionSnapshotsClient) Delete(ctx context.Context, req *computepb.DeleteRegionSnapshotRequest, ...) (*Operation, error)
- func (c *RegionSnapshotsClient) Get(ctx context.Context, req *computepb.GetRegionSnapshotRequest, ...) (*computepb.Snapshot, error)
- func (c *RegionSnapshotsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionSnapshotRequest, ...) (*computepb.Policy, error)
- func (c *RegionSnapshotsClient) Insert(ctx context.Context, req *computepb.InsertRegionSnapshotRequest, ...) (*Operation, error)
- func (c *RegionSnapshotsClient) List(ctx context.Context, req *computepb.ListRegionSnapshotsRequest, ...) *SnapshotIterator
- func (c *RegionSnapshotsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionSnapshotRequest, ...) (*computepb.Policy, error)
- func (c *RegionSnapshotsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsRegionSnapshotRequest, ...) (*Operation, error)
- func (c *RegionSnapshotsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionSnapshotRequest, ...) (*computepb.TestPermissionsResponse, error)
- type RegionSslCertificatesCallOptions
- type RegionSslCertificatesClient
- func (c *RegionSslCertificatesClient) Close() error
- func (c *RegionSslCertificatesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionSslCertificatesClient) Delete(ctx context.Context, req *computepb.DeleteRegionSslCertificateRequest, ...) (*Operation, error)
- func (c *RegionSslCertificatesClient) Get(ctx context.Context, req *computepb.GetRegionSslCertificateRequest, ...) (*computepb.SslCertificate, error)
- func (c *RegionSslCertificatesClient) Insert(ctx context.Context, req *computepb.InsertRegionSslCertificateRequest, ...) (*Operation, error)
- func (c *RegionSslCertificatesClient) List(ctx context.Context, req *computepb.ListRegionSslCertificatesRequest, ...) *SslCertificateIterator
- func (c *RegionSslCertificatesClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionSslPoliciesCallOptions
- type RegionSslPoliciesClient
- func (c *RegionSslPoliciesClient) Close() error
- func (c *RegionSslPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionSslPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionSslPolicyRequest, ...) (*Operation, error)
- func (c *RegionSslPoliciesClient) Get(ctx context.Context, req *computepb.GetRegionSslPolicyRequest, ...) (*computepb.SslPolicy, error)
- func (c *RegionSslPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionSslPolicyRequest, ...) (*Operation, error)
- func (c *RegionSslPoliciesClient) List(ctx context.Context, req *computepb.ListRegionSslPoliciesRequest, ...) *SslPolicyIterator
- func (c *RegionSslPoliciesClient) ListAvailableFeatures(ctx context.Context, ...) (*computepb.SslPoliciesListAvailableFeaturesResponse, error)
- func (c *RegionSslPoliciesClient) Patch(ctx context.Context, req *computepb.PatchRegionSslPolicyRequest, ...) (*Operation, error)
- func (c *RegionSslPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionSslPolicyRequest, ...) (*computepb.TestPermissionsResponse, error)
- type RegionTargetHttpProxiesCallOptions
- type RegionTargetHttpProxiesClient
- func (c *RegionTargetHttpProxiesClient) Close() error
- func (c *RegionTargetHttpProxiesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionTargetHttpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetHttpProxyRequest, ...) (*Operation, error)
- func (c *RegionTargetHttpProxiesClient) Get(ctx context.Context, req *computepb.GetRegionTargetHttpProxyRequest, ...) (*computepb.TargetHttpProxy, error)
- func (c *RegionTargetHttpProxiesClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetHttpProxyRequest, ...) (*Operation, error)
- func (c *RegionTargetHttpProxiesClient) List(ctx context.Context, req *computepb.ListRegionTargetHttpProxiesRequest, ...) *TargetHttpProxyIterator
- func (c *RegionTargetHttpProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapRegionTargetHttpProxyRequest, ...) (*Operation, error)
- func (c *RegionTargetHttpProxiesClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionTargetHttpsProxiesCallOptions
- type RegionTargetHttpsProxiesClient
- func (c *RegionTargetHttpsProxiesClient) Close() error
- func (c *RegionTargetHttpsProxiesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionTargetHttpsProxiesClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *RegionTargetHttpsProxiesClient) Get(ctx context.Context, req *computepb.GetRegionTargetHttpsProxyRequest, ...) (*computepb.TargetHttpsProxy, error)
- func (c *RegionTargetHttpsProxiesClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *RegionTargetHttpsProxiesClient) List(ctx context.Context, req *computepb.ListRegionTargetHttpsProxiesRequest, ...) *TargetHttpsProxyIterator
- func (c *RegionTargetHttpsProxiesClient) Patch(ctx context.Context, req *computepb.PatchRegionTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *RegionTargetHttpsProxiesClient) SetSslCertificates(ctx context.Context, ...) (*Operation, error)
- func (c *RegionTargetHttpsProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapRegionTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *RegionTargetHttpsProxiesClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionTargetTcpProxiesCallOptions
- type RegionTargetTcpProxiesClient
- func (c *RegionTargetTcpProxiesClient) Close() error
- func (c *RegionTargetTcpProxiesClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionTargetTcpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetTcpProxyRequest, ...) (*Operation, error)
- func (c *RegionTargetTcpProxiesClient) Get(ctx context.Context, req *computepb.GetRegionTargetTcpProxyRequest, ...) (*computepb.TargetTcpProxy, error)
- func (c *RegionTargetTcpProxiesClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetTcpProxyRequest, ...) (*Operation, error)
- func (c *RegionTargetTcpProxiesClient) List(ctx context.Context, req *computepb.ListRegionTargetTcpProxiesRequest, ...) *TargetTcpProxyIterator
- func (c *RegionTargetTcpProxiesClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type RegionUrlMapsCallOptions
- type RegionUrlMapsClient
- func (c *RegionUrlMapsClient) Close() error
- func (c *RegionUrlMapsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionUrlMapsClient) Delete(ctx context.Context, req *computepb.DeleteRegionUrlMapRequest, ...) (*Operation, error)
- func (c *RegionUrlMapsClient) Get(ctx context.Context, req *computepb.GetRegionUrlMapRequest, ...) (*computepb.UrlMap, error)
- func (c *RegionUrlMapsClient) Insert(ctx context.Context, req *computepb.InsertRegionUrlMapRequest, ...) (*Operation, error)
- func (c *RegionUrlMapsClient) InvalidateCache(ctx context.Context, req *computepb.InvalidateCacheRegionUrlMapRequest, ...) (*Operation, error)
- func (c *RegionUrlMapsClient) List(ctx context.Context, req *computepb.ListRegionUrlMapsRequest, ...) *UrlMapIterator
- func (c *RegionUrlMapsClient) Patch(ctx context.Context, req *computepb.PatchRegionUrlMapRequest, ...) (*Operation, error)
- func (c *RegionUrlMapsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionUrlMapRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *RegionUrlMapsClient) Update(ctx context.Context, req *computepb.UpdateRegionUrlMapRequest, ...) (*Operation, error)
- func (c *RegionUrlMapsClient) Validate(ctx context.Context, req *computepb.ValidateRegionUrlMapRequest, ...) (*computepb.UrlMapsValidateResponse, error)
- type RegionZonesCallOptions
- type RegionZonesClient
- type RegionsCallOptions
- type RegionsClient
- func (c *RegionsClient) Close() error
- func (c *RegionsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionsClient) Get(ctx context.Context, req *computepb.GetRegionRequest, opts ...gax.CallOption) (*computepb.Region, error)
- func (c *RegionsClient) List(ctx context.Context, req *computepb.ListRegionsRequest, opts ...gax.CallOption) *RegionIterator
- type ReservationBlockIterator
- type ReservationBlocksCallOptions
- type ReservationBlocksClient
- func (c *ReservationBlocksClient) Close() error
- func (c *ReservationBlocksClient) Connection() *grpc.ClientConndeprecated
- func (c *ReservationBlocksClient) Get(ctx context.Context, req *computepb.GetReservationBlockRequest, ...) (*computepb.ReservationBlocksGetResponse, error)
- func (c *ReservationBlocksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyReservationBlockRequest, ...) (*computepb.Policy, error)
- func (c *ReservationBlocksClient) List(ctx context.Context, req *computepb.ListReservationBlocksRequest, ...) *ReservationBlockIterator
- func (c *ReservationBlocksClient) PerformMaintenance(ctx context.Context, req *computepb.PerformMaintenanceReservationBlockRequest, ...) (*Operation, error)
- func (c *ReservationBlocksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyReservationBlockRequest, ...) (*computepb.Policy, error)
- func (c *ReservationBlocksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsReservationBlockRequest, ...) (*computepb.TestPermissionsResponse, error)
- type ReservationIterator
- type ReservationSlotIterator
- type ReservationSlotsCallOptions
- type ReservationSlotsClient
- func (c *ReservationSlotsClient) Close() error
- func (c *ReservationSlotsClient) Connection() *grpc.ClientConndeprecated
- func (c *ReservationSlotsClient) Get(ctx context.Context, req *computepb.GetReservationSlotRequest, ...) (*computepb.ReservationSlotsGetResponse, error)
- func (c *ReservationSlotsClient) List(ctx context.Context, req *computepb.ListReservationSlotsRequest, ...) *ReservationSlotIterator
- func (c *ReservationSlotsClient) Update(ctx context.Context, req *computepb.UpdateReservationSlotRequest, ...) (*Operation, error)
- type ReservationSubBlockIterator
- type ReservationSubBlocksCallOptions
- type ReservationSubBlocksClient
- func (c *ReservationSubBlocksClient) Close() error
- func (c *ReservationSubBlocksClient) Connection() *grpc.ClientConndeprecated
- func (c *ReservationSubBlocksClient) Get(ctx context.Context, req *computepb.GetReservationSubBlockRequest, ...) (*computepb.ReservationSubBlocksGetResponse, error)
- func (c *ReservationSubBlocksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyReservationSubBlockRequest, ...) (*computepb.Policy, error)
- func (c *ReservationSubBlocksClient) List(ctx context.Context, req *computepb.ListReservationSubBlocksRequest, ...) *ReservationSubBlockIterator
- func (c *ReservationSubBlocksClient) PerformMaintenance(ctx context.Context, ...) (*Operation, error)
- func (c *ReservationSubBlocksClient) ReportFaulty(ctx context.Context, req *computepb.ReportFaultyReservationSubBlockRequest, ...) (*Operation, error)
- func (c *ReservationSubBlocksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyReservationSubBlockRequest, ...) (*computepb.Policy, error)
- func (c *ReservationSubBlocksClient) TestIamPermissions(ctx context.Context, ...) (*computepb.TestPermissionsResponse, error)
- type ReservationsCallOptions
- type ReservationsClient
- func (c *ReservationsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListReservationsRequest, ...) *ReservationsScopedListPairIterator
- func (c *ReservationsClient) Close() error
- func (c *ReservationsClient) Connection() *grpc.ClientConndeprecated
- func (c *ReservationsClient) Delete(ctx context.Context, req *computepb.DeleteReservationRequest, ...) (*Operation, error)
- func (c *ReservationsClient) Get(ctx context.Context, req *computepb.GetReservationRequest, ...) (*computepb.Reservation, error)
- func (c *ReservationsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyReservationRequest, ...) (*computepb.Policy, error)
- func (c *ReservationsClient) Insert(ctx context.Context, req *computepb.InsertReservationRequest, ...) (*Operation, error)
- func (c *ReservationsClient) List(ctx context.Context, req *computepb.ListReservationsRequest, ...) *ReservationIterator
- func (c *ReservationsClient) PerformMaintenance(ctx context.Context, req *computepb.PerformMaintenanceReservationRequest, ...) (*Operation, error)
- func (c *ReservationsClient) Resize(ctx context.Context, req *computepb.ResizeReservationRequest, ...) (*Operation, error)
- func (c *ReservationsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyReservationRequest, ...) (*computepb.Policy, error)
- func (c *ReservationsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsReservationRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *ReservationsClient) Update(ctx context.Context, req *computepb.UpdateReservationRequest, ...) (*Operation, error)
- type ReservationsScopedListPair
- type ReservationsScopedListPairIterator
- type ResourcePoliciesCallOptions
- type ResourcePoliciesClient
- func (c *ResourcePoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListResourcePoliciesRequest, ...) *ResourcePoliciesScopedListPairIterator
- func (c *ResourcePoliciesClient) Close() error
- func (c *ResourcePoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *ResourcePoliciesClient) Delete(ctx context.Context, req *computepb.DeleteResourcePolicyRequest, ...) (*Operation, error)
- func (c *ResourcePoliciesClient) Get(ctx context.Context, req *computepb.GetResourcePolicyRequest, ...) (*computepb.ResourcePolicy, error)
- func (c *ResourcePoliciesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyResourcePolicyRequest, ...) (*computepb.Policy, error)
- func (c *ResourcePoliciesClient) Insert(ctx context.Context, req *computepb.InsertResourcePolicyRequest, ...) (*Operation, error)
- func (c *ResourcePoliciesClient) List(ctx context.Context, req *computepb.ListResourcePoliciesRequest, ...) *ResourcePolicyIterator
- func (c *ResourcePoliciesClient) Patch(ctx context.Context, req *computepb.PatchResourcePolicyRequest, ...) (*Operation, error)
- func (c *ResourcePoliciesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyResourcePolicyRequest, ...) (*computepb.Policy, error)
- func (c *ResourcePoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsResourcePolicyRequest, ...) (*computepb.TestPermissionsResponse, error)
- type ResourcePoliciesScopedListPair
- type ResourcePoliciesScopedListPairIterator
- type ResourcePolicyIterator
- type RolloutIterator
- type RolloutPlanIterator
- type RolloutPlansCallOptions
- type RolloutPlansClient
- func (c *RolloutPlansClient) Close() error
- func (c *RolloutPlansClient) Connection() *grpc.ClientConndeprecated
- func (c *RolloutPlansClient) Delete(ctx context.Context, req *computepb.DeleteRolloutPlanRequest, ...) (*Operation, error)
- func (c *RolloutPlansClient) Get(ctx context.Context, req *computepb.GetRolloutPlanRequest, ...) (*computepb.RolloutPlan, error)
- func (c *RolloutPlansClient) Insert(ctx context.Context, req *computepb.InsertRolloutPlanRequest, ...) (*Operation, error)
- func (c *RolloutPlansClient) List(ctx context.Context, req *computepb.ListRolloutPlansRequest, ...) *RolloutPlanIterator
- type RolloutsCallOptions
- type RolloutsClient
- func (c *RolloutsClient) Cancel(ctx context.Context, req *computepb.CancelRolloutRequest, ...) (*Operation, error)
- func (c *RolloutsClient) Close() error
- func (c *RolloutsClient) Connection() *grpc.ClientConndeprecated
- func (c *RolloutsClient) Delete(ctx context.Context, req *computepb.DeleteRolloutRequest, ...) (*Operation, error)
- func (c *RolloutsClient) Get(ctx context.Context, req *computepb.GetRolloutRequest, opts ...gax.CallOption) (*computepb.Rollout, error)
- func (c *RolloutsClient) List(ctx context.Context, req *computepb.ListRolloutsRequest, ...) *RolloutIterator
- type RouteIterator
- type RoutePolicyIterator
- type RouterIterator
- type RoutersCallOptions
- type RoutersClient
- func (c *RoutersClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRoutersRequest, ...) *RoutersScopedListPairIterator
- func (c *RoutersClient) Close() error
- func (c *RoutersClient) Connection() *grpc.ClientConndeprecated
- func (c *RoutersClient) Delete(ctx context.Context, req *computepb.DeleteRouterRequest, ...) (*Operation, error)
- func (c *RoutersClient) DeleteRoutePolicy(ctx context.Context, req *computepb.DeleteRoutePolicyRouterRequest, ...) (*Operation, error)
- func (c *RoutersClient) Get(ctx context.Context, req *computepb.GetRouterRequest, opts ...gax.CallOption) (*computepb.Router, error)
- func (c *RoutersClient) GetNatIpInfo(ctx context.Context, req *computepb.GetNatIpInfoRouterRequest, ...) (*computepb.NatIpInfoResponse, error)
- func (c *RoutersClient) GetNatMappingInfo(ctx context.Context, req *computepb.GetNatMappingInfoRoutersRequest, ...) *VmEndpointNatMappingsIterator
- func (c *RoutersClient) GetRoutePolicy(ctx context.Context, req *computepb.GetRoutePolicyRouterRequest, ...) (*computepb.RoutersGetRoutePolicyResponse, error)
- func (c *RoutersClient) GetRouterStatus(ctx context.Context, req *computepb.GetRouterStatusRouterRequest, ...) (*computepb.RouterStatusResponse, error)
- func (c *RoutersClient) Insert(ctx context.Context, req *computepb.InsertRouterRequest, ...) (*Operation, error)
- func (c *RoutersClient) List(ctx context.Context, req *computepb.ListRoutersRequest, opts ...gax.CallOption) *RouterIterator
- func (c *RoutersClient) ListBgpRoutes(ctx context.Context, req *computepb.ListBgpRoutesRoutersRequest, ...) *BgpRouteIterator
- func (c *RoutersClient) ListRoutePolicies(ctx context.Context, req *computepb.ListRoutePoliciesRoutersRequest, ...) *RoutePolicyIterator
- func (c *RoutersClient) Patch(ctx context.Context, req *computepb.PatchRouterRequest, opts ...gax.CallOption) (*Operation, error)
- func (c *RoutersClient) PatchRoutePolicy(ctx context.Context, req *computepb.PatchRoutePolicyRouterRequest, ...) (*Operation, error)
- func (c *RoutersClient) Preview(ctx context.Context, req *computepb.PreviewRouterRequest, ...) (*computepb.RoutersPreviewResponse, error)
- func (c *RoutersClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRouterRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *RoutersClient) Update(ctx context.Context, req *computepb.UpdateRouterRequest, ...) (*Operation, error)
- func (c *RoutersClient) UpdateRoutePolicy(ctx context.Context, req *computepb.UpdateRoutePolicyRouterRequest, ...) (*Operation, error)
- type RoutersScopedListPair
- type RoutersScopedListPairIterator
- type RoutesCallOptions
- type RoutesClient
- func (c *RoutesClient) Close() error
- func (c *RoutesClient) Connection() *grpc.ClientConndeprecated
- func (c *RoutesClient) Delete(ctx context.Context, req *computepb.DeleteRouteRequest, opts ...gax.CallOption) (*Operation, error)
- func (c *RoutesClient) Get(ctx context.Context, req *computepb.GetRouteRequest, opts ...gax.CallOption) (*computepb.Route, error)
- func (c *RoutesClient) Insert(ctx context.Context, req *computepb.InsertRouteRequest, opts ...gax.CallOption) (*Operation, error)
- func (c *RoutesClient) List(ctx context.Context, req *computepb.ListRoutesRequest, opts ...gax.CallOption) *RouteIterator
- func (c *RoutesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRouteRequest, ...) (*computepb.TestPermissionsResponse, error)
- type SecurityPoliciesCallOptions
- type SecurityPoliciesClient
- func (c *SecurityPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleSecurityPolicyRequest, ...) (*Operation, error)
- func (c *SecurityPoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSecurityPoliciesRequest, ...) *SecurityPoliciesScopedListPairIterator
- func (c *SecurityPoliciesClient) Close() error
- func (c *SecurityPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *SecurityPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteSecurityPolicyRequest, ...) (*Operation, error)
- func (c *SecurityPoliciesClient) Get(ctx context.Context, req *computepb.GetSecurityPolicyRequest, ...) (*computepb.SecurityPolicy, error)
- func (c *SecurityPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleSecurityPolicyRequest, ...) (*computepb.SecurityPolicyRule, error)
- func (c *SecurityPoliciesClient) Insert(ctx context.Context, req *computepb.InsertSecurityPolicyRequest, ...) (*Operation, error)
- func (c *SecurityPoliciesClient) List(ctx context.Context, req *computepb.ListSecurityPoliciesRequest, ...) *SecurityPolicyIterator
- func (c *SecurityPoliciesClient) ListPreconfiguredExpressionSets(ctx context.Context, ...) (*computepb.SecurityPoliciesListPreconfiguredExpressionSetsResponse, error)
- func (c *SecurityPoliciesClient) Patch(ctx context.Context, req *computepb.PatchSecurityPolicyRequest, ...) (*Operation, error)
- func (c *SecurityPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleSecurityPolicyRequest, ...) (*Operation, error)
- func (c *SecurityPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleSecurityPolicyRequest, ...) (*Operation, error)
- func (c *SecurityPoliciesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsSecurityPolicyRequest, ...) (*Operation, error)
- func (c *SecurityPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSecurityPolicyRequest, ...) (*computepb.TestPermissionsResponse, error)
- type SecurityPoliciesScopedListPair
- type SecurityPoliciesScopedListPairIterator
- type SecurityPolicyIterator
- type ServiceAttachmentIterator
- type ServiceAttachmentsCallOptions
- type ServiceAttachmentsClient
- func (c *ServiceAttachmentsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListServiceAttachmentsRequest, ...) *ServiceAttachmentsScopedListPairIterator
- func (c *ServiceAttachmentsClient) Close() error
- func (c *ServiceAttachmentsClient) Connection() *grpc.ClientConndeprecated
- func (c *ServiceAttachmentsClient) Delete(ctx context.Context, req *computepb.DeleteServiceAttachmentRequest, ...) (*Operation, error)
- func (c *ServiceAttachmentsClient) Get(ctx context.Context, req *computepb.GetServiceAttachmentRequest, ...) (*computepb.ServiceAttachment, error)
- func (c *ServiceAttachmentsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyServiceAttachmentRequest, ...) (*computepb.Policy, error)
- func (c *ServiceAttachmentsClient) Insert(ctx context.Context, req *computepb.InsertServiceAttachmentRequest, ...) (*Operation, error)
- func (c *ServiceAttachmentsClient) List(ctx context.Context, req *computepb.ListServiceAttachmentsRequest, ...) *ServiceAttachmentIterator
- func (c *ServiceAttachmentsClient) Patch(ctx context.Context, req *computepb.PatchServiceAttachmentRequest, ...) (*Operation, error)
- func (c *ServiceAttachmentsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyServiceAttachmentRequest, ...) (*computepb.Policy, error)
- func (c *ServiceAttachmentsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsServiceAttachmentRequest, ...) (*computepb.TestPermissionsResponse, error)
- type ServiceAttachmentsScopedListPair
- type ServiceAttachmentsScopedListPairIterator
- type SnapshotIterator
- type SnapshotSettingsCallOptions
- type SnapshotSettingsClient
- func (c *SnapshotSettingsClient) Close() error
- func (c *SnapshotSettingsClient) Connection() *grpc.ClientConndeprecated
- func (c *SnapshotSettingsClient) Get(ctx context.Context, req *computepb.GetSnapshotSettingRequest, ...) (*computepb.SnapshotSettings, error)
- func (c *SnapshotSettingsClient) Patch(ctx context.Context, req *computepb.PatchSnapshotSettingRequest, ...) (*Operation, error)
- type SnapshotsCallOptions
- type SnapshotsClient
- func (c *SnapshotsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSnapshotsRequest, ...) *SnapshotsScopedListPairIterator
- func (c *SnapshotsClient) Close() error
- func (c *SnapshotsClient) Connection() *grpc.ClientConndeprecated
- func (c *SnapshotsClient) Delete(ctx context.Context, req *computepb.DeleteSnapshotRequest, ...) (*Operation, error)
- func (c *SnapshotsClient) Get(ctx context.Context, req *computepb.GetSnapshotRequest, opts ...gax.CallOption) (*computepb.Snapshot, error)
- func (c *SnapshotsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicySnapshotRequest, ...) (*computepb.Policy, error)
- func (c *SnapshotsClient) Insert(ctx context.Context, req *computepb.InsertSnapshotRequest, ...) (*Operation, error)
- func (c *SnapshotsClient) List(ctx context.Context, req *computepb.ListSnapshotsRequest, ...) *SnapshotIterator
- func (c *SnapshotsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicySnapshotRequest, ...) (*computepb.Policy, error)
- func (c *SnapshotsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsSnapshotRequest, ...) (*Operation, error)
- func (c *SnapshotsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSnapshotRequest, ...) (*computepb.TestPermissionsResponse, error)
- type SnapshotsScopedListPair
- type SnapshotsScopedListPairIterator
- type SslCertificateIterator
- type SslCertificatesCallOptions
- type SslCertificatesClient
- func (c *SslCertificatesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSslCertificatesRequest, ...) *SslCertificatesScopedListPairIterator
- func (c *SslCertificatesClient) Close() error
- func (c *SslCertificatesClient) Connection() *grpc.ClientConndeprecated
- func (c *SslCertificatesClient) Delete(ctx context.Context, req *computepb.DeleteSslCertificateRequest, ...) (*Operation, error)
- func (c *SslCertificatesClient) Get(ctx context.Context, req *computepb.GetSslCertificateRequest, ...) (*computepb.SslCertificate, error)
- func (c *SslCertificatesClient) Insert(ctx context.Context, req *computepb.InsertSslCertificateRequest, ...) (*Operation, error)
- func (c *SslCertificatesClient) List(ctx context.Context, req *computepb.ListSslCertificatesRequest, ...) *SslCertificateIterator
- func (c *SslCertificatesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSslCertificateRequest, ...) (*computepb.TestPermissionsResponse, error)
- type SslCertificatesScopedListPair
- type SslCertificatesScopedListPairIterator
- type SslPoliciesCallOptions
- type SslPoliciesClient
- func (c *SslPoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSslPoliciesRequest, ...) *SslPoliciesScopedListPairIterator
- func (c *SslPoliciesClient) Close() error
- func (c *SslPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *SslPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteSslPolicyRequest, ...) (*Operation, error)
- func (c *SslPoliciesClient) Get(ctx context.Context, req *computepb.GetSslPolicyRequest, ...) (*computepb.SslPolicy, error)
- func (c *SslPoliciesClient) Insert(ctx context.Context, req *computepb.InsertSslPolicyRequest, ...) (*Operation, error)
- func (c *SslPoliciesClient) List(ctx context.Context, req *computepb.ListSslPoliciesRequest, ...) *SslPolicyIterator
- func (c *SslPoliciesClient) ListAvailableFeatures(ctx context.Context, req *computepb.ListAvailableFeaturesSslPoliciesRequest, ...) (*computepb.SslPoliciesListAvailableFeaturesResponse, error)
- func (c *SslPoliciesClient) Patch(ctx context.Context, req *computepb.PatchSslPolicyRequest, ...) (*Operation, error)
- func (c *SslPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSslPolicyRequest, ...) (*computepb.TestPermissionsResponse, error)
- type SslPoliciesScopedListPair
- type SslPoliciesScopedListPairIterator
- type SslPolicyIterator
- type StoragePoolDiskIterator
- type StoragePoolIterator
- type StoragePoolTypeIterator
- type StoragePoolTypesCallOptions
- type StoragePoolTypesClient
- func (c *StoragePoolTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListStoragePoolTypesRequest, ...) *StoragePoolTypesScopedListPairIterator
- func (c *StoragePoolTypesClient) Close() error
- func (c *StoragePoolTypesClient) Connection() *grpc.ClientConndeprecated
- func (c *StoragePoolTypesClient) Get(ctx context.Context, req *computepb.GetStoragePoolTypeRequest, ...) (*computepb.StoragePoolType, error)
- func (c *StoragePoolTypesClient) List(ctx context.Context, req *computepb.ListStoragePoolTypesRequest, ...) *StoragePoolTypeIterator
- type StoragePoolTypesScopedListPair
- type StoragePoolTypesScopedListPairIterator
- type StoragePoolsCallOptions
- type StoragePoolsClient
- func (c *StoragePoolsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListStoragePoolsRequest, ...) *StoragePoolsScopedListPairIterator
- func (c *StoragePoolsClient) Close() error
- func (c *StoragePoolsClient) Connection() *grpc.ClientConndeprecated
- func (c *StoragePoolsClient) Delete(ctx context.Context, req *computepb.DeleteStoragePoolRequest, ...) (*Operation, error)
- func (c *StoragePoolsClient) Get(ctx context.Context, req *computepb.GetStoragePoolRequest, ...) (*computepb.StoragePool, error)
- func (c *StoragePoolsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyStoragePoolRequest, ...) (*computepb.Policy, error)
- func (c *StoragePoolsClient) Insert(ctx context.Context, req *computepb.InsertStoragePoolRequest, ...) (*Operation, error)
- func (c *StoragePoolsClient) List(ctx context.Context, req *computepb.ListStoragePoolsRequest, ...) *StoragePoolIterator
- func (c *StoragePoolsClient) ListDisks(ctx context.Context, req *computepb.ListDisksStoragePoolsRequest, ...) *StoragePoolDiskIterator
- func (c *StoragePoolsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyStoragePoolRequest, ...) (*computepb.Policy, error)
- func (c *StoragePoolsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsStoragePoolRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *StoragePoolsClient) Update(ctx context.Context, req *computepb.UpdateStoragePoolRequest, ...) (*Operation, error)
- type StoragePoolsScopedListPair
- type StoragePoolsScopedListPairIterator
- type SubnetworkIterator
- type SubnetworksCallOptions
- type SubnetworksClient
- func (c *SubnetworksClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSubnetworksRequest, ...) *SubnetworksScopedListPairIterator
- func (c *SubnetworksClient) Close() error
- func (c *SubnetworksClient) Connection() *grpc.ClientConndeprecated
- func (c *SubnetworksClient) Delete(ctx context.Context, req *computepb.DeleteSubnetworkRequest, ...) (*Operation, error)
- func (c *SubnetworksClient) ExpandIpCidrRange(ctx context.Context, req *computepb.ExpandIpCidrRangeSubnetworkRequest, ...) (*Operation, error)
- func (c *SubnetworksClient) Get(ctx context.Context, req *computepb.GetSubnetworkRequest, ...) (*computepb.Subnetwork, error)
- func (c *SubnetworksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicySubnetworkRequest, ...) (*computepb.Policy, error)
- func (c *SubnetworksClient) Insert(ctx context.Context, req *computepb.InsertSubnetworkRequest, ...) (*Operation, error)
- func (c *SubnetworksClient) List(ctx context.Context, req *computepb.ListSubnetworksRequest, ...) *SubnetworkIterator
- func (c *SubnetworksClient) ListUsable(ctx context.Context, req *computepb.ListUsableSubnetworksRequest, ...) *UsableSubnetworkIterator
- func (c *SubnetworksClient) Patch(ctx context.Context, req *computepb.PatchSubnetworkRequest, ...) (*Operation, error)
- func (c *SubnetworksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicySubnetworkRequest, ...) (*computepb.Policy, error)
- func (c *SubnetworksClient) SetPrivateIpGoogleAccess(ctx context.Context, req *computepb.SetPrivateIpGoogleAccessSubnetworkRequest, ...) (*Operation, error)
- func (c *SubnetworksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSubnetworkRequest, ...) (*computepb.TestPermissionsResponse, error)
- type SubnetworksScopedListPair
- type SubnetworksScopedListPairIterator
- type TargetGrpcProxiesCallOptions
- type TargetGrpcProxiesClient
- func (c *TargetGrpcProxiesClient) Close() error
- func (c *TargetGrpcProxiesClient) Connection() *grpc.ClientConndeprecated
- func (c *TargetGrpcProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetGrpcProxyRequest, ...) (*Operation, error)
- func (c *TargetGrpcProxiesClient) Get(ctx context.Context, req *computepb.GetTargetGrpcProxyRequest, ...) (*computepb.TargetGrpcProxy, error)
- func (c *TargetGrpcProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetGrpcProxyRequest, ...) (*Operation, error)
- func (c *TargetGrpcProxiesClient) List(ctx context.Context, req *computepb.ListTargetGrpcProxiesRequest, ...) *TargetGrpcProxyIterator
- func (c *TargetGrpcProxiesClient) Patch(ctx context.Context, req *computepb.PatchTargetGrpcProxyRequest, ...) (*Operation, error)
- func (c *TargetGrpcProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetGrpcProxyRequest, ...) (*computepb.TestPermissionsResponse, error)
- type TargetGrpcProxyIterator
- type TargetHttpProxiesCallOptions
- type TargetHttpProxiesClient
- func (c *TargetHttpProxiesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetHttpProxiesRequest, ...) *TargetHttpProxiesScopedListPairIterator
- func (c *TargetHttpProxiesClient) Close() error
- func (c *TargetHttpProxiesClient) Connection() *grpc.ClientConndeprecated
- func (c *TargetHttpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetHttpProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpProxiesClient) Get(ctx context.Context, req *computepb.GetTargetHttpProxyRequest, ...) (*computepb.TargetHttpProxy, error)
- func (c *TargetHttpProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetHttpProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpProxiesClient) List(ctx context.Context, req *computepb.ListTargetHttpProxiesRequest, ...) *TargetHttpProxyIterator
- func (c *TargetHttpProxiesClient) Patch(ctx context.Context, req *computepb.PatchTargetHttpProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapTargetHttpProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetHttpProxyRequest, ...) (*computepb.TestPermissionsResponse, error)
- type TargetHttpProxiesScopedListPair
- type TargetHttpProxiesScopedListPairIterator
- type TargetHttpProxyIterator
- type TargetHttpsProxiesCallOptions
- type TargetHttpsProxiesClient
- func (c *TargetHttpsProxiesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetHttpsProxiesRequest, ...) *TargetHttpsProxiesScopedListPairIterator
- func (c *TargetHttpsProxiesClient) Close() error
- func (c *TargetHttpsProxiesClient) Connection() *grpc.ClientConndeprecated
- func (c *TargetHttpsProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpsProxiesClient) Get(ctx context.Context, req *computepb.GetTargetHttpsProxyRequest, ...) (*computepb.TargetHttpsProxy, error)
- func (c *TargetHttpsProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpsProxiesClient) List(ctx context.Context, req *computepb.ListTargetHttpsProxiesRequest, ...) *TargetHttpsProxyIterator
- func (c *TargetHttpsProxiesClient) Patch(ctx context.Context, req *computepb.PatchTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpsProxiesClient) SetCertificateMap(ctx context.Context, req *computepb.SetCertificateMapTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpsProxiesClient) SetQuicOverride(ctx context.Context, req *computepb.SetQuicOverrideTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpsProxiesClient) SetSslCertificates(ctx context.Context, req *computepb.SetSslCertificatesTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpsProxiesClient) SetSslPolicy(ctx context.Context, req *computepb.SetSslPolicyTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpsProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapTargetHttpsProxyRequest, ...) (*Operation, error)
- func (c *TargetHttpsProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetHttpsProxyRequest, ...) (*computepb.TestPermissionsResponse, error)
- type TargetHttpsProxiesScopedListPair
- type TargetHttpsProxiesScopedListPairIterator
- type TargetHttpsProxyIterator
- type TargetInstanceIterator
- type TargetInstancesCallOptions
- type TargetInstancesClient
- func (c *TargetInstancesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetInstancesRequest, ...) *TargetInstancesScopedListPairIterator
- func (c *TargetInstancesClient) Close() error
- func (c *TargetInstancesClient) Connection() *grpc.ClientConndeprecated
- func (c *TargetInstancesClient) Delete(ctx context.Context, req *computepb.DeleteTargetInstanceRequest, ...) (*Operation, error)
- func (c *TargetInstancesClient) Get(ctx context.Context, req *computepb.GetTargetInstanceRequest, ...) (*computepb.TargetInstance, error)
- func (c *TargetInstancesClient) Insert(ctx context.Context, req *computepb.InsertTargetInstanceRequest, ...) (*Operation, error)
- func (c *TargetInstancesClient) List(ctx context.Context, req *computepb.ListTargetInstancesRequest, ...) *TargetInstanceIterator
- func (c *TargetInstancesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyTargetInstanceRequest, ...) (*Operation, error)
- func (c *TargetInstancesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetInstanceRequest, ...) (*computepb.TestPermissionsResponse, error)
- type TargetInstancesScopedListPair
- type TargetInstancesScopedListPairIterator
- type TargetPoolIterator
- type TargetPoolsCallOptions
- type TargetPoolsClient
- func (c *TargetPoolsClient) AddHealthCheck(ctx context.Context, req *computepb.AddHealthCheckTargetPoolRequest, ...) (*Operation, error)
- func (c *TargetPoolsClient) AddInstance(ctx context.Context, req *computepb.AddInstanceTargetPoolRequest, ...) (*Operation, error)
- func (c *TargetPoolsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetPoolsRequest, ...) *TargetPoolsScopedListPairIterator
- func (c *TargetPoolsClient) Close() error
- func (c *TargetPoolsClient) Connection() *grpc.ClientConndeprecated
- func (c *TargetPoolsClient) Delete(ctx context.Context, req *computepb.DeleteTargetPoolRequest, ...) (*Operation, error)
- func (c *TargetPoolsClient) Get(ctx context.Context, req *computepb.GetTargetPoolRequest, ...) (*computepb.TargetPool, error)
- func (c *TargetPoolsClient) GetHealth(ctx context.Context, req *computepb.GetHealthTargetPoolRequest, ...) (*computepb.TargetPoolInstanceHealth, error)
- func (c *TargetPoolsClient) Insert(ctx context.Context, req *computepb.InsertTargetPoolRequest, ...) (*Operation, error)
- func (c *TargetPoolsClient) List(ctx context.Context, req *computepb.ListTargetPoolsRequest, ...) *TargetPoolIterator
- func (c *TargetPoolsClient) RemoveHealthCheck(ctx context.Context, req *computepb.RemoveHealthCheckTargetPoolRequest, ...) (*Operation, error)
- func (c *TargetPoolsClient) RemoveInstance(ctx context.Context, req *computepb.RemoveInstanceTargetPoolRequest, ...) (*Operation, error)
- func (c *TargetPoolsClient) SetBackup(ctx context.Context, req *computepb.SetBackupTargetPoolRequest, ...) (*Operation, error)
- func (c *TargetPoolsClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyTargetPoolRequest, ...) (*Operation, error)
- func (c *TargetPoolsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetPoolRequest, ...) (*computepb.TestPermissionsResponse, error)
- type TargetPoolsScopedListPair
- type TargetPoolsScopedListPairIterator
- type TargetSslProxiesCallOptions
- type TargetSslProxiesClient
- func (c *TargetSslProxiesClient) Close() error
- func (c *TargetSslProxiesClient) Connection() *grpc.ClientConndeprecated
- func (c *TargetSslProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetSslProxyRequest, ...) (*Operation, error)
- func (c *TargetSslProxiesClient) Get(ctx context.Context, req *computepb.GetTargetSslProxyRequest, ...) (*computepb.TargetSslProxy, error)
- func (c *TargetSslProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetSslProxyRequest, ...) (*Operation, error)
- func (c *TargetSslProxiesClient) List(ctx context.Context, req *computepb.ListTargetSslProxiesRequest, ...) *TargetSslProxyIterator
- func (c *TargetSslProxiesClient) SetBackendService(ctx context.Context, req *computepb.SetBackendServiceTargetSslProxyRequest, ...) (*Operation, error)
- func (c *TargetSslProxiesClient) SetCertificateMap(ctx context.Context, req *computepb.SetCertificateMapTargetSslProxyRequest, ...) (*Operation, error)
- func (c *TargetSslProxiesClient) SetProxyHeader(ctx context.Context, req *computepb.SetProxyHeaderTargetSslProxyRequest, ...) (*Operation, error)
- func (c *TargetSslProxiesClient) SetSslCertificates(ctx context.Context, req *computepb.SetSslCertificatesTargetSslProxyRequest, ...) (*Operation, error)
- func (c *TargetSslProxiesClient) SetSslPolicy(ctx context.Context, req *computepb.SetSslPolicyTargetSslProxyRequest, ...) (*Operation, error)
- func (c *TargetSslProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetSslProxyRequest, ...) (*computepb.TestPermissionsResponse, error)
- type TargetSslProxyIterator
- type TargetTcpProxiesCallOptions
- type TargetTcpProxiesClient
- func (c *TargetTcpProxiesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetTcpProxiesRequest, ...) *TargetTcpProxiesScopedListPairIterator
- func (c *TargetTcpProxiesClient) Close() error
- func (c *TargetTcpProxiesClient) Connection() *grpc.ClientConndeprecated
- func (c *TargetTcpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetTcpProxyRequest, ...) (*Operation, error)
- func (c *TargetTcpProxiesClient) Get(ctx context.Context, req *computepb.GetTargetTcpProxyRequest, ...) (*computepb.TargetTcpProxy, error)
- func (c *TargetTcpProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetTcpProxyRequest, ...) (*Operation, error)
- func (c *TargetTcpProxiesClient) List(ctx context.Context, req *computepb.ListTargetTcpProxiesRequest, ...) *TargetTcpProxyIterator
- func (c *TargetTcpProxiesClient) SetBackendService(ctx context.Context, req *computepb.SetBackendServiceTargetTcpProxyRequest, ...) (*Operation, error)
- func (c *TargetTcpProxiesClient) SetProxyHeader(ctx context.Context, req *computepb.SetProxyHeaderTargetTcpProxyRequest, ...) (*Operation, error)
- func (c *TargetTcpProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetTcpProxyRequest, ...) (*computepb.TestPermissionsResponse, error)
- type TargetTcpProxiesScopedListPair
- type TargetTcpProxiesScopedListPairIterator
- type TargetTcpProxyIterator
- type TargetVpnGatewayIterator
- type TargetVpnGatewaysCallOptions
- type TargetVpnGatewaysClient
- func (c *TargetVpnGatewaysClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetVpnGatewaysRequest, ...) *TargetVpnGatewaysScopedListPairIterator
- func (c *TargetVpnGatewaysClient) Close() error
- func (c *TargetVpnGatewaysClient) Connection() *grpc.ClientConndeprecated
- func (c *TargetVpnGatewaysClient) Delete(ctx context.Context, req *computepb.DeleteTargetVpnGatewayRequest, ...) (*Operation, error)
- func (c *TargetVpnGatewaysClient) Get(ctx context.Context, req *computepb.GetTargetVpnGatewayRequest, ...) (*computepb.TargetVpnGateway, error)
- func (c *TargetVpnGatewaysClient) Insert(ctx context.Context, req *computepb.InsertTargetVpnGatewayRequest, ...) (*Operation, error)
- func (c *TargetVpnGatewaysClient) List(ctx context.Context, req *computepb.ListTargetVpnGatewaysRequest, ...) *TargetVpnGatewayIterator
- func (c *TargetVpnGatewaysClient) SetLabels(ctx context.Context, req *computepb.SetLabelsTargetVpnGatewayRequest, ...) (*Operation, error)
- func (c *TargetVpnGatewaysClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetVpnGatewayRequest, ...) (*computepb.TestPermissionsResponse, error)
- type TargetVpnGatewaysScopedListPair
- type TargetVpnGatewaysScopedListPairIterator
- type UrlMapIterator
- type UrlMapsCallOptions
- type UrlMapsClient
- func (c *UrlMapsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListUrlMapsRequest, ...) *UrlMapsScopedListPairIterator
- func (c *UrlMapsClient) Close() error
- func (c *UrlMapsClient) Connection() *grpc.ClientConndeprecated
- func (c *UrlMapsClient) Delete(ctx context.Context, req *computepb.DeleteUrlMapRequest, ...) (*Operation, error)
- func (c *UrlMapsClient) Get(ctx context.Context, req *computepb.GetUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMap, error)
- func (c *UrlMapsClient) Insert(ctx context.Context, req *computepb.InsertUrlMapRequest, ...) (*Operation, error)
- func (c *UrlMapsClient) InvalidateCache(ctx context.Context, req *computepb.InvalidateCacheUrlMapRequest, ...) (*Operation, error)
- func (c *UrlMapsClient) List(ctx context.Context, req *computepb.ListUrlMapsRequest, opts ...gax.CallOption) *UrlMapIterator
- func (c *UrlMapsClient) Patch(ctx context.Context, req *computepb.PatchUrlMapRequest, opts ...gax.CallOption) (*Operation, error)
- func (c *UrlMapsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsUrlMapRequest, ...) (*computepb.TestPermissionsResponse, error)
- func (c *UrlMapsClient) Update(ctx context.Context, req *computepb.UpdateUrlMapRequest, ...) (*Operation, error)
- func (c *UrlMapsClient) Validate(ctx context.Context, req *computepb.ValidateUrlMapRequest, ...) (*computepb.UrlMapsValidateResponse, error)
- type UrlMapsScopedListPair
- type UrlMapsScopedListPairIterator
- type UsableSubnetworkIterator
- type VmEndpointNatMappingsIterator
- type VmExtensionPoliciesScopedListPair
- type VmExtensionPoliciesScopedListPairIterator
- type VmExtensionPolicyIterator
- type VpnGatewayIterator
- type VpnGatewaysCallOptions
- type VpnGatewaysClient
- func (c *VpnGatewaysClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListVpnGatewaysRequest, ...) *VpnGatewaysScopedListPairIterator
- func (c *VpnGatewaysClient) Close() error
- func (c *VpnGatewaysClient) Connection() *grpc.ClientConndeprecated
- func (c *VpnGatewaysClient) Delete(ctx context.Context, req *computepb.DeleteVpnGatewayRequest, ...) (*Operation, error)
- func (c *VpnGatewaysClient) Get(ctx context.Context, req *computepb.GetVpnGatewayRequest, ...) (*computepb.VpnGateway, error)
- func (c *VpnGatewaysClient) GetStatus(ctx context.Context, req *computepb.GetStatusVpnGatewayRequest, ...) (*computepb.VpnGatewaysGetStatusResponse, error)
- func (c *VpnGatewaysClient) Insert(ctx context.Context, req *computepb.InsertVpnGatewayRequest, ...) (*Operation, error)
- func (c *VpnGatewaysClient) List(ctx context.Context, req *computepb.ListVpnGatewaysRequest, ...) *VpnGatewayIterator
- func (c *VpnGatewaysClient) SetLabels(ctx context.Context, req *computepb.SetLabelsVpnGatewayRequest, ...) (*Operation, error)
- func (c *VpnGatewaysClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsVpnGatewayRequest, ...) (*computepb.TestPermissionsResponse, error)
- type VpnGatewaysScopedListPair
- type VpnGatewaysScopedListPairIterator
- type VpnTunnelIterator
- type VpnTunnelsCallOptions
- type VpnTunnelsClient
- func (c *VpnTunnelsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListVpnTunnelsRequest, ...) *VpnTunnelsScopedListPairIterator
- func (c *VpnTunnelsClient) Close() error
- func (c *VpnTunnelsClient) Connection() *grpc.ClientConndeprecated
- func (c *VpnTunnelsClient) Delete(ctx context.Context, req *computepb.DeleteVpnTunnelRequest, ...) (*Operation, error)
- func (c *VpnTunnelsClient) Get(ctx context.Context, req *computepb.GetVpnTunnelRequest, ...) (*computepb.VpnTunnel, error)
- func (c *VpnTunnelsClient) Insert(ctx context.Context, req *computepb.InsertVpnTunnelRequest, ...) (*Operation, error)
- func (c *VpnTunnelsClient) List(ctx context.Context, req *computepb.ListVpnTunnelsRequest, ...) *VpnTunnelIterator
- func (c *VpnTunnelsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsVpnTunnelRequest, ...) (*Operation, error)
- func (c *VpnTunnelsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsVpnTunnelRequest, ...) (*computepb.TestPermissionsResponse, error)
- type VpnTunnelsScopedListPair
- type VpnTunnelsScopedListPairIterator
- type WireGroupIterator
- type WireGroupsCallOptions
- type WireGroupsClient
- func (c *WireGroupsClient) Close() error
- func (c *WireGroupsClient) Connection() *grpc.ClientConndeprecated
- func (c *WireGroupsClient) Delete(ctx context.Context, req *computepb.DeleteWireGroupRequest, ...) (*Operation, error)
- func (c *WireGroupsClient) Get(ctx context.Context, req *computepb.GetWireGroupRequest, ...) (*computepb.WireGroup, error)
- func (c *WireGroupsClient) Insert(ctx context.Context, req *computepb.InsertWireGroupRequest, ...) (*Operation, error)
- func (c *WireGroupsClient) List(ctx context.Context, req *computepb.ListWireGroupsRequest, ...) *WireGroupIterator
- func (c *WireGroupsClient) Patch(ctx context.Context, req *computepb.PatchWireGroupRequest, ...) (*Operation, error)
- type XpnResourceIdIterator
- type ZoneIterator
- type ZoneOperationsCallOptions
- type ZoneOperationsClient
- func (c *ZoneOperationsClient) Close() error
- func (c *ZoneOperationsClient) Connection() *grpc.ClientConndeprecated
- func (c *ZoneOperationsClient) Delete(ctx context.Context, req *computepb.DeleteZoneOperationRequest, ...) (*computepb.DeleteZoneOperationResponse, error)
- func (c *ZoneOperationsClient) Get(ctx context.Context, req *computepb.GetZoneOperationRequest, ...) (*computepb.Operation, error)
- func (c *ZoneOperationsClient) List(ctx context.Context, req *computepb.ListZoneOperationsRequest, ...) *OperationIterator
- func (c *ZoneOperationsClient) Wait(ctx context.Context, req *computepb.WaitZoneOperationRequest, ...) (*computepb.Operation, error)
- type ZoneVmExtensionPoliciesCallOptions
- type ZoneVmExtensionPoliciesClient
- func (c *ZoneVmExtensionPoliciesClient) Close() error
- func (c *ZoneVmExtensionPoliciesClient) Connection() *grpc.ClientConndeprecated
- func (c *ZoneVmExtensionPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteZoneVmExtensionPolicyRequest, ...) (*Operation, error)
- func (c *ZoneVmExtensionPoliciesClient) Get(ctx context.Context, req *computepb.GetZoneVmExtensionPolicyRequest, ...) (*computepb.VmExtensionPolicy, error)
- func (c *ZoneVmExtensionPoliciesClient) Insert(ctx context.Context, req *computepb.InsertZoneVmExtensionPolicyRequest, ...) (*Operation, error)
- func (c *ZoneVmExtensionPoliciesClient) List(ctx context.Context, req *computepb.ListZoneVmExtensionPoliciesRequest, ...) *VmExtensionPolicyIterator
- func (c *ZoneVmExtensionPoliciesClient) Update(ctx context.Context, req *computepb.UpdateZoneVmExtensionPolicyRequest, ...) (*Operation, error)
- type ZonesCallOptions
- type ZonesClient
- func (c *ZonesClient) Close() error
- func (c *ZonesClient) Connection() *grpc.ClientConndeprecated
- func (c *ZonesClient) Get(ctx context.Context, req *computepb.GetZoneRequest, opts ...gax.CallOption) (*computepb.Zone, error)
- func (c *ZonesClient) List(ctx context.Context, req *computepb.ListZonesRequest, opts ...gax.CallOption) *ZoneIterator
Examples ¶
- AcceleratorTypesClient.AggregatedList
- AcceleratorTypesClient.AggregatedList (All)
- AcceleratorTypesClient.Get
- AcceleratorTypesClient.List
- AcceleratorTypesClient.List (All)
- AddressesClient.AggregatedList
- AddressesClient.AggregatedList (All)
- AddressesClient.Delete
- AddressesClient.Get
- AddressesClient.Insert
- AddressesClient.List
- AddressesClient.List (All)
- AddressesClient.Move
- AddressesClient.SetLabels
- AddressesClient.TestIamPermissions
- AdviceClient.CalendarMode
- AutoscalersClient.AggregatedList
- AutoscalersClient.AggregatedList (All)
- AutoscalersClient.Delete
- AutoscalersClient.Get
- AutoscalersClient.Insert
- AutoscalersClient.List
- AutoscalersClient.List (All)
- AutoscalersClient.Patch
- AutoscalersClient.TestIamPermissions
- AutoscalersClient.Update
- BackendBucketsClient.AddSignedUrlKey
- BackendBucketsClient.AggregatedList
- BackendBucketsClient.AggregatedList (All)
- BackendBucketsClient.Delete
- BackendBucketsClient.DeleteSignedUrlKey
- BackendBucketsClient.Get
- BackendBucketsClient.GetIamPolicy
- BackendBucketsClient.Insert
- BackendBucketsClient.List
- BackendBucketsClient.List (All)
- BackendBucketsClient.ListUsable
- BackendBucketsClient.ListUsable (All)
- BackendBucketsClient.Patch
- BackendBucketsClient.SetEdgeSecurityPolicy
- BackendBucketsClient.SetIamPolicy
- BackendBucketsClient.TestIamPermissions
- BackendBucketsClient.Update
- BackendServicesClient.AddSignedUrlKey
- BackendServicesClient.AggregatedList
- BackendServicesClient.AggregatedList (All)
- BackendServicesClient.Delete
- BackendServicesClient.DeleteSignedUrlKey
- BackendServicesClient.Get
- BackendServicesClient.GetEffectiveSecurityPolicies
- BackendServicesClient.GetHealth
- BackendServicesClient.GetIamPolicy
- BackendServicesClient.Insert
- BackendServicesClient.List
- BackendServicesClient.List (All)
- BackendServicesClient.ListUsable
- BackendServicesClient.ListUsable (All)
- BackendServicesClient.Patch
- BackendServicesClient.SetEdgeSecurityPolicy
- BackendServicesClient.SetIamPolicy
- BackendServicesClient.SetSecurityPolicy
- BackendServicesClient.TestIamPermissions
- BackendServicesClient.Update
- CrossSiteNetworksClient.Delete
- CrossSiteNetworksClient.Get
- CrossSiteNetworksClient.Insert
- CrossSiteNetworksClient.List
- CrossSiteNetworksClient.List (All)
- CrossSiteNetworksClient.Patch
- DiskSettingsClient.Get
- DiskSettingsClient.Patch
- DiskTypesClient.AggregatedList
- DiskTypesClient.AggregatedList (All)
- DiskTypesClient.Get
- DiskTypesClient.List
- DiskTypesClient.List (All)
- DisksClient.AddResourcePolicies
- DisksClient.AggregatedList
- DisksClient.AggregatedList (All)
- DisksClient.BulkInsert
- DisksClient.BulkSetLabels
- DisksClient.CreateSnapshot
- DisksClient.Delete
- DisksClient.Get
- DisksClient.GetIamPolicy
- DisksClient.Insert
- DisksClient.List
- DisksClient.List (All)
- DisksClient.RemoveResourcePolicies
- DisksClient.Resize
- DisksClient.SetIamPolicy
- DisksClient.SetLabels
- DisksClient.StartAsyncReplication
- DisksClient.StopAsyncReplication
- DisksClient.StopGroupAsyncReplication
- DisksClient.TestIamPermissions
- DisksClient.Update
- ExternalVpnGatewaysClient.Delete
- ExternalVpnGatewaysClient.Get
- ExternalVpnGatewaysClient.Insert
- ExternalVpnGatewaysClient.List
- ExternalVpnGatewaysClient.List (All)
- ExternalVpnGatewaysClient.SetLabels
- ExternalVpnGatewaysClient.TestIamPermissions
- FirewallPoliciesClient.AddAssociation
- FirewallPoliciesClient.AddPacketMirroringRule
- FirewallPoliciesClient.AddRule
- FirewallPoliciesClient.CloneRules
- FirewallPoliciesClient.Delete
- FirewallPoliciesClient.Get
- FirewallPoliciesClient.GetAssociation
- FirewallPoliciesClient.GetIamPolicy
- FirewallPoliciesClient.GetPacketMirroringRule
- FirewallPoliciesClient.GetRule
- FirewallPoliciesClient.Insert
- FirewallPoliciesClient.List
- FirewallPoliciesClient.List (All)
- FirewallPoliciesClient.ListAssociations
- FirewallPoliciesClient.Move
- FirewallPoliciesClient.Patch
- FirewallPoliciesClient.PatchPacketMirroringRule
- FirewallPoliciesClient.PatchRule
- FirewallPoliciesClient.RemoveAssociation
- FirewallPoliciesClient.RemovePacketMirroringRule
- FirewallPoliciesClient.RemoveRule
- FirewallPoliciesClient.SetIamPolicy
- FirewallPoliciesClient.TestIamPermissions
- FirewallsClient.Delete
- FirewallsClient.Get
- FirewallsClient.Insert
- FirewallsClient.List
- FirewallsClient.List (All)
- FirewallsClient.Patch
- FirewallsClient.TestIamPermissions
- FirewallsClient.Update
- ForwardingRulesClient.AggregatedList
- ForwardingRulesClient.AggregatedList (All)
- ForwardingRulesClient.Delete
- ForwardingRulesClient.Get
- ForwardingRulesClient.Insert
- ForwardingRulesClient.List
- ForwardingRulesClient.List (All)
- ForwardingRulesClient.Patch
- ForwardingRulesClient.SetLabels
- ForwardingRulesClient.SetTarget
- ForwardingRulesClient.TestIamPermissions
- FutureReservationsClient.AggregatedList
- FutureReservationsClient.AggregatedList (All)
- FutureReservationsClient.Cancel
- FutureReservationsClient.Delete
- FutureReservationsClient.Get
- FutureReservationsClient.Insert
- FutureReservationsClient.List
- FutureReservationsClient.List (All)
- FutureReservationsClient.Update
- GlobalAddressesClient.Delete
- GlobalAddressesClient.Get
- GlobalAddressesClient.Insert
- GlobalAddressesClient.List
- GlobalAddressesClient.List (All)
- GlobalAddressesClient.Move
- GlobalAddressesClient.SetLabels
- GlobalAddressesClient.TestIamPermissions
- GlobalForwardingRulesClient.Delete
- GlobalForwardingRulesClient.Get
- GlobalForwardingRulesClient.Insert
- GlobalForwardingRulesClient.List
- GlobalForwardingRulesClient.List (All)
- GlobalForwardingRulesClient.Patch
- GlobalForwardingRulesClient.SetLabels
- GlobalForwardingRulesClient.SetTarget
- GlobalForwardingRulesClient.TestIamPermissions
- GlobalNetworkEndpointGroupsClient.AttachNetworkEndpoints
- GlobalNetworkEndpointGroupsClient.Delete
- GlobalNetworkEndpointGroupsClient.DetachNetworkEndpoints
- GlobalNetworkEndpointGroupsClient.Get
- GlobalNetworkEndpointGroupsClient.Insert
- GlobalNetworkEndpointGroupsClient.List
- GlobalNetworkEndpointGroupsClient.List (All)
- GlobalNetworkEndpointGroupsClient.ListNetworkEndpoints
- GlobalNetworkEndpointGroupsClient.ListNetworkEndpoints (All)
- GlobalOperationsClient.AggregatedList
- GlobalOperationsClient.AggregatedList (All)
- GlobalOperationsClient.Delete
- GlobalOperationsClient.Get
- GlobalOperationsClient.List
- GlobalOperationsClient.List (All)
- GlobalOperationsClient.Wait
- GlobalOrganizationOperationsClient.Delete
- GlobalOrganizationOperationsClient.Get
- GlobalOrganizationOperationsClient.List
- GlobalOrganizationOperationsClient.List (All)
- GlobalPublicDelegatedPrefixesClient.Delete
- GlobalPublicDelegatedPrefixesClient.Get
- GlobalPublicDelegatedPrefixesClient.Insert
- GlobalPublicDelegatedPrefixesClient.List
- GlobalPublicDelegatedPrefixesClient.List (All)
- GlobalPublicDelegatedPrefixesClient.Patch
- GlobalVmExtensionPoliciesClient.AggregatedList
- GlobalVmExtensionPoliciesClient.AggregatedList (All)
- GlobalVmExtensionPoliciesClient.Delete
- GlobalVmExtensionPoliciesClient.Get
- GlobalVmExtensionPoliciesClient.Insert
- GlobalVmExtensionPoliciesClient.List
- GlobalVmExtensionPoliciesClient.List (All)
- GlobalVmExtensionPoliciesClient.Update
- HealthChecksClient.AggregatedList
- HealthChecksClient.AggregatedList (All)
- HealthChecksClient.Delete
- HealthChecksClient.Get
- HealthChecksClient.Insert
- HealthChecksClient.List
- HealthChecksClient.List (All)
- HealthChecksClient.Patch
- HealthChecksClient.TestIamPermissions
- HealthChecksClient.Update
- ImageFamilyViewsClient.Get
- ImagesClient.Delete
- ImagesClient.Deprecate
- ImagesClient.Get
- ImagesClient.GetFromFamily
- ImagesClient.GetIamPolicy
- ImagesClient.Insert
- ImagesClient.List
- ImagesClient.List (All)
- ImagesClient.Patch
- ImagesClient.SetIamPolicy
- ImagesClient.SetLabels
- ImagesClient.TestIamPermissions
- InstanceGroupManagerResizeRequestsClient.Cancel
- InstanceGroupManagerResizeRequestsClient.Delete
- InstanceGroupManagerResizeRequestsClient.Get
- InstanceGroupManagerResizeRequestsClient.Insert
- InstanceGroupManagerResizeRequestsClient.List
- InstanceGroupManagerResizeRequestsClient.List (All)
- InstanceGroupManagersClient.AbandonInstances
- InstanceGroupManagersClient.AggregatedList
- InstanceGroupManagersClient.AggregatedList (All)
- InstanceGroupManagersClient.ApplyUpdatesToInstances
- InstanceGroupManagersClient.CreateInstances
- InstanceGroupManagersClient.Delete
- InstanceGroupManagersClient.DeleteInstances
- InstanceGroupManagersClient.DeletePerInstanceConfigs
- InstanceGroupManagersClient.Get
- InstanceGroupManagersClient.GetAvailableAcceleratorTopologies
- InstanceGroupManagersClient.Insert
- InstanceGroupManagersClient.List
- InstanceGroupManagersClient.List (All)
- InstanceGroupManagersClient.ListErrors
- InstanceGroupManagersClient.ListErrors (All)
- InstanceGroupManagersClient.ListManagedInstances
- InstanceGroupManagersClient.ListManagedInstances (All)
- InstanceGroupManagersClient.ListPerInstanceConfigs
- InstanceGroupManagersClient.ListPerInstanceConfigs (All)
- InstanceGroupManagersClient.Patch
- InstanceGroupManagersClient.PatchPerInstanceConfigs
- InstanceGroupManagersClient.RecreateInstances
- InstanceGroupManagersClient.Resize
- InstanceGroupManagersClient.ResizeAdvanced
- InstanceGroupManagersClient.ResumeInstances
- InstanceGroupManagersClient.SetAutoHealingPolicies
- InstanceGroupManagersClient.SetInstanceTemplate
- InstanceGroupManagersClient.SetTargetPools
- InstanceGroupManagersClient.StartInstances
- InstanceGroupManagersClient.StopInstances
- InstanceGroupManagersClient.SuspendInstances
- InstanceGroupManagersClient.TestIamPermissions
- InstanceGroupManagersClient.Update
- InstanceGroupManagersClient.UpdatePerInstanceConfigs
- InstanceGroupsClient.AddInstances
- InstanceGroupsClient.AggregatedList
- InstanceGroupsClient.AggregatedList (All)
- InstanceGroupsClient.Delete
- InstanceGroupsClient.Get
- InstanceGroupsClient.Insert
- InstanceGroupsClient.List
- InstanceGroupsClient.List (All)
- InstanceGroupsClient.ListInstances
- InstanceGroupsClient.ListInstances (All)
- InstanceGroupsClient.RemoveInstances
- InstanceGroupsClient.SetNamedPorts
- InstanceGroupsClient.TestIamPermissions
- InstanceSettingsClient.Get
- InstanceSettingsClient.Patch
- InstanceTemplatesClient.AggregatedList
- InstanceTemplatesClient.AggregatedList (All)
- InstanceTemplatesClient.Delete
- InstanceTemplatesClient.Get
- InstanceTemplatesClient.GetIamPolicy
- InstanceTemplatesClient.Insert
- InstanceTemplatesClient.List
- InstanceTemplatesClient.List (All)
- InstanceTemplatesClient.SetIamPolicy
- InstanceTemplatesClient.TestIamPermissions
- InstancesClient.AddAccessConfig
- InstancesClient.AddNetworkInterface
- InstancesClient.AddResourcePolicies
- InstancesClient.AggregatedList
- InstancesClient.AggregatedList (All)
- InstancesClient.AttachDisk
- InstancesClient.BulkInsert
- InstancesClient.Delete
- InstancesClient.DeleteAccessConfig
- InstancesClient.DeleteNetworkInterface
- InstancesClient.DetachDisk
- InstancesClient.Get
- InstancesClient.GetEffectiveFirewalls
- InstancesClient.GetGuestAttributes
- InstancesClient.GetIamPolicy
- InstancesClient.GetPartnerMetadata
- InstancesClient.GetScreenshot
- InstancesClient.GetSerialPortOutput
- InstancesClient.GetShieldedInstanceIdentity
- InstancesClient.GetShieldedVmIdentity
- InstancesClient.Insert
- InstancesClient.List
- InstancesClient.List (All)
- InstancesClient.ListReferrers
- InstancesClient.ListReferrers (All)
- InstancesClient.PatchPartnerMetadata
- InstancesClient.PerformMaintenance
- InstancesClient.RemoveResourcePolicies
- InstancesClient.ReportHostAsFaulty
- InstancesClient.Reset
- InstancesClient.Resume
- InstancesClient.SendDiagnosticInterrupt
- InstancesClient.SetDeletionProtection
- InstancesClient.SetDiskAutoDelete
- InstancesClient.SetIamPolicy
- InstancesClient.SetLabels
- InstancesClient.SetMachineResources
- InstancesClient.SetMachineType
- InstancesClient.SetMetadata
- InstancesClient.SetMinCpuPlatform
- InstancesClient.SetName
- InstancesClient.SetScheduling
- InstancesClient.SetSecurityPolicy
- InstancesClient.SetServiceAccount
- InstancesClient.SetShieldedInstanceIntegrityPolicy
- InstancesClient.SetShieldedVmIntegrityPolicy
- InstancesClient.SetTags
- InstancesClient.SimulateMaintenanceEvent
- InstancesClient.Start
- InstancesClient.StartWithEncryptionKey
- InstancesClient.Stop
- InstancesClient.Suspend
- InstancesClient.TestIamPermissions
- InstancesClient.Update
- InstancesClient.UpdateAccessConfig
- InstancesClient.UpdateDisplayDevice
- InstancesClient.UpdateNetworkInterface
- InstancesClient.UpdateShieldedInstanceConfig
- InstancesClient.UpdateShieldedVmConfig
- InstantSnapshotGroupsClient.Delete
- InstantSnapshotGroupsClient.Get
- InstantSnapshotGroupsClient.GetIamPolicy
- InstantSnapshotGroupsClient.Insert
- InstantSnapshotGroupsClient.List
- InstantSnapshotGroupsClient.List (All)
- InstantSnapshotGroupsClient.SetIamPolicy
- InstantSnapshotGroupsClient.TestIamPermissions
- InstantSnapshotsClient.AggregatedList
- InstantSnapshotsClient.AggregatedList (All)
- InstantSnapshotsClient.Delete
- InstantSnapshotsClient.Get
- InstantSnapshotsClient.GetIamPolicy
- InstantSnapshotsClient.Insert
- InstantSnapshotsClient.List
- InstantSnapshotsClient.List (All)
- InstantSnapshotsClient.SetIamPolicy
- InstantSnapshotsClient.SetLabels
- InstantSnapshotsClient.TestIamPermissions
- InterconnectAttachmentGroupsClient.Delete
- InterconnectAttachmentGroupsClient.Get
- InterconnectAttachmentGroupsClient.GetIamPolicy
- InterconnectAttachmentGroupsClient.GetOperationalStatus
- InterconnectAttachmentGroupsClient.Insert
- InterconnectAttachmentGroupsClient.List
- InterconnectAttachmentGroupsClient.List (All)
- InterconnectAttachmentGroupsClient.Patch
- InterconnectAttachmentGroupsClient.SetIamPolicy
- InterconnectAttachmentGroupsClient.TestIamPermissions
- InterconnectAttachmentsClient.AggregatedList
- InterconnectAttachmentsClient.AggregatedList (All)
- InterconnectAttachmentsClient.Delete
- InterconnectAttachmentsClient.Get
- InterconnectAttachmentsClient.Insert
- InterconnectAttachmentsClient.List
- InterconnectAttachmentsClient.List (All)
- InterconnectAttachmentsClient.Patch
- InterconnectAttachmentsClient.SetLabels
- InterconnectAttachmentsClient.TestIamPermissions
- InterconnectGroupsClient.CreateMembers
- InterconnectGroupsClient.Delete
- InterconnectGroupsClient.Get
- InterconnectGroupsClient.GetIamPolicy
- InterconnectGroupsClient.GetOperationalStatus
- InterconnectGroupsClient.Insert
- InterconnectGroupsClient.List
- InterconnectGroupsClient.List (All)
- InterconnectGroupsClient.Patch
- InterconnectGroupsClient.SetIamPolicy
- InterconnectGroupsClient.TestIamPermissions
- InterconnectLocationsClient.Get
- InterconnectLocationsClient.List
- InterconnectLocationsClient.List (All)
- InterconnectRemoteLocationsClient.Get
- InterconnectRemoteLocationsClient.List
- InterconnectRemoteLocationsClient.List (All)
- InterconnectsClient.Delete
- InterconnectsClient.Get
- InterconnectsClient.GetDiagnostics
- InterconnectsClient.GetMacsecConfig
- InterconnectsClient.Insert
- InterconnectsClient.List
- InterconnectsClient.List (All)
- InterconnectsClient.Patch
- InterconnectsClient.SetLabels
- InterconnectsClient.TestIamPermissions
- LicenseCodesClient.Get
- LicenseCodesClient.TestIamPermissions
- LicensesClient.Delete
- LicensesClient.Get
- LicensesClient.GetIamPolicy
- LicensesClient.Insert
- LicensesClient.List
- LicensesClient.List (All)
- LicensesClient.SetIamPolicy
- LicensesClient.TestIamPermissions
- LicensesClient.Update
- MachineImagesClient.Delete
- MachineImagesClient.Get
- MachineImagesClient.GetIamPolicy
- MachineImagesClient.Insert
- MachineImagesClient.List
- MachineImagesClient.List (All)
- MachineImagesClient.SetIamPolicy
- MachineImagesClient.SetLabels
- MachineImagesClient.TestIamPermissions
- MachineTypesClient.AggregatedList
- MachineTypesClient.AggregatedList (All)
- MachineTypesClient.Get
- MachineTypesClient.List
- MachineTypesClient.List (All)
- NetworkAttachmentsClient.AggregatedList
- NetworkAttachmentsClient.AggregatedList (All)
- NetworkAttachmentsClient.Delete
- NetworkAttachmentsClient.Get
- NetworkAttachmentsClient.GetIamPolicy
- NetworkAttachmentsClient.Insert
- NetworkAttachmentsClient.List
- NetworkAttachmentsClient.List (All)
- NetworkAttachmentsClient.Patch
- NetworkAttachmentsClient.SetIamPolicy
- NetworkAttachmentsClient.TestIamPermissions
- NetworkEdgeSecurityServicesClient.AggregatedList
- NetworkEdgeSecurityServicesClient.AggregatedList (All)
- NetworkEdgeSecurityServicesClient.Delete
- NetworkEdgeSecurityServicesClient.Get
- NetworkEdgeSecurityServicesClient.Insert
- NetworkEdgeSecurityServicesClient.Patch
- NetworkEndpointGroupsClient.AggregatedList
- NetworkEndpointGroupsClient.AggregatedList (All)
- NetworkEndpointGroupsClient.AttachNetworkEndpoints
- NetworkEndpointGroupsClient.Delete
- NetworkEndpointGroupsClient.DetachNetworkEndpoints
- NetworkEndpointGroupsClient.Get
- NetworkEndpointGroupsClient.Insert
- NetworkEndpointGroupsClient.List
- NetworkEndpointGroupsClient.List (All)
- NetworkEndpointGroupsClient.ListNetworkEndpoints
- NetworkEndpointGroupsClient.ListNetworkEndpoints (All)
- NetworkEndpointGroupsClient.TestIamPermissions
- NetworkFirewallPoliciesClient.AddAssociation
- NetworkFirewallPoliciesClient.AddPacketMirroringRule
- NetworkFirewallPoliciesClient.AddRule
- NetworkFirewallPoliciesClient.AggregatedList
- NetworkFirewallPoliciesClient.AggregatedList (All)
- NetworkFirewallPoliciesClient.CloneRules
- NetworkFirewallPoliciesClient.Delete
- NetworkFirewallPoliciesClient.Get
- NetworkFirewallPoliciesClient.GetAssociation
- NetworkFirewallPoliciesClient.GetIamPolicy
- NetworkFirewallPoliciesClient.GetPacketMirroringRule
- NetworkFirewallPoliciesClient.GetRule
- NetworkFirewallPoliciesClient.Insert
- NetworkFirewallPoliciesClient.List
- NetworkFirewallPoliciesClient.List (All)
- NetworkFirewallPoliciesClient.Patch
- NetworkFirewallPoliciesClient.PatchPacketMirroringRule
- NetworkFirewallPoliciesClient.PatchRule
- NetworkFirewallPoliciesClient.RemoveAssociation
- NetworkFirewallPoliciesClient.RemovePacketMirroringRule
- NetworkFirewallPoliciesClient.RemoveRule
- NetworkFirewallPoliciesClient.SetIamPolicy
- NetworkFirewallPoliciesClient.TestIamPermissions
- NetworkProfilesClient.Get
- NetworkProfilesClient.List
- NetworkProfilesClient.List (All)
- NetworksClient.AddPeering
- NetworksClient.CancelRequestRemovePeering
- NetworksClient.Delete
- NetworksClient.Get
- NetworksClient.GetEffectiveFirewalls
- NetworksClient.Insert
- NetworksClient.List
- NetworksClient.List (All)
- NetworksClient.ListPeeringRoutes
- NetworksClient.ListPeeringRoutes (All)
- NetworksClient.Patch
- NetworksClient.RemovePeering
- NetworksClient.RequestRemovePeering
- NetworksClient.SwitchToCustomMode
- NetworksClient.TestIamPermissions
- NetworksClient.UpdatePeering
- NewAcceleratorTypesRESTClient
- NewAddressesRESTClient
- NewAdviceRESTClient
- NewAutoscalersRESTClient
- NewBackendBucketsRESTClient
- NewBackendServicesRESTClient
- NewCrossSiteNetworksRESTClient
- NewDiskSettingsRESTClient
- NewDiskTypesRESTClient
- NewDisksRESTClient
- NewExternalVpnGatewaysRESTClient
- NewFirewallPoliciesRESTClient
- NewFirewallsRESTClient
- NewForwardingRulesRESTClient
- NewFutureReservationsRESTClient
- NewGlobalAddressesRESTClient
- NewGlobalForwardingRulesRESTClient
- NewGlobalNetworkEndpointGroupsRESTClient
- NewGlobalOperationsRESTClient
- NewGlobalOrganizationOperationsRESTClient
- NewGlobalPublicDelegatedPrefixesRESTClient
- NewGlobalVmExtensionPoliciesRESTClient
- NewHealthChecksRESTClient
- NewImageFamilyViewsRESTClient
- NewImagesRESTClient
- NewInstanceGroupManagerResizeRequestsRESTClient
- NewInstanceGroupManagersRESTClient
- NewInstanceGroupsRESTClient
- NewInstanceSettingsRESTClient
- NewInstanceTemplatesRESTClient
- NewInstancesRESTClient
- NewInstantSnapshotGroupsRESTClient
- NewInstantSnapshotsRESTClient
- NewInterconnectAttachmentGroupsRESTClient
- NewInterconnectAttachmentsRESTClient
- NewInterconnectGroupsRESTClient
- NewInterconnectLocationsRESTClient
- NewInterconnectRemoteLocationsRESTClient
- NewInterconnectsRESTClient
- NewLicenseCodesRESTClient
- NewLicensesRESTClient
- NewMachineImagesRESTClient
- NewMachineTypesRESTClient
- NewNetworkAttachmentsRESTClient
- NewNetworkEdgeSecurityServicesRESTClient
- NewNetworkEndpointGroupsRESTClient
- NewNetworkFirewallPoliciesRESTClient
- NewNetworkProfilesRESTClient
- NewNetworksRESTClient
- NewNodeGroupsRESTClient
- NewNodeTemplatesRESTClient
- NewNodeTypesRESTClient
- NewOrganizationSecurityPoliciesRESTClient
- NewPacketMirroringsRESTClient
- NewPreviewFeaturesRESTClient
- NewProjectsRESTClient
- NewPublicAdvertisedPrefixesRESTClient
- NewPublicDelegatedPrefixesRESTClient
- NewRegionAutoscalersRESTClient
- NewRegionBackendBucketsRESTClient
- NewRegionBackendServicesRESTClient
- NewRegionCommitmentsRESTClient
- NewRegionCompositeHealthChecksRESTClient
- NewRegionDiskSettingsRESTClient
- NewRegionDiskTypesRESTClient
- NewRegionDisksRESTClient
- NewRegionHealthAggregationPoliciesRESTClient
- NewRegionHealthCheckServicesRESTClient
- NewRegionHealthChecksRESTClient
- NewRegionHealthSourcesRESTClient
- NewRegionInstanceGroupManagerResizeRequestsRESTClient
- NewRegionInstanceGroupManagersRESTClient
- NewRegionInstanceGroupsRESTClient
- NewRegionInstanceTemplatesRESTClient
- NewRegionInstancesRESTClient
- NewRegionInstantSnapshotGroupsRESTClient
- NewRegionInstantSnapshotsRESTClient
- NewRegionMultiMigMembersRESTClient
- NewRegionMultiMigsRESTClient
- NewRegionNetworkEndpointGroupsRESTClient
- NewRegionNetworkFirewallPoliciesRESTClient
- NewRegionNetworkPoliciesRESTClient
- NewRegionNotificationEndpointsRESTClient
- NewRegionOperationsRESTClient
- NewRegionSecurityPoliciesRESTClient
- NewRegionSnapshotSettingsRESTClient
- NewRegionSnapshotsRESTClient
- NewRegionSslCertificatesRESTClient
- NewRegionSslPoliciesRESTClient
- NewRegionTargetHttpProxiesRESTClient
- NewRegionTargetHttpsProxiesRESTClient
- NewRegionTargetTcpProxiesRESTClient
- NewRegionUrlMapsRESTClient
- NewRegionZonesRESTClient
- NewRegionsRESTClient
- NewReservationBlocksRESTClient
- NewReservationSlotsRESTClient
- NewReservationSubBlocksRESTClient
- NewReservationsRESTClient
- NewResourcePoliciesRESTClient
- NewRolloutPlansRESTClient
- NewRolloutsRESTClient
- NewRoutersRESTClient
- NewRoutesRESTClient
- NewSecurityPoliciesRESTClient
- NewServiceAttachmentsRESTClient
- NewSnapshotSettingsRESTClient
- NewSnapshotsRESTClient
- NewSslCertificatesRESTClient
- NewSslPoliciesRESTClient
- NewStoragePoolTypesRESTClient
- NewStoragePoolsRESTClient
- NewSubnetworksRESTClient
- NewTargetGrpcProxiesRESTClient
- NewTargetHttpProxiesRESTClient
- NewTargetHttpsProxiesRESTClient
- NewTargetInstancesRESTClient
- NewTargetPoolsRESTClient
- NewTargetSslProxiesRESTClient
- NewTargetTcpProxiesRESTClient
- NewTargetVpnGatewaysRESTClient
- NewUrlMapsRESTClient
- NewVpnGatewaysRESTClient
- NewVpnTunnelsRESTClient
- NewWireGroupsRESTClient
- NewZoneOperationsRESTClient
- NewZoneVmExtensionPoliciesRESTClient
- NewZonesRESTClient
- NodeGroupsClient.AddNodes
- NodeGroupsClient.AggregatedList
- NodeGroupsClient.AggregatedList (All)
- NodeGroupsClient.Delete
- NodeGroupsClient.DeleteNodes
- NodeGroupsClient.Get
- NodeGroupsClient.GetIamPolicy
- NodeGroupsClient.Insert
- NodeGroupsClient.List
- NodeGroupsClient.List (All)
- NodeGroupsClient.ListNodes
- NodeGroupsClient.ListNodes (All)
- NodeGroupsClient.Patch
- NodeGroupsClient.PerformMaintenance
- NodeGroupsClient.SetIamPolicy
- NodeGroupsClient.SetNodeTemplate
- NodeGroupsClient.SimulateMaintenanceEvent
- NodeGroupsClient.TestIamPermissions
- NodeTemplatesClient.AggregatedList
- NodeTemplatesClient.AggregatedList (All)
- NodeTemplatesClient.Delete
- NodeTemplatesClient.Get
- NodeTemplatesClient.GetIamPolicy
- NodeTemplatesClient.Insert
- NodeTemplatesClient.List
- NodeTemplatesClient.List (All)
- NodeTemplatesClient.SetIamPolicy
- NodeTemplatesClient.TestIamPermissions
- NodeTypesClient.AggregatedList
- NodeTypesClient.AggregatedList (All)
- NodeTypesClient.Get
- NodeTypesClient.List
- NodeTypesClient.List (All)
- OrganizationSecurityPoliciesClient.AddAssociation
- OrganizationSecurityPoliciesClient.AddRule
- OrganizationSecurityPoliciesClient.CopyRules
- OrganizationSecurityPoliciesClient.Delete
- OrganizationSecurityPoliciesClient.Get
- OrganizationSecurityPoliciesClient.GetAssociation
- OrganizationSecurityPoliciesClient.GetRule
- OrganizationSecurityPoliciesClient.Insert
- OrganizationSecurityPoliciesClient.List
- OrganizationSecurityPoliciesClient.List (All)
- OrganizationSecurityPoliciesClient.ListAssociations
- OrganizationSecurityPoliciesClient.ListPreconfiguredExpressionSets
- OrganizationSecurityPoliciesClient.Move
- OrganizationSecurityPoliciesClient.Patch
- OrganizationSecurityPoliciesClient.PatchRule
- OrganizationSecurityPoliciesClient.RemoveAssociation
- OrganizationSecurityPoliciesClient.RemoveRule
- PacketMirroringsClient.AggregatedList
- PacketMirroringsClient.AggregatedList (All)
- PacketMirroringsClient.Delete
- PacketMirroringsClient.Get
- PacketMirroringsClient.Insert
- PacketMirroringsClient.List
- PacketMirroringsClient.List (All)
- PacketMirroringsClient.Patch
- PacketMirroringsClient.TestIamPermissions
- PreviewFeaturesClient.Get
- PreviewFeaturesClient.List
- PreviewFeaturesClient.List (All)
- PreviewFeaturesClient.Update
- ProjectsClient.DisableXpnHost
- ProjectsClient.DisableXpnResource
- ProjectsClient.EnableXpnHost
- ProjectsClient.EnableXpnResource
- ProjectsClient.Get
- ProjectsClient.GetXpnHost
- ProjectsClient.GetXpnResources
- ProjectsClient.GetXpnResources (All)
- ProjectsClient.ListXpnHosts
- ProjectsClient.ListXpnHosts (All)
- ProjectsClient.MoveDisk
- ProjectsClient.MoveInstance
- ProjectsClient.SetCloudArmorTier
- ProjectsClient.SetCommonInstanceMetadata
- ProjectsClient.SetDefaultNetworkTier
- ProjectsClient.SetManagedProtectionTier
- ProjectsClient.SetUsageExportBucket
- PublicAdvertisedPrefixesClient.Announce
- PublicAdvertisedPrefixesClient.Delete
- PublicAdvertisedPrefixesClient.Get
- PublicAdvertisedPrefixesClient.Insert
- PublicAdvertisedPrefixesClient.List
- PublicAdvertisedPrefixesClient.List (All)
- PublicAdvertisedPrefixesClient.Patch
- PublicAdvertisedPrefixesClient.Withdraw
- PublicDelegatedPrefixesClient.AggregatedList
- PublicDelegatedPrefixesClient.AggregatedList (All)
- PublicDelegatedPrefixesClient.Announce
- PublicDelegatedPrefixesClient.Delete
- PublicDelegatedPrefixesClient.Get
- PublicDelegatedPrefixesClient.Insert
- PublicDelegatedPrefixesClient.List
- PublicDelegatedPrefixesClient.List (All)
- PublicDelegatedPrefixesClient.Patch
- PublicDelegatedPrefixesClient.Withdraw
- RegionAutoscalersClient.Delete
- RegionAutoscalersClient.Get
- RegionAutoscalersClient.Insert
- RegionAutoscalersClient.List
- RegionAutoscalersClient.List (All)
- RegionAutoscalersClient.Patch
- RegionAutoscalersClient.TestIamPermissions
- RegionAutoscalersClient.Update
- RegionBackendBucketsClient.Delete
- RegionBackendBucketsClient.Get
- RegionBackendBucketsClient.GetIamPolicy
- RegionBackendBucketsClient.Insert
- RegionBackendBucketsClient.List
- RegionBackendBucketsClient.List (All)
- RegionBackendBucketsClient.ListUsable
- RegionBackendBucketsClient.ListUsable (All)
- RegionBackendBucketsClient.Patch
- RegionBackendBucketsClient.SetIamPolicy
- RegionBackendBucketsClient.TestIamPermissions
- RegionBackendServicesClient.Delete
- RegionBackendServicesClient.Get
- RegionBackendServicesClient.GetHealth
- RegionBackendServicesClient.GetIamPolicy
- RegionBackendServicesClient.Insert
- RegionBackendServicesClient.List
- RegionBackendServicesClient.List (All)
- RegionBackendServicesClient.ListUsable
- RegionBackendServicesClient.ListUsable (All)
- RegionBackendServicesClient.Patch
- RegionBackendServicesClient.SetIamPolicy
- RegionBackendServicesClient.SetSecurityPolicy
- RegionBackendServicesClient.TestIamPermissions
- RegionBackendServicesClient.Update
- RegionCommitmentsClient.AggregatedList
- RegionCommitmentsClient.AggregatedList (All)
- RegionCommitmentsClient.Get
- RegionCommitmentsClient.Insert
- RegionCommitmentsClient.List
- RegionCommitmentsClient.List (All)
- RegionCommitmentsClient.TestIamPermissions
- RegionCommitmentsClient.Update
- RegionCommitmentsClient.UpdateReservations
- RegionCompositeHealthChecksClient.AggregatedList
- RegionCompositeHealthChecksClient.AggregatedList (All)
- RegionCompositeHealthChecksClient.Delete
- RegionCompositeHealthChecksClient.Get
- RegionCompositeHealthChecksClient.Insert
- RegionCompositeHealthChecksClient.List
- RegionCompositeHealthChecksClient.List (All)
- RegionCompositeHealthChecksClient.Patch
- RegionCompositeHealthChecksClient.TestIamPermissions
- RegionDiskSettingsClient.Get
- RegionDiskSettingsClient.Patch
- RegionDiskTypesClient.Get
- RegionDiskTypesClient.List
- RegionDiskTypesClient.List (All)
- RegionDisksClient.AddResourcePolicies
- RegionDisksClient.BulkInsert
- RegionDisksClient.CreateSnapshot
- RegionDisksClient.Delete
- RegionDisksClient.Get
- RegionDisksClient.GetIamPolicy
- RegionDisksClient.Insert
- RegionDisksClient.List
- RegionDisksClient.List (All)
- RegionDisksClient.RemoveResourcePolicies
- RegionDisksClient.Resize
- RegionDisksClient.SetIamPolicy
- RegionDisksClient.SetLabels
- RegionDisksClient.StartAsyncReplication
- RegionDisksClient.StopAsyncReplication
- RegionDisksClient.StopGroupAsyncReplication
- RegionDisksClient.TestIamPermissions
- RegionDisksClient.Update
- RegionHealthAggregationPoliciesClient.AggregatedList
- RegionHealthAggregationPoliciesClient.AggregatedList (All)
- RegionHealthAggregationPoliciesClient.Delete
- RegionHealthAggregationPoliciesClient.Get
- RegionHealthAggregationPoliciesClient.Insert
- RegionHealthAggregationPoliciesClient.List
- RegionHealthAggregationPoliciesClient.List (All)
- RegionHealthAggregationPoliciesClient.Patch
- RegionHealthAggregationPoliciesClient.TestIamPermissions
- RegionHealthCheckServicesClient.Delete
- RegionHealthCheckServicesClient.Get
- RegionHealthCheckServicesClient.Insert
- RegionHealthCheckServicesClient.List
- RegionHealthCheckServicesClient.List (All)
- RegionHealthCheckServicesClient.Patch
- RegionHealthCheckServicesClient.TestIamPermissions
- RegionHealthChecksClient.Delete
- RegionHealthChecksClient.Get
- RegionHealthChecksClient.Insert
- RegionHealthChecksClient.List
- RegionHealthChecksClient.List (All)
- RegionHealthChecksClient.Patch
- RegionHealthChecksClient.TestIamPermissions
- RegionHealthChecksClient.Update
- RegionHealthSourcesClient.AggregatedList
- RegionHealthSourcesClient.AggregatedList (All)
- RegionHealthSourcesClient.Delete
- RegionHealthSourcesClient.Get
- RegionHealthSourcesClient.Insert
- RegionHealthSourcesClient.List
- RegionHealthSourcesClient.List (All)
- RegionHealthSourcesClient.Patch
- RegionHealthSourcesClient.TestIamPermissions
- RegionInstanceGroupManagerResizeRequestsClient.Cancel
- RegionInstanceGroupManagerResizeRequestsClient.Delete
- RegionInstanceGroupManagerResizeRequestsClient.Get
- RegionInstanceGroupManagerResizeRequestsClient.Insert
- RegionInstanceGroupManagerResizeRequestsClient.List
- RegionInstanceGroupManagerResizeRequestsClient.List (All)
- RegionInstanceGroupManagersClient.AbandonInstances
- RegionInstanceGroupManagersClient.AdoptInstances
- RegionInstanceGroupManagersClient.ApplyUpdatesToInstances
- RegionInstanceGroupManagersClient.CreateInstances
- RegionInstanceGroupManagersClient.Delete
- RegionInstanceGroupManagersClient.DeleteInstances
- RegionInstanceGroupManagersClient.DeletePerInstanceConfigs
- RegionInstanceGroupManagersClient.Get
- RegionInstanceGroupManagersClient.Insert
- RegionInstanceGroupManagersClient.List
- RegionInstanceGroupManagersClient.List (All)
- RegionInstanceGroupManagersClient.ListErrors
- RegionInstanceGroupManagersClient.ListErrors (All)
- RegionInstanceGroupManagersClient.ListManagedInstances
- RegionInstanceGroupManagersClient.ListManagedInstances (All)
- RegionInstanceGroupManagersClient.ListPerInstanceConfigs
- RegionInstanceGroupManagersClient.ListPerInstanceConfigs (All)
- RegionInstanceGroupManagersClient.Patch
- RegionInstanceGroupManagersClient.PatchPerInstanceConfigs
- RegionInstanceGroupManagersClient.RecreateInstances
- RegionInstanceGroupManagersClient.Resize
- RegionInstanceGroupManagersClient.ResizeAdvanced
- RegionInstanceGroupManagersClient.ResumeInstances
- RegionInstanceGroupManagersClient.SetAutoHealingPolicies
- RegionInstanceGroupManagersClient.SetInstanceTemplate
- RegionInstanceGroupManagersClient.SetTargetPools
- RegionInstanceGroupManagersClient.StartInstances
- RegionInstanceGroupManagersClient.StopInstances
- RegionInstanceGroupManagersClient.SuspendInstances
- RegionInstanceGroupManagersClient.TestIamPermissions
- RegionInstanceGroupManagersClient.Update
- RegionInstanceGroupManagersClient.UpdatePerInstanceConfigs
- RegionInstanceGroupsClient.Get
- RegionInstanceGroupsClient.List
- RegionInstanceGroupsClient.List (All)
- RegionInstanceGroupsClient.ListInstances
- RegionInstanceGroupsClient.ListInstances (All)
- RegionInstanceGroupsClient.SetNamedPorts
- RegionInstanceGroupsClient.TestIamPermissions
- RegionInstanceTemplatesClient.Delete
- RegionInstanceTemplatesClient.Get
- RegionInstanceTemplatesClient.Insert
- RegionInstanceTemplatesClient.List
- RegionInstanceTemplatesClient.List (All)
- RegionInstancesClient.BulkInsert
- RegionInstantSnapshotGroupsClient.Delete
- RegionInstantSnapshotGroupsClient.Get
- RegionInstantSnapshotGroupsClient.GetIamPolicy
- RegionInstantSnapshotGroupsClient.Insert
- RegionInstantSnapshotGroupsClient.List
- RegionInstantSnapshotGroupsClient.List (All)
- RegionInstantSnapshotGroupsClient.SetIamPolicy
- RegionInstantSnapshotGroupsClient.TestIamPermissions
- RegionInstantSnapshotsClient.Delete
- RegionInstantSnapshotsClient.Get
- RegionInstantSnapshotsClient.GetIamPolicy
- RegionInstantSnapshotsClient.Insert
- RegionInstantSnapshotsClient.List
- RegionInstantSnapshotsClient.List (All)
- RegionInstantSnapshotsClient.SetIamPolicy
- RegionInstantSnapshotsClient.SetLabels
- RegionInstantSnapshotsClient.TestIamPermissions
- RegionMultiMigMembersClient.Get
- RegionMultiMigMembersClient.List
- RegionMultiMigMembersClient.List (All)
- RegionMultiMigsClient.Delete
- RegionMultiMigsClient.Get
- RegionMultiMigsClient.Insert
- RegionMultiMigsClient.List
- RegionMultiMigsClient.List (All)
- RegionNetworkEndpointGroupsClient.AttachNetworkEndpoints
- RegionNetworkEndpointGroupsClient.Delete
- RegionNetworkEndpointGroupsClient.DetachNetworkEndpoints
- RegionNetworkEndpointGroupsClient.Get
- RegionNetworkEndpointGroupsClient.Insert
- RegionNetworkEndpointGroupsClient.List
- RegionNetworkEndpointGroupsClient.List (All)
- RegionNetworkEndpointGroupsClient.ListNetworkEndpoints
- RegionNetworkEndpointGroupsClient.ListNetworkEndpoints (All)
- RegionNetworkFirewallPoliciesClient.AddAssociation
- RegionNetworkFirewallPoliciesClient.AddRule
- RegionNetworkFirewallPoliciesClient.CloneRules
- RegionNetworkFirewallPoliciesClient.Delete
- RegionNetworkFirewallPoliciesClient.Get
- RegionNetworkFirewallPoliciesClient.GetAssociation
- RegionNetworkFirewallPoliciesClient.GetEffectiveFirewalls
- RegionNetworkFirewallPoliciesClient.GetIamPolicy
- RegionNetworkFirewallPoliciesClient.GetRule
- RegionNetworkFirewallPoliciesClient.Insert
- RegionNetworkFirewallPoliciesClient.List
- RegionNetworkFirewallPoliciesClient.List (All)
- RegionNetworkFirewallPoliciesClient.Patch
- RegionNetworkFirewallPoliciesClient.PatchAssociation
- RegionNetworkFirewallPoliciesClient.PatchRule
- RegionNetworkFirewallPoliciesClient.RemoveAssociation
- RegionNetworkFirewallPoliciesClient.RemoveRule
- RegionNetworkFirewallPoliciesClient.SetIamPolicy
- RegionNetworkFirewallPoliciesClient.TestIamPermissions
- RegionNetworkPoliciesClient.AddAssociation
- RegionNetworkPoliciesClient.AddTrafficClassificationRule
- RegionNetworkPoliciesClient.AggregatedList
- RegionNetworkPoliciesClient.AggregatedList (All)
- RegionNetworkPoliciesClient.Delete
- RegionNetworkPoliciesClient.Get
- RegionNetworkPoliciesClient.GetAssociation
- RegionNetworkPoliciesClient.GetTrafficClassificationRule
- RegionNetworkPoliciesClient.Insert
- RegionNetworkPoliciesClient.List
- RegionNetworkPoliciesClient.List (All)
- RegionNetworkPoliciesClient.Patch
- RegionNetworkPoliciesClient.PatchTrafficClassificationRule
- RegionNetworkPoliciesClient.RemoveAssociation
- RegionNetworkPoliciesClient.RemoveTrafficClassificationRule
- RegionNotificationEndpointsClient.Delete
- RegionNotificationEndpointsClient.Get
- RegionNotificationEndpointsClient.Insert
- RegionNotificationEndpointsClient.List
- RegionNotificationEndpointsClient.List (All)
- RegionNotificationEndpointsClient.TestIamPermissions
- RegionOperationsClient.Delete
- RegionOperationsClient.Get
- RegionOperationsClient.List
- RegionOperationsClient.List (All)
- RegionOperationsClient.Wait
- RegionSecurityPoliciesClient.AddRule
- RegionSecurityPoliciesClient.Delete
- RegionSecurityPoliciesClient.Get
- RegionSecurityPoliciesClient.GetRule
- RegionSecurityPoliciesClient.Insert
- RegionSecurityPoliciesClient.List
- RegionSecurityPoliciesClient.List (All)
- RegionSecurityPoliciesClient.Patch
- RegionSecurityPoliciesClient.PatchRule
- RegionSecurityPoliciesClient.RemoveRule
- RegionSecurityPoliciesClient.SetLabels
- RegionSnapshotSettingsClient.Get
- RegionSnapshotSettingsClient.Patch
- RegionSnapshotsClient.Delete
- RegionSnapshotsClient.Get
- RegionSnapshotsClient.GetIamPolicy
- RegionSnapshotsClient.Insert
- RegionSnapshotsClient.List
- RegionSnapshotsClient.List (All)
- RegionSnapshotsClient.SetIamPolicy
- RegionSnapshotsClient.SetLabels
- RegionSnapshotsClient.TestIamPermissions
- RegionSslCertificatesClient.Delete
- RegionSslCertificatesClient.Get
- RegionSslCertificatesClient.Insert
- RegionSslCertificatesClient.List
- RegionSslCertificatesClient.List (All)
- RegionSslCertificatesClient.TestIamPermissions
- RegionSslPoliciesClient.Delete
- RegionSslPoliciesClient.Get
- RegionSslPoliciesClient.Insert
- RegionSslPoliciesClient.List
- RegionSslPoliciesClient.List (All)
- RegionSslPoliciesClient.ListAvailableFeatures
- RegionSslPoliciesClient.Patch
- RegionSslPoliciesClient.TestIamPermissions
- RegionTargetHttpProxiesClient.Delete
- RegionTargetHttpProxiesClient.Get
- RegionTargetHttpProxiesClient.Insert
- RegionTargetHttpProxiesClient.List
- RegionTargetHttpProxiesClient.List (All)
- RegionTargetHttpProxiesClient.SetUrlMap
- RegionTargetHttpProxiesClient.TestIamPermissions
- RegionTargetHttpsProxiesClient.Delete
- RegionTargetHttpsProxiesClient.Get
- RegionTargetHttpsProxiesClient.Insert
- RegionTargetHttpsProxiesClient.List
- RegionTargetHttpsProxiesClient.List (All)
- RegionTargetHttpsProxiesClient.Patch
- RegionTargetHttpsProxiesClient.SetSslCertificates
- RegionTargetHttpsProxiesClient.SetUrlMap
- RegionTargetHttpsProxiesClient.TestIamPermissions
- RegionTargetTcpProxiesClient.Delete
- RegionTargetTcpProxiesClient.Get
- RegionTargetTcpProxiesClient.Insert
- RegionTargetTcpProxiesClient.List
- RegionTargetTcpProxiesClient.List (All)
- RegionTargetTcpProxiesClient.TestIamPermissions
- RegionUrlMapsClient.Delete
- RegionUrlMapsClient.Get
- RegionUrlMapsClient.Insert
- RegionUrlMapsClient.InvalidateCache
- RegionUrlMapsClient.List
- RegionUrlMapsClient.List (All)
- RegionUrlMapsClient.Patch
- RegionUrlMapsClient.TestIamPermissions
- RegionUrlMapsClient.Update
- RegionUrlMapsClient.Validate
- RegionZonesClient.List
- RegionZonesClient.List (All)
- RegionsClient.Get
- RegionsClient.List
- RegionsClient.List (All)
- ReservationBlocksClient.Get
- ReservationBlocksClient.GetIamPolicy
- ReservationBlocksClient.List
- ReservationBlocksClient.List (All)
- ReservationBlocksClient.PerformMaintenance
- ReservationBlocksClient.SetIamPolicy
- ReservationBlocksClient.TestIamPermissions
- ReservationSlotsClient.Get
- ReservationSlotsClient.List
- ReservationSlotsClient.List (All)
- ReservationSlotsClient.Update
- ReservationSubBlocksClient.Get
- ReservationSubBlocksClient.GetIamPolicy
- ReservationSubBlocksClient.List
- ReservationSubBlocksClient.List (All)
- ReservationSubBlocksClient.PerformMaintenance
- ReservationSubBlocksClient.ReportFaulty
- ReservationSubBlocksClient.SetIamPolicy
- ReservationSubBlocksClient.TestIamPermissions
- ReservationsClient.AggregatedList
- ReservationsClient.AggregatedList (All)
- ReservationsClient.Delete
- ReservationsClient.Get
- ReservationsClient.GetIamPolicy
- ReservationsClient.Insert
- ReservationsClient.List
- ReservationsClient.List (All)
- ReservationsClient.PerformMaintenance
- ReservationsClient.Resize
- ReservationsClient.SetIamPolicy
- ReservationsClient.TestIamPermissions
- ReservationsClient.Update
- ResourcePoliciesClient.AggregatedList
- ResourcePoliciesClient.AggregatedList (All)
- ResourcePoliciesClient.Delete
- ResourcePoliciesClient.Get
- ResourcePoliciesClient.GetIamPolicy
- ResourcePoliciesClient.Insert
- ResourcePoliciesClient.List
- ResourcePoliciesClient.List (All)
- ResourcePoliciesClient.Patch
- ResourcePoliciesClient.SetIamPolicy
- ResourcePoliciesClient.TestIamPermissions
- RolloutPlansClient.Delete
- RolloutPlansClient.Get
- RolloutPlansClient.Insert
- RolloutPlansClient.List
- RolloutPlansClient.List (All)
- RolloutsClient.Cancel
- RolloutsClient.Delete
- RolloutsClient.Get
- RolloutsClient.List
- RolloutsClient.List (All)
- RoutersClient.AggregatedList
- RoutersClient.AggregatedList (All)
- RoutersClient.Delete
- RoutersClient.DeleteRoutePolicy
- RoutersClient.Get
- RoutersClient.GetNatIpInfo
- RoutersClient.GetNatMappingInfo
- RoutersClient.GetNatMappingInfo (All)
- RoutersClient.GetRoutePolicy
- RoutersClient.GetRouterStatus
- RoutersClient.Insert
- RoutersClient.List
- RoutersClient.List (All)
- RoutersClient.ListBgpRoutes
- RoutersClient.ListBgpRoutes (All)
- RoutersClient.ListRoutePolicies
- RoutersClient.ListRoutePolicies (All)
- RoutersClient.Patch
- RoutersClient.PatchRoutePolicy
- RoutersClient.Preview
- RoutersClient.TestIamPermissions
- RoutersClient.Update
- RoutersClient.UpdateRoutePolicy
- RoutesClient.Delete
- RoutesClient.Get
- RoutesClient.Insert
- RoutesClient.List
- RoutesClient.List (All)
- RoutesClient.TestIamPermissions
- SecurityPoliciesClient.AddRule
- SecurityPoliciesClient.AggregatedList
- SecurityPoliciesClient.AggregatedList (All)
- SecurityPoliciesClient.Delete
- SecurityPoliciesClient.Get
- SecurityPoliciesClient.GetRule
- SecurityPoliciesClient.Insert
- SecurityPoliciesClient.List
- SecurityPoliciesClient.List (All)
- SecurityPoliciesClient.ListPreconfiguredExpressionSets
- SecurityPoliciesClient.Patch
- SecurityPoliciesClient.PatchRule
- SecurityPoliciesClient.RemoveRule
- SecurityPoliciesClient.SetLabels
- SecurityPoliciesClient.TestIamPermissions
- ServiceAttachmentsClient.AggregatedList
- ServiceAttachmentsClient.AggregatedList (All)
- ServiceAttachmentsClient.Delete
- ServiceAttachmentsClient.Get
- ServiceAttachmentsClient.GetIamPolicy
- ServiceAttachmentsClient.Insert
- ServiceAttachmentsClient.List
- ServiceAttachmentsClient.List (All)
- ServiceAttachmentsClient.Patch
- ServiceAttachmentsClient.SetIamPolicy
- ServiceAttachmentsClient.TestIamPermissions
- SnapshotSettingsClient.Get
- SnapshotSettingsClient.Patch
- SnapshotsClient.AggregatedList
- SnapshotsClient.AggregatedList (All)
- SnapshotsClient.Delete
- SnapshotsClient.Get
- SnapshotsClient.GetIamPolicy
- SnapshotsClient.Insert
- SnapshotsClient.List
- SnapshotsClient.List (All)
- SnapshotsClient.SetIamPolicy
- SnapshotsClient.SetLabels
- SnapshotsClient.TestIamPermissions
- SslCertificatesClient.AggregatedList
- SslCertificatesClient.AggregatedList (All)
- SslCertificatesClient.Delete
- SslCertificatesClient.Get
- SslCertificatesClient.Insert
- SslCertificatesClient.List
- SslCertificatesClient.List (All)
- SslCertificatesClient.TestIamPermissions
- SslPoliciesClient.AggregatedList
- SslPoliciesClient.AggregatedList (All)
- SslPoliciesClient.Delete
- SslPoliciesClient.Get
- SslPoliciesClient.Insert
- SslPoliciesClient.List
- SslPoliciesClient.List (All)
- SslPoliciesClient.ListAvailableFeatures
- SslPoliciesClient.Patch
- SslPoliciesClient.TestIamPermissions
- StoragePoolTypesClient.AggregatedList
- StoragePoolTypesClient.AggregatedList (All)
- StoragePoolTypesClient.Get
- StoragePoolTypesClient.List
- StoragePoolTypesClient.List (All)
- StoragePoolsClient.AggregatedList
- StoragePoolsClient.AggregatedList (All)
- StoragePoolsClient.Delete
- StoragePoolsClient.Get
- StoragePoolsClient.GetIamPolicy
- StoragePoolsClient.Insert
- StoragePoolsClient.List
- StoragePoolsClient.List (All)
- StoragePoolsClient.ListDisks
- StoragePoolsClient.ListDisks (All)
- StoragePoolsClient.SetIamPolicy
- StoragePoolsClient.TestIamPermissions
- StoragePoolsClient.Update
- SubnetworksClient.AggregatedList
- SubnetworksClient.AggregatedList (All)
- SubnetworksClient.Delete
- SubnetworksClient.ExpandIpCidrRange
- SubnetworksClient.Get
- SubnetworksClient.GetIamPolicy
- SubnetworksClient.Insert
- SubnetworksClient.List
- SubnetworksClient.List (All)
- SubnetworksClient.ListUsable
- SubnetworksClient.ListUsable (All)
- SubnetworksClient.Patch
- SubnetworksClient.SetIamPolicy
- SubnetworksClient.SetPrivateIpGoogleAccess
- SubnetworksClient.TestIamPermissions
- TargetGrpcProxiesClient.Delete
- TargetGrpcProxiesClient.Get
- TargetGrpcProxiesClient.Insert
- TargetGrpcProxiesClient.List
- TargetGrpcProxiesClient.List (All)
- TargetGrpcProxiesClient.Patch
- TargetGrpcProxiesClient.TestIamPermissions
- TargetHttpProxiesClient.AggregatedList
- TargetHttpProxiesClient.AggregatedList (All)
- TargetHttpProxiesClient.Delete
- TargetHttpProxiesClient.Get
- TargetHttpProxiesClient.Insert
- TargetHttpProxiesClient.List
- TargetHttpProxiesClient.List (All)
- TargetHttpProxiesClient.Patch
- TargetHttpProxiesClient.SetUrlMap
- TargetHttpProxiesClient.TestIamPermissions
- TargetHttpsProxiesClient.AggregatedList
- TargetHttpsProxiesClient.AggregatedList (All)
- TargetHttpsProxiesClient.Delete
- TargetHttpsProxiesClient.Get
- TargetHttpsProxiesClient.Insert
- TargetHttpsProxiesClient.List
- TargetHttpsProxiesClient.List (All)
- TargetHttpsProxiesClient.Patch
- TargetHttpsProxiesClient.SetCertificateMap
- TargetHttpsProxiesClient.SetQuicOverride
- TargetHttpsProxiesClient.SetSslCertificates
- TargetHttpsProxiesClient.SetSslPolicy
- TargetHttpsProxiesClient.SetUrlMap
- TargetHttpsProxiesClient.TestIamPermissions
- TargetInstancesClient.AggregatedList
- TargetInstancesClient.AggregatedList (All)
- TargetInstancesClient.Delete
- TargetInstancesClient.Get
- TargetInstancesClient.Insert
- TargetInstancesClient.List
- TargetInstancesClient.List (All)
- TargetInstancesClient.SetSecurityPolicy
- TargetInstancesClient.TestIamPermissions
- TargetPoolsClient.AddHealthCheck
- TargetPoolsClient.AddInstance
- TargetPoolsClient.AggregatedList
- TargetPoolsClient.AggregatedList (All)
- TargetPoolsClient.Delete
- TargetPoolsClient.Get
- TargetPoolsClient.GetHealth
- TargetPoolsClient.Insert
- TargetPoolsClient.List
- TargetPoolsClient.List (All)
- TargetPoolsClient.RemoveHealthCheck
- TargetPoolsClient.RemoveInstance
- TargetPoolsClient.SetBackup
- TargetPoolsClient.SetSecurityPolicy
- TargetPoolsClient.TestIamPermissions
- TargetSslProxiesClient.Delete
- TargetSslProxiesClient.Get
- TargetSslProxiesClient.Insert
- TargetSslProxiesClient.List
- TargetSslProxiesClient.List (All)
- TargetSslProxiesClient.SetBackendService
- TargetSslProxiesClient.SetCertificateMap
- TargetSslProxiesClient.SetProxyHeader
- TargetSslProxiesClient.SetSslCertificates
- TargetSslProxiesClient.SetSslPolicy
- TargetSslProxiesClient.TestIamPermissions
- TargetTcpProxiesClient.AggregatedList
- TargetTcpProxiesClient.AggregatedList (All)
- TargetTcpProxiesClient.Delete
- TargetTcpProxiesClient.Get
- TargetTcpProxiesClient.Insert
- TargetTcpProxiesClient.List
- TargetTcpProxiesClient.List (All)
- TargetTcpProxiesClient.SetBackendService
- TargetTcpProxiesClient.SetProxyHeader
- TargetTcpProxiesClient.TestIamPermissions
- TargetVpnGatewaysClient.AggregatedList
- TargetVpnGatewaysClient.AggregatedList (All)
- TargetVpnGatewaysClient.Delete
- TargetVpnGatewaysClient.Get
- TargetVpnGatewaysClient.Insert
- TargetVpnGatewaysClient.List
- TargetVpnGatewaysClient.List (All)
- TargetVpnGatewaysClient.SetLabels
- TargetVpnGatewaysClient.TestIamPermissions
- UrlMapsClient.AggregatedList
- UrlMapsClient.AggregatedList (All)
- UrlMapsClient.Delete
- UrlMapsClient.Get
- UrlMapsClient.Insert
- UrlMapsClient.InvalidateCache
- UrlMapsClient.List
- UrlMapsClient.List (All)
- UrlMapsClient.Patch
- UrlMapsClient.TestIamPermissions
- UrlMapsClient.Update
- UrlMapsClient.Validate
- VpnGatewaysClient.AggregatedList
- VpnGatewaysClient.AggregatedList (All)
- VpnGatewaysClient.Delete
- VpnGatewaysClient.Get
- VpnGatewaysClient.GetStatus
- VpnGatewaysClient.Insert
- VpnGatewaysClient.List
- VpnGatewaysClient.List (All)
- VpnGatewaysClient.SetLabels
- VpnGatewaysClient.TestIamPermissions
- VpnTunnelsClient.AggregatedList
- VpnTunnelsClient.AggregatedList (All)
- VpnTunnelsClient.Delete
- VpnTunnelsClient.Get
- VpnTunnelsClient.Insert
- VpnTunnelsClient.List
- VpnTunnelsClient.List (All)
- VpnTunnelsClient.SetLabels
- VpnTunnelsClient.TestIamPermissions
- WireGroupsClient.Delete
- WireGroupsClient.Get
- WireGroupsClient.Insert
- WireGroupsClient.List
- WireGroupsClient.List (All)
- WireGroupsClient.Patch
- ZoneOperationsClient.Delete
- ZoneOperationsClient.Get
- ZoneOperationsClient.List
- ZoneOperationsClient.List (All)
- ZoneOperationsClient.Wait
- ZoneVmExtensionPoliciesClient.Delete
- ZoneVmExtensionPoliciesClient.Get
- ZoneVmExtensionPoliciesClient.Insert
- ZoneVmExtensionPoliciesClient.List
- ZoneVmExtensionPoliciesClient.List (All)
- ZoneVmExtensionPoliciesClient.Update
- ZonesClient.Get
- ZonesClient.List
- ZonesClient.List (All)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type AcceleratorTypeIterator ¶
type AcceleratorTypeIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.AcceleratorType, nextPageToken string, err error)
// contains filtered or unexported fields
}
AcceleratorTypeIterator manages a stream of *computepb.AcceleratorType.
func (*AcceleratorTypeIterator) All ¶
func (it *AcceleratorTypeIterator) All() iter.Seq2[*computepb.AcceleratorType, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AcceleratorTypeIterator) Next ¶
func (it *AcceleratorTypeIterator) Next() (*computepb.AcceleratorType, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*AcceleratorTypeIterator) PageInfo ¶
func (it *AcceleratorTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type AcceleratorTypesCallOptions ¶
type AcceleratorTypesCallOptions struct {
AggregatedList []gax.CallOption
Get []gax.CallOption
List []gax.CallOption
}
AcceleratorTypesCallOptions contains the retry settings for each method of AcceleratorTypesClient.
type AcceleratorTypesClient ¶
type AcceleratorTypesClient struct {
// The call options for this service.
CallOptions *AcceleratorTypesCallOptions
// contains filtered or unexported fields
}
AcceleratorTypesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Services ¶
The AcceleratorTypes API.
func NewAcceleratorTypesRESTClient ¶
func NewAcceleratorTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*AcceleratorTypesClient, error)
NewAcceleratorTypesRESTClient creates a new accelerator types rest client.
Services ¶
The AcceleratorTypes API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAcceleratorTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*AcceleratorTypesClient) AggregatedList ¶
func (c *AcceleratorTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAcceleratorTypesRequest, opts ...gax.CallOption) *AcceleratorTypesScopedListPairIterator
AggregatedList retrieves an aggregated list of accelerator types.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAcceleratorTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListAcceleratorTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListAcceleratorTypesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.AcceleratorTypeAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAcceleratorTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListAcceleratorTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListAcceleratorTypesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AcceleratorTypesClient) Close ¶
func (c *AcceleratorTypesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AcceleratorTypesClient) Connection
deprecated
func (c *AcceleratorTypesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*AcceleratorTypesClient) Get ¶
func (c *AcceleratorTypesClient) Get(ctx context.Context, req *computepb.GetAcceleratorTypeRequest, opts ...gax.CallOption) (*computepb.AcceleratorType, error)
Get returns the specified accelerator type.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAcceleratorTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetAcceleratorTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetAcceleratorTypeRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AcceleratorTypesClient) List ¶
func (c *AcceleratorTypesClient) List(ctx context.Context, req *computepb.ListAcceleratorTypesRequest, opts ...gax.CallOption) *AcceleratorTypeIterator
List retrieves a list of accelerator types that are available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAcceleratorTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListAcceleratorTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListAcceleratorTypesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.AcceleratorTypeList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAcceleratorTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListAcceleratorTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListAcceleratorTypesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type AcceleratorTypesScopedListPair ¶
type AcceleratorTypesScopedListPair struct {
Key string
Value *computepb.AcceleratorTypesScopedList
}
AcceleratorTypesScopedListPair is a holder type for string/*computepb.AcceleratorTypesScopedList map entries
type AcceleratorTypesScopedListPairIterator ¶
type AcceleratorTypesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []AcceleratorTypesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
AcceleratorTypesScopedListPairIterator manages a stream of AcceleratorTypesScopedListPair.
func (*AcceleratorTypesScopedListPairIterator) All ¶
func (it *AcceleratorTypesScopedListPairIterator) All() iter.Seq2[AcceleratorTypesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AcceleratorTypesScopedListPairIterator) Next ¶
func (it *AcceleratorTypesScopedListPairIterator) Next() (AcceleratorTypesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*AcceleratorTypesScopedListPairIterator) PageInfo ¶
func (it *AcceleratorTypesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type AddressIterator ¶
type AddressIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Address, nextPageToken string, err error)
// contains filtered or unexported fields
}
AddressIterator manages a stream of *computepb.Address.
func (*AddressIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AddressIterator) Next ¶
func (it *AddressIterator) Next() (*computepb.Address, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*AddressIterator) PageInfo ¶
func (it *AddressIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type AddressesCallOptions ¶
type AddressesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Move []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
AddressesCallOptions contains the retry settings for each method of AddressesClient.
type AddressesClient ¶
type AddressesClient struct {
// The call options for this service.
CallOptions *AddressesCallOptions
// contains filtered or unexported fields
}
AddressesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Addresses API.
func NewAddressesRESTClient ¶
func NewAddressesRESTClient(ctx context.Context, opts ...option.ClientOption) (*AddressesClient, error)
NewAddressesRESTClient creates a new addresses rest client.
The Addresses API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*AddressesClient) AggregatedList ¶
func (c *AddressesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAddressesRequest, opts ...gax.CallOption) *AddressesScopedListPairIterator
AggregatedList retrieves an aggregated list of addresses.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListAddressesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListAddressesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.AddressAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListAddressesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListAddressesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AddressesClient) Close ¶
func (c *AddressesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AddressesClient) Connection
deprecated
func (c *AddressesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*AddressesClient) Delete ¶
func (c *AddressesClient) Delete(ctx context.Context, req *computepb.DeleteAddressRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified address resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteAddressRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AddressesClient) Get ¶
func (c *AddressesClient) Get(ctx context.Context, req *computepb.GetAddressRequest, opts ...gax.CallOption) (*computepb.Address, error)
Get returns the specified address resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetAddressRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AddressesClient) Insert ¶
func (c *AddressesClient) Insert(ctx context.Context, req *computepb.InsertAddressRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an address resource in the specified project by using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertAddressRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AddressesClient) List ¶
func (c *AddressesClient) List(ctx context.Context, req *computepb.ListAddressesRequest, opts ...gax.CallOption) *AddressIterator
List retrieves a list of addresses contained within the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListAddressesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListAddressesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.AddressList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListAddressesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListAddressesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AddressesClient) Move ¶
func (c *AddressesClient) Move(ctx context.Context, req *computepb.MoveAddressRequest, opts ...gax.CallOption) (*Operation, error)
Move moves the specified address resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.MoveAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#MoveAddressRequest.
}
op, err := c.Move(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AddressesClient) SetLabels ¶
func (c *AddressesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsAddressRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on an Address. To learn more about labels, read theLabeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsAddressRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AddressesClient) TestIamPermissions ¶
func (c *AddressesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsAddressRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsAddressRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type AddressesScopedListPair ¶
type AddressesScopedListPair struct {
Key string
Value *computepb.AddressesScopedList
}
AddressesScopedListPair is a holder type for string/*computepb.AddressesScopedList map entries
type AddressesScopedListPairIterator ¶
type AddressesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []AddressesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
AddressesScopedListPairIterator manages a stream of AddressesScopedListPair.
func (*AddressesScopedListPairIterator) All ¶
func (it *AddressesScopedListPairIterator) All() iter.Seq2[AddressesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AddressesScopedListPairIterator) Next ¶
func (it *AddressesScopedListPairIterator) Next() (AddressesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*AddressesScopedListPairIterator) PageInfo ¶
func (it *AddressesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type AdviceCallOptions ¶
type AdviceCallOptions struct {
CalendarMode []gax.CallOption
}
AdviceCallOptions contains the retry settings for each method of AdviceClient.
type AdviceClient ¶
type AdviceClient struct {
// The call options for this service.
CallOptions *AdviceCallOptions
// contains filtered or unexported fields
}
AdviceClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Advice API.
func NewAdviceRESTClient ¶
func NewAdviceRESTClient(ctx context.Context, opts ...option.ClientOption) (*AdviceClient, error)
NewAdviceRESTClient creates a new advice rest client.
The Advice API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAdviceRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*AdviceClient) CalendarMode ¶
func (c *AdviceClient) CalendarMode(ctx context.Context, req *computepb.CalendarModeAdviceRpcRequest, opts ...gax.CallOption) (*computepb.CalendarModeAdviceResponse, error)
CalendarMode advise how, where and when to create the requested amount of instances with specified accelerators, within the specified time and location limits. The method recommends creating future reservations for the requested resources.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAdviceRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CalendarModeAdviceRpcRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CalendarModeAdviceRpcRequest.
}
resp, err := c.CalendarMode(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AdviceClient) Close ¶
func (c *AdviceClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AdviceClient) Connection
deprecated
func (c *AdviceClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
type AutoscalerIterator ¶
type AutoscalerIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Autoscaler, nextPageToken string, err error)
// contains filtered or unexported fields
}
AutoscalerIterator manages a stream of *computepb.Autoscaler.
func (*AutoscalerIterator) All ¶
func (it *AutoscalerIterator) All() iter.Seq2[*computepb.Autoscaler, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AutoscalerIterator) Next ¶
func (it *AutoscalerIterator) Next() (*computepb.Autoscaler, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*AutoscalerIterator) PageInfo ¶
func (it *AutoscalerIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type AutoscalersCallOptions ¶
type AutoscalersCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
AutoscalersCallOptions contains the retry settings for each method of AutoscalersClient.
type AutoscalersClient ¶
type AutoscalersClient struct {
// The call options for this service.
CallOptions *AutoscalersCallOptions
// contains filtered or unexported fields
}
AutoscalersClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Autoscalers API.
func NewAutoscalersRESTClient ¶
func NewAutoscalersRESTClient(ctx context.Context, opts ...option.ClientOption) (*AutoscalersClient, error)
NewAutoscalersRESTClient creates a new autoscalers rest client.
The Autoscalers API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*AutoscalersClient) AggregatedList ¶
func (c *AutoscalersClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAutoscalersRequest, opts ...gax.CallOption) *AutoscalersScopedListPairIterator
AggregatedList retrieves an aggregated list of autoscalers.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListAutoscalersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListAutoscalersRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.AutoscalerAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListAutoscalersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListAutoscalersRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AutoscalersClient) Close ¶
func (c *AutoscalersClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AutoscalersClient) Connection
deprecated
func (c *AutoscalersClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*AutoscalersClient) Delete ¶
func (c *AutoscalersClient) Delete(ctx context.Context, req *computepb.DeleteAutoscalerRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified autoscaler.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteAutoscalerRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AutoscalersClient) Get ¶
func (c *AutoscalersClient) Get(ctx context.Context, req *computepb.GetAutoscalerRequest, opts ...gax.CallOption) (*computepb.Autoscaler, error)
Get returns the specified autoscaler resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetAutoscalerRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AutoscalersClient) Insert ¶
func (c *AutoscalersClient) Insert(ctx context.Context, req *computepb.InsertAutoscalerRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an autoscaler in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertAutoscalerRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AutoscalersClient) List ¶
func (c *AutoscalersClient) List(ctx context.Context, req *computepb.ListAutoscalersRequest, opts ...gax.CallOption) *AutoscalerIterator
List retrieves a list of autoscalers contained within the specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListAutoscalersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListAutoscalersRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.AutoscalerList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListAutoscalersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListAutoscalersRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AutoscalersClient) Patch ¶
func (c *AutoscalersClient) Patch(ctx context.Context, req *computepb.PatchAutoscalerRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates an autoscaler in the specified project using the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchAutoscalerRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AutoscalersClient) TestIamPermissions ¶
func (c *AutoscalersClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsAutoscalerRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsAutoscalerRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AutoscalersClient) Update ¶
func (c *AutoscalersClient) Update(ctx context.Context, req *computepb.UpdateAutoscalerRequest, opts ...gax.CallOption) (*Operation, error)
Update updates an autoscaler in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateAutoscalerRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type AutoscalersScopedListPair ¶
type AutoscalersScopedListPair struct {
Key string
Value *computepb.AutoscalersScopedList
}
AutoscalersScopedListPair is a holder type for string/*computepb.AutoscalersScopedList map entries
type AutoscalersScopedListPairIterator ¶
type AutoscalersScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []AutoscalersScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
AutoscalersScopedListPairIterator manages a stream of AutoscalersScopedListPair.
func (*AutoscalersScopedListPairIterator) All ¶
func (it *AutoscalersScopedListPairIterator) All() iter.Seq2[AutoscalersScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AutoscalersScopedListPairIterator) Next ¶
func (it *AutoscalersScopedListPairIterator) Next() (AutoscalersScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*AutoscalersScopedListPairIterator) PageInfo ¶
func (it *AutoscalersScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type BackendBucketIterator ¶
type BackendBucketIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.BackendBucket, nextPageToken string, err error)
// contains filtered or unexported fields
}
BackendBucketIterator manages a stream of *computepb.BackendBucket.
func (*BackendBucketIterator) All ¶
func (it *BackendBucketIterator) All() iter.Seq2[*computepb.BackendBucket, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*BackendBucketIterator) Next ¶
func (it *BackendBucketIterator) Next() (*computepb.BackendBucket, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*BackendBucketIterator) PageInfo ¶
func (it *BackendBucketIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type BackendBucketsCallOptions ¶
type BackendBucketsCallOptions struct {
AddSignedUrlKey []gax.CallOption
AggregatedList []gax.CallOption
Delete []gax.CallOption
DeleteSignedUrlKey []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListUsable []gax.CallOption
Patch []gax.CallOption
SetEdgeSecurityPolicy []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
BackendBucketsCallOptions contains the retry settings for each method of BackendBucketsClient.
type BackendBucketsClient ¶
type BackendBucketsClient struct {
// The call options for this service.
CallOptions *BackendBucketsCallOptions
// contains filtered or unexported fields
}
BackendBucketsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The BackendBuckets API.
func NewBackendBucketsRESTClient ¶
func NewBackendBucketsRESTClient(ctx context.Context, opts ...option.ClientOption) (*BackendBucketsClient, error)
NewBackendBucketsRESTClient creates a new backend buckets rest client.
The BackendBuckets API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*BackendBucketsClient) AddSignedUrlKey ¶
func (c *BackendBucketsClient) AddSignedUrlKey(ctx context.Context, req *computepb.AddSignedUrlKeyBackendBucketRequest, opts ...gax.CallOption) (*Operation, error)
AddSignedUrlKey adds a key for validating requests with signed URLs for this backend bucket.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddSignedUrlKeyBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddSignedUrlKeyBackendBucketRequest.
}
op, err := c.AddSignedUrlKey(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendBucketsClient) AggregatedList ¶ added in v1.50.0
func (c *BackendBucketsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListBackendBucketsRequest, opts ...gax.CallOption) *BackendBucketsScopedListPairIterator
AggregatedList retrieves the list of all BackendBucket resources, regional and global, available to the specified project.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListBackendBucketsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListBackendBucketsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.BackendBucketAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListBackendBucketsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListBackendBucketsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackendBucketsClient) Close ¶
func (c *BackendBucketsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*BackendBucketsClient) Connection
deprecated
func (c *BackendBucketsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*BackendBucketsClient) Delete ¶
func (c *BackendBucketsClient) Delete(ctx context.Context, req *computepb.DeleteBackendBucketRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified BackendBucket resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteBackendBucketRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendBucketsClient) DeleteSignedUrlKey ¶
func (c *BackendBucketsClient) DeleteSignedUrlKey(ctx context.Context, req *computepb.DeleteSignedUrlKeyBackendBucketRequest, opts ...gax.CallOption) (*Operation, error)
DeleteSignedUrlKey deletes a key for validating requests with signed URLs for this backend bucket.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteSignedUrlKeyBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteSignedUrlKeyBackendBucketRequest.
}
op, err := c.DeleteSignedUrlKey(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendBucketsClient) Get ¶
func (c *BackendBucketsClient) Get(ctx context.Context, req *computepb.GetBackendBucketRequest, opts ...gax.CallOption) (*computepb.BackendBucket, error)
Get returns the specified BackendBucket resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetBackendBucketRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackendBucketsClient) GetIamPolicy ¶
func (c *BackendBucketsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyBackendBucketRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackendBucketsClient) Insert ¶
func (c *BackendBucketsClient) Insert(ctx context.Context, req *computepb.InsertBackendBucketRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a BackendBucket resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertBackendBucketRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendBucketsClient) List ¶
func (c *BackendBucketsClient) List(ctx context.Context, req *computepb.ListBackendBucketsRequest, opts ...gax.CallOption) *BackendBucketIterator
List retrieves the list of BackendBucket resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListBackendBucketsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListBackendBucketsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.BackendBucketList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListBackendBucketsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListBackendBucketsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackendBucketsClient) ListUsable ¶
func (c *BackendBucketsClient) ListUsable(ctx context.Context, req *computepb.ListUsableBackendBucketsRequest, opts ...gax.CallOption) *BackendBucketIterator
ListUsable retrieves a list of all usable backend buckets in the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUsableBackendBucketsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUsableBackendBucketsRequest.
}
it := c.ListUsable(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.BackendBucketListUsable)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUsableBackendBucketsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUsableBackendBucketsRequest.
}
for resp, err := range c.ListUsable(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackendBucketsClient) Patch ¶
func (c *BackendBucketsClient) Patch(ctx context.Context, req *computepb.PatchBackendBucketRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified BackendBucket resource with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchBackendBucketRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendBucketsClient) SetEdgeSecurityPolicy ¶
func (c *BackendBucketsClient) SetEdgeSecurityPolicy(ctx context.Context, req *computepb.SetEdgeSecurityPolicyBackendBucketRequest, opts ...gax.CallOption) (*Operation, error)
SetEdgeSecurityPolicy sets the edge security policy for the specified backend bucket.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetEdgeSecurityPolicyBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetEdgeSecurityPolicyBackendBucketRequest.
}
op, err := c.SetEdgeSecurityPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendBucketsClient) SetIamPolicy ¶
func (c *BackendBucketsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyBackendBucketRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackendBucketsClient) TestIamPermissions ¶
func (c *BackendBucketsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsBackendBucketRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsBackendBucketRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackendBucketsClient) Update ¶
func (c *BackendBucketsClient) Update(ctx context.Context, req *computepb.UpdateBackendBucketRequest, opts ...gax.CallOption) (*Operation, error)
Update updates the specified BackendBucket resource with the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateBackendBucketRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type BackendBucketsScopedListPair ¶ added in v1.50.0
type BackendBucketsScopedListPair struct {
Key string
Value *computepb.BackendBucketsScopedList
}
BackendBucketsScopedListPair is a holder type for string/*computepb.BackendBucketsScopedList map entries
type BackendBucketsScopedListPairIterator ¶ added in v1.50.0
type BackendBucketsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []BackendBucketsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
BackendBucketsScopedListPairIterator manages a stream of BackendBucketsScopedListPair.
func (*BackendBucketsScopedListPairIterator) All ¶ added in v1.50.0
func (it *BackendBucketsScopedListPairIterator) All() iter.Seq2[BackendBucketsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*BackendBucketsScopedListPairIterator) Next ¶ added in v1.50.0
func (it *BackendBucketsScopedListPairIterator) Next() (BackendBucketsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*BackendBucketsScopedListPairIterator) PageInfo ¶ added in v1.50.0
func (it *BackendBucketsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type BackendServiceIterator ¶
type BackendServiceIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.BackendService, nextPageToken string, err error)
// contains filtered or unexported fields
}
BackendServiceIterator manages a stream of *computepb.BackendService.
func (*BackendServiceIterator) All ¶
func (it *BackendServiceIterator) All() iter.Seq2[*computepb.BackendService, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*BackendServiceIterator) Next ¶
func (it *BackendServiceIterator) Next() (*computepb.BackendService, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*BackendServiceIterator) PageInfo ¶
func (it *BackendServiceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type BackendServicesCallOptions ¶
type BackendServicesCallOptions struct {
AddSignedUrlKey []gax.CallOption
AggregatedList []gax.CallOption
Delete []gax.CallOption
DeleteSignedUrlKey []gax.CallOption
Get []gax.CallOption
GetEffectiveSecurityPolicies []gax.CallOption
GetHealth []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListUsable []gax.CallOption
Patch []gax.CallOption
SetEdgeSecurityPolicy []gax.CallOption
SetIamPolicy []gax.CallOption
SetSecurityPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
BackendServicesCallOptions contains the retry settings for each method of BackendServicesClient.
type BackendServicesClient ¶
type BackendServicesClient struct {
// The call options for this service.
CallOptions *BackendServicesCallOptions
// contains filtered or unexported fields
}
BackendServicesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The BackendServices API.
func NewBackendServicesRESTClient ¶
func NewBackendServicesRESTClient(ctx context.Context, opts ...option.ClientOption) (*BackendServicesClient, error)
NewBackendServicesRESTClient creates a new backend services rest client.
The BackendServices API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*BackendServicesClient) AddSignedUrlKey ¶
func (c *BackendServicesClient) AddSignedUrlKey(ctx context.Context, req *computepb.AddSignedUrlKeyBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
AddSignedUrlKey adds a key for validating requests with signed URLs for this backend service.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddSignedUrlKeyBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddSignedUrlKeyBackendServiceRequest.
}
op, err := c.AddSignedUrlKey(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendServicesClient) AggregatedList ¶
func (c *BackendServicesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListBackendServicesRequest, opts ...gax.CallOption) *BackendServicesScopedListPairIterator
AggregatedList retrieves the list of all BackendService resources, regional and global, available to the specified project.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListBackendServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListBackendServicesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.BackendServiceAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListBackendServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListBackendServicesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackendServicesClient) Close ¶
func (c *BackendServicesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*BackendServicesClient) Connection
deprecated
func (c *BackendServicesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*BackendServicesClient) Delete ¶
func (c *BackendServicesClient) Delete(ctx context.Context, req *computepb.DeleteBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified BackendService resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteBackendServiceRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendServicesClient) DeleteSignedUrlKey ¶
func (c *BackendServicesClient) DeleteSignedUrlKey(ctx context.Context, req *computepb.DeleteSignedUrlKeyBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
DeleteSignedUrlKey deletes a key for validating requests with signed URLs for this backend service.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteSignedUrlKeyBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteSignedUrlKeyBackendServiceRequest.
}
op, err := c.DeleteSignedUrlKey(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendServicesClient) Get ¶
func (c *BackendServicesClient) Get(ctx context.Context, req *computepb.GetBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendService, error)
Get returns the specified BackendService resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetBackendServiceRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackendServicesClient) GetEffectiveSecurityPolicies ¶
func (c *BackendServicesClient) GetEffectiveSecurityPolicies(ctx context.Context, req *computepb.GetEffectiveSecurityPoliciesBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendServicesGetEffectiveSecurityPoliciesResponse, error)
GetEffectiveSecurityPolicies returns effective security policies applied to this backend service.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetEffectiveSecurityPoliciesBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetEffectiveSecurityPoliciesBackendServiceRequest.
}
resp, err := c.GetEffectiveSecurityPolicies(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackendServicesClient) GetHealth ¶
func (c *BackendServicesClient) GetHealth(ctx context.Context, req *computepb.GetHealthBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendServiceGroupHealth, error)
GetHealth gets the most recent health check results for this BackendService.
Example request body:
{ “group”: “/zones/us-east1-b/instanceGroups/lb-backend-example” }
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetHealthBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetHealthBackendServiceRequest.
}
resp, err := c.GetHealth(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackendServicesClient) GetIamPolicy ¶
func (c *BackendServicesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyBackendServiceRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackendServicesClient) Insert ¶
func (c *BackendServicesClient) Insert(ctx context.Context, req *computepb.InsertBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertBackendServiceRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendServicesClient) List ¶
func (c *BackendServicesClient) List(ctx context.Context, req *computepb.ListBackendServicesRequest, opts ...gax.CallOption) *BackendServiceIterator
List retrieves the list of BackendService resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListBackendServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListBackendServicesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.BackendServiceList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListBackendServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListBackendServicesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackendServicesClient) ListUsable ¶
func (c *BackendServicesClient) ListUsable(ctx context.Context, req *computepb.ListUsableBackendServicesRequest, opts ...gax.CallOption) *BackendServiceIterator
ListUsable retrieves a list of all usable backend services in the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUsableBackendServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUsableBackendServicesRequest.
}
it := c.ListUsable(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.BackendServiceListUsable)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUsableBackendServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUsableBackendServicesRequest.
}
for resp, err := range c.ListUsable(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackendServicesClient) Patch ¶
func (c *BackendServicesClient) Patch(ctx context.Context, req *computepb.PatchBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchBackendServiceRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendServicesClient) SetEdgeSecurityPolicy ¶
func (c *BackendServicesClient) SetEdgeSecurityPolicy(ctx context.Context, req *computepb.SetEdgeSecurityPolicyBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
SetEdgeSecurityPolicy sets the edge security policy for the specified backend service.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetEdgeSecurityPolicyBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetEdgeSecurityPolicyBackendServiceRequest.
}
op, err := c.SetEdgeSecurityPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendServicesClient) SetIamPolicy ¶
func (c *BackendServicesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyBackendServiceRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackendServicesClient) SetSecurityPolicy ¶
func (c *BackendServicesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
SetSecurityPolicy sets the Google Cloud Armor security policy for the specified backend service. For more information, seeGoogle Cloud Armor Overview
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSecurityPolicyBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetSecurityPolicyBackendServiceRequest.
}
op, err := c.SetSecurityPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackendServicesClient) TestIamPermissions ¶
func (c *BackendServicesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsBackendServiceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsBackendServiceRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackendServicesClient) Update ¶
func (c *BackendServicesClient) Update(ctx context.Context, req *computepb.UpdateBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
Update updates the specified BackendService resource with the data included in the request. For more information, seeBackend services overview.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateBackendServiceRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type BackendServicesScopedListPair ¶
type BackendServicesScopedListPair struct {
Key string
Value *computepb.BackendServicesScopedList
}
BackendServicesScopedListPair is a holder type for string/*computepb.BackendServicesScopedList map entries
type BackendServicesScopedListPairIterator ¶
type BackendServicesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []BackendServicesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
BackendServicesScopedListPairIterator manages a stream of BackendServicesScopedListPair.
func (*BackendServicesScopedListPairIterator) All ¶
func (it *BackendServicesScopedListPairIterator) All() iter.Seq2[BackendServicesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*BackendServicesScopedListPairIterator) Next ¶
func (it *BackendServicesScopedListPairIterator) Next() (BackendServicesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*BackendServicesScopedListPairIterator) PageInfo ¶
func (it *BackendServicesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type BgpRouteIterator ¶
type BgpRouteIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.BgpRoute, nextPageToken string, err error)
// contains filtered or unexported fields
}
BgpRouteIterator manages a stream of *computepb.BgpRoute.
func (*BgpRouteIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*BgpRouteIterator) Next ¶
func (it *BgpRouteIterator) Next() (*computepb.BgpRoute, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*BgpRouteIterator) PageInfo ¶
func (it *BgpRouteIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CommitmentIterator ¶
type CommitmentIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Commitment, nextPageToken string, err error)
// contains filtered or unexported fields
}
CommitmentIterator manages a stream of *computepb.Commitment.
func (*CommitmentIterator) All ¶
func (it *CommitmentIterator) All() iter.Seq2[*computepb.Commitment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*CommitmentIterator) Next ¶
func (it *CommitmentIterator) Next() (*computepb.Commitment, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*CommitmentIterator) PageInfo ¶
func (it *CommitmentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CommitmentsScopedListPair ¶
type CommitmentsScopedListPair struct {
Key string
Value *computepb.CommitmentsScopedList
}
CommitmentsScopedListPair is a holder type for string/*computepb.CommitmentsScopedList map entries
type CommitmentsScopedListPairIterator ¶
type CommitmentsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []CommitmentsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
CommitmentsScopedListPairIterator manages a stream of CommitmentsScopedListPair.
func (*CommitmentsScopedListPairIterator) All ¶
func (it *CommitmentsScopedListPairIterator) All() iter.Seq2[CommitmentsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*CommitmentsScopedListPairIterator) Next ¶
func (it *CommitmentsScopedListPairIterator) Next() (CommitmentsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*CommitmentsScopedListPairIterator) PageInfo ¶
func (it *CommitmentsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CompositeHealthCheckIterator ¶ added in v1.50.0
type CompositeHealthCheckIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.CompositeHealthCheck, nextPageToken string, err error)
// contains filtered or unexported fields
}
CompositeHealthCheckIterator manages a stream of *computepb.CompositeHealthCheck.
func (*CompositeHealthCheckIterator) All ¶ added in v1.50.0
func (it *CompositeHealthCheckIterator) All() iter.Seq2[*computepb.CompositeHealthCheck, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*CompositeHealthCheckIterator) Next ¶ added in v1.50.0
func (it *CompositeHealthCheckIterator) Next() (*computepb.CompositeHealthCheck, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*CompositeHealthCheckIterator) PageInfo ¶ added in v1.50.0
func (it *CompositeHealthCheckIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CompositeHealthChecksScopedListPair ¶ added in v1.50.0
type CompositeHealthChecksScopedListPair struct {
Key string
Value *computepb.CompositeHealthChecksScopedList
}
CompositeHealthChecksScopedListPair is a holder type for string/*computepb.CompositeHealthChecksScopedList map entries
type CompositeHealthChecksScopedListPairIterator ¶ added in v1.50.0
type CompositeHealthChecksScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []CompositeHealthChecksScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
CompositeHealthChecksScopedListPairIterator manages a stream of CompositeHealthChecksScopedListPair.
func (*CompositeHealthChecksScopedListPairIterator) All ¶ added in v1.50.0
func (it *CompositeHealthChecksScopedListPairIterator) All() iter.Seq2[CompositeHealthChecksScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*CompositeHealthChecksScopedListPairIterator) Next ¶ added in v1.50.0
func (it *CompositeHealthChecksScopedListPairIterator) Next() (CompositeHealthChecksScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*CompositeHealthChecksScopedListPairIterator) PageInfo ¶ added in v1.50.0
func (it *CompositeHealthChecksScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CrossSiteNetworkIterator ¶
type CrossSiteNetworkIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.CrossSiteNetwork, nextPageToken string, err error)
// contains filtered or unexported fields
}
CrossSiteNetworkIterator manages a stream of *computepb.CrossSiteNetwork.
func (*CrossSiteNetworkIterator) All ¶
func (it *CrossSiteNetworkIterator) All() iter.Seq2[*computepb.CrossSiteNetwork, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*CrossSiteNetworkIterator) Next ¶
func (it *CrossSiteNetworkIterator) Next() (*computepb.CrossSiteNetwork, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*CrossSiteNetworkIterator) PageInfo ¶
func (it *CrossSiteNetworkIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CrossSiteNetworksCallOptions ¶
type CrossSiteNetworksCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
}
CrossSiteNetworksCallOptions contains the retry settings for each method of CrossSiteNetworksClient.
type CrossSiteNetworksClient ¶
type CrossSiteNetworksClient struct {
// The call options for this service.
CallOptions *CrossSiteNetworksCallOptions
// contains filtered or unexported fields
}
CrossSiteNetworksClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The CrossSiteNetworks API.
func NewCrossSiteNetworksRESTClient ¶
func NewCrossSiteNetworksRESTClient(ctx context.Context, opts ...option.ClientOption) (*CrossSiteNetworksClient, error)
NewCrossSiteNetworksRESTClient creates a new cross site networks rest client.
The CrossSiteNetworks API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewCrossSiteNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*CrossSiteNetworksClient) Close ¶
func (c *CrossSiteNetworksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*CrossSiteNetworksClient) Connection
deprecated
func (c *CrossSiteNetworksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*CrossSiteNetworksClient) Delete ¶
func (c *CrossSiteNetworksClient) Delete(ctx context.Context, req *computepb.DeleteCrossSiteNetworkRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified cross-site network in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewCrossSiteNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteCrossSiteNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteCrossSiteNetworkRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*CrossSiteNetworksClient) Get ¶
func (c *CrossSiteNetworksClient) Get(ctx context.Context, req *computepb.GetCrossSiteNetworkRequest, opts ...gax.CallOption) (*computepb.CrossSiteNetwork, error)
Get returns the specified cross-site network in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewCrossSiteNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetCrossSiteNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetCrossSiteNetworkRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CrossSiteNetworksClient) Insert ¶
func (c *CrossSiteNetworksClient) Insert(ctx context.Context, req *computepb.InsertCrossSiteNetworkRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a cross-site network in the specified project in the given scope using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewCrossSiteNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertCrossSiteNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertCrossSiteNetworkRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*CrossSiteNetworksClient) List ¶
func (c *CrossSiteNetworksClient) List(ctx context.Context, req *computepb.ListCrossSiteNetworksRequest, opts ...gax.CallOption) *CrossSiteNetworkIterator
List lists the cross-site networks for a project in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewCrossSiteNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListCrossSiteNetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListCrossSiteNetworksRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.CrossSiteNetworkList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewCrossSiteNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListCrossSiteNetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListCrossSiteNetworksRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*CrossSiteNetworksClient) Patch ¶
func (c *CrossSiteNetworksClient) Patch(ctx context.Context, req *computepb.PatchCrossSiteNetworkRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified cross-site network with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewCrossSiteNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchCrossSiteNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchCrossSiteNetworkRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type DiskIterator ¶
type DiskIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Disk, nextPageToken string, err error)
// contains filtered or unexported fields
}
DiskIterator manages a stream of *computepb.Disk.
func (*DiskIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DiskIterator) Next ¶
func (it *DiskIterator) Next() (*computepb.Disk, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*DiskIterator) PageInfo ¶
func (it *DiskIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type DiskSettingsCallOptions ¶
type DiskSettingsCallOptions struct {
Get []gax.CallOption
Patch []gax.CallOption
}
DiskSettingsCallOptions contains the retry settings for each method of DiskSettingsClient.
type DiskSettingsClient ¶
type DiskSettingsClient struct {
// The call options for this service.
CallOptions *DiskSettingsCallOptions
// contains filtered or unexported fields
}
DiskSettingsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The DiskSettings API.
func NewDiskSettingsRESTClient ¶
func NewDiskSettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*DiskSettingsClient, error)
NewDiskSettingsRESTClient creates a new disk settings service rest client.
The DiskSettings API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDiskSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*DiskSettingsClient) Close ¶
func (c *DiskSettingsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*DiskSettingsClient) Connection
deprecated
func (c *DiskSettingsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*DiskSettingsClient) Get ¶
func (c *DiskSettingsClient) Get(ctx context.Context, req *computepb.GetDiskSettingRequest, opts ...gax.CallOption) (*computepb.DiskSettings, error)
Get get Zonal Disk Settings.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDiskSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetDiskSettingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetDiskSettingRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DiskSettingsClient) Patch ¶
func (c *DiskSettingsClient) Patch(ctx context.Context, req *computepb.PatchDiskSettingRequest, opts ...gax.CallOption) (*Operation, error)
Patch patch Zonal Disk Settings
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDiskSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchDiskSettingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchDiskSettingRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type DiskTypeIterator ¶
type DiskTypeIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.DiskType, nextPageToken string, err error)
// contains filtered or unexported fields
}
DiskTypeIterator manages a stream of *computepb.DiskType.
func (*DiskTypeIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DiskTypeIterator) Next ¶
func (it *DiskTypeIterator) Next() (*computepb.DiskType, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*DiskTypeIterator) PageInfo ¶
func (it *DiskTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type DiskTypesCallOptions ¶
type DiskTypesCallOptions struct {
AggregatedList []gax.CallOption
Get []gax.CallOption
List []gax.CallOption
}
DiskTypesCallOptions contains the retry settings for each method of DiskTypesClient.
type DiskTypesClient ¶
type DiskTypesClient struct {
// The call options for this service.
CallOptions *DiskTypesCallOptions
// contains filtered or unexported fields
}
DiskTypesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The DiskTypes API.
func NewDiskTypesRESTClient ¶
func NewDiskTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*DiskTypesClient, error)
NewDiskTypesRESTClient creates a new disk types rest client.
The DiskTypes API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDiskTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*DiskTypesClient) AggregatedList ¶
func (c *DiskTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListDiskTypesRequest, opts ...gax.CallOption) *DiskTypesScopedListPairIterator
AggregatedList retrieves an aggregated list of disk types.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDiskTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListDiskTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListDiskTypesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.DiskTypeAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDiskTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListDiskTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListDiskTypesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DiskTypesClient) Close ¶
func (c *DiskTypesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*DiskTypesClient) Connection
deprecated
func (c *DiskTypesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*DiskTypesClient) Get ¶
func (c *DiskTypesClient) Get(ctx context.Context, req *computepb.GetDiskTypeRequest, opts ...gax.CallOption) (*computepb.DiskType, error)
Get returns the specified disk type.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDiskTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetDiskTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetDiskTypeRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DiskTypesClient) List ¶
func (c *DiskTypesClient) List(ctx context.Context, req *computepb.ListDiskTypesRequest, opts ...gax.CallOption) *DiskTypeIterator
List retrieves a list of disk types available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDiskTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListDiskTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListDiskTypesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.DiskTypeList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDiskTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListDiskTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListDiskTypesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type DiskTypesScopedListPair ¶
type DiskTypesScopedListPair struct {
Key string
Value *computepb.DiskTypesScopedList
}
DiskTypesScopedListPair is a holder type for string/*computepb.DiskTypesScopedList map entries
type DiskTypesScopedListPairIterator ¶
type DiskTypesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []DiskTypesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
DiskTypesScopedListPairIterator manages a stream of DiskTypesScopedListPair.
func (*DiskTypesScopedListPairIterator) All ¶
func (it *DiskTypesScopedListPairIterator) All() iter.Seq2[DiskTypesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DiskTypesScopedListPairIterator) Next ¶
func (it *DiskTypesScopedListPairIterator) Next() (DiskTypesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*DiskTypesScopedListPairIterator) PageInfo ¶
func (it *DiskTypesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type DisksCallOptions ¶
type DisksCallOptions struct {
AddResourcePolicies []gax.CallOption
AggregatedList []gax.CallOption
BulkInsert []gax.CallOption
BulkSetLabels []gax.CallOption
CreateSnapshot []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
RemoveResourcePolicies []gax.CallOption
Resize []gax.CallOption
SetIamPolicy []gax.CallOption
SetLabels []gax.CallOption
StartAsyncReplication []gax.CallOption
StopAsyncReplication []gax.CallOption
StopGroupAsyncReplication []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
DisksCallOptions contains the retry settings for each method of DisksClient.
type DisksClient ¶
type DisksClient struct {
// The call options for this service.
CallOptions *DisksCallOptions
// contains filtered or unexported fields
}
DisksClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Disks API.
func NewDisksRESTClient ¶
func NewDisksRESTClient(ctx context.Context, opts ...option.ClientOption) (*DisksClient, error)
NewDisksRESTClient creates a new disks rest client.
The Disks API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*DisksClient) AddResourcePolicies ¶
func (c *DisksClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesDiskRequest, opts ...gax.CallOption) (*Operation, error)
AddResourcePolicies adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddResourcePoliciesDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddResourcePoliciesDiskRequest.
}
op, err := c.AddResourcePolicies(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) AggregatedList ¶
func (c *DisksClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListDisksRequest, opts ...gax.CallOption) *DisksScopedListPairIterator
AggregatedList retrieves an aggregated list of persistent disks.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListDisksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListDisksRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.DiskAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListDisksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListDisksRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DisksClient) BulkInsert ¶
func (c *DisksClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertDiskRequest, opts ...gax.CallOption) (*Operation, error)
BulkInsert bulk create a set of disks.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.BulkInsertDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#BulkInsertDiskRequest.
}
op, err := c.BulkInsert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) BulkSetLabels ¶
func (c *DisksClient) BulkSetLabels(ctx context.Context, req *computepb.BulkSetLabelsDiskRequest, opts ...gax.CallOption) (*Operation, error)
BulkSetLabels sets the labels on many disks at once. To learn more about labels, read theLabeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.BulkSetLabelsDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#BulkSetLabelsDiskRequest.
}
op, err := c.BulkSetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) Close ¶
func (c *DisksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*DisksClient) Connection
deprecated
func (c *DisksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*DisksClient) CreateSnapshot ¶
func (c *DisksClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotDiskRequest, opts ...gax.CallOption) (*Operation, error)
CreateSnapshot creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CreateSnapshotDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CreateSnapshotDiskRequest.
}
op, err := c.CreateSnapshot(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) Delete ¶
func (c *DisksClient) Delete(ctx context.Context, req *computepb.DeleteDiskRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separatelydelete snapshots.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteDiskRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) Get ¶
func (c *DisksClient) Get(ctx context.Context, req *computepb.GetDiskRequest, opts ...gax.CallOption) (*computepb.Disk, error)
Get returns the specified persistent disk.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetDiskRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DisksClient) GetIamPolicy ¶
func (c *DisksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyDiskRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DisksClient) Insert ¶
func (c *DisksClient) Insert(ctx context.Context, req *computepb.InsertDiskRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, orsourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertDiskRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) List ¶
func (c *DisksClient) List(ctx context.Context, req *computepb.ListDisksRequest, opts ...gax.CallOption) *DiskIterator
List retrieves a list of persistent disks contained within the specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListDisksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListDisksRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.DiskList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListDisksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListDisksRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DisksClient) RemoveResourcePolicies ¶
func (c *DisksClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesDiskRequest, opts ...gax.CallOption) (*Operation, error)
RemoveResourcePolicies removes resource policies from a disk.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveResourcePoliciesDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveResourcePoliciesDiskRequest.
}
op, err := c.RemoveResourcePolicies(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) Resize ¶
func (c *DisksClient) Resize(ctx context.Context, req *computepb.ResizeDiskRequest, opts ...gax.CallOption) (*Operation, error)
Resize resizes the specified persistent disk. You can only increase the size of the disk.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResizeDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ResizeDiskRequest.
}
op, err := c.Resize(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) SetIamPolicy ¶
func (c *DisksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyDiskRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DisksClient) SetLabels ¶
func (c *DisksClient) SetLabels(ctx context.Context, req *computepb.SetLabelsDiskRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a disk. To learn more about labels, read theLabeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsDiskRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) StartAsyncReplication ¶
func (c *DisksClient) StartAsyncReplication(ctx context.Context, req *computepb.StartAsyncReplicationDiskRequest, opts ...gax.CallOption) (*Operation, error)
StartAsyncReplication starts asynchronous replication. Must be invoked on the primary disk.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StartAsyncReplicationDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StartAsyncReplicationDiskRequest.
}
op, err := c.StartAsyncReplication(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) StopAsyncReplication ¶
func (c *DisksClient) StopAsyncReplication(ctx context.Context, req *computepb.StopAsyncReplicationDiskRequest, opts ...gax.CallOption) (*Operation, error)
StopAsyncReplication stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StopAsyncReplicationDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StopAsyncReplicationDiskRequest.
}
op, err := c.StopAsyncReplication(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) StopGroupAsyncReplication ¶
func (c *DisksClient) StopGroupAsyncReplication(ctx context.Context, req *computepb.StopGroupAsyncReplicationDiskRequest, opts ...gax.CallOption) (*Operation, error)
StopGroupAsyncReplication stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StopGroupAsyncReplicationDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StopGroupAsyncReplicationDiskRequest.
}
op, err := c.StopGroupAsyncReplication(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DisksClient) TestIamPermissions ¶
func (c *DisksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsDiskRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsDiskRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DisksClient) Update ¶
func (c *DisksClient) Update(ctx context.Context, req *computepb.UpdateDiskRequest, opts ...gax.CallOption) (*Operation, error)
Update updates the specified disk with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateDiskRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type DisksScopedListPair ¶
type DisksScopedListPair struct {
Key string
Value *computepb.DisksScopedList
}
DisksScopedListPair is a holder type for string/*computepb.DisksScopedList map entries
type DisksScopedListPairIterator ¶
type DisksScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []DisksScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
DisksScopedListPairIterator manages a stream of DisksScopedListPair.
func (*DisksScopedListPairIterator) All ¶
func (it *DisksScopedListPairIterator) All() iter.Seq2[DisksScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DisksScopedListPairIterator) Next ¶
func (it *DisksScopedListPairIterator) Next() (DisksScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*DisksScopedListPairIterator) PageInfo ¶
func (it *DisksScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ExchangedPeeringRouteIterator ¶
type ExchangedPeeringRouteIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.ExchangedPeeringRoute, nextPageToken string, err error)
// contains filtered or unexported fields
}
ExchangedPeeringRouteIterator manages a stream of *computepb.ExchangedPeeringRoute.
func (*ExchangedPeeringRouteIterator) All ¶
func (it *ExchangedPeeringRouteIterator) All() iter.Seq2[*computepb.ExchangedPeeringRoute, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ExchangedPeeringRouteIterator) Next ¶
func (it *ExchangedPeeringRouteIterator) Next() (*computepb.ExchangedPeeringRoute, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ExchangedPeeringRouteIterator) PageInfo ¶
func (it *ExchangedPeeringRouteIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ExternalVpnGatewayIterator ¶
type ExternalVpnGatewayIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.ExternalVpnGateway, nextPageToken string, err error)
// contains filtered or unexported fields
}
ExternalVpnGatewayIterator manages a stream of *computepb.ExternalVpnGateway.
func (*ExternalVpnGatewayIterator) All ¶
func (it *ExternalVpnGatewayIterator) All() iter.Seq2[*computepb.ExternalVpnGateway, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ExternalVpnGatewayIterator) Next ¶
func (it *ExternalVpnGatewayIterator) Next() (*computepb.ExternalVpnGateway, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ExternalVpnGatewayIterator) PageInfo ¶
func (it *ExternalVpnGatewayIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ExternalVpnGatewaysCallOptions ¶
type ExternalVpnGatewaysCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
ExternalVpnGatewaysCallOptions contains the retry settings for each method of ExternalVpnGatewaysClient.
type ExternalVpnGatewaysClient ¶
type ExternalVpnGatewaysClient struct {
// The call options for this service.
CallOptions *ExternalVpnGatewaysCallOptions
// contains filtered or unexported fields
}
ExternalVpnGatewaysClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ExternalVpnGateways API.
func NewExternalVpnGatewaysRESTClient ¶
func NewExternalVpnGatewaysRESTClient(ctx context.Context, opts ...option.ClientOption) (*ExternalVpnGatewaysClient, error)
NewExternalVpnGatewaysRESTClient creates a new external vpn gateways rest client.
The ExternalVpnGateways API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ExternalVpnGatewaysClient) Close ¶
func (c *ExternalVpnGatewaysClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ExternalVpnGatewaysClient) Connection
deprecated
func (c *ExternalVpnGatewaysClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ExternalVpnGatewaysClient) Delete ¶
func (c *ExternalVpnGatewaysClient) Delete(ctx context.Context, req *computepb.DeleteExternalVpnGatewayRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified externalVpnGateway.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteExternalVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteExternalVpnGatewayRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ExternalVpnGatewaysClient) Get ¶
func (c *ExternalVpnGatewaysClient) Get(ctx context.Context, req *computepb.GetExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.ExternalVpnGateway, error)
Get returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetExternalVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetExternalVpnGatewayRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ExternalVpnGatewaysClient) Insert ¶
func (c *ExternalVpnGatewaysClient) Insert(ctx context.Context, req *computepb.InsertExternalVpnGatewayRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a ExternalVpnGateway in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertExternalVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertExternalVpnGatewayRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ExternalVpnGatewaysClient) List ¶
func (c *ExternalVpnGatewaysClient) List(ctx context.Context, req *computepb.ListExternalVpnGatewaysRequest, opts ...gax.CallOption) *ExternalVpnGatewayIterator
List retrieves the list of ExternalVpnGateway available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListExternalVpnGatewaysRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListExternalVpnGatewaysRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ExternalVpnGatewayList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListExternalVpnGatewaysRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListExternalVpnGatewaysRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ExternalVpnGatewaysClient) SetLabels ¶
func (c *ExternalVpnGatewaysClient) SetLabels(ctx context.Context, req *computepb.SetLabelsExternalVpnGatewayRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsExternalVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsExternalVpnGatewayRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ExternalVpnGatewaysClient) TestIamPermissions ¶
func (c *ExternalVpnGatewaysClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsExternalVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsExternalVpnGatewayRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type FirewallIterator ¶
type FirewallIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Firewall, nextPageToken string, err error)
// contains filtered or unexported fields
}
FirewallIterator manages a stream of *computepb.Firewall.
func (*FirewallIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*FirewallIterator) Next ¶
func (it *FirewallIterator) Next() (*computepb.Firewall, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*FirewallIterator) PageInfo ¶
func (it *FirewallIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type FirewallPoliciesCallOptions ¶
type FirewallPoliciesCallOptions struct {
AddAssociation []gax.CallOption
AddPacketMirroringRule []gax.CallOption
AddRule []gax.CallOption
CloneRules []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetAssociation []gax.CallOption
GetIamPolicy []gax.CallOption
GetPacketMirroringRule []gax.CallOption
GetRule []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListAssociations []gax.CallOption
Move []gax.CallOption
Patch []gax.CallOption
PatchPacketMirroringRule []gax.CallOption
PatchRule []gax.CallOption
RemoveAssociation []gax.CallOption
RemovePacketMirroringRule []gax.CallOption
RemoveRule []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
FirewallPoliciesCallOptions contains the retry settings for each method of FirewallPoliciesClient.
type FirewallPoliciesClient ¶
type FirewallPoliciesClient struct {
// The call options for this service.
CallOptions *FirewallPoliciesCallOptions
// contains filtered or unexported fields
}
FirewallPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The FirewallPolicies API.
func NewFirewallPoliciesRESTClient ¶
func NewFirewallPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*FirewallPoliciesClient, error)
NewFirewallPoliciesRESTClient creates a new firewall policies rest client.
The FirewallPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*FirewallPoliciesClient) AddAssociation ¶
func (c *FirewallPoliciesClient) AddAssociation(ctx context.Context, req *computepb.AddAssociationFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddAssociation inserts an association for the specified firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddAssociationFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddAssociationFirewallPolicyRequest.
}
op, err := c.AddAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) AddPacketMirroringRule ¶
func (c *FirewallPoliciesClient) AddPacketMirroringRule(ctx context.Context, req *computepb.AddPacketMirroringRuleFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddPacketMirroringRule inserts a packet mirroring rule into a firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddPacketMirroringRuleFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddPacketMirroringRuleFirewallPolicyRequest.
}
op, err := c.AddPacketMirroringRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) AddRule ¶
func (c *FirewallPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddRule inserts a rule into a firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddRuleFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddRuleFirewallPolicyRequest.
}
op, err := c.AddRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) CloneRules ¶
func (c *FirewallPoliciesClient) CloneRules(ctx context.Context, req *computepb.CloneRulesFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
CloneRules copies rules to the specified firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CloneRulesFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CloneRulesFirewallPolicyRequest.
}
op, err := c.CloneRules(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) Close ¶
func (c *FirewallPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*FirewallPoliciesClient) Connection
deprecated
func (c *FirewallPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*FirewallPoliciesClient) Delete ¶
func (c *FirewallPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteFirewallPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) Get ¶
func (c *FirewallPoliciesClient) Get(ctx context.Context, req *computepb.GetFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicy, error)
Get returns the specified firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetFirewallPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FirewallPoliciesClient) GetAssociation ¶
func (c *FirewallPoliciesClient) GetAssociation(ctx context.Context, req *computepb.GetAssociationFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyAssociation, error)
GetAssociation gets an association with the specified name.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetAssociationFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetAssociationFirewallPolicyRequest.
}
resp, err := c.GetAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FirewallPoliciesClient) GetIamPolicy ¶
func (c *FirewallPoliciesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyFirewallPolicyRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FirewallPoliciesClient) GetPacketMirroringRule ¶
func (c *FirewallPoliciesClient) GetPacketMirroringRule(ctx context.Context, req *computepb.GetPacketMirroringRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyRule, error)
GetPacketMirroringRule gets a packet mirroring rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetPacketMirroringRuleFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetPacketMirroringRuleFirewallPolicyRequest.
}
resp, err := c.GetPacketMirroringRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FirewallPoliciesClient) GetRule ¶
func (c *FirewallPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyRule, error)
GetRule gets a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRuleFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRuleFirewallPolicyRequest.
}
resp, err := c.GetRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FirewallPoliciesClient) Insert ¶
func (c *FirewallPoliciesClient) Insert(ctx context.Context, req *computepb.InsertFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new policy in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertFirewallPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) List ¶
func (c *FirewallPoliciesClient) List(ctx context.Context, req *computepb.ListFirewallPoliciesRequest, opts ...gax.CallOption) *FirewallPolicyIterator
List lists all the policies that have been configured for the specified folder or organization.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListFirewallPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListFirewallPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.FirewallPolicyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListFirewallPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListFirewallPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*FirewallPoliciesClient) ListAssociations ¶
func (c *FirewallPoliciesClient) ListAssociations(ctx context.Context, req *computepb.ListAssociationsFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPoliciesListAssociationsResponse, error)
ListAssociations lists associations of a specified target, i.e., organization or folder.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListAssociationsFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListAssociationsFirewallPolicyRequest.
}
resp, err := c.ListAssociations(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FirewallPoliciesClient) Move ¶
func (c *FirewallPoliciesClient) Move(ctx context.Context, req *computepb.MoveFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Move moves the specified firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.MoveFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#MoveFirewallPolicyRequest.
}
op, err := c.Move(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) Patch ¶
func (c *FirewallPoliciesClient) Patch(ctx context.Context, req *computepb.PatchFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified policy with the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchFirewallPolicyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) PatchPacketMirroringRule ¶
func (c *FirewallPoliciesClient) PatchPacketMirroringRule(ctx context.Context, req *computepb.PatchPacketMirroringRuleFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
PatchPacketMirroringRule patches a packet mirroring rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchPacketMirroringRuleFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchPacketMirroringRuleFirewallPolicyRequest.
}
op, err := c.PatchPacketMirroringRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) PatchRule ¶
func (c *FirewallPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
PatchRule patches a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRuleFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRuleFirewallPolicyRequest.
}
op, err := c.PatchRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) RemoveAssociation ¶
func (c *FirewallPoliciesClient) RemoveAssociation(ctx context.Context, req *computepb.RemoveAssociationFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveAssociation removes an association for the specified firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveAssociationFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveAssociationFirewallPolicyRequest.
}
op, err := c.RemoveAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) RemovePacketMirroringRule ¶
func (c *FirewallPoliciesClient) RemovePacketMirroringRule(ctx context.Context, req *computepb.RemovePacketMirroringRuleFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemovePacketMirroringRule deletes a packet mirroring rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemovePacketMirroringRuleFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemovePacketMirroringRuleFirewallPolicyRequest.
}
op, err := c.RemovePacketMirroringRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) RemoveRule ¶
func (c *FirewallPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveRule deletes a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveRuleFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveRuleFirewallPolicyRequest.
}
op, err := c.RemoveRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallPoliciesClient) SetIamPolicy ¶
func (c *FirewallPoliciesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyFirewallPolicyRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FirewallPoliciesClient) TestIamPermissions ¶
func (c *FirewallPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsFirewallPolicyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type FirewallPoliciesScopedListPair ¶
type FirewallPoliciesScopedListPair struct {
Key string
Value *computepb.FirewallPoliciesScopedList
}
FirewallPoliciesScopedListPair is a holder type for string/*computepb.FirewallPoliciesScopedList map entries
type FirewallPoliciesScopedListPairIterator ¶
type FirewallPoliciesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []FirewallPoliciesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
FirewallPoliciesScopedListPairIterator manages a stream of FirewallPoliciesScopedListPair.
func (*FirewallPoliciesScopedListPairIterator) All ¶
func (it *FirewallPoliciesScopedListPairIterator) All() iter.Seq2[FirewallPoliciesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*FirewallPoliciesScopedListPairIterator) Next ¶
func (it *FirewallPoliciesScopedListPairIterator) Next() (FirewallPoliciesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*FirewallPoliciesScopedListPairIterator) PageInfo ¶
func (it *FirewallPoliciesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type FirewallPolicyIterator ¶
type FirewallPolicyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.FirewallPolicy, nextPageToken string, err error)
// contains filtered or unexported fields
}
FirewallPolicyIterator manages a stream of *computepb.FirewallPolicy.
func (*FirewallPolicyIterator) All ¶
func (it *FirewallPolicyIterator) All() iter.Seq2[*computepb.FirewallPolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*FirewallPolicyIterator) Next ¶
func (it *FirewallPolicyIterator) Next() (*computepb.FirewallPolicy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*FirewallPolicyIterator) PageInfo ¶
func (it *FirewallPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type FirewallsCallOptions ¶
type FirewallsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
FirewallsCallOptions contains the retry settings for each method of FirewallsClient.
type FirewallsClient ¶
type FirewallsClient struct {
// The call options for this service.
CallOptions *FirewallsCallOptions
// contains filtered or unexported fields
}
FirewallsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Firewalls API.
func NewFirewallsRESTClient ¶
func NewFirewallsRESTClient(ctx context.Context, opts ...option.ClientOption) (*FirewallsClient, error)
NewFirewallsRESTClient creates a new firewalls rest client.
The Firewalls API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*FirewallsClient) Close ¶
func (c *FirewallsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*FirewallsClient) Connection
deprecated
func (c *FirewallsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*FirewallsClient) Delete ¶
func (c *FirewallsClient) Delete(ctx context.Context, req *computepb.DeleteFirewallRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified firewall.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteFirewallRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteFirewallRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallsClient) Get ¶
func (c *FirewallsClient) Get(ctx context.Context, req *computepb.GetFirewallRequest, opts ...gax.CallOption) (*computepb.Firewall, error)
Get returns the specified firewall.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetFirewallRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetFirewallRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FirewallsClient) Insert ¶
func (c *FirewallsClient) Insert(ctx context.Context, req *computepb.InsertFirewallRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a firewall rule in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertFirewallRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertFirewallRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallsClient) List ¶
func (c *FirewallsClient) List(ctx context.Context, req *computepb.ListFirewallsRequest, opts ...gax.CallOption) *FirewallIterator
List retrieves the list of firewall rules available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListFirewallsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListFirewallsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.FirewallList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListFirewallsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListFirewallsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*FirewallsClient) Patch ¶
func (c *FirewallsClient) Patch(ctx context.Context, req *computepb.PatchFirewallRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified firewall rule with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchFirewallRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchFirewallRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FirewallsClient) TestIamPermissions ¶
func (c *FirewallsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsFirewallRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsFirewallRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsFirewallRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FirewallsClient) Update ¶
func (c *FirewallsClient) Update(ctx context.Context, req *computepb.UpdateFirewallRequest, opts ...gax.CallOption) (*Operation, error)
Update updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFirewallsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateFirewallRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateFirewallRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type ForwardingRuleIterator ¶
type ForwardingRuleIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.ForwardingRule, nextPageToken string, err error)
// contains filtered or unexported fields
}
ForwardingRuleIterator manages a stream of *computepb.ForwardingRule.
func (*ForwardingRuleIterator) All ¶
func (it *ForwardingRuleIterator) All() iter.Seq2[*computepb.ForwardingRule, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ForwardingRuleIterator) Next ¶
func (it *ForwardingRuleIterator) Next() (*computepb.ForwardingRule, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ForwardingRuleIterator) PageInfo ¶
func (it *ForwardingRuleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ForwardingRulesCallOptions ¶
type ForwardingRulesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetLabels []gax.CallOption
SetTarget []gax.CallOption
TestIamPermissions []gax.CallOption
}
ForwardingRulesCallOptions contains the retry settings for each method of ForwardingRulesClient.
type ForwardingRulesClient ¶
type ForwardingRulesClient struct {
// The call options for this service.
CallOptions *ForwardingRulesCallOptions
// contains filtered or unexported fields
}
ForwardingRulesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ForwardingRules API.
func NewForwardingRulesRESTClient ¶
func NewForwardingRulesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ForwardingRulesClient, error)
NewForwardingRulesRESTClient creates a new forwarding rules rest client.
The ForwardingRules API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ForwardingRulesClient) AggregatedList ¶
func (c *ForwardingRulesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListForwardingRulesRequest, opts ...gax.CallOption) *ForwardingRulesScopedListPairIterator
AggregatedList retrieves an aggregated list of forwarding rules.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListForwardingRulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListForwardingRulesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ForwardingRuleAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListForwardingRulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListForwardingRulesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ForwardingRulesClient) Close ¶
func (c *ForwardingRulesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ForwardingRulesClient) Connection
deprecated
func (c *ForwardingRulesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ForwardingRulesClient) Delete ¶
func (c *ForwardingRulesClient) Delete(ctx context.Context, req *computepb.DeleteForwardingRuleRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified ForwardingRule resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteForwardingRuleRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ForwardingRulesClient) Get ¶
func (c *ForwardingRulesClient) Get(ctx context.Context, req *computepb.GetForwardingRuleRequest, opts ...gax.CallOption) (*computepb.ForwardingRule, error)
Get returns the specified ForwardingRule resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetForwardingRuleRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ForwardingRulesClient) Insert ¶
func (c *ForwardingRulesClient) Insert(ctx context.Context, req *computepb.InsertForwardingRuleRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a ForwardingRule resource in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertForwardingRuleRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ForwardingRulesClient) List ¶
func (c *ForwardingRulesClient) List(ctx context.Context, req *computepb.ListForwardingRulesRequest, opts ...gax.CallOption) *ForwardingRuleIterator
List retrieves a list of ForwardingRule resources available to the specified project and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListForwardingRulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListForwardingRulesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ForwardingRuleList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListForwardingRulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListForwardingRulesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ForwardingRulesClient) Patch ¶
func (c *ForwardingRulesClient) Patch(ctx context.Context, req *computepb.PatchForwardingRuleRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified forwarding rule with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules. Currently, you can only patch the network_tier field.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchForwardingRuleRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ForwardingRulesClient) SetLabels ¶
func (c *ForwardingRulesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsForwardingRuleRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsForwardingRuleRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ForwardingRulesClient) SetTarget ¶
func (c *ForwardingRulesClient) SetTarget(ctx context.Context, req *computepb.SetTargetForwardingRuleRequest, opts ...gax.CallOption) (*Operation, error)
SetTarget changes target URL for forwarding rule. The new target should be of the same type as the old target.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetTargetForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetTargetForwardingRuleRequest.
}
op, err := c.SetTarget(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ForwardingRulesClient) TestIamPermissions ¶
func (c *ForwardingRulesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsForwardingRuleRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsForwardingRuleRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ForwardingRulesScopedListPair ¶
type ForwardingRulesScopedListPair struct {
Key string
Value *computepb.ForwardingRulesScopedList
}
ForwardingRulesScopedListPair is a holder type for string/*computepb.ForwardingRulesScopedList map entries
type ForwardingRulesScopedListPairIterator ¶
type ForwardingRulesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []ForwardingRulesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
ForwardingRulesScopedListPairIterator manages a stream of ForwardingRulesScopedListPair.
func (*ForwardingRulesScopedListPairIterator) All ¶
func (it *ForwardingRulesScopedListPairIterator) All() iter.Seq2[ForwardingRulesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ForwardingRulesScopedListPairIterator) Next ¶
func (it *ForwardingRulesScopedListPairIterator) Next() (ForwardingRulesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ForwardingRulesScopedListPairIterator) PageInfo ¶
func (it *ForwardingRulesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type FutureReservationIterator ¶
type FutureReservationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.FutureReservation, nextPageToken string, err error)
// contains filtered or unexported fields
}
FutureReservationIterator manages a stream of *computepb.FutureReservation.
func (*FutureReservationIterator) All ¶
func (it *FutureReservationIterator) All() iter.Seq2[*computepb.FutureReservation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*FutureReservationIterator) Next ¶
func (it *FutureReservationIterator) Next() (*computepb.FutureReservation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*FutureReservationIterator) PageInfo ¶
func (it *FutureReservationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type FutureReservationsCallOptions ¶
type FutureReservationsCallOptions struct {
AggregatedList []gax.CallOption
Cancel []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Update []gax.CallOption
}
FutureReservationsCallOptions contains the retry settings for each method of FutureReservationsClient.
type FutureReservationsClient ¶
type FutureReservationsClient struct {
// The call options for this service.
CallOptions *FutureReservationsCallOptions
// contains filtered or unexported fields
}
FutureReservationsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The FutureReservations API.
func NewFutureReservationsRESTClient ¶
func NewFutureReservationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*FutureReservationsClient, error)
NewFutureReservationsRESTClient creates a new future reservations rest client.
The FutureReservations API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFutureReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*FutureReservationsClient) AggregatedList ¶
func (c *FutureReservationsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListFutureReservationsRequest, opts ...gax.CallOption) *FutureReservationsScopedListPairIterator
AggregatedList retrieves an aggregated list of future reservations.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFutureReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListFutureReservationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListFutureReservationsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.FutureReservationsAggregatedListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFutureReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListFutureReservationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListFutureReservationsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*FutureReservationsClient) Cancel ¶
func (c *FutureReservationsClient) Cancel(ctx context.Context, req *computepb.CancelFutureReservationRequest, opts ...gax.CallOption) (*Operation, error)
Cancel cancel the specified future reservation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFutureReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CancelFutureReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CancelFutureReservationRequest.
}
op, err := c.Cancel(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FutureReservationsClient) Close ¶
func (c *FutureReservationsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*FutureReservationsClient) Connection
deprecated
func (c *FutureReservationsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*FutureReservationsClient) Delete ¶
func (c *FutureReservationsClient) Delete(ctx context.Context, req *computepb.DeleteFutureReservationRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified future reservation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFutureReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteFutureReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteFutureReservationRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FutureReservationsClient) Get ¶
func (c *FutureReservationsClient) Get(ctx context.Context, req *computepb.GetFutureReservationRequest, opts ...gax.CallOption) (*computepb.FutureReservation, error)
Get retrieves information about the specified future reservation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFutureReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetFutureReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetFutureReservationRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FutureReservationsClient) Insert ¶
func (c *FutureReservationsClient) Insert(ctx context.Context, req *computepb.InsertFutureReservationRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new Future Reservation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFutureReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertFutureReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertFutureReservationRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FutureReservationsClient) List ¶
func (c *FutureReservationsClient) List(ctx context.Context, req *computepb.ListFutureReservationsRequest, opts ...gax.CallOption) *FutureReservationIterator
List a list of all the future reservations that have been configured for the specified project in specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFutureReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListFutureReservationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListFutureReservationsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.FutureReservationsListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFutureReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListFutureReservationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListFutureReservationsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*FutureReservationsClient) Update ¶
func (c *FutureReservationsClient) Update(ctx context.Context, req *computepb.UpdateFutureReservationRequest, opts ...gax.CallOption) (*Operation, error)
Update updates the specified future reservation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewFutureReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateFutureReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateFutureReservationRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type FutureReservationsScopedListPair ¶
type FutureReservationsScopedListPair struct {
Key string
Value *computepb.FutureReservationsScopedList
}
FutureReservationsScopedListPair is a holder type for string/*computepb.FutureReservationsScopedList map entries
type FutureReservationsScopedListPairIterator ¶
type FutureReservationsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []FutureReservationsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
FutureReservationsScopedListPairIterator manages a stream of FutureReservationsScopedListPair.
func (*FutureReservationsScopedListPairIterator) All ¶
func (it *FutureReservationsScopedListPairIterator) All() iter.Seq2[FutureReservationsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*FutureReservationsScopedListPairIterator) Next ¶
func (it *FutureReservationsScopedListPairIterator) Next() (FutureReservationsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*FutureReservationsScopedListPairIterator) PageInfo ¶
func (it *FutureReservationsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type GlobalAddressesCallOptions ¶
type GlobalAddressesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Move []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
GlobalAddressesCallOptions contains the retry settings for each method of GlobalAddressesClient.
type GlobalAddressesClient ¶
type GlobalAddressesClient struct {
// The call options for this service.
CallOptions *GlobalAddressesCallOptions
// contains filtered or unexported fields
}
GlobalAddressesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The GlobalAddresses API.
func NewGlobalAddressesRESTClient ¶
func NewGlobalAddressesRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalAddressesClient, error)
NewGlobalAddressesRESTClient creates a new global addresses rest client.
The GlobalAddresses API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*GlobalAddressesClient) Close ¶
func (c *GlobalAddressesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*GlobalAddressesClient) Connection
deprecated
func (c *GlobalAddressesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*GlobalAddressesClient) Delete ¶
func (c *GlobalAddressesClient) Delete(ctx context.Context, req *computepb.DeleteGlobalAddressRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified address resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteGlobalAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteGlobalAddressRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalAddressesClient) Get ¶
func (c *GlobalAddressesClient) Get(ctx context.Context, req *computepb.GetGlobalAddressRequest, opts ...gax.CallOption) (*computepb.Address, error)
Get returns the specified address resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetGlobalAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetGlobalAddressRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GlobalAddressesClient) Insert ¶
func (c *GlobalAddressesClient) Insert(ctx context.Context, req *computepb.InsertGlobalAddressRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an address resource in the specified project by using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertGlobalAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertGlobalAddressRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalAddressesClient) List ¶
func (c *GlobalAddressesClient) List(ctx context.Context, req *computepb.ListGlobalAddressesRequest, opts ...gax.CallOption) *AddressIterator
List retrieves a list of global addresses.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalAddressesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalAddressesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.AddressList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalAddressesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalAddressesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*GlobalAddressesClient) Move ¶
func (c *GlobalAddressesClient) Move(ctx context.Context, req *computepb.MoveGlobalAddressRequest, opts ...gax.CallOption) (*Operation, error)
Move moves the specified address resource from one project to another project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.MoveGlobalAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#MoveGlobalAddressRequest.
}
op, err := c.Move(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalAddressesClient) SetLabels ¶
func (c *GlobalAddressesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsGlobalAddressRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a GlobalAddress. To learn more about labels, read theLabeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsGlobalAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsGlobalAddressRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalAddressesClient) TestIamPermissions ¶
func (c *GlobalAddressesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsGlobalAddressRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalAddressesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsGlobalAddressRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsGlobalAddressRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type GlobalForwardingRulesCallOptions ¶
type GlobalForwardingRulesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetLabels []gax.CallOption
SetTarget []gax.CallOption
TestIamPermissions []gax.CallOption
}
GlobalForwardingRulesCallOptions contains the retry settings for each method of GlobalForwardingRulesClient.
type GlobalForwardingRulesClient ¶
type GlobalForwardingRulesClient struct {
// The call options for this service.
CallOptions *GlobalForwardingRulesCallOptions
// contains filtered or unexported fields
}
GlobalForwardingRulesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The GlobalForwardingRules API.
func NewGlobalForwardingRulesRESTClient ¶
func NewGlobalForwardingRulesRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalForwardingRulesClient, error)
NewGlobalForwardingRulesRESTClient creates a new global forwarding rules rest client.
The GlobalForwardingRules API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*GlobalForwardingRulesClient) Close ¶
func (c *GlobalForwardingRulesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*GlobalForwardingRulesClient) Connection
deprecated
func (c *GlobalForwardingRulesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*GlobalForwardingRulesClient) Delete ¶
func (c *GlobalForwardingRulesClient) Delete(ctx context.Context, req *computepb.DeleteGlobalForwardingRuleRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified GlobalForwardingRule resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteGlobalForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteGlobalForwardingRuleRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalForwardingRulesClient) Get ¶
func (c *GlobalForwardingRulesClient) Get(ctx context.Context, req *computepb.GetGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.ForwardingRule, error)
Get returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetGlobalForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetGlobalForwardingRuleRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GlobalForwardingRulesClient) Insert ¶
func (c *GlobalForwardingRulesClient) Insert(ctx context.Context, req *computepb.InsertGlobalForwardingRuleRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a GlobalForwardingRule resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertGlobalForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertGlobalForwardingRuleRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalForwardingRulesClient) List ¶
func (c *GlobalForwardingRulesClient) List(ctx context.Context, req *computepb.ListGlobalForwardingRulesRequest, opts ...gax.CallOption) *ForwardingRuleIterator
List retrieves a list of GlobalForwardingRule resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalForwardingRulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalForwardingRulesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ForwardingRuleList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalForwardingRulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalForwardingRulesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*GlobalForwardingRulesClient) Patch ¶
func (c *GlobalForwardingRulesClient) Patch(ctx context.Context, req *computepb.PatchGlobalForwardingRuleRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified forwarding rule with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules. Currently, you can only patch the network_tier field.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchGlobalForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchGlobalForwardingRuleRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalForwardingRulesClient) SetLabels ¶
func (c *GlobalForwardingRulesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsGlobalForwardingRuleRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on the specified resource. To learn more about labels, read the Labeling resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsGlobalForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsGlobalForwardingRuleRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalForwardingRulesClient) SetTarget ¶
func (c *GlobalForwardingRulesClient) SetTarget(ctx context.Context, req *computepb.SetTargetGlobalForwardingRuleRequest, opts ...gax.CallOption) (*Operation, error)
SetTarget changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetTargetGlobalForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetTargetGlobalForwardingRuleRequest.
}
op, err := c.SetTarget(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalForwardingRulesClient) TestIamPermissions ¶
func (c *GlobalForwardingRulesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalForwardingRulesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsGlobalForwardingRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsGlobalForwardingRuleRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type GlobalNetworkEndpointGroupsCallOptions ¶
type GlobalNetworkEndpointGroupsCallOptions struct {
AttachNetworkEndpoints []gax.CallOption
Delete []gax.CallOption
DetachNetworkEndpoints []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListNetworkEndpoints []gax.CallOption
}
GlobalNetworkEndpointGroupsCallOptions contains the retry settings for each method of GlobalNetworkEndpointGroupsClient.
type GlobalNetworkEndpointGroupsClient ¶
type GlobalNetworkEndpointGroupsClient struct {
// The call options for this service.
CallOptions *GlobalNetworkEndpointGroupsCallOptions
// contains filtered or unexported fields
}
GlobalNetworkEndpointGroupsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The GlobalNetworkEndpointGroups API.
func NewGlobalNetworkEndpointGroupsRESTClient ¶
func NewGlobalNetworkEndpointGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalNetworkEndpointGroupsClient, error)
NewGlobalNetworkEndpointGroupsRESTClient creates a new global network endpoint groups rest client.
The GlobalNetworkEndpointGroups API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*GlobalNetworkEndpointGroupsClient) AttachNetworkEndpoints ¶
func (c *GlobalNetworkEndpointGroupsClient) AttachNetworkEndpoints(ctx context.Context, req *computepb.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
AttachNetworkEndpoints attach a network endpoint to the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.
}
op, err := c.AttachNetworkEndpoints(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalNetworkEndpointGroupsClient) Close ¶
func (c *GlobalNetworkEndpointGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*GlobalNetworkEndpointGroupsClient) Connection
deprecated
func (c *GlobalNetworkEndpointGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*GlobalNetworkEndpointGroupsClient) Delete ¶
func (c *GlobalNetworkEndpointGroupsClient) Delete(ctx context.Context, req *computepb.DeleteGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteGlobalNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteGlobalNetworkEndpointGroupRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalNetworkEndpointGroupsClient) DetachNetworkEndpoints ¶
func (c *GlobalNetworkEndpointGroupsClient) DetachNetworkEndpoints(ctx context.Context, req *computepb.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
DetachNetworkEndpoints detach the network endpoint from the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.
}
op, err := c.DetachNetworkEndpoints(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalNetworkEndpointGroupsClient) Get ¶
func (c *GlobalNetworkEndpointGroupsClient) Get(ctx context.Context, req *computepb.GetGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroup, error)
Get returns the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetGlobalNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetGlobalNetworkEndpointGroupRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GlobalNetworkEndpointGroupsClient) Insert ¶
func (c *GlobalNetworkEndpointGroupsClient) Insert(ctx context.Context, req *computepb.InsertGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a network endpoint group in the specified project using the parameters that are included in the request.
Note: Use the following APIs to manage network endpoint groups:
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertGlobalNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertGlobalNetworkEndpointGroupRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalNetworkEndpointGroupsClient) List ¶
func (c *GlobalNetworkEndpointGroupsClient) List(ctx context.Context, req *computepb.ListGlobalNetworkEndpointGroupsRequest, opts ...gax.CallOption) *NetworkEndpointGroupIterator
List retrieves the list of network endpoint groups that are located in the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalNetworkEndpointGroupsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkEndpointGroupList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalNetworkEndpointGroupsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*GlobalNetworkEndpointGroupsClient) ListNetworkEndpoints ¶
func (c *GlobalNetworkEndpointGroupsClient) ListNetworkEndpoints(ctx context.Context, req *computepb.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, opts ...gax.CallOption) *NetworkEndpointWithHealthStatusIterator
ListNetworkEndpoints lists the network endpoints in the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.
}
it := c.ListNetworkEndpoints(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkEndpointGroupsListNetworkEndpoints)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.
}
for resp, err := range c.ListNetworkEndpoints(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type GlobalOperationsCallOptions ¶
type GlobalOperationsCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
List []gax.CallOption
Wait []gax.CallOption
}
GlobalOperationsCallOptions contains the retry settings for each method of GlobalOperationsClient.
type GlobalOperationsClient ¶
type GlobalOperationsClient struct {
// The call options for this service.
CallOptions *GlobalOperationsCallOptions
// contains filtered or unexported fields
}
GlobalOperationsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The GlobalOperations API.
func NewGlobalOperationsRESTClient ¶
func NewGlobalOperationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalOperationsClient, error)
NewGlobalOperationsRESTClient creates a new global operations rest client.
The GlobalOperations API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*GlobalOperationsClient) AggregatedList ¶
func (c *GlobalOperationsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListGlobalOperationsRequest, opts ...gax.CallOption) *OperationsScopedListPairIterator
AggregatedList retrieves an aggregated list of all operations.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListGlobalOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListGlobalOperationsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.OperationAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListGlobalOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListGlobalOperationsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*GlobalOperationsClient) Close ¶
func (c *GlobalOperationsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*GlobalOperationsClient) Connection
deprecated
func (c *GlobalOperationsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*GlobalOperationsClient) Delete ¶
func (c *GlobalOperationsClient) Delete(ctx context.Context, req *computepb.DeleteGlobalOperationRequest, opts ...gax.CallOption) (*computepb.DeleteGlobalOperationResponse, error)
Delete deletes the specified Operations resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteGlobalOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteGlobalOperationRequest.
}
resp, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GlobalOperationsClient) Get ¶
func (c *GlobalOperationsClient) Get(ctx context.Context, req *computepb.GetGlobalOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error)
Get retrieves the specified Operations resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetGlobalOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetGlobalOperationRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GlobalOperationsClient) List ¶
func (c *GlobalOperationsClient) List(ctx context.Context, req *computepb.ListGlobalOperationsRequest, opts ...gax.CallOption) *OperationIterator
List retrieves a list of Operation resources contained within the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalOperationsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.OperationList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalOperationsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*GlobalOperationsClient) Wait ¶
func (c *GlobalOperationsClient) Wait(ctx context.Context, req *computepb.WaitGlobalOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error)
Wait waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the GET method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be DONE or still in progress.
This method is called on a best-effort basis. Specifically:
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.WaitGlobalOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#WaitGlobalOperationRequest.
}
resp, err := c.Wait(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type GlobalOrganizationOperationsCallOptions ¶
type GlobalOrganizationOperationsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
List []gax.CallOption
}
GlobalOrganizationOperationsCallOptions contains the retry settings for each method of GlobalOrganizationOperationsClient.
type GlobalOrganizationOperationsClient ¶
type GlobalOrganizationOperationsClient struct {
// The call options for this service.
CallOptions *GlobalOrganizationOperationsCallOptions
// contains filtered or unexported fields
}
GlobalOrganizationOperationsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The GlobalOrganizationOperations API.
func NewGlobalOrganizationOperationsRESTClient ¶
func NewGlobalOrganizationOperationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalOrganizationOperationsClient, error)
NewGlobalOrganizationOperationsRESTClient creates a new global organization operations rest client.
The GlobalOrganizationOperations API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOrganizationOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*GlobalOrganizationOperationsClient) Close ¶
func (c *GlobalOrganizationOperationsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*GlobalOrganizationOperationsClient) Connection
deprecated
func (c *GlobalOrganizationOperationsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*GlobalOrganizationOperationsClient) Delete ¶
func (c *GlobalOrganizationOperationsClient) Delete(ctx context.Context, req *computepb.DeleteGlobalOrganizationOperationRequest, opts ...gax.CallOption) (*computepb.DeleteGlobalOrganizationOperationResponse, error)
Delete deletes the specified Operations resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOrganizationOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteGlobalOrganizationOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteGlobalOrganizationOperationRequest.
}
resp, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GlobalOrganizationOperationsClient) Get ¶
func (c *GlobalOrganizationOperationsClient) Get(ctx context.Context, req *computepb.GetGlobalOrganizationOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error)
Get retrieves the specified Operations resource. Gets a list of operations by making a list() request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOrganizationOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetGlobalOrganizationOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetGlobalOrganizationOperationRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GlobalOrganizationOperationsClient) List ¶
func (c *GlobalOrganizationOperationsClient) List(ctx context.Context, req *computepb.ListGlobalOrganizationOperationsRequest, opts ...gax.CallOption) *OperationIterator
List retrieves a list of Operation resources contained within the specified organization.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOrganizationOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalOrganizationOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalOrganizationOperationsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.OperationList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalOrganizationOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalOrganizationOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalOrganizationOperationsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type GlobalPublicDelegatedPrefixesCallOptions ¶
type GlobalPublicDelegatedPrefixesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
}
GlobalPublicDelegatedPrefixesCallOptions contains the retry settings for each method of GlobalPublicDelegatedPrefixesClient.
type GlobalPublicDelegatedPrefixesClient ¶
type GlobalPublicDelegatedPrefixesClient struct {
// The call options for this service.
CallOptions *GlobalPublicDelegatedPrefixesCallOptions
// contains filtered or unexported fields
}
GlobalPublicDelegatedPrefixesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The GlobalPublicDelegatedPrefixes API.
func NewGlobalPublicDelegatedPrefixesRESTClient ¶
func NewGlobalPublicDelegatedPrefixesRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalPublicDelegatedPrefixesClient, error)
NewGlobalPublicDelegatedPrefixesRESTClient creates a new global public delegated prefixes rest client.
The GlobalPublicDelegatedPrefixes API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*GlobalPublicDelegatedPrefixesClient) Close ¶
func (c *GlobalPublicDelegatedPrefixesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*GlobalPublicDelegatedPrefixesClient) Connection
deprecated
func (c *GlobalPublicDelegatedPrefixesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*GlobalPublicDelegatedPrefixesClient) Delete ¶
func (c *GlobalPublicDelegatedPrefixesClient) Delete(ctx context.Context, req *computepb.DeleteGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified global PublicDelegatedPrefix.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteGlobalPublicDelegatedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteGlobalPublicDelegatedPrefixeRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalPublicDelegatedPrefixesClient) Get ¶
func (c *GlobalPublicDelegatedPrefixesClient) Get(ctx context.Context, req *computepb.GetGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefix, error)
Get returns the specified global PublicDelegatedPrefix resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetGlobalPublicDelegatedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetGlobalPublicDelegatedPrefixeRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GlobalPublicDelegatedPrefixesClient) Insert ¶
func (c *GlobalPublicDelegatedPrefixesClient) Insert(ctx context.Context, req *computepb.InsertGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertGlobalPublicDelegatedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertGlobalPublicDelegatedPrefixeRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalPublicDelegatedPrefixesClient) List ¶
func (c *GlobalPublicDelegatedPrefixesClient) List(ctx context.Context, req *computepb.ListGlobalPublicDelegatedPrefixesRequest, opts ...gax.CallOption) *PublicDelegatedPrefixIterator
List lists the global PublicDelegatedPrefixes for a project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalPublicDelegatedPrefixesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalPublicDelegatedPrefixesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.PublicDelegatedPrefixList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalPublicDelegatedPrefixesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalPublicDelegatedPrefixesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*GlobalPublicDelegatedPrefixesClient) Patch ¶
func (c *GlobalPublicDelegatedPrefixesClient) Patch(ctx context.Context, req *computepb.PatchGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified global PublicDelegatedPrefix resource with the data included in the request. This method supportsPATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchGlobalPublicDelegatedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchGlobalPublicDelegatedPrefixeRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type GlobalVmExtensionPoliciesCallOptions ¶ added in v1.50.0
type GlobalVmExtensionPoliciesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Update []gax.CallOption
}
GlobalVmExtensionPoliciesCallOptions contains the retry settings for each method of GlobalVmExtensionPoliciesClient.
type GlobalVmExtensionPoliciesClient ¶ added in v1.50.0
type GlobalVmExtensionPoliciesClient struct {
// The call options for this service.
CallOptions *GlobalVmExtensionPoliciesCallOptions
// contains filtered or unexported fields
}
GlobalVmExtensionPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The GlobalVmExtensionPolicies API.
func NewGlobalVmExtensionPoliciesRESTClient ¶ added in v1.50.0
func NewGlobalVmExtensionPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalVmExtensionPoliciesClient, error)
NewGlobalVmExtensionPoliciesRESTClient creates a new global vm extension policies rest client.
The GlobalVmExtensionPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*GlobalVmExtensionPoliciesClient) AggregatedList ¶ added in v1.50.0
func (c *GlobalVmExtensionPoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListGlobalVmExtensionPoliciesRequest, opts ...gax.CallOption) *VmExtensionPoliciesScopedListPairIterator
AggregatedList retrieves the list of all VM Extension Policy resources available to the specified project.
To prevent failure, it’s recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListGlobalVmExtensionPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListGlobalVmExtensionPoliciesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.VmExtensionPolicyAggregatedListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListGlobalVmExtensionPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListGlobalVmExtensionPoliciesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*GlobalVmExtensionPoliciesClient) Close ¶ added in v1.50.0
func (c *GlobalVmExtensionPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*GlobalVmExtensionPoliciesClient) Connection
deprecated
added in
v1.50.0
func (c *GlobalVmExtensionPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*GlobalVmExtensionPoliciesClient) Delete ¶ added in v1.51.0
func (c *GlobalVmExtensionPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteGlobalVmExtensionPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete purge scoped resources (zonal policies) from a global VM extension policy, and then delete the global VM extension policy. Purge of the scoped resources is a pre-condition of the global VM extension policy deletion. The deletion of the global VM extension policy happens after the purge rollout is done, so it’s not a part of the LRO. It’s an automatic process that triggers in the backend.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteGlobalVmExtensionPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteGlobalVmExtensionPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalVmExtensionPoliciesClient) Get ¶ added in v1.50.0
func (c *GlobalVmExtensionPoliciesClient) Get(ctx context.Context, req *computepb.GetGlobalVmExtensionPolicyRequest, opts ...gax.CallOption) (*computepb.GlobalVmExtensionPolicy, error)
Get gets details of a global VM extension policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetGlobalVmExtensionPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetGlobalVmExtensionPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GlobalVmExtensionPoliciesClient) Insert ¶ added in v1.51.0
func (c *GlobalVmExtensionPoliciesClient) Insert(ctx context.Context, req *computepb.InsertGlobalVmExtensionPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new project level GlobalVmExtensionPolicy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertGlobalVmExtensionPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertGlobalVmExtensionPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*GlobalVmExtensionPoliciesClient) List ¶ added in v1.51.0
func (c *GlobalVmExtensionPoliciesClient) List(ctx context.Context, req *computepb.ListGlobalVmExtensionPoliciesRequest, opts ...gax.CallOption) *GlobalVmExtensionPolicyIterator
List lists global VM extension policies.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalVmExtensionPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalVmExtensionPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.GlobalVmExtensionPolicyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListGlobalVmExtensionPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListGlobalVmExtensionPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*GlobalVmExtensionPoliciesClient) Update ¶ added in v1.51.0
func (c *GlobalVmExtensionPoliciesClient) Update(ctx context.Context, req *computepb.UpdateGlobalVmExtensionPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Update updates a global VM extension policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewGlobalVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateGlobalVmExtensionPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateGlobalVmExtensionPolicyRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type GlobalVmExtensionPolicyIterator ¶ added in v1.51.0
type GlobalVmExtensionPolicyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.GlobalVmExtensionPolicy, nextPageToken string, err error)
// contains filtered or unexported fields
}
GlobalVmExtensionPolicyIterator manages a stream of *computepb.GlobalVmExtensionPolicy.
func (*GlobalVmExtensionPolicyIterator) All ¶ added in v1.51.0
func (it *GlobalVmExtensionPolicyIterator) All() iter.Seq2[*computepb.GlobalVmExtensionPolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*GlobalVmExtensionPolicyIterator) Next ¶ added in v1.51.0
func (it *GlobalVmExtensionPolicyIterator) Next() (*computepb.GlobalVmExtensionPolicy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*GlobalVmExtensionPolicyIterator) PageInfo ¶ added in v1.51.0
func (it *GlobalVmExtensionPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type HealthAggregationPoliciesScopedListPair ¶ added in v1.50.0
type HealthAggregationPoliciesScopedListPair struct {
Key string
Value *computepb.HealthAggregationPoliciesScopedList
}
HealthAggregationPoliciesScopedListPair is a holder type for string/*computepb.HealthAggregationPoliciesScopedList map entries
type HealthAggregationPoliciesScopedListPairIterator ¶ added in v1.50.0
type HealthAggregationPoliciesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []HealthAggregationPoliciesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
HealthAggregationPoliciesScopedListPairIterator manages a stream of HealthAggregationPoliciesScopedListPair.
func (*HealthAggregationPoliciesScopedListPairIterator) All ¶ added in v1.50.0
func (it *HealthAggregationPoliciesScopedListPairIterator) All() iter.Seq2[HealthAggregationPoliciesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*HealthAggregationPoliciesScopedListPairIterator) Next ¶ added in v1.50.0
func (it *HealthAggregationPoliciesScopedListPairIterator) Next() (HealthAggregationPoliciesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*HealthAggregationPoliciesScopedListPairIterator) PageInfo ¶ added in v1.50.0
func (it *HealthAggregationPoliciesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type HealthAggregationPolicyIterator ¶ added in v1.50.0
type HealthAggregationPolicyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.HealthAggregationPolicy, nextPageToken string, err error)
// contains filtered or unexported fields
}
HealthAggregationPolicyIterator manages a stream of *computepb.HealthAggregationPolicy.
func (*HealthAggregationPolicyIterator) All ¶ added in v1.50.0
func (it *HealthAggregationPolicyIterator) All() iter.Seq2[*computepb.HealthAggregationPolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*HealthAggregationPolicyIterator) Next ¶ added in v1.50.0
func (it *HealthAggregationPolicyIterator) Next() (*computepb.HealthAggregationPolicy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*HealthAggregationPolicyIterator) PageInfo ¶ added in v1.50.0
func (it *HealthAggregationPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type HealthCheckIterator ¶
type HealthCheckIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.HealthCheck, nextPageToken string, err error)
// contains filtered or unexported fields
}
HealthCheckIterator manages a stream of *computepb.HealthCheck.
func (*HealthCheckIterator) All ¶
func (it *HealthCheckIterator) All() iter.Seq2[*computepb.HealthCheck, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*HealthCheckIterator) Next ¶
func (it *HealthCheckIterator) Next() (*computepb.HealthCheck, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*HealthCheckIterator) PageInfo ¶
func (it *HealthCheckIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type HealthCheckServiceIterator ¶
type HealthCheckServiceIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.HealthCheckService, nextPageToken string, err error)
// contains filtered or unexported fields
}
HealthCheckServiceIterator manages a stream of *computepb.HealthCheckService.
func (*HealthCheckServiceIterator) All ¶
func (it *HealthCheckServiceIterator) All() iter.Seq2[*computepb.HealthCheckService, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*HealthCheckServiceIterator) Next ¶
func (it *HealthCheckServiceIterator) Next() (*computepb.HealthCheckService, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*HealthCheckServiceIterator) PageInfo ¶
func (it *HealthCheckServiceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type HealthChecksCallOptions ¶
type HealthChecksCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
HealthChecksCallOptions contains the retry settings for each method of HealthChecksClient.
type HealthChecksClient ¶
type HealthChecksClient struct {
// The call options for this service.
CallOptions *HealthChecksCallOptions
// contains filtered or unexported fields
}
HealthChecksClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The HealthChecks API.
func NewHealthChecksRESTClient ¶
func NewHealthChecksRESTClient(ctx context.Context, opts ...option.ClientOption) (*HealthChecksClient, error)
NewHealthChecksRESTClient creates a new health checks rest client.
The HealthChecks API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*HealthChecksClient) AggregatedList ¶
func (c *HealthChecksClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListHealthChecksRequest, opts ...gax.CallOption) *HealthChecksScopedListPairIterator
AggregatedList retrieves the list of all HealthCheck resources, regional and global, available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListHealthChecksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListHealthChecksRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.HealthChecksAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListHealthChecksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListHealthChecksRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*HealthChecksClient) Close ¶
func (c *HealthChecksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*HealthChecksClient) Connection
deprecated
func (c *HealthChecksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*HealthChecksClient) Delete ¶
func (c *HealthChecksClient) Delete(ctx context.Context, req *computepb.DeleteHealthCheckRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified HealthCheck resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteHealthCheckRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*HealthChecksClient) Get ¶
func (c *HealthChecksClient) Get(ctx context.Context, req *computepb.GetHealthCheckRequest, opts ...gax.CallOption) (*computepb.HealthCheck, error)
Get returns the specified HealthCheck resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetHealthCheckRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HealthChecksClient) Insert ¶
func (c *HealthChecksClient) Insert(ctx context.Context, req *computepb.InsertHealthCheckRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a HealthCheck resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertHealthCheckRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*HealthChecksClient) List ¶
func (c *HealthChecksClient) List(ctx context.Context, req *computepb.ListHealthChecksRequest, opts ...gax.CallOption) *HealthCheckIterator
List retrieves the list of HealthCheck resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListHealthChecksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListHealthChecksRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.HealthCheckList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListHealthChecksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListHealthChecksRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*HealthChecksClient) Patch ¶
func (c *HealthChecksClient) Patch(ctx context.Context, req *computepb.PatchHealthCheckRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates a HealthCheck resource in the specified project using the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchHealthCheckRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*HealthChecksClient) TestIamPermissions ¶
func (c *HealthChecksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsHealthCheckRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsHealthCheckRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HealthChecksClient) Update ¶
func (c *HealthChecksClient) Update(ctx context.Context, req *computepb.UpdateHealthCheckRequest, opts ...gax.CallOption) (*Operation, error)
Update updates a HealthCheck resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateHealthCheckRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type HealthChecksScopedListPair ¶
type HealthChecksScopedListPair struct {
Key string
Value *computepb.HealthChecksScopedList
}
HealthChecksScopedListPair is a holder type for string/*computepb.HealthChecksScopedList map entries
type HealthChecksScopedListPairIterator ¶
type HealthChecksScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []HealthChecksScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
HealthChecksScopedListPairIterator manages a stream of HealthChecksScopedListPair.
func (*HealthChecksScopedListPairIterator) All ¶
func (it *HealthChecksScopedListPairIterator) All() iter.Seq2[HealthChecksScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*HealthChecksScopedListPairIterator) Next ¶
func (it *HealthChecksScopedListPairIterator) Next() (HealthChecksScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*HealthChecksScopedListPairIterator) PageInfo ¶
func (it *HealthChecksScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type HealthSourceIterator ¶ added in v1.49.0
type HealthSourceIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.HealthSource, nextPageToken string, err error)
// contains filtered or unexported fields
}
HealthSourceIterator manages a stream of *computepb.HealthSource.
func (*HealthSourceIterator) All ¶ added in v1.49.0
func (it *HealthSourceIterator) All() iter.Seq2[*computepb.HealthSource, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*HealthSourceIterator) Next ¶ added in v1.49.0
func (it *HealthSourceIterator) Next() (*computepb.HealthSource, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*HealthSourceIterator) PageInfo ¶ added in v1.49.0
func (it *HealthSourceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type HealthSourcesScopedListPair ¶ added in v1.49.0
type HealthSourcesScopedListPair struct {
Key string
Value *computepb.HealthSourcesScopedList
}
HealthSourcesScopedListPair is a holder type for string/*computepb.HealthSourcesScopedList map entries
type HealthSourcesScopedListPairIterator ¶ added in v1.49.0
type HealthSourcesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []HealthSourcesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
HealthSourcesScopedListPairIterator manages a stream of HealthSourcesScopedListPair.
func (*HealthSourcesScopedListPairIterator) All ¶ added in v1.49.0
func (it *HealthSourcesScopedListPairIterator) All() iter.Seq2[HealthSourcesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*HealthSourcesScopedListPairIterator) Next ¶ added in v1.49.0
func (it *HealthSourcesScopedListPairIterator) Next() (HealthSourcesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*HealthSourcesScopedListPairIterator) PageInfo ¶ added in v1.49.0
func (it *HealthSourcesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ImageFamilyViewsCallOptions ¶
type ImageFamilyViewsCallOptions struct {
Get []gax.CallOption
}
ImageFamilyViewsCallOptions contains the retry settings for each method of ImageFamilyViewsClient.
type ImageFamilyViewsClient ¶
type ImageFamilyViewsClient struct {
// The call options for this service.
CallOptions *ImageFamilyViewsCallOptions
// contains filtered or unexported fields
}
ImageFamilyViewsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ImageFamilyViews API.
func NewImageFamilyViewsRESTClient ¶
func NewImageFamilyViewsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ImageFamilyViewsClient, error)
NewImageFamilyViewsRESTClient creates a new image family views rest client.
The ImageFamilyViews API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImageFamilyViewsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ImageFamilyViewsClient) Close ¶
func (c *ImageFamilyViewsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ImageFamilyViewsClient) Connection
deprecated
func (c *ImageFamilyViewsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ImageFamilyViewsClient) Get ¶
func (c *ImageFamilyViewsClient) Get(ctx context.Context, req *computepb.GetImageFamilyViewRequest, opts ...gax.CallOption) (*computepb.ImageFamilyView, error)
Get returns the latest image that is part of an image family, is not deprecated and is rolled out in the specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImageFamilyViewsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetImageFamilyViewRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetImageFamilyViewRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ImageIterator ¶
type ImageIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Image, nextPageToken string, err error)
// contains filtered or unexported fields
}
ImageIterator manages a stream of *computepb.Image.
func (*ImageIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ImageIterator) Next ¶
func (it *ImageIterator) Next() (*computepb.Image, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ImageIterator) PageInfo ¶
func (it *ImageIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ImagesCallOptions ¶
type ImagesCallOptions struct {
Delete []gax.CallOption
Deprecate []gax.CallOption
Get []gax.CallOption
GetFromFamily []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetIamPolicy []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
ImagesCallOptions contains the retry settings for each method of ImagesClient.
type ImagesClient ¶
type ImagesClient struct {
// The call options for this service.
CallOptions *ImagesCallOptions
// contains filtered or unexported fields
}
ImagesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Images API.
func NewImagesRESTClient ¶
func NewImagesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ImagesClient, error)
NewImagesRESTClient creates a new images rest client.
The Images API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ImagesClient) Close ¶
func (c *ImagesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ImagesClient) Connection
deprecated
func (c *ImagesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ImagesClient) Delete ¶
func (c *ImagesClient) Delete(ctx context.Context, req *computepb.DeleteImageRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified image.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteImageRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ImagesClient) Deprecate ¶
func (c *ImagesClient) Deprecate(ctx context.Context, req *computepb.DeprecateImageRequest, opts ...gax.CallOption) (*Operation, error)
Deprecate sets the deprecation status of an image.
If an empty request body is given, clears the deprecation status instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeprecateImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeprecateImageRequest.
}
op, err := c.Deprecate(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ImagesClient) Get ¶
func (c *ImagesClient) Get(ctx context.Context, req *computepb.GetImageRequest, opts ...gax.CallOption) (*computepb.Image, error)
Get returns the specified image.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetImageRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ImagesClient) GetFromFamily ¶
func (c *ImagesClient) GetFromFamily(ctx context.Context, req *computepb.GetFromFamilyImageRequest, opts ...gax.CallOption) (*computepb.Image, error)
GetFromFamily returns the latest image that is part of an image family and is not deprecated. For more information on image families, seePublic image families documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetFromFamilyImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetFromFamilyImageRequest.
}
resp, err := c.GetFromFamily(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ImagesClient) GetIamPolicy ¶
func (c *ImagesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyImageRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyImageRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ImagesClient) Insert ¶
func (c *ImagesClient) Insert(ctx context.Context, req *computepb.InsertImageRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an image in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertImageRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ImagesClient) List ¶
func (c *ImagesClient) List(ctx context.Context, req *computepb.ListImagesRequest, opts ...gax.CallOption) *ImageIterator
List retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListImagesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListImagesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ImageList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListImagesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListImagesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ImagesClient) Patch ¶
func (c *ImagesClient) Patch(ctx context.Context, req *computepb.PatchImageRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchImageRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ImagesClient) SetIamPolicy ¶
func (c *ImagesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyImageRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyImageRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ImagesClient) SetLabels ¶
func (c *ImagesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsImageRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on an image. To learn more about labels, read theLabeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsImageRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ImagesClient) TestIamPermissions ¶
func (c *ImagesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsImageRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsImageRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type InstanceGroupIterator ¶
type InstanceGroupIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InstanceGroup, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceGroupIterator manages a stream of *computepb.InstanceGroup.
func (*InstanceGroupIterator) All ¶
func (it *InstanceGroupIterator) All() iter.Seq2[*computepb.InstanceGroup, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceGroupIterator) Next ¶
func (it *InstanceGroupIterator) Next() (*computepb.InstanceGroup, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstanceGroupIterator) PageInfo ¶
func (it *InstanceGroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstanceGroupManagerIterator ¶
type InstanceGroupManagerIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InstanceGroupManager, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceGroupManagerIterator manages a stream of *computepb.InstanceGroupManager.
func (*InstanceGroupManagerIterator) All ¶
func (it *InstanceGroupManagerIterator) All() iter.Seq2[*computepb.InstanceGroupManager, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceGroupManagerIterator) Next ¶
func (it *InstanceGroupManagerIterator) Next() (*computepb.InstanceGroupManager, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstanceGroupManagerIterator) PageInfo ¶
func (it *InstanceGroupManagerIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstanceGroupManagerResizeRequestIterator ¶
type InstanceGroupManagerResizeRequestIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InstanceGroupManagerResizeRequest, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceGroupManagerResizeRequestIterator manages a stream of *computepb.InstanceGroupManagerResizeRequest.
func (*InstanceGroupManagerResizeRequestIterator) All ¶
func (it *InstanceGroupManagerResizeRequestIterator) All() iter.Seq2[*computepb.InstanceGroupManagerResizeRequest, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceGroupManagerResizeRequestIterator) Next ¶
func (it *InstanceGroupManagerResizeRequestIterator) Next() (*computepb.InstanceGroupManagerResizeRequest, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstanceGroupManagerResizeRequestIterator) PageInfo ¶
func (it *InstanceGroupManagerResizeRequestIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstanceGroupManagerResizeRequestsCallOptions ¶
type InstanceGroupManagerResizeRequestsCallOptions struct {
Cancel []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
}
InstanceGroupManagerResizeRequestsCallOptions contains the retry settings for each method of InstanceGroupManagerResizeRequestsClient.
type InstanceGroupManagerResizeRequestsClient ¶
type InstanceGroupManagerResizeRequestsClient struct {
// The call options for this service.
CallOptions *InstanceGroupManagerResizeRequestsCallOptions
// contains filtered or unexported fields
}
InstanceGroupManagerResizeRequestsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InstanceGroupManagerResizeRequests API.
func NewInstanceGroupManagerResizeRequestsRESTClient ¶
func NewInstanceGroupManagerResizeRequestsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstanceGroupManagerResizeRequestsClient, error)
NewInstanceGroupManagerResizeRequestsRESTClient creates a new instance group manager resize requests rest client.
The InstanceGroupManagerResizeRequests API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InstanceGroupManagerResizeRequestsClient) Cancel ¶
func (c *InstanceGroupManagerResizeRequestsClient) Cancel(ctx context.Context, req *computepb.CancelInstanceGroupManagerResizeRequestRequest, opts ...gax.CallOption) (*Operation, error)
Cancel cancels the specified resize request and removes it from the queue. Cancelled resize request does no longer wait for the resources to be provisioned. Cancel is only possible for requests that are accepted in the queue.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CancelInstanceGroupManagerResizeRequestRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CancelInstanceGroupManagerResizeRequestRequest.
}
op, err := c.Cancel(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagerResizeRequestsClient) Close ¶
func (c *InstanceGroupManagerResizeRequestsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InstanceGroupManagerResizeRequestsClient) Connection
deprecated
func (c *InstanceGroupManagerResizeRequestsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InstanceGroupManagerResizeRequestsClient) Delete ¶
func (c *InstanceGroupManagerResizeRequestsClient) Delete(ctx context.Context, req *computepb.DeleteInstanceGroupManagerResizeRequestRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified, inactive resize request. Requests that are still active cannot be deleted. Deleting request does not delete instances that were provisioned previously.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInstanceGroupManagerResizeRequestRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInstanceGroupManagerResizeRequestRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagerResizeRequestsClient) Get ¶
func (c *InstanceGroupManagerResizeRequestsClient) Get(ctx context.Context, req *computepb.GetInstanceGroupManagerResizeRequestRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagerResizeRequest, error)
Get returns all of the details about the specified resize request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInstanceGroupManagerResizeRequestRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInstanceGroupManagerResizeRequestRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstanceGroupManagerResizeRequestsClient) Insert ¶
func (c *InstanceGroupManagerResizeRequestsClient) Insert(ctx context.Context, req *computepb.InsertInstanceGroupManagerResizeRequestRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new resize request that starts provisioning VMs immediately or queues VM creation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInstanceGroupManagerResizeRequestRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertInstanceGroupManagerResizeRequestRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagerResizeRequestsClient) List ¶
func (c *InstanceGroupManagerResizeRequestsClient) List(ctx context.Context, req *computepb.ListInstanceGroupManagerResizeRequestsRequest, opts ...gax.CallOption) *InstanceGroupManagerResizeRequestIterator
List retrieves a list of resize requests that are contained in the managed instance group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstanceGroupManagerResizeRequestsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstanceGroupManagerResizeRequestsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceGroupManagerResizeRequestsListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstanceGroupManagerResizeRequestsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstanceGroupManagerResizeRequestsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type InstanceGroupManagersCallOptions ¶
type InstanceGroupManagersCallOptions struct {
AbandonInstances []gax.CallOption
AggregatedList []gax.CallOption
ApplyUpdatesToInstances []gax.CallOption
CreateInstances []gax.CallOption
Delete []gax.CallOption
DeleteInstances []gax.CallOption
DeletePerInstanceConfigs []gax.CallOption
Get []gax.CallOption
GetAvailableAcceleratorTopologies []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListErrors []gax.CallOption
ListManagedInstances []gax.CallOption
ListPerInstanceConfigs []gax.CallOption
Patch []gax.CallOption
PatchPerInstanceConfigs []gax.CallOption
RecreateInstances []gax.CallOption
Resize []gax.CallOption
ResizeAdvanced []gax.CallOption
ResumeInstances []gax.CallOption
SetAutoHealingPolicies []gax.CallOption
SetInstanceTemplate []gax.CallOption
SetTargetPools []gax.CallOption
StartInstances []gax.CallOption
StopInstances []gax.CallOption
SuspendInstances []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
UpdatePerInstanceConfigs []gax.CallOption
}
InstanceGroupManagersCallOptions contains the retry settings for each method of InstanceGroupManagersClient.
type InstanceGroupManagersClient ¶
type InstanceGroupManagersClient struct {
// The call options for this service.
CallOptions *InstanceGroupManagersCallOptions
// contains filtered or unexported fields
}
InstanceGroupManagersClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InstanceGroupManagers API.
func NewInstanceGroupManagersRESTClient ¶
func NewInstanceGroupManagersRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstanceGroupManagersClient, error)
NewInstanceGroupManagersRESTClient creates a new instance group managers rest client.
The InstanceGroupManagers API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InstanceGroupManagersClient) AbandonInstances ¶
func (c *InstanceGroupManagersClient) AbandonInstances(ctx context.Context, req *computepb.AbandonInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
AbandonInstances flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with thelistmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AbandonInstancesInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AbandonInstancesInstanceGroupManagerRequest.
}
op, err := c.AbandonInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) AggregatedList ¶
func (c *InstanceGroupManagersClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstanceGroupManagersRequest, opts ...gax.CallOption) *InstanceGroupManagersScopedListPairIterator
AggregatedList retrieves the list of managed instance groups and groups them by zone.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInstanceGroupManagersRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceGroupManagerAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInstanceGroupManagersRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstanceGroupManagersClient) ApplyUpdatesToInstances ¶
func (c *InstanceGroupManagersClient) ApplyUpdatesToInstances(ctx context.Context, req *computepb.ApplyUpdatesToInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
ApplyUpdatesToInstances applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ApplyUpdatesToInstancesInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ApplyUpdatesToInstancesInstanceGroupManagerRequest.
}
op, err := c.ApplyUpdatesToInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) Close ¶
func (c *InstanceGroupManagersClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InstanceGroupManagersClient) Connection
deprecated
func (c *InstanceGroupManagersClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InstanceGroupManagersClient) CreateInstances ¶
func (c *InstanceGroupManagersClient) CreateInstances(ctx context.Context, req *computepb.CreateInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
CreateInstances creates instances with per-instance configurations in this managed instance group. Instances are created using the current instance template. Thecreate instances operation is marked DONE if thecreateInstances request is successful. The underlying actions take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances method.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CreateInstancesInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CreateInstancesInstanceGroupManagerRequest.
}
op, err := c.CreateInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) Delete ¶
func (c *InstanceGroupManagersClient) Delete(ctx context.Context, req *computepb.DeleteInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInstanceGroupManagerRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) DeleteInstances ¶
func (c *InstanceGroupManagersClient) DeleteInstances(ctx context.Context, req *computepb.DeleteInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
DeleteInstances flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with thelistmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInstancesInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInstancesInstanceGroupManagerRequest.
}
op, err := c.DeleteInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) DeletePerInstanceConfigs ¶
func (c *InstanceGroupManagersClient) DeletePerInstanceConfigs(ctx context.Context, req *computepb.DeletePerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
DeletePerInstanceConfigs deletes selected per-instance configurations for the managed instance group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeletePerInstanceConfigsInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeletePerInstanceConfigsInstanceGroupManagerRequest.
}
op, err := c.DeletePerInstanceConfigs(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) Get ¶
func (c *InstanceGroupManagersClient) Get(ctx context.Context, req *computepb.GetInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManager, error)
Get returns all of the details about the specified managed instance group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInstanceGroupManagerRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstanceGroupManagersClient) GetAvailableAcceleratorTopologies ¶ added in v1.50.0
func (c *InstanceGroupManagersClient) GetAvailableAcceleratorTopologies(ctx context.Context, req *computepb.GetAvailableAcceleratorTopologiesInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagersGetAvailableAcceleratorTopologiesResponse, error)
GetAvailableAcceleratorTopologies returns information about available accelerator topologies for a given MIG.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetAvailableAcceleratorTopologiesInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetAvailableAcceleratorTopologiesInstanceGroupManagerRequest.
}
resp, err := c.GetAvailableAcceleratorTopologies(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstanceGroupManagersClient) Insert ¶
func (c *InstanceGroupManagersClient) Insert(ctx context.Context, req *computepb.InsertInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with thelistmanagedinstances method.
A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertInstanceGroupManagerRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) List ¶
func (c *InstanceGroupManagersClient) List(ctx context.Context, req *computepb.ListInstanceGroupManagersRequest, opts ...gax.CallOption) *InstanceGroupManagerIterator
List retrieves a list of managed instance groups that are contained within the specified project and zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstanceGroupManagersRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceGroupManagerList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstanceGroupManagersRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstanceGroupManagersClient) ListErrors ¶
func (c *InstanceGroupManagersClient) ListErrors(ctx context.Context, req *computepb.ListErrorsInstanceGroupManagersRequest, opts ...gax.CallOption) *InstanceManagedByIgmErrorIterator
ListErrors lists all errors thrown by actions on instances for a given managed instance group. The filter and orderBy query parameters are not supported.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListErrorsInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListErrorsInstanceGroupManagersRequest.
}
it := c.ListErrors(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceGroupManagersListErrorsResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListErrorsInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListErrorsInstanceGroupManagersRequest.
}
for resp, err := range c.ListErrors(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstanceGroupManagersClient) ListManagedInstances ¶
func (c *InstanceGroupManagersClient) ListManagedInstances(ctx context.Context, req *computepb.ListManagedInstancesInstanceGroupManagersRequest, opts ...gax.CallOption) *ManagedInstanceIterator
ListManagedInstances lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. The pageToken query parameter is supported only if the group’s listManagedInstancesResults field is set to PAGINATED.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListManagedInstancesInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListManagedInstancesInstanceGroupManagersRequest.
}
it := c.ListManagedInstances(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceGroupManagersListManagedInstancesResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListManagedInstancesInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListManagedInstancesInstanceGroupManagersRequest.
}
for resp, err := range c.ListManagedInstances(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstanceGroupManagersClient) ListPerInstanceConfigs ¶
func (c *InstanceGroupManagersClient) ListPerInstanceConfigs(ctx context.Context, req *computepb.ListPerInstanceConfigsInstanceGroupManagersRequest, opts ...gax.CallOption) *PerInstanceConfigIterator
ListPerInstanceConfigs lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPerInstanceConfigsInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPerInstanceConfigsInstanceGroupManagersRequest.
}
it := c.ListPerInstanceConfigs(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceGroupManagersListPerInstanceConfigsResp)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPerInstanceConfigsInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPerInstanceConfigsInstanceGroupManagersRequest.
}
for resp, err := range c.ListPerInstanceConfigs(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstanceGroupManagersClient) Patch ¶
func (c *InstanceGroupManagersClient) Patch(ctx context.Context, req *computepb.PatchInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with thelistManagedInstances method. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
If you update your group to specify a new template or instance configuration, it’s possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, seeUpdating instances in a MIG.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchInstanceGroupManagerRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) PatchPerInstanceConfigs ¶
func (c *InstanceGroupManagersClient) PatchPerInstanceConfigs(ctx context.Context, req *computepb.PatchPerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
PatchPerInstanceConfigs inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchPerInstanceConfigsInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchPerInstanceConfigsInstanceGroupManagerRequest.
}
op, err := c.PatchPerInstanceConfigs(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) RecreateInstances ¶
func (c *InstanceGroupManagersClient) RecreateInstances(ctx context.Context, req *computepb.RecreateInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
RecreateInstances flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group’s current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking the status of managed instances.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RecreateInstancesInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RecreateInstancesInstanceGroupManagerRequest.
}
op, err := c.RecreateInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) Resize ¶
func (c *InstanceGroupManagersClient) Resize(ctx context.Context, req *computepb.ResizeInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
Resize resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is markedDONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with thelistmanagedinstances method.
When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including:
The status of the VM instance. The health of the VM instance. The instance template version the VM is based on. For regional managed instance groups, the location of the VM instance.
This list is subject to change.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResizeInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ResizeInstanceGroupManagerRequest.
}
op, err := c.Resize(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) ResizeAdvanced ¶
func (c *InstanceGroupManagersClient) ResizeAdvanced(ctx context.Context, req *computepb.ResizeAdvancedInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
ResizeAdvanced resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of theresize method.
If you increase the size of the instance group, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is markedDONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating,creatingWithoutRetries, or deleting actions with the get orlistmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResizeAdvancedInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ResizeAdvancedInstanceGroupManagerRequest.
}
op, err := c.ResizeAdvanced(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) ResumeInstances ¶
func (c *InstanceGroupManagersClient) ResumeInstances(ctx context.Context, req *computepb.ResumeInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
ResumeInstances flags the specified instances in the managed instance group to be resumed. This method increases thetargetSize and decreases the targetSuspendedSize of the managed instance group by the number of instances that you resume. The resumeInstances operation is marked DONE if the resumeInstances request is successful. The underlying actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances method.
In this request, you can only specify instances that are suspended. For example, if an instance was previously suspended using the suspendInstances method, it can be resumed using the resumeInstances method.
If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are resumed.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResumeInstancesInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ResumeInstancesInstanceGroupManagerRequest.
}
op, err := c.ResumeInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) SetAutoHealingPolicies ¶
func (c *InstanceGroupManagersClient) SetAutoHealingPolicies(ctx context.Context, req *computepb.SetAutoHealingPoliciesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
SetAutoHealingPolicies motifies the autohealing policy for the instances in this managed instance group. [Deprecated] This method is deprecated. UseinstanceGroupManagers.patch instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetAutoHealingPoliciesInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetAutoHealingPoliciesInstanceGroupManagerRequest.
}
op, err := c.SetAutoHealingPolicies(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) SetInstanceTemplate ¶
func (c *InstanceGroupManagersClient) SetInstanceTemplate(ctx context.Context, req *computepb.SetInstanceTemplateInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
SetInstanceTemplate specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, runapplyUpdatesToInstances, or set the group’supdatePolicy.type to PROACTIVE.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetInstanceTemplateInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetInstanceTemplateInstanceGroupManagerRequest.
}
op, err := c.SetInstanceTemplate(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) SetTargetPools ¶
func (c *InstanceGroupManagersClient) SetTargetPools(ctx context.Context, req *computepb.SetTargetPoolsInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
SetTargetPools modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is markedDONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetTargetPoolsInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetTargetPoolsInstanceGroupManagerRequest.
}
op, err := c.SetTargetPools(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) StartInstances ¶
func (c *InstanceGroupManagersClient) StartInstances(ctx context.Context, req *computepb.StartInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
StartInstances flags the specified instances in the managed instance group to be started. This method increases thetargetSize and decreases the targetStoppedSize of the managed instance group by the number of instances that you start. The startInstances operation is marked DONE if the startInstances request is successful. The underlying actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances method.
In this request, you can only specify instances that are stopped. For example, if an instance was previously stopped using the stopInstances method, it can be started using the startInstances method.
If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are started.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StartInstancesInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StartInstancesInstanceGroupManagerRequest.
}
op, err := c.StartInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) StopInstances ¶
func (c *InstanceGroupManagersClient) StopInstances(ctx context.Context, req *computepb.StopInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
StopInstances flags the specified instances in the managed instance group to be immediately stopped. You can only specify instances that are running in this request. This method reduces thetargetSize and increases the targetStoppedSize of the managed instance group by the number of instances that you stop. The stopInstances operation is marked DONE if the stopInstances request is successful. The underlying actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances method.
If the standbyPolicy.initialDelaySec field is set, the group delays stopping the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there will be zero delay.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is stopped.
Stopped instances can be started using the startInstances method.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StopInstancesInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StopInstancesInstanceGroupManagerRequest.
}
op, err := c.StopInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) SuspendInstances ¶
func (c *InstanceGroupManagersClient) SuspendInstances(ctx context.Context, req *computepb.SuspendInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
SuspendInstances flags the specified instances in the managed instance group to be immediately suspended. You can only specify instances that are running in this request. This method reduces thetargetSize and increases the targetSuspendedSize of the managed instance group by the number of instances that you suspend. The suspendInstances operation is marked DONE if the suspendInstances request is successful. The underlying actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances method.
If the standbyPolicy.initialDelaySec field is set, the group delays suspension of the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there will be zero delay.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is suspended.
Suspended instances can be resumed using the resumeInstances method.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SuspendInstancesInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SuspendInstancesInstanceGroupManagerRequest.
}
op, err := c.SuspendInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) TestIamPermissions ¶
func (c *InstanceGroupManagersClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsInstanceGroupManagerRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstanceGroupManagersClient) Update ¶
func (c *InstanceGroupManagersClient) Update(ctx context.Context, req *computepb.UpdateInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
Update updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with thelistManagedInstances method.
If you update your group to specify a new template or instance configuration, it’s possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, seeUpdating instances in a MIG.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateInstanceGroupManagerRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupManagersClient) UpdatePerInstanceConfigs ¶
func (c *InstanceGroupManagersClient) UpdatePerInstanceConfigs(ctx context.Context, req *computepb.UpdatePerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
UpdatePerInstanceConfigs inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdatePerInstanceConfigsInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdatePerInstanceConfigsInstanceGroupManagerRequest.
}
op, err := c.UpdatePerInstanceConfigs(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type InstanceGroupManagersScopedListPair ¶
type InstanceGroupManagersScopedListPair struct {
Key string
Value *computepb.InstanceGroupManagersScopedList
}
InstanceGroupManagersScopedListPair is a holder type for string/*computepb.InstanceGroupManagersScopedList map entries
type InstanceGroupManagersScopedListPairIterator ¶
type InstanceGroupManagersScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []InstanceGroupManagersScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceGroupManagersScopedListPairIterator manages a stream of InstanceGroupManagersScopedListPair.
func (*InstanceGroupManagersScopedListPairIterator) All ¶
func (it *InstanceGroupManagersScopedListPairIterator) All() iter.Seq2[InstanceGroupManagersScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceGroupManagersScopedListPairIterator) Next ¶
func (it *InstanceGroupManagersScopedListPairIterator) Next() (InstanceGroupManagersScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstanceGroupManagersScopedListPairIterator) PageInfo ¶
func (it *InstanceGroupManagersScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstanceGroupsCallOptions ¶
type InstanceGroupsCallOptions struct {
AddInstances []gax.CallOption
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListInstances []gax.CallOption
RemoveInstances []gax.CallOption
SetNamedPorts []gax.CallOption
TestIamPermissions []gax.CallOption
}
InstanceGroupsCallOptions contains the retry settings for each method of InstanceGroupsClient.
type InstanceGroupsClient ¶
type InstanceGroupsClient struct {
// The call options for this service.
CallOptions *InstanceGroupsCallOptions
// contains filtered or unexported fields
}
InstanceGroupsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InstanceGroups API.
func NewInstanceGroupsRESTClient ¶
func NewInstanceGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstanceGroupsClient, error)
NewInstanceGroupsRESTClient creates a new instance groups rest client.
The InstanceGroups API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InstanceGroupsClient) AddInstances ¶
func (c *InstanceGroupsClient) AddInstances(ctx context.Context, req *computepb.AddInstancesInstanceGroupRequest, opts ...gax.CallOption) (*Operation, error)
AddInstances adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddInstancesInstanceGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddInstancesInstanceGroupRequest.
}
op, err := c.AddInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupsClient) AggregatedList ¶
func (c *InstanceGroupsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstanceGroupsRequest, opts ...gax.CallOption) *InstanceGroupsScopedListPairIterator
AggregatedList retrieves the list of instance groups and sorts them by zone.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInstanceGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInstanceGroupsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceGroupAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInstanceGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInstanceGroupsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstanceGroupsClient) Close ¶
func (c *InstanceGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InstanceGroupsClient) Connection
deprecated
func (c *InstanceGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InstanceGroupsClient) Delete ¶
func (c *InstanceGroupsClient) Delete(ctx context.Context, req *computepb.DeleteInstanceGroupRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInstanceGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInstanceGroupRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupsClient) Get ¶
func (c *InstanceGroupsClient) Get(ctx context.Context, req *computepb.GetInstanceGroupRequest, opts ...gax.CallOption) (*computepb.InstanceGroup, error)
Get returns the specified zonal instance group. Get a list of available zonal instance groups by making a list() request.
For managed instance groups, use theinstanceGroupManagers or regionInstanceGroupManagers methods instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInstanceGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInstanceGroupRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstanceGroupsClient) Insert ¶
func (c *InstanceGroupsClient) Insert(ctx context.Context, req *computepb.InsertInstanceGroupRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an instance group in the specified project using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInstanceGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertInstanceGroupRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupsClient) List ¶
func (c *InstanceGroupsClient) List(ctx context.Context, req *computepb.ListInstanceGroupsRequest, opts ...gax.CallOption) *InstanceGroupIterator
List retrieves the list of zonal instance group resources contained within the specified zone.
For managed instance groups, use theinstanceGroupManagers or regionInstanceGroupManagers methods instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstanceGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstanceGroupsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceGroupList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstanceGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstanceGroupsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstanceGroupsClient) ListInstances ¶
func (c *InstanceGroupsClient) ListInstances(ctx context.Context, req *computepb.ListInstancesInstanceGroupsRequest, opts ...gax.CallOption) *InstanceWithNamedPortsIterator
ListInstances lists the instances in the specified instance group. The orderBy query parameter is not supported. The filter query parameter is supported, but only for expressions that use eq (equal) or ne (not equal) operators.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstancesInstanceGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstancesInstanceGroupsRequest.
}
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
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceGroupsListInstances)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstancesInstanceGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstancesInstanceGroupsRequest.
}
for resp, err := range c.ListInstances(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstanceGroupsClient) RemoveInstances ¶
func (c *InstanceGroupsClient) RemoveInstances(ctx context.Context, req *computepb.RemoveInstancesInstanceGroupRequest, opts ...gax.CallOption) (*Operation, error)
RemoveInstances removes one or more instances from the specified instance group, but does not delete those instances.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveInstancesInstanceGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveInstancesInstanceGroupRequest.
}
op, err := c.RemoveInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupsClient) SetNamedPorts ¶
func (c *InstanceGroupsClient) SetNamedPorts(ctx context.Context, req *computepb.SetNamedPortsInstanceGroupRequest, opts ...gax.CallOption) (*Operation, error)
SetNamedPorts sets the named ports for the specified instance group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetNamedPortsInstanceGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetNamedPortsInstanceGroupRequest.
}
op, err := c.SetNamedPorts(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceGroupsClient) TestIamPermissions ¶
func (c *InstanceGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstanceGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsInstanceGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsInstanceGroupRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type InstanceGroupsScopedListPair ¶
type InstanceGroupsScopedListPair struct {
Key string
Value *computepb.InstanceGroupsScopedList
}
InstanceGroupsScopedListPair is a holder type for string/*computepb.InstanceGroupsScopedList map entries
type InstanceGroupsScopedListPairIterator ¶
type InstanceGroupsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []InstanceGroupsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceGroupsScopedListPairIterator manages a stream of InstanceGroupsScopedListPair.
func (*InstanceGroupsScopedListPairIterator) All ¶
func (it *InstanceGroupsScopedListPairIterator) All() iter.Seq2[InstanceGroupsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceGroupsScopedListPairIterator) Next ¶
func (it *InstanceGroupsScopedListPairIterator) Next() (InstanceGroupsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstanceGroupsScopedListPairIterator) PageInfo ¶
func (it *InstanceGroupsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstanceIterator ¶
type InstanceIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Instance, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceIterator manages a stream of *computepb.Instance.
func (*InstanceIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceIterator) Next ¶
func (it *InstanceIterator) Next() (*computepb.Instance, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstanceIterator) PageInfo ¶
func (it *InstanceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstanceManagedByIgmErrorIterator ¶
type InstanceManagedByIgmErrorIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InstanceManagedByIgmError, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceManagedByIgmErrorIterator manages a stream of *computepb.InstanceManagedByIgmError.
func (*InstanceManagedByIgmErrorIterator) All ¶
func (it *InstanceManagedByIgmErrorIterator) All() iter.Seq2[*computepb.InstanceManagedByIgmError, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceManagedByIgmErrorIterator) Next ¶
func (it *InstanceManagedByIgmErrorIterator) Next() (*computepb.InstanceManagedByIgmError, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstanceManagedByIgmErrorIterator) PageInfo ¶
func (it *InstanceManagedByIgmErrorIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstanceSettingsCallOptions ¶
type InstanceSettingsCallOptions struct {
Get []gax.CallOption
Patch []gax.CallOption
}
InstanceSettingsCallOptions contains the retry settings for each method of InstanceSettingsClient.
type InstanceSettingsClient ¶
type InstanceSettingsClient struct {
// The call options for this service.
CallOptions *InstanceSettingsCallOptions
// contains filtered or unexported fields
}
InstanceSettingsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InstanceSettings API.
func NewInstanceSettingsRESTClient ¶
func NewInstanceSettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstanceSettingsClient, error)
NewInstanceSettingsRESTClient creates a new instance settings service rest client.
The InstanceSettings API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InstanceSettingsClient) Close ¶
func (c *InstanceSettingsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InstanceSettingsClient) Connection
deprecated
func (c *InstanceSettingsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InstanceSettingsClient) Get ¶
func (c *InstanceSettingsClient) Get(ctx context.Context, req *computepb.GetInstanceSettingRequest, opts ...gax.CallOption) (*computepb.InstanceSettings, error)
Get get Instance settings.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInstanceSettingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInstanceSettingRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstanceSettingsClient) Patch ¶
func (c *InstanceSettingsClient) Patch(ctx context.Context, req *computepb.PatchInstanceSettingRequest, opts ...gax.CallOption) (*Operation, error)
Patch patch Instance settings
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchInstanceSettingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchInstanceSettingRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type InstanceTemplateIterator ¶
type InstanceTemplateIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InstanceTemplate, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceTemplateIterator manages a stream of *computepb.InstanceTemplate.
func (*InstanceTemplateIterator) All ¶
func (it *InstanceTemplateIterator) All() iter.Seq2[*computepb.InstanceTemplate, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceTemplateIterator) Next ¶
func (it *InstanceTemplateIterator) Next() (*computepb.InstanceTemplate, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstanceTemplateIterator) PageInfo ¶
func (it *InstanceTemplateIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstanceTemplatesCallOptions ¶
type InstanceTemplatesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
InstanceTemplatesCallOptions contains the retry settings for each method of InstanceTemplatesClient.
type InstanceTemplatesClient ¶
type InstanceTemplatesClient struct {
// The call options for this service.
CallOptions *InstanceTemplatesCallOptions
// contains filtered or unexported fields
}
InstanceTemplatesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InstanceTemplates API.
func NewInstanceTemplatesRESTClient ¶
func NewInstanceTemplatesRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstanceTemplatesClient, error)
NewInstanceTemplatesRESTClient creates a new instance templates rest client.
The InstanceTemplates API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InstanceTemplatesClient) AggregatedList ¶
func (c *InstanceTemplatesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstanceTemplatesRequest, opts ...gax.CallOption) *InstanceTemplatesScopedListPairIterator
AggregatedList retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInstanceTemplatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInstanceTemplatesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceTemplateAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInstanceTemplatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInstanceTemplatesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstanceTemplatesClient) Close ¶
func (c *InstanceTemplatesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InstanceTemplatesClient) Connection
deprecated
func (c *InstanceTemplatesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InstanceTemplatesClient) Delete ¶
func (c *InstanceTemplatesClient) Delete(ctx context.Context, req *computepb.DeleteInstanceTemplateRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInstanceTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInstanceTemplateRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceTemplatesClient) Get ¶
func (c *InstanceTemplatesClient) Get(ctx context.Context, req *computepb.GetInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.InstanceTemplate, error)
Get returns the specified instance template.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInstanceTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInstanceTemplateRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstanceTemplatesClient) GetIamPolicy ¶
func (c *InstanceTemplatesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyInstanceTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyInstanceTemplateRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstanceTemplatesClient) Insert ¶
func (c *InstanceTemplatesClient) Insert(ctx context.Context, req *computepb.InsertInstanceTemplateRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInstanceTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertInstanceTemplateRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceTemplatesClient) List ¶
func (c *InstanceTemplatesClient) List(ctx context.Context, req *computepb.ListInstanceTemplatesRequest, opts ...gax.CallOption) *InstanceTemplateIterator
List retrieves a list of instance templates that are contained within the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstanceTemplatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstanceTemplatesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceTemplateList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstanceTemplatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstanceTemplatesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstanceTemplatesClient) SetIamPolicy ¶
func (c *InstanceTemplatesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyInstanceTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyInstanceTemplateRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstanceTemplatesClient) TestIamPermissions ¶
func (c *InstanceTemplatesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsInstanceTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsInstanceTemplateRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type InstanceTemplatesScopedListPair ¶
type InstanceTemplatesScopedListPair struct {
Key string
Value *computepb.InstanceTemplatesScopedList
}
InstanceTemplatesScopedListPair is a holder type for string/*computepb.InstanceTemplatesScopedList map entries
type InstanceTemplatesScopedListPairIterator ¶
type InstanceTemplatesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []InstanceTemplatesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceTemplatesScopedListPairIterator manages a stream of InstanceTemplatesScopedListPair.
func (*InstanceTemplatesScopedListPairIterator) All ¶
func (it *InstanceTemplatesScopedListPairIterator) All() iter.Seq2[InstanceTemplatesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceTemplatesScopedListPairIterator) Next ¶
func (it *InstanceTemplatesScopedListPairIterator) Next() (InstanceTemplatesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstanceTemplatesScopedListPairIterator) PageInfo ¶
func (it *InstanceTemplatesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstanceWithNamedPortsIterator ¶
type InstanceWithNamedPortsIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InstanceWithNamedPorts, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceWithNamedPortsIterator manages a stream of *computepb.InstanceWithNamedPorts.
func (*InstanceWithNamedPortsIterator) All ¶
func (it *InstanceWithNamedPortsIterator) All() iter.Seq2[*computepb.InstanceWithNamedPorts, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceWithNamedPortsIterator) Next ¶
func (it *InstanceWithNamedPortsIterator) Next() (*computepb.InstanceWithNamedPorts, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstanceWithNamedPortsIterator) PageInfo ¶
func (it *InstanceWithNamedPortsIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstancesCallOptions ¶
type InstancesCallOptions struct {
AddAccessConfig []gax.CallOption
AddNetworkInterface []gax.CallOption
AddResourcePolicies []gax.CallOption
AggregatedList []gax.CallOption
AttachDisk []gax.CallOption
BulkInsert []gax.CallOption
Delete []gax.CallOption
DeleteAccessConfig []gax.CallOption
DeleteNetworkInterface []gax.CallOption
DetachDisk []gax.CallOption
Get []gax.CallOption
GetEffectiveFirewalls []gax.CallOption
GetGuestAttributes []gax.CallOption
GetIamPolicy []gax.CallOption
GetPartnerMetadata []gax.CallOption
GetScreenshot []gax.CallOption
GetSerialPortOutput []gax.CallOption
GetShieldedInstanceIdentity []gax.CallOption
GetShieldedVmIdentity []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListReferrers []gax.CallOption
PatchPartnerMetadata []gax.CallOption
PerformMaintenance []gax.CallOption
RemoveResourcePolicies []gax.CallOption
ReportHostAsFaulty []gax.CallOption
Reset []gax.CallOption
Resume []gax.CallOption
SendDiagnosticInterrupt []gax.CallOption
SetDeletionProtection []gax.CallOption
SetDiskAutoDelete []gax.CallOption
SetIamPolicy []gax.CallOption
SetLabels []gax.CallOption
SetMachineResources []gax.CallOption
SetMachineType []gax.CallOption
SetMetadata []gax.CallOption
SetMinCpuPlatform []gax.CallOption
SetName []gax.CallOption
SetScheduling []gax.CallOption
SetSecurityPolicy []gax.CallOption
SetServiceAccount []gax.CallOption
SetShieldedInstanceIntegrityPolicy []gax.CallOption
SetShieldedVmIntegrityPolicy []gax.CallOption
SetTags []gax.CallOption
SimulateMaintenanceEvent []gax.CallOption
Start []gax.CallOption
StartWithEncryptionKey []gax.CallOption
Stop []gax.CallOption
Suspend []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
UpdateAccessConfig []gax.CallOption
UpdateDisplayDevice []gax.CallOption
UpdateNetworkInterface []gax.CallOption
UpdateShieldedInstanceConfig []gax.CallOption
UpdateShieldedVmConfig []gax.CallOption
}
InstancesCallOptions contains the retry settings for each method of InstancesClient.
type InstancesClient ¶
type InstancesClient struct {
// The call options for this service.
CallOptions *InstancesCallOptions
// contains filtered or unexported fields
}
InstancesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Instances API.
func NewInstancesRESTClient ¶
func NewInstancesRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstancesClient, error)
NewInstancesRESTClient creates a new instances rest client.
The Instances API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InstancesClient) AddAccessConfig ¶
func (c *InstancesClient) AddAccessConfig(ctx context.Context, req *computepb.AddAccessConfigInstanceRequest, opts ...gax.CallOption) (*Operation, error)
AddAccessConfig adds an access config to an instance’s network interface.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddAccessConfigInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddAccessConfigInstanceRequest.
}
op, err := c.AddAccessConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) AddNetworkInterface ¶
func (c *InstancesClient) AddNetworkInterface(ctx context.Context, req *computepb.AddNetworkInterfaceInstanceRequest, opts ...gax.CallOption) (*Operation, error)
AddNetworkInterface adds one dynamic network interface to an active instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddNetworkInterfaceInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddNetworkInterfaceInstanceRequest.
}
op, err := c.AddNetworkInterface(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) AddResourcePolicies ¶
func (c *InstancesClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesInstanceRequest, opts ...gax.CallOption) (*Operation, error)
AddResourcePolicies adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddResourcePoliciesInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddResourcePoliciesInstanceRequest.
}
op, err := c.AddResourcePolicies(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) AggregatedList ¶
func (c *InstancesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstancesRequest, opts ...gax.CallOption) *InstancesScopedListPairIterator
AggregatedList retrieves an aggregated list of all of the instances in your project across all regions and zones.
The performance of this method degrades when a filter is specified on a project that has a very large number of instances.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInstancesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInstancesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstancesClient) AttachDisk ¶
func (c *InstancesClient) AttachDisk(ctx context.Context, req *computepb.AttachDiskInstanceRequest, opts ...gax.CallOption) (*Operation, error)
AttachDisk attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, readAdding a persistent disk to your instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AttachDiskInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AttachDiskInstanceRequest.
}
op, err := c.AttachDisk(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) BulkInsert ¶
func (c *InstancesClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertInstanceRequest, opts ...gax.CallOption) (*Operation, error)
BulkInsert creates multiple instances. Count specifies the number of instances to create. For more information, seeAbout bulk creation of VMs.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.BulkInsertInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#BulkInsertInstanceRequest.
}
op, err := c.BulkInsert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) Close ¶
func (c *InstancesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InstancesClient) Connection
deprecated
func (c *InstancesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InstancesClient) Delete ¶
func (c *InstancesClient) Delete(ctx context.Context, req *computepb.DeleteInstanceRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified Instance resource. For more information, seeDeleting an instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInstanceRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) DeleteAccessConfig ¶
func (c *InstancesClient) DeleteAccessConfig(ctx context.Context, req *computepb.DeleteAccessConfigInstanceRequest, opts ...gax.CallOption) (*Operation, error)
DeleteAccessConfig deletes an access config from an instance’s network interface.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteAccessConfigInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteAccessConfigInstanceRequest.
}
op, err := c.DeleteAccessConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) DeleteNetworkInterface ¶
func (c *InstancesClient) DeleteNetworkInterface(ctx context.Context, req *computepb.DeleteNetworkInterfaceInstanceRequest, opts ...gax.CallOption) (*Operation, error)
DeleteNetworkInterface deletes one dynamic network interface from an active instance. InstancesDeleteNetworkInterfaceRequest indicates:
instance from which to delete, using project+zone+resource_id fields; dynamic network interface to be deleted, using network_interface_name field;
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteNetworkInterfaceInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteNetworkInterfaceInstanceRequest.
}
op, err := c.DeleteNetworkInterface(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) DetachDisk ¶
func (c *InstancesClient) DetachDisk(ctx context.Context, req *computepb.DetachDiskInstanceRequest, opts ...gax.CallOption) (*Operation, error)
DetachDisk detaches a disk from an instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DetachDiskInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DetachDiskInstanceRequest.
}
op, err := c.DetachDisk(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) Get ¶
func (c *InstancesClient) Get(ctx context.Context, req *computepb.GetInstanceRequest, opts ...gax.CallOption) (*computepb.Instance, error)
Get returns the specified Instance resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInstanceRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) GetEffectiveFirewalls ¶
func (c *InstancesClient) GetEffectiveFirewalls(ctx context.Context, req *computepb.GetEffectiveFirewallsInstanceRequest, opts ...gax.CallOption) (*computepb.InstancesGetEffectiveFirewallsResponse, error)
GetEffectiveFirewalls returns effective firewalls applied to an interface of the instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetEffectiveFirewallsInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetEffectiveFirewallsInstanceRequest.
}
resp, err := c.GetEffectiveFirewalls(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) GetGuestAttributes ¶
func (c *InstancesClient) GetGuestAttributes(ctx context.Context, req *computepb.GetGuestAttributesInstanceRequest, opts ...gax.CallOption) (*computepb.GuestAttributes, error)
GetGuestAttributes returns the specified guest attributes entry.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetGuestAttributesInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetGuestAttributesInstanceRequest.
}
resp, err := c.GetGuestAttributes(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) GetIamPolicy ¶
func (c *InstancesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstanceRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyInstanceRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) GetPartnerMetadata ¶
func (c *InstancesClient) GetPartnerMetadata(ctx context.Context, req *computepb.GetPartnerMetadataInstanceRequest, opts ...gax.CallOption) (*computepb.PartnerMetadata, error)
GetPartnerMetadata gets partner metadata of the specified instance and namespaces.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetPartnerMetadataInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetPartnerMetadataInstanceRequest.
}
resp, err := c.GetPartnerMetadata(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) GetScreenshot ¶
func (c *InstancesClient) GetScreenshot(ctx context.Context, req *computepb.GetScreenshotInstanceRequest, opts ...gax.CallOption) (*computepb.Screenshot, error)
GetScreenshot returns the screenshot from the specified instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetScreenshotInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetScreenshotInstanceRequest.
}
resp, err := c.GetScreenshot(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) GetSerialPortOutput ¶
func (c *InstancesClient) GetSerialPortOutput(ctx context.Context, req *computepb.GetSerialPortOutputInstanceRequest, opts ...gax.CallOption) (*computepb.SerialPortOutput, error)
GetSerialPortOutput returns the last 1 MB of serial port output from the specified instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetSerialPortOutputInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetSerialPortOutputInstanceRequest.
}
resp, err := c.GetSerialPortOutput(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) GetShieldedInstanceIdentity ¶
func (c *InstancesClient) GetShieldedInstanceIdentity(ctx context.Context, req *computepb.GetShieldedInstanceIdentityInstanceRequest, opts ...gax.CallOption) (*computepb.ShieldedInstanceIdentity, error)
GetShieldedInstanceIdentity returns the Shielded Instance Identity of an instance
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetShieldedInstanceIdentityInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetShieldedInstanceIdentityInstanceRequest.
}
resp, err := c.GetShieldedInstanceIdentity(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) GetShieldedVmIdentity ¶
func (c *InstancesClient) GetShieldedVmIdentity(ctx context.Context, req *computepb.GetShieldedVmIdentityInstanceRequest, opts ...gax.CallOption) (*computepb.ShieldedVmIdentity, error)
GetShieldedVmIdentity returns the Shielded VM Identity of an instance
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetShieldedVmIdentityInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetShieldedVmIdentityInstanceRequest.
}
resp, err := c.GetShieldedVmIdentity(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) Insert ¶
func (c *InstancesClient) Insert(ctx context.Context, req *computepb.InsertInstanceRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an instance resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertInstanceRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) List ¶
func (c *InstancesClient) List(ctx context.Context, req *computepb.ListInstancesRequest, opts ...gax.CallOption) *InstanceIterator
List retrieves the list of instances contained within the specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstancesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstancesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstancesClient) ListReferrers ¶
func (c *InstancesClient) ListReferrers(ctx context.Context, req *computepb.ListReferrersInstancesRequest, opts ...gax.CallOption) *ReferenceIterator
ListReferrers retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, readViewing referrers to VM instances.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListReferrersInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListReferrersInstancesRequest.
}
it := c.ListReferrers(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceListReferrers)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListReferrersInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListReferrersInstancesRequest.
}
for resp, err := range c.ListReferrers(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstancesClient) PatchPartnerMetadata ¶
func (c *InstancesClient) PatchPartnerMetadata(ctx context.Context, req *computepb.PatchPartnerMetadataInstanceRequest, opts ...gax.CallOption) (*Operation, error)
PatchPartnerMetadata patches partner metadata of the specified instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchPartnerMetadataInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchPartnerMetadataInstanceRequest.
}
op, err := c.PatchPartnerMetadata(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) PerformMaintenance ¶
func (c *InstancesClient) PerformMaintenance(ctx context.Context, req *computepb.PerformMaintenanceInstanceRequest, opts ...gax.CallOption) (*Operation, error)
PerformMaintenance perform a manual maintenance on the instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PerformMaintenanceInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PerformMaintenanceInstanceRequest.
}
op, err := c.PerformMaintenance(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) RemoveResourcePolicies ¶
func (c *InstancesClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesInstanceRequest, opts ...gax.CallOption) (*Operation, error)
RemoveResourcePolicies removes resource policies from an instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveResourcePoliciesInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveResourcePoliciesInstanceRequest.
}
op, err := c.RemoveResourcePolicies(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) ReportHostAsFaulty ¶
func (c *InstancesClient) ReportHostAsFaulty(ctx context.Context, req *computepb.ReportHostAsFaultyInstanceRequest, opts ...gax.CallOption) (*Operation, error)
ReportHostAsFaulty mark the host as faulty and try to restart the instance on a new host.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ReportHostAsFaultyInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ReportHostAsFaultyInstanceRequest.
}
op, err := c.ReportHostAsFaulty(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) Reset ¶
func (c *InstancesClient) Reset(ctx context.Context, req *computepb.ResetInstanceRequest, opts ...gax.CallOption) (*Operation, error)
Reset performs a reset on the instance. This is a hard reset. The VM does not do a graceful shutdown. For more information, seeResetting an instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResetInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ResetInstanceRequest.
}
op, err := c.Reset(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) Resume ¶
func (c *InstancesClient) Resume(ctx context.Context, req *computepb.ResumeInstanceRequest, opts ...gax.CallOption) (*Operation, error)
Resume resumes an instance that was suspended using theinstances().suspend method.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResumeInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ResumeInstanceRequest.
}
op, err := c.Resume(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SendDiagnosticInterrupt ¶
func (c *InstancesClient) SendDiagnosticInterrupt(ctx context.Context, req *computepb.SendDiagnosticInterruptInstanceRequest, opts ...gax.CallOption) (*computepb.SendDiagnosticInterruptInstanceResponse, error)
SendDiagnosticInterrupt sends diagnostic interrupt to the instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SendDiagnosticInterruptInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SendDiagnosticInterruptInstanceRequest.
}
resp, err := c.SendDiagnosticInterrupt(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) SetDeletionProtection ¶
func (c *InstancesClient) SetDeletionProtection(ctx context.Context, req *computepb.SetDeletionProtectionInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetDeletionProtection sets deletion protection on the instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetDeletionProtectionInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetDeletionProtectionInstanceRequest.
}
op, err := c.SetDeletionProtection(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetDiskAutoDelete ¶
func (c *InstancesClient) SetDiskAutoDelete(ctx context.Context, req *computepb.SetDiskAutoDeleteInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetDiskAutoDelete sets the auto-delete flag for a disk attached to an instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetDiskAutoDeleteInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetDiskAutoDeleteInstanceRequest.
}
op, err := c.SetDiskAutoDelete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetIamPolicy ¶
func (c *InstancesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstanceRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyInstanceRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) SetLabels ¶
func (c *InstancesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets labels on an instance. To learn more about labels, read theLabeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsInstanceRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetMachineResources ¶
func (c *InstancesClient) SetMachineResources(ctx context.Context, req *computepb.SetMachineResourcesInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetMachineResources changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetMachineResourcesInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetMachineResourcesInstanceRequest.
}
op, err := c.SetMachineResources(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetMachineType ¶
func (c *InstancesClient) SetMachineType(ctx context.Context, req *computepb.SetMachineTypeInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetMachineType changes the machine type for a stopped instance to the machine type specified in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetMachineTypeInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetMachineTypeInstanceRequest.
}
op, err := c.SetMachineType(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetMetadata ¶
func (c *InstancesClient) SetMetadata(ctx context.Context, req *computepb.SetMetadataInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetMetadata sets metadata for the specified instance to the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetMetadataInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetMetadataInstanceRequest.
}
op, err := c.SetMetadata(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetMinCpuPlatform ¶
func (c *InstancesClient) SetMinCpuPlatform(ctx context.Context, req *computepb.SetMinCpuPlatformInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetMinCpuPlatform changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, readSpecifying a Minimum CPU Platform.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetMinCpuPlatformInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetMinCpuPlatformInstanceRequest.
}
op, err := c.SetMinCpuPlatform(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetName ¶
func (c *InstancesClient) SetName(ctx context.Context, req *computepb.SetNameInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetName sets name of an instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetNameInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetNameInstanceRequest.
}
op, err := c.SetName(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetScheduling ¶
func (c *InstancesClient) SetScheduling(ctx context.Context, req *computepb.SetSchedulingInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetScheduling sets an instance’s scheduling options. You can only call this method on astopped instance, that is, a VM instance that is in a TERMINATED state. SeeInstance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, seeSet VM host maintenance policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSchedulingInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetSchedulingInstanceRequest.
}
op, err := c.SetScheduling(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetSecurityPolicy ¶
func (c *InstancesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetSecurityPolicy sets the Google Cloud Armor security policy for the specified instance. For more information, seeGoogle Cloud Armor Overview
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSecurityPolicyInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetSecurityPolicyInstanceRequest.
}
op, err := c.SetSecurityPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetServiceAccount ¶
func (c *InstancesClient) SetServiceAccount(ctx context.Context, req *computepb.SetServiceAccountInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetServiceAccount sets the service account on the instance. For more information, readChanging the service account and access scopes for an instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetServiceAccountInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetServiceAccountInstanceRequest.
}
op, err := c.SetServiceAccount(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetShieldedInstanceIntegrityPolicy ¶
func (c *InstancesClient) SetShieldedInstanceIntegrityPolicy(ctx context.Context, req *computepb.SetShieldedInstanceIntegrityPolicyInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetShieldedInstanceIntegrityPolicy sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetShieldedInstanceIntegrityPolicyInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetShieldedInstanceIntegrityPolicyInstanceRequest.
}
op, err := c.SetShieldedInstanceIntegrityPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetShieldedVmIntegrityPolicy ¶
func (c *InstancesClient) SetShieldedVmIntegrityPolicy(ctx context.Context, req *computepb.SetShieldedVmIntegrityPolicyInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetShieldedVmIntegrityPolicy sets the Shielded VM integrity policy for a VM instance. You can only use this method on a running VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetShieldedVmIntegrityPolicyInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetShieldedVmIntegrityPolicyInstanceRequest.
}
op, err := c.SetShieldedVmIntegrityPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SetTags ¶
func (c *InstancesClient) SetTags(ctx context.Context, req *computepb.SetTagsInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetTags sets network tags for the specified instance to the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetTagsInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetTagsInstanceRequest.
}
op, err := c.SetTags(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) SimulateMaintenanceEvent ¶
func (c *InstancesClient) SimulateMaintenanceEvent(ctx context.Context, req *computepb.SimulateMaintenanceEventInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SimulateMaintenanceEvent simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SimulateMaintenanceEventInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SimulateMaintenanceEventInstanceRequest.
}
op, err := c.SimulateMaintenanceEvent(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) Start ¶
func (c *InstancesClient) Start(ctx context.Context, req *computepb.StartInstanceRequest, opts ...gax.CallOption) (*Operation, error)
Start starts an instance that was stopped using theinstances().stop method. For more information, seeRestart an instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StartInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StartInstanceRequest.
}
op, err := c.Start(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) StartWithEncryptionKey ¶
func (c *InstancesClient) StartWithEncryptionKey(ctx context.Context, req *computepb.StartWithEncryptionKeyInstanceRequest, opts ...gax.CallOption) (*Operation, error)
StartWithEncryptionKey starts an instance that was stopped using theinstances().stop method. For more information, seeRestart an instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StartWithEncryptionKeyInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StartWithEncryptionKeyInstanceRequest.
}
op, err := c.StartWithEncryptionKey(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) Stop ¶
func (c *InstancesClient) Stop(ctx context.Context, req *computepb.StopInstanceRequest, opts ...gax.CallOption) (*Operation, error)
Stop stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, seeStopping an instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StopInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StopInstanceRequest.
}
op, err := c.Stop(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) Suspend ¶
func (c *InstancesClient) Suspend(ctx context.Context, req *computepb.SuspendInstanceRequest, opts ...gax.CallOption) (*Operation, error)
Suspend this method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SuspendInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SuspendInstanceRequest.
}
op, err := c.Suspend(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) TestIamPermissions ¶
func (c *InstancesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstanceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsInstanceRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstancesClient) Update ¶
func (c *InstancesClient) Update(ctx context.Context, req *computepb.UpdateInstanceRequest, opts ...gax.CallOption) (*Operation, error)
Update updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateInstanceRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) UpdateAccessConfig ¶
func (c *InstancesClient) UpdateAccessConfig(ctx context.Context, req *computepb.UpdateAccessConfigInstanceRequest, opts ...gax.CallOption) (*Operation, error)
UpdateAccessConfig updates the specified access config from an instance’s network interface with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateAccessConfigInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateAccessConfigInstanceRequest.
}
op, err := c.UpdateAccessConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) UpdateDisplayDevice ¶
func (c *InstancesClient) UpdateDisplayDevice(ctx context.Context, req *computepb.UpdateDisplayDeviceInstanceRequest, opts ...gax.CallOption) (*Operation, error)
UpdateDisplayDevice updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateDisplayDeviceInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateDisplayDeviceInstanceRequest.
}
op, err := c.UpdateDisplayDevice(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) UpdateNetworkInterface ¶
func (c *InstancesClient) UpdateNetworkInterface(ctx context.Context, req *computepb.UpdateNetworkInterfaceInstanceRequest, opts ...gax.CallOption) (*Operation, error)
UpdateNetworkInterface updates an instance’s network interface. This method can only update an interface’s alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateNetworkInterfaceInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateNetworkInterfaceInstanceRequest.
}
op, err := c.UpdateNetworkInterface(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) UpdateShieldedInstanceConfig ¶
func (c *InstancesClient) UpdateShieldedInstanceConfig(ctx context.Context, req *computepb.UpdateShieldedInstanceConfigInstanceRequest, opts ...gax.CallOption) (*Operation, error)
UpdateShieldedInstanceConfig updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateShieldedInstanceConfigInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateShieldedInstanceConfigInstanceRequest.
}
op, err := c.UpdateShieldedInstanceConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstancesClient) UpdateShieldedVmConfig ¶
func (c *InstancesClient) UpdateShieldedVmConfig(ctx context.Context, req *computepb.UpdateShieldedVmConfigInstanceRequest, opts ...gax.CallOption) (*Operation, error)
UpdateShieldedVmConfig updates the Shielded VM config for a VM instance. You can only use this method on a stopped VM instance. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateShieldedVmConfigInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateShieldedVmConfigInstanceRequest.
}
op, err := c.UpdateShieldedVmConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type InstancesScopedListPair ¶
type InstancesScopedListPair struct {
Key string
Value *computepb.InstancesScopedList
}
InstancesScopedListPair is a holder type for string/*computepb.InstancesScopedList map entries
type InstancesScopedListPairIterator ¶
type InstancesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []InstancesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstancesScopedListPairIterator manages a stream of InstancesScopedListPair.
func (*InstancesScopedListPairIterator) All ¶
func (it *InstancesScopedListPairIterator) All() iter.Seq2[InstancesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstancesScopedListPairIterator) Next ¶
func (it *InstancesScopedListPairIterator) Next() (InstancesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstancesScopedListPairIterator) PageInfo ¶
func (it *InstancesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstantSnapshotGroupIterator ¶ added in v1.55.0
type InstantSnapshotGroupIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InstantSnapshotGroup, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstantSnapshotGroupIterator manages a stream of *computepb.InstantSnapshotGroup.
func (*InstantSnapshotGroupIterator) All ¶ added in v1.55.0
func (it *InstantSnapshotGroupIterator) All() iter.Seq2[*computepb.InstantSnapshotGroup, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstantSnapshotGroupIterator) Next ¶ added in v1.55.0
func (it *InstantSnapshotGroupIterator) Next() (*computepb.InstantSnapshotGroup, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstantSnapshotGroupIterator) PageInfo ¶ added in v1.55.0
func (it *InstantSnapshotGroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstantSnapshotGroupsCallOptions ¶ added in v1.55.0
type InstantSnapshotGroupsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
InstantSnapshotGroupsCallOptions contains the retry settings for each method of InstantSnapshotGroupsClient.
type InstantSnapshotGroupsClient ¶ added in v1.55.0
type InstantSnapshotGroupsClient struct {
// The call options for this service.
CallOptions *InstantSnapshotGroupsCallOptions
// contains filtered or unexported fields
}
InstantSnapshotGroupsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InstantSnapshotGroups API.
func NewInstantSnapshotGroupsRESTClient ¶ added in v1.55.0
func NewInstantSnapshotGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstantSnapshotGroupsClient, error)
NewInstantSnapshotGroupsRESTClient creates a new instant snapshot groups rest client.
The InstantSnapshotGroups API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InstantSnapshotGroupsClient) Close ¶ added in v1.55.0
func (c *InstantSnapshotGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InstantSnapshotGroupsClient) Connection
deprecated
added in
v1.55.0
func (c *InstantSnapshotGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InstantSnapshotGroupsClient) Delete ¶ added in v1.55.0
func (c *InstantSnapshotGroupsClient) Delete(ctx context.Context, req *computepb.DeleteInstantSnapshotGroupRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes a Zonal InstantSnapshotGroup resource
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInstantSnapshotGroupRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstantSnapshotGroupsClient) Get ¶ added in v1.55.0
func (c *InstantSnapshotGroupsClient) Get(ctx context.Context, req *computepb.GetInstantSnapshotGroupRequest, opts ...gax.CallOption) (*computepb.InstantSnapshotGroup, error)
Get returns the specified InstantSnapshotGroup resource in the specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInstantSnapshotGroupRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstantSnapshotGroupsClient) GetIamPolicy ¶ added in v1.55.0
func (c *InstantSnapshotGroupsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstantSnapshotGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyInstantSnapshotGroupRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstantSnapshotGroupsClient) Insert ¶ added in v1.55.0
func (c *InstantSnapshotGroupsClient) Insert(ctx context.Context, req *computepb.InsertInstantSnapshotGroupRequest, opts ...gax.CallOption) (*Operation, error)
Insert inserts a Zonal InstantSnapshotGroup resource
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertInstantSnapshotGroupRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstantSnapshotGroupsClient) List ¶ added in v1.55.0
func (c *InstantSnapshotGroupsClient) List(ctx context.Context, req *computepb.ListInstantSnapshotGroupsRequest, opts ...gax.CallOption) *InstantSnapshotGroupIterator
List retrieves the list of InstantSnapshotGroup resources contained within the specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstantSnapshotGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstantSnapshotGroupsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ListInstantSnapshotGroups)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstantSnapshotGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstantSnapshotGroupsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstantSnapshotGroupsClient) SetIamPolicy ¶ added in v1.55.0
func (c *InstantSnapshotGroupsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstantSnapshotGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyInstantSnapshotGroupRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstantSnapshotGroupsClient) TestIamPermissions ¶ added in v1.55.0
func (c *InstantSnapshotGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstantSnapshotGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsInstantSnapshotGroupRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type InstantSnapshotIterator ¶
type InstantSnapshotIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InstantSnapshot, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstantSnapshotIterator manages a stream of *computepb.InstantSnapshot.
func (*InstantSnapshotIterator) All ¶
func (it *InstantSnapshotIterator) All() iter.Seq2[*computepb.InstantSnapshot, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstantSnapshotIterator) Next ¶
func (it *InstantSnapshotIterator) Next() (*computepb.InstantSnapshot, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstantSnapshotIterator) PageInfo ¶
func (it *InstantSnapshotIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstantSnapshotsCallOptions ¶
type InstantSnapshotsCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetIamPolicy []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
InstantSnapshotsCallOptions contains the retry settings for each method of InstantSnapshotsClient.
type InstantSnapshotsClient ¶
type InstantSnapshotsClient struct {
// The call options for this service.
CallOptions *InstantSnapshotsCallOptions
// contains filtered or unexported fields
}
InstantSnapshotsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InstantSnapshots API.
func NewInstantSnapshotsRESTClient ¶
func NewInstantSnapshotsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstantSnapshotsClient, error)
NewInstantSnapshotsRESTClient creates a new instant snapshots rest client.
The InstantSnapshots API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InstantSnapshotsClient) AggregatedList ¶
func (c *InstantSnapshotsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstantSnapshotsRequest, opts ...gax.CallOption) *InstantSnapshotsScopedListPairIterator
AggregatedList retrieves an aggregated list of instantSnapshots.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInstantSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInstantSnapshotsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstantSnapshotAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInstantSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInstantSnapshotsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstantSnapshotsClient) Close ¶
func (c *InstantSnapshotsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InstantSnapshotsClient) Connection
deprecated
func (c *InstantSnapshotsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InstantSnapshotsClient) Delete ¶
func (c *InstantSnapshotsClient) Delete(ctx context.Context, req *computepb.DeleteInstantSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified InstantSnapshot resource. Keep in mind that deleting a single instantSnapshot might not necessarily delete all the data on that instantSnapshot. If any data on the instantSnapshot that is marked for deletion is needed for subsequent instantSnapshots, the data will be moved to the next corresponding instantSnapshot.
For more information, seeDeleting instantSnapshots.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInstantSnapshotRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstantSnapshotsClient) Get ¶
func (c *InstantSnapshotsClient) Get(ctx context.Context, req *computepb.GetInstantSnapshotRequest, opts ...gax.CallOption) (*computepb.InstantSnapshot, error)
Get returns the specified InstantSnapshot resource in the specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInstantSnapshotRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstantSnapshotsClient) GetIamPolicy ¶
func (c *InstantSnapshotsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstantSnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyInstantSnapshotRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstantSnapshotsClient) Insert ¶
func (c *InstantSnapshotsClient) Insert(ctx context.Context, req *computepb.InsertInstantSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an instant snapshot in the specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertInstantSnapshotRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstantSnapshotsClient) List ¶
func (c *InstantSnapshotsClient) List(ctx context.Context, req *computepb.ListInstantSnapshotsRequest, opts ...gax.CallOption) *InstantSnapshotIterator
List retrieves the list of InstantSnapshot resources contained within the specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstantSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstantSnapshotsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstantSnapshotList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstantSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstantSnapshotsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InstantSnapshotsClient) SetIamPolicy ¶
func (c *InstantSnapshotsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstantSnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyInstantSnapshotRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstantSnapshotsClient) SetLabels ¶
func (c *InstantSnapshotsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInstantSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a instantSnapshot in the given zone. To learn more about labels, read the Labeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsInstantSnapshotRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InstantSnapshotsClient) TestIamPermissions ¶
func (c *InstantSnapshotsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstantSnapshotRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsInstantSnapshotRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type InstantSnapshotsScopedListPair ¶
type InstantSnapshotsScopedListPair struct {
Key string
Value *computepb.InstantSnapshotsScopedList
}
InstantSnapshotsScopedListPair is a holder type for string/*computepb.InstantSnapshotsScopedList map entries
type InstantSnapshotsScopedListPairIterator ¶
type InstantSnapshotsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []InstantSnapshotsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstantSnapshotsScopedListPairIterator manages a stream of InstantSnapshotsScopedListPair.
func (*InstantSnapshotsScopedListPairIterator) All ¶
func (it *InstantSnapshotsScopedListPairIterator) All() iter.Seq2[InstantSnapshotsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstantSnapshotsScopedListPairIterator) Next ¶
func (it *InstantSnapshotsScopedListPairIterator) Next() (InstantSnapshotsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstantSnapshotsScopedListPairIterator) PageInfo ¶
func (it *InstantSnapshotsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InterconnectAttachmentGroupIterator ¶
type InterconnectAttachmentGroupIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InterconnectAttachmentGroup, nextPageToken string, err error)
// contains filtered or unexported fields
}
InterconnectAttachmentGroupIterator manages a stream of *computepb.InterconnectAttachmentGroup.
func (*InterconnectAttachmentGroupIterator) All ¶
func (it *InterconnectAttachmentGroupIterator) All() iter.Seq2[*computepb.InterconnectAttachmentGroup, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InterconnectAttachmentGroupIterator) Next ¶
func (it *InterconnectAttachmentGroupIterator) Next() (*computepb.InterconnectAttachmentGroup, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InterconnectAttachmentGroupIterator) PageInfo ¶
func (it *InterconnectAttachmentGroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InterconnectAttachmentGroupsCallOptions ¶
type InterconnectAttachmentGroupsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
GetOperationalStatus []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
InterconnectAttachmentGroupsCallOptions contains the retry settings for each method of InterconnectAttachmentGroupsClient.
type InterconnectAttachmentGroupsClient ¶
type InterconnectAttachmentGroupsClient struct {
// The call options for this service.
CallOptions *InterconnectAttachmentGroupsCallOptions
// contains filtered or unexported fields
}
InterconnectAttachmentGroupsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InterconnectAttachmentGroups API.
func NewInterconnectAttachmentGroupsRESTClient ¶
func NewInterconnectAttachmentGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InterconnectAttachmentGroupsClient, error)
NewInterconnectAttachmentGroupsRESTClient creates a new interconnect attachment groups rest client.
The InterconnectAttachmentGroups API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InterconnectAttachmentGroupsClient) Close ¶
func (c *InterconnectAttachmentGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InterconnectAttachmentGroupsClient) Connection
deprecated
func (c *InterconnectAttachmentGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InterconnectAttachmentGroupsClient) Delete ¶
func (c *InterconnectAttachmentGroupsClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectAttachmentGroupRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified InterconnectAttachmentGroup in the given scope
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInterconnectAttachmentGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInterconnectAttachmentGroupRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectAttachmentGroupsClient) Get ¶
func (c *InterconnectAttachmentGroupsClient) Get(ctx context.Context, req *computepb.GetInterconnectAttachmentGroupRequest, opts ...gax.CallOption) (*computepb.InterconnectAttachmentGroup, error)
Get returns the specified InterconnectAttachmentGroup resource in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInterconnectAttachmentGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInterconnectAttachmentGroupRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectAttachmentGroupsClient) GetIamPolicy ¶
func (c *InterconnectAttachmentGroupsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInterconnectAttachmentGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyInterconnectAttachmentGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyInterconnectAttachmentGroupRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectAttachmentGroupsClient) GetOperationalStatus ¶
func (c *InterconnectAttachmentGroupsClient) GetOperationalStatus(ctx context.Context, req *computepb.GetOperationalStatusInterconnectAttachmentGroupRequest, opts ...gax.CallOption) (*computepb.InterconnectAttachmentGroupsGetOperationalStatusResponse, error)
GetOperationalStatus returns the InterconnectAttachmentStatuses for the specified InterconnectAttachmentGroup resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetOperationalStatusInterconnectAttachmentGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetOperationalStatusInterconnectAttachmentGroupRequest.
}
resp, err := c.GetOperationalStatus(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectAttachmentGroupsClient) Insert ¶
func (c *InterconnectAttachmentGroupsClient) Insert(ctx context.Context, req *computepb.InsertInterconnectAttachmentGroupRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a InterconnectAttachmentGroup in the specified project in the given scope using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInterconnectAttachmentGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertInterconnectAttachmentGroupRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectAttachmentGroupsClient) List ¶
func (c *InterconnectAttachmentGroupsClient) List(ctx context.Context, req *computepb.ListInterconnectAttachmentGroupsRequest, opts ...gax.CallOption) *InterconnectAttachmentGroupIterator
List lists the InterconnectAttachmentGroups for a project in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectAttachmentGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectAttachmentGroupsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InterconnectAttachmentGroupsListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectAttachmentGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectAttachmentGroupsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InterconnectAttachmentGroupsClient) Patch ¶
func (c *InterconnectAttachmentGroupsClient) Patch(ctx context.Context, req *computepb.PatchInterconnectAttachmentGroupRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified InterconnectAttachmentGroup resource with the data included in the request. This method supports PATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchInterconnectAttachmentGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchInterconnectAttachmentGroupRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectAttachmentGroupsClient) SetIamPolicy ¶
func (c *InterconnectAttachmentGroupsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInterconnectAttachmentGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyInterconnectAttachmentGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyInterconnectAttachmentGroupRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectAttachmentGroupsClient) TestIamPermissions ¶
func (c *InterconnectAttachmentGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInterconnectAttachmentGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsInterconnectAttachmentGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsInterconnectAttachmentGroupRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type InterconnectAttachmentIterator ¶
type InterconnectAttachmentIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InterconnectAttachment, nextPageToken string, err error)
// contains filtered or unexported fields
}
InterconnectAttachmentIterator manages a stream of *computepb.InterconnectAttachment.
func (*InterconnectAttachmentIterator) All ¶
func (it *InterconnectAttachmentIterator) All() iter.Seq2[*computepb.InterconnectAttachment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InterconnectAttachmentIterator) Next ¶
func (it *InterconnectAttachmentIterator) Next() (*computepb.InterconnectAttachment, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InterconnectAttachmentIterator) PageInfo ¶
func (it *InterconnectAttachmentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InterconnectAttachmentsCallOptions ¶
type InterconnectAttachmentsCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
InterconnectAttachmentsCallOptions contains the retry settings for each method of InterconnectAttachmentsClient.
type InterconnectAttachmentsClient ¶
type InterconnectAttachmentsClient struct {
// The call options for this service.
CallOptions *InterconnectAttachmentsCallOptions
// contains filtered or unexported fields
}
InterconnectAttachmentsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InterconnectAttachments API.
func NewInterconnectAttachmentsRESTClient ¶
func NewInterconnectAttachmentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InterconnectAttachmentsClient, error)
NewInterconnectAttachmentsRESTClient creates a new interconnect attachments rest client.
The InterconnectAttachments API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InterconnectAttachmentsClient) AggregatedList ¶
func (c *InterconnectAttachmentsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInterconnectAttachmentsRequest, opts ...gax.CallOption) *InterconnectAttachmentsScopedListPairIterator
AggregatedList retrieves an aggregated list of interconnect attachments.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInterconnectAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInterconnectAttachmentsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InterconnectAttachmentAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListInterconnectAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListInterconnectAttachmentsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InterconnectAttachmentsClient) Close ¶
func (c *InterconnectAttachmentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InterconnectAttachmentsClient) Connection
deprecated
func (c *InterconnectAttachmentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InterconnectAttachmentsClient) Delete ¶
func (c *InterconnectAttachmentsClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectAttachmentRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified interconnect attachment.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInterconnectAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInterconnectAttachmentRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectAttachmentsClient) Get ¶
func (c *InterconnectAttachmentsClient) Get(ctx context.Context, req *computepb.GetInterconnectAttachmentRequest, opts ...gax.CallOption) (*computepb.InterconnectAttachment, error)
Get returns the specified interconnect attachment.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInterconnectAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInterconnectAttachmentRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectAttachmentsClient) Insert ¶
func (c *InterconnectAttachmentsClient) Insert(ctx context.Context, req *computepb.InsertInterconnectAttachmentRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an InterconnectAttachment in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInterconnectAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertInterconnectAttachmentRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectAttachmentsClient) List ¶
func (c *InterconnectAttachmentsClient) List(ctx context.Context, req *computepb.ListInterconnectAttachmentsRequest, opts ...gax.CallOption) *InterconnectAttachmentIterator
List retrieves the list of interconnect attachments contained within the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectAttachmentsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InterconnectAttachmentList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectAttachmentsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InterconnectAttachmentsClient) Patch ¶
func (c *InterconnectAttachmentsClient) Patch(ctx context.Context, req *computepb.PatchInterconnectAttachmentRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified interconnect attachment with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchInterconnectAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchInterconnectAttachmentRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectAttachmentsClient) SetLabels ¶
func (c *InterconnectAttachmentsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInterconnectAttachmentRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsInterconnectAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsInterconnectAttachmentRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectAttachmentsClient) TestIamPermissions ¶
func (c *InterconnectAttachmentsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInterconnectAttachmentRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsInterconnectAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsInterconnectAttachmentRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type InterconnectAttachmentsScopedListPair ¶
type InterconnectAttachmentsScopedListPair struct {
Key string
Value *computepb.InterconnectAttachmentsScopedList
}
InterconnectAttachmentsScopedListPair is a holder type for string/*computepb.InterconnectAttachmentsScopedList map entries
type InterconnectAttachmentsScopedListPairIterator ¶
type InterconnectAttachmentsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []InterconnectAttachmentsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
InterconnectAttachmentsScopedListPairIterator manages a stream of InterconnectAttachmentsScopedListPair.
func (*InterconnectAttachmentsScopedListPairIterator) All ¶
func (it *InterconnectAttachmentsScopedListPairIterator) All() iter.Seq2[InterconnectAttachmentsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InterconnectAttachmentsScopedListPairIterator) Next ¶
func (it *InterconnectAttachmentsScopedListPairIterator) Next() (InterconnectAttachmentsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InterconnectAttachmentsScopedListPairIterator) PageInfo ¶
func (it *InterconnectAttachmentsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InterconnectGroupIterator ¶
type InterconnectGroupIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InterconnectGroup, nextPageToken string, err error)
// contains filtered or unexported fields
}
InterconnectGroupIterator manages a stream of *computepb.InterconnectGroup.
func (*InterconnectGroupIterator) All ¶
func (it *InterconnectGroupIterator) All() iter.Seq2[*computepb.InterconnectGroup, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InterconnectGroupIterator) Next ¶
func (it *InterconnectGroupIterator) Next() (*computepb.InterconnectGroup, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InterconnectGroupIterator) PageInfo ¶
func (it *InterconnectGroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InterconnectGroupsCallOptions ¶
type InterconnectGroupsCallOptions struct {
CreateMembers []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
GetOperationalStatus []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
InterconnectGroupsCallOptions contains the retry settings for each method of InterconnectGroupsClient.
type InterconnectGroupsClient ¶
type InterconnectGroupsClient struct {
// The call options for this service.
CallOptions *InterconnectGroupsCallOptions
// contains filtered or unexported fields
}
InterconnectGroupsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InterconnectGroups API.
func NewInterconnectGroupsRESTClient ¶
func NewInterconnectGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InterconnectGroupsClient, error)
NewInterconnectGroupsRESTClient creates a new interconnect groups rest client.
The InterconnectGroups API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InterconnectGroupsClient) Close ¶
func (c *InterconnectGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InterconnectGroupsClient) Connection
deprecated
func (c *InterconnectGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InterconnectGroupsClient) CreateMembers ¶
func (c *InterconnectGroupsClient) CreateMembers(ctx context.Context, req *computepb.CreateMembersInterconnectGroupRequest, opts ...gax.CallOption) (*Operation, error)
CreateMembers create Interconnects with redundancy by creating them in a specified interconnect group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CreateMembersInterconnectGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CreateMembersInterconnectGroupRequest.
}
op, err := c.CreateMembers(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectGroupsClient) Delete ¶
func (c *InterconnectGroupsClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectGroupRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified InterconnectGroup in the given scope
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInterconnectGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInterconnectGroupRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectGroupsClient) Get ¶
func (c *InterconnectGroupsClient) Get(ctx context.Context, req *computepb.GetInterconnectGroupRequest, opts ...gax.CallOption) (*computepb.InterconnectGroup, error)
Get returns the specified InterconnectGroup resource in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInterconnectGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInterconnectGroupRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectGroupsClient) GetIamPolicy ¶
func (c *InterconnectGroupsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInterconnectGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyInterconnectGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyInterconnectGroupRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectGroupsClient) GetOperationalStatus ¶
func (c *InterconnectGroupsClient) GetOperationalStatus(ctx context.Context, req *computepb.GetOperationalStatusInterconnectGroupRequest, opts ...gax.CallOption) (*computepb.InterconnectGroupsGetOperationalStatusResponse, error)
GetOperationalStatus returns the interconnectStatuses for the specified InterconnectGroup.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetOperationalStatusInterconnectGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetOperationalStatusInterconnectGroupRequest.
}
resp, err := c.GetOperationalStatus(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectGroupsClient) Insert ¶
func (c *InterconnectGroupsClient) Insert(ctx context.Context, req *computepb.InsertInterconnectGroupRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a InterconnectGroup in the specified project in the given scope using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInterconnectGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertInterconnectGroupRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectGroupsClient) List ¶
func (c *InterconnectGroupsClient) List(ctx context.Context, req *computepb.ListInterconnectGroupsRequest, opts ...gax.CallOption) *InterconnectGroupIterator
List lists the InterconnectGroups for a project in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectGroupsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InterconnectGroupsListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectGroupsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InterconnectGroupsClient) Patch ¶
func (c *InterconnectGroupsClient) Patch(ctx context.Context, req *computepb.PatchInterconnectGroupRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified InterconnectGroup resource with the data included in the request. This method supports PATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchInterconnectGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchInterconnectGroupRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectGroupsClient) SetIamPolicy ¶
func (c *InterconnectGroupsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInterconnectGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyInterconnectGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyInterconnectGroupRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectGroupsClient) TestIamPermissions ¶
func (c *InterconnectGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInterconnectGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsInterconnectGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsInterconnectGroupRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type InterconnectIterator ¶
type InterconnectIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Interconnect, nextPageToken string, err error)
// contains filtered or unexported fields
}
InterconnectIterator manages a stream of *computepb.Interconnect.
func (*InterconnectIterator) All ¶
func (it *InterconnectIterator) All() iter.Seq2[*computepb.Interconnect, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InterconnectIterator) Next ¶
func (it *InterconnectIterator) Next() (*computepb.Interconnect, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InterconnectIterator) PageInfo ¶
func (it *InterconnectIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InterconnectLocationIterator ¶
type InterconnectLocationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InterconnectLocation, nextPageToken string, err error)
// contains filtered or unexported fields
}
InterconnectLocationIterator manages a stream of *computepb.InterconnectLocation.
func (*InterconnectLocationIterator) All ¶
func (it *InterconnectLocationIterator) All() iter.Seq2[*computepb.InterconnectLocation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InterconnectLocationIterator) Next ¶
func (it *InterconnectLocationIterator) Next() (*computepb.InterconnectLocation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InterconnectLocationIterator) PageInfo ¶
func (it *InterconnectLocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InterconnectLocationsCallOptions ¶
type InterconnectLocationsCallOptions struct {
Get []gax.CallOption
List []gax.CallOption
}
InterconnectLocationsCallOptions contains the retry settings for each method of InterconnectLocationsClient.
type InterconnectLocationsClient ¶
type InterconnectLocationsClient struct {
// The call options for this service.
CallOptions *InterconnectLocationsCallOptions
// contains filtered or unexported fields
}
InterconnectLocationsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InterconnectLocations API.
func NewInterconnectLocationsRESTClient ¶
func NewInterconnectLocationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InterconnectLocationsClient, error)
NewInterconnectLocationsRESTClient creates a new interconnect locations rest client.
The InterconnectLocations API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectLocationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InterconnectLocationsClient) Close ¶
func (c *InterconnectLocationsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InterconnectLocationsClient) Connection
deprecated
func (c *InterconnectLocationsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InterconnectLocationsClient) Get ¶
func (c *InterconnectLocationsClient) Get(ctx context.Context, req *computepb.GetInterconnectLocationRequest, opts ...gax.CallOption) (*computepb.InterconnectLocation, error)
Get returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectLocationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInterconnectLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInterconnectLocationRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectLocationsClient) List ¶
func (c *InterconnectLocationsClient) List(ctx context.Context, req *computepb.ListInterconnectLocationsRequest, opts ...gax.CallOption) *InterconnectLocationIterator
List retrieves the list of interconnect locations available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectLocationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectLocationsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InterconnectLocationList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectLocationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectLocationsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type InterconnectRemoteLocationIterator ¶
type InterconnectRemoteLocationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InterconnectRemoteLocation, nextPageToken string, err error)
// contains filtered or unexported fields
}
InterconnectRemoteLocationIterator manages a stream of *computepb.InterconnectRemoteLocation.
func (*InterconnectRemoteLocationIterator) All ¶
func (it *InterconnectRemoteLocationIterator) All() iter.Seq2[*computepb.InterconnectRemoteLocation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InterconnectRemoteLocationIterator) Next ¶
func (it *InterconnectRemoteLocationIterator) Next() (*computepb.InterconnectRemoteLocation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InterconnectRemoteLocationIterator) PageInfo ¶
func (it *InterconnectRemoteLocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InterconnectRemoteLocationsCallOptions ¶
type InterconnectRemoteLocationsCallOptions struct {
Get []gax.CallOption
List []gax.CallOption
}
InterconnectRemoteLocationsCallOptions contains the retry settings for each method of InterconnectRemoteLocationsClient.
type InterconnectRemoteLocationsClient ¶
type InterconnectRemoteLocationsClient struct {
// The call options for this service.
CallOptions *InterconnectRemoteLocationsCallOptions
// contains filtered or unexported fields
}
InterconnectRemoteLocationsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The InterconnectRemoteLocations API.
func NewInterconnectRemoteLocationsRESTClient ¶
func NewInterconnectRemoteLocationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InterconnectRemoteLocationsClient, error)
NewInterconnectRemoteLocationsRESTClient creates a new interconnect remote locations rest client.
The InterconnectRemoteLocations API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectRemoteLocationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InterconnectRemoteLocationsClient) Close ¶
func (c *InterconnectRemoteLocationsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InterconnectRemoteLocationsClient) Connection
deprecated
func (c *InterconnectRemoteLocationsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InterconnectRemoteLocationsClient) Get ¶
func (c *InterconnectRemoteLocationsClient) Get(ctx context.Context, req *computepb.GetInterconnectRemoteLocationRequest, opts ...gax.CallOption) (*computepb.InterconnectRemoteLocation, error)
Get returns the details for the specified interconnect remote location. Gets a list of available interconnect remote locations by making alist() request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectRemoteLocationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInterconnectRemoteLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInterconnectRemoteLocationRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectRemoteLocationsClient) List ¶
func (c *InterconnectRemoteLocationsClient) List(ctx context.Context, req *computepb.ListInterconnectRemoteLocationsRequest, opts ...gax.CallOption) *InterconnectRemoteLocationIterator
List retrieves the list of interconnect remote locations available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectRemoteLocationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectRemoteLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectRemoteLocationsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InterconnectRemoteLocationList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectRemoteLocationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectRemoteLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectRemoteLocationsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type InterconnectsCallOptions ¶
type InterconnectsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
GetDiagnostics []gax.CallOption
GetMacsecConfig []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
InterconnectsCallOptions contains the retry settings for each method of InterconnectsClient.
type InterconnectsClient ¶
type InterconnectsClient struct {
// The call options for this service.
CallOptions *InterconnectsCallOptions
// contains filtered or unexported fields
}
InterconnectsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Interconnects API.
func NewInterconnectsRESTClient ¶
func NewInterconnectsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InterconnectsClient, error)
NewInterconnectsRESTClient creates a new interconnects rest client.
The Interconnects API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InterconnectsClient) Close ¶
func (c *InterconnectsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InterconnectsClient) Connection
deprecated
func (c *InterconnectsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InterconnectsClient) Delete ¶
func (c *InterconnectsClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified Interconnect.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInterconnectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInterconnectRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectsClient) Get ¶
func (c *InterconnectsClient) Get(ctx context.Context, req *computepb.GetInterconnectRequest, opts ...gax.CallOption) (*computepb.Interconnect, error)
Get returns the specified Interconnect. Get a list of available Interconnects by making a list() request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetInterconnectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetInterconnectRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectsClient) GetDiagnostics ¶
func (c *InterconnectsClient) GetDiagnostics(ctx context.Context, req *computepb.GetDiagnosticsInterconnectRequest, opts ...gax.CallOption) (*computepb.InterconnectsGetDiagnosticsResponse, error)
GetDiagnostics returns the interconnectDiagnostics for the specified Interconnect.
In the event of a global outage, do not use this API to make decisions about where to redirect your network traffic.
Unlike a VLAN attachment, which is regional, a Cloud Interconnect connection is a global resource. A global outage can prevent this API from functioning properly.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetDiagnosticsInterconnectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetDiagnosticsInterconnectRequest.
}
resp, err := c.GetDiagnostics(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectsClient) GetMacsecConfig ¶
func (c *InterconnectsClient) GetMacsecConfig(ctx context.Context, req *computepb.GetMacsecConfigInterconnectRequest, opts ...gax.CallOption) (*computepb.InterconnectsGetMacsecConfigResponse, error)
GetMacsecConfig returns the interconnectMacsecConfig for the specified Interconnect.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetMacsecConfigInterconnectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetMacsecConfigInterconnectRequest.
}
resp, err := c.GetMacsecConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InterconnectsClient) Insert ¶
func (c *InterconnectsClient) Insert(ctx context.Context, req *computepb.InsertInterconnectRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an Interconnect in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertInterconnectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertInterconnectRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectsClient) List ¶
func (c *InterconnectsClient) List(ctx context.Context, req *computepb.ListInterconnectsRequest, opts ...gax.CallOption) *InterconnectIterator
List retrieves the list of Interconnects available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InterconnectList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInterconnectsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInterconnectsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*InterconnectsClient) Patch ¶
func (c *InterconnectsClient) Patch(ctx context.Context, req *computepb.PatchInterconnectRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified Interconnect with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchInterconnectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchInterconnectRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectsClient) SetLabels ¶
func (c *InterconnectsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInterconnectRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsInterconnectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsInterconnectRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*InterconnectsClient) TestIamPermissions ¶
func (c *InterconnectsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInterconnectRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewInterconnectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsInterconnectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsInterconnectRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type LicenseCodesCallOptions ¶
type LicenseCodesCallOptions struct {
Get []gax.CallOption
TestIamPermissions []gax.CallOption
}
LicenseCodesCallOptions contains the retry settings for each method of LicenseCodesClient.
type LicenseCodesClient ¶
type LicenseCodesClient struct {
// The call options for this service.
CallOptions *LicenseCodesCallOptions
// contains filtered or unexported fields
}
LicenseCodesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The LicenseCodes API.
func NewLicenseCodesRESTClient ¶
func NewLicenseCodesRESTClient(ctx context.Context, opts ...option.ClientOption) (*LicenseCodesClient, error)
NewLicenseCodesRESTClient creates a new license codes rest client.
The LicenseCodes API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicenseCodesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*LicenseCodesClient) Close ¶
func (c *LicenseCodesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*LicenseCodesClient) Connection
deprecated
func (c *LicenseCodesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*LicenseCodesClient) Get ¶
func (c *LicenseCodesClient) Get(ctx context.Context, req *computepb.GetLicenseCodeRequest, opts ...gax.CallOption) (*computepb.LicenseCode, error)
Get return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicenseCodesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetLicenseCodeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetLicenseCodeRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*LicenseCodesClient) TestIamPermissions ¶
func (c *LicenseCodesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsLicenseCodeRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicenseCodesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsLicenseCodeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsLicenseCodeRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type LicenseIterator ¶
type LicenseIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.License, nextPageToken string, err error)
// contains filtered or unexported fields
}
LicenseIterator manages a stream of *computepb.License.
func (*LicenseIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LicenseIterator) Next ¶
func (it *LicenseIterator) Next() (*computepb.License, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LicenseIterator) PageInfo ¶
func (it *LicenseIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type LicensesCallOptions ¶
type LicensesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
LicensesCallOptions contains the retry settings for each method of LicensesClient.
type LicensesClient ¶
type LicensesClient struct {
// The call options for this service.
CallOptions *LicensesCallOptions
// contains filtered or unexported fields
}
LicensesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Licenses API.
func NewLicensesRESTClient ¶
func NewLicensesRESTClient(ctx context.Context, opts ...option.ClientOption) (*LicensesClient, error)
NewLicensesRESTClient creates a new licenses rest client.
The Licenses API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicensesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*LicensesClient) Close ¶
func (c *LicensesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*LicensesClient) Connection
deprecated
func (c *LicensesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*LicensesClient) Delete ¶
func (c *LicensesClient) Delete(ctx context.Context, req *computepb.DeleteLicenseRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified license. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicensesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteLicenseRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteLicenseRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*LicensesClient) Get ¶
func (c *LicensesClient) Get(ctx context.Context, req *computepb.GetLicenseRequest, opts ...gax.CallOption) (*computepb.License, error)
Get returns the specified License resource. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicensesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetLicenseRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetLicenseRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*LicensesClient) GetIamPolicy ¶
func (c *LicensesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyLicenseRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicensesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyLicenseRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyLicenseRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*LicensesClient) Insert ¶
func (c *LicensesClient) Insert(ctx context.Context, req *computepb.InsertLicenseRequest, opts ...gax.CallOption) (*Operation, error)
Insert create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicensesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertLicenseRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertLicenseRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*LicensesClient) List ¶
func (c *LicensesClient) List(ctx context.Context, req *computepb.ListLicensesRequest, opts ...gax.CallOption) *LicenseIterator
List retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud orwindows-cloud. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicensesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListLicensesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListLicensesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.LicensesListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicensesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListLicensesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListLicensesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*LicensesClient) SetIamPolicy ¶
func (c *LicensesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyLicenseRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicensesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyLicenseRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyLicenseRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*LicensesClient) TestIamPermissions ¶
func (c *LicensesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsLicenseRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicensesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsLicenseRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsLicenseRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*LicensesClient) Update ¶
func (c *LicensesClient) Update(ctx context.Context, req *computepb.UpdateLicenseRequest, opts ...gax.CallOption) (*Operation, error)
Update updates a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewLicensesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateLicenseRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateLicenseRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type MachineImageIterator ¶
type MachineImageIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.MachineImage, nextPageToken string, err error)
// contains filtered or unexported fields
}
MachineImageIterator manages a stream of *computepb.MachineImage.
func (*MachineImageIterator) All ¶
func (it *MachineImageIterator) All() iter.Seq2[*computepb.MachineImage, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*MachineImageIterator) Next ¶
func (it *MachineImageIterator) Next() (*computepb.MachineImage, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MachineImageIterator) PageInfo ¶
func (it *MachineImageIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type MachineImagesCallOptions ¶
type MachineImagesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetIamPolicy []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
MachineImagesCallOptions contains the retry settings for each method of MachineImagesClient.
type MachineImagesClient ¶
type MachineImagesClient struct {
// The call options for this service.
CallOptions *MachineImagesCallOptions
// contains filtered or unexported fields
}
MachineImagesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The MachineImages API.
func NewMachineImagesRESTClient ¶
func NewMachineImagesRESTClient(ctx context.Context, opts ...option.ClientOption) (*MachineImagesClient, error)
NewMachineImagesRESTClient creates a new machine images rest client.
The MachineImages API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*MachineImagesClient) Close ¶
func (c *MachineImagesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*MachineImagesClient) Connection
deprecated
func (c *MachineImagesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*MachineImagesClient) Delete ¶
func (c *MachineImagesClient) Delete(ctx context.Context, req *computepb.DeleteMachineImageRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified machine image. Deleting a machine image is permanent and cannot be undone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteMachineImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteMachineImageRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*MachineImagesClient) Get ¶
func (c *MachineImagesClient) Get(ctx context.Context, req *computepb.GetMachineImageRequest, opts ...gax.CallOption) (*computepb.MachineImage, error)
Get returns the specified machine image.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetMachineImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetMachineImageRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*MachineImagesClient) GetIamPolicy ¶
func (c *MachineImagesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyMachineImageRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyMachineImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyMachineImageRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*MachineImagesClient) Insert ¶
func (c *MachineImagesClient) Insert(ctx context.Context, req *computepb.InsertMachineImageRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a machine image in the specified project using the data that is included in the request. If you are creating a new machine image to update an existing instance, your new machine image should use the same network or, if applicable, the same subnetwork as the original instance.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertMachineImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertMachineImageRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*MachineImagesClient) List ¶
func (c *MachineImagesClient) List(ctx context.Context, req *computepb.ListMachineImagesRequest, opts ...gax.CallOption) *MachineImageIterator
List retrieves a list of machine images that are contained within the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListMachineImagesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListMachineImagesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.MachineImageList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListMachineImagesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListMachineImagesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*MachineImagesClient) SetIamPolicy ¶
func (c *MachineImagesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyMachineImageRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyMachineImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyMachineImageRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*MachineImagesClient) SetLabels ¶
func (c *MachineImagesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsMachineImageRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a machine image. To learn more about labels, read theLabeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsMachineImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsMachineImageRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*MachineImagesClient) TestIamPermissions ¶
func (c *MachineImagesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsMachineImageRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineImagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsMachineImageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsMachineImageRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type MachineTypeIterator ¶
type MachineTypeIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.MachineType, nextPageToken string, err error)
// contains filtered or unexported fields
}
MachineTypeIterator manages a stream of *computepb.MachineType.
func (*MachineTypeIterator) All ¶
func (it *MachineTypeIterator) All() iter.Seq2[*computepb.MachineType, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*MachineTypeIterator) Next ¶
func (it *MachineTypeIterator) Next() (*computepb.MachineType, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MachineTypeIterator) PageInfo ¶
func (it *MachineTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type MachineTypesCallOptions ¶
type MachineTypesCallOptions struct {
AggregatedList []gax.CallOption
Get []gax.CallOption
List []gax.CallOption
}
MachineTypesCallOptions contains the retry settings for each method of MachineTypesClient.
type MachineTypesClient ¶
type MachineTypesClient struct {
// The call options for this service.
CallOptions *MachineTypesCallOptions
// contains filtered or unexported fields
}
MachineTypesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The MachineTypes API.
func NewMachineTypesRESTClient ¶
func NewMachineTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*MachineTypesClient, error)
NewMachineTypesRESTClient creates a new machine types rest client.
The MachineTypes API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*MachineTypesClient) AggregatedList ¶
func (c *MachineTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListMachineTypesRequest, opts ...gax.CallOption) *MachineTypesScopedListPairIterator
AggregatedList retrieves an aggregated list of machine types.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListMachineTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListMachineTypesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.MachineTypeAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListMachineTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListMachineTypesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*MachineTypesClient) Close ¶
func (c *MachineTypesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*MachineTypesClient) Connection
deprecated
func (c *MachineTypesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*MachineTypesClient) Get ¶
func (c *MachineTypesClient) Get(ctx context.Context, req *computepb.GetMachineTypeRequest, opts ...gax.CallOption) (*computepb.MachineType, error)
Get returns the specified machine type.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetMachineTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetMachineTypeRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*MachineTypesClient) List ¶
func (c *MachineTypesClient) List(ctx context.Context, req *computepb.ListMachineTypesRequest, opts ...gax.CallOption) *MachineTypeIterator
List retrieves a list of machine types available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListMachineTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListMachineTypesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.MachineTypeList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewMachineTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListMachineTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListMachineTypesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type MachineTypesScopedListPair ¶
type MachineTypesScopedListPair struct {
Key string
Value *computepb.MachineTypesScopedList
}
MachineTypesScopedListPair is a holder type for string/*computepb.MachineTypesScopedList map entries
type MachineTypesScopedListPairIterator ¶
type MachineTypesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []MachineTypesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
MachineTypesScopedListPairIterator manages a stream of MachineTypesScopedListPair.
func (*MachineTypesScopedListPairIterator) All ¶
func (it *MachineTypesScopedListPairIterator) All() iter.Seq2[MachineTypesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*MachineTypesScopedListPairIterator) Next ¶
func (it *MachineTypesScopedListPairIterator) Next() (MachineTypesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MachineTypesScopedListPairIterator) PageInfo ¶
func (it *MachineTypesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ManagedInstanceIterator ¶
type ManagedInstanceIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.ManagedInstance, nextPageToken string, err error)
// contains filtered or unexported fields
}
ManagedInstanceIterator manages a stream of *computepb.ManagedInstance.
func (*ManagedInstanceIterator) All ¶
func (it *ManagedInstanceIterator) All() iter.Seq2[*computepb.ManagedInstance, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ManagedInstanceIterator) Next ¶
func (it *ManagedInstanceIterator) Next() (*computepb.ManagedInstance, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ManagedInstanceIterator) PageInfo ¶
func (it *ManagedInstanceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type MultiMigIterator ¶
type MultiMigIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.MultiMig, nextPageToken string, err error)
// contains filtered or unexported fields
}
MultiMigIterator manages a stream of *computepb.MultiMig.
func (*MultiMigIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*MultiMigIterator) Next ¶
func (it *MultiMigIterator) Next() (*computepb.MultiMig, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MultiMigIterator) PageInfo ¶
func (it *MultiMigIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type MultiMigMemberIterator ¶ added in v1.54.0
type MultiMigMemberIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.MultiMigMember, nextPageToken string, err error)
// contains filtered or unexported fields
}
MultiMigMemberIterator manages a stream of *computepb.MultiMigMember.
func (*MultiMigMemberIterator) All ¶ added in v1.54.0
func (it *MultiMigMemberIterator) All() iter.Seq2[*computepb.MultiMigMember, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*MultiMigMemberIterator) Next ¶ added in v1.54.0
func (it *MultiMigMemberIterator) Next() (*computepb.MultiMigMember, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MultiMigMemberIterator) PageInfo ¶ added in v1.54.0
func (it *MultiMigMemberIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NetworkAttachmentIterator ¶
type NetworkAttachmentIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.NetworkAttachment, nextPageToken string, err error)
// contains filtered or unexported fields
}
NetworkAttachmentIterator manages a stream of *computepb.NetworkAttachment.
func (*NetworkAttachmentIterator) All ¶
func (it *NetworkAttachmentIterator) All() iter.Seq2[*computepb.NetworkAttachment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NetworkAttachmentIterator) Next ¶
func (it *NetworkAttachmentIterator) Next() (*computepb.NetworkAttachment, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NetworkAttachmentIterator) PageInfo ¶
func (it *NetworkAttachmentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NetworkAttachmentsCallOptions ¶
type NetworkAttachmentsCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
NetworkAttachmentsCallOptions contains the retry settings for each method of NetworkAttachmentsClient.
type NetworkAttachmentsClient ¶
type NetworkAttachmentsClient struct {
// The call options for this service.
CallOptions *NetworkAttachmentsCallOptions
// contains filtered or unexported fields
}
NetworkAttachmentsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The NetworkAttachments API.
func NewNetworkAttachmentsRESTClient ¶
func NewNetworkAttachmentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*NetworkAttachmentsClient, error)
NewNetworkAttachmentsRESTClient creates a new network attachments rest client.
The NetworkAttachments API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*NetworkAttachmentsClient) AggregatedList ¶
func (c *NetworkAttachmentsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNetworkAttachmentsRequest, opts ...gax.CallOption) *NetworkAttachmentsScopedListPairIterator
AggregatedList retrieves the list of all NetworkAttachment resources, regional and global, available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNetworkAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNetworkAttachmentsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkAttachmentAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNetworkAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNetworkAttachmentsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NetworkAttachmentsClient) Close ¶
func (c *NetworkAttachmentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*NetworkAttachmentsClient) Connection
deprecated
func (c *NetworkAttachmentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*NetworkAttachmentsClient) Delete ¶
func (c *NetworkAttachmentsClient) Delete(ctx context.Context, req *computepb.DeleteNetworkAttachmentRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified NetworkAttachment in the given scope
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteNetworkAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteNetworkAttachmentRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkAttachmentsClient) Get ¶
func (c *NetworkAttachmentsClient) Get(ctx context.Context, req *computepb.GetNetworkAttachmentRequest, opts ...gax.CallOption) (*computepb.NetworkAttachment, error)
Get returns the specified NetworkAttachment resource in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNetworkAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNetworkAttachmentRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkAttachmentsClient) GetIamPolicy ¶
func (c *NetworkAttachmentsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNetworkAttachmentRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyNetworkAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyNetworkAttachmentRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkAttachmentsClient) Insert ¶
func (c *NetworkAttachmentsClient) Insert(ctx context.Context, req *computepb.InsertNetworkAttachmentRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a NetworkAttachment in the specified project in the given scope using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertNetworkAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertNetworkAttachmentRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkAttachmentsClient) List ¶
func (c *NetworkAttachmentsClient) List(ctx context.Context, req *computepb.ListNetworkAttachmentsRequest, opts ...gax.CallOption) *NetworkAttachmentIterator
List lists the NetworkAttachments for a project in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkAttachmentsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkAttachmentList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkAttachmentsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NetworkAttachmentsClient) Patch ¶
func (c *NetworkAttachmentsClient) Patch(ctx context.Context, req *computepb.PatchNetworkAttachmentRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified NetworkAttachment resource with the data included in the request. This method supports PATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchNetworkAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchNetworkAttachmentRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkAttachmentsClient) SetIamPolicy ¶
func (c *NetworkAttachmentsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNetworkAttachmentRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyNetworkAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyNetworkAttachmentRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkAttachmentsClient) TestIamPermissions ¶
func (c *NetworkAttachmentsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNetworkAttachmentRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsNetworkAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsNetworkAttachmentRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type NetworkAttachmentsScopedListPair ¶
type NetworkAttachmentsScopedListPair struct {
Key string
Value *computepb.NetworkAttachmentsScopedList
}
NetworkAttachmentsScopedListPair is a holder type for string/*computepb.NetworkAttachmentsScopedList map entries
type NetworkAttachmentsScopedListPairIterator ¶
type NetworkAttachmentsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []NetworkAttachmentsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
NetworkAttachmentsScopedListPairIterator manages a stream of NetworkAttachmentsScopedListPair.
func (*NetworkAttachmentsScopedListPairIterator) All ¶
func (it *NetworkAttachmentsScopedListPairIterator) All() iter.Seq2[NetworkAttachmentsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NetworkAttachmentsScopedListPairIterator) Next ¶
func (it *NetworkAttachmentsScopedListPairIterator) Next() (NetworkAttachmentsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NetworkAttachmentsScopedListPairIterator) PageInfo ¶
func (it *NetworkAttachmentsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NetworkEdgeSecurityServicesCallOptions ¶
type NetworkEdgeSecurityServicesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
Patch []gax.CallOption
}
NetworkEdgeSecurityServicesCallOptions contains the retry settings for each method of NetworkEdgeSecurityServicesClient.
type NetworkEdgeSecurityServicesClient ¶
type NetworkEdgeSecurityServicesClient struct {
// The call options for this service.
CallOptions *NetworkEdgeSecurityServicesCallOptions
// contains filtered or unexported fields
}
NetworkEdgeSecurityServicesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The NetworkEdgeSecurityServices API.
func NewNetworkEdgeSecurityServicesRESTClient ¶
func NewNetworkEdgeSecurityServicesRESTClient(ctx context.Context, opts ...option.ClientOption) (*NetworkEdgeSecurityServicesClient, error)
NewNetworkEdgeSecurityServicesRESTClient creates a new network edge security services rest client.
The NetworkEdgeSecurityServices API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEdgeSecurityServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*NetworkEdgeSecurityServicesClient) AggregatedList ¶
func (c *NetworkEdgeSecurityServicesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNetworkEdgeSecurityServicesRequest, opts ...gax.CallOption) *NetworkEdgeSecurityServicesScopedListPairIterator
AggregatedList retrieves the list of all NetworkEdgeSecurityService resources available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEdgeSecurityServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNetworkEdgeSecurityServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNetworkEdgeSecurityServicesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkEdgeSecurityServiceAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEdgeSecurityServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNetworkEdgeSecurityServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNetworkEdgeSecurityServicesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NetworkEdgeSecurityServicesClient) Close ¶
func (c *NetworkEdgeSecurityServicesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*NetworkEdgeSecurityServicesClient) Connection
deprecated
func (c *NetworkEdgeSecurityServicesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*NetworkEdgeSecurityServicesClient) Delete ¶
func (c *NetworkEdgeSecurityServicesClient) Delete(ctx context.Context, req *computepb.DeleteNetworkEdgeSecurityServiceRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified service.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEdgeSecurityServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteNetworkEdgeSecurityServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteNetworkEdgeSecurityServiceRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkEdgeSecurityServicesClient) Get ¶
func (c *NetworkEdgeSecurityServicesClient) Get(ctx context.Context, req *computepb.GetNetworkEdgeSecurityServiceRequest, opts ...gax.CallOption) (*computepb.NetworkEdgeSecurityService, error)
Get gets a specified NetworkEdgeSecurityService.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEdgeSecurityServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNetworkEdgeSecurityServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNetworkEdgeSecurityServiceRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkEdgeSecurityServicesClient) Insert ¶
func (c *NetworkEdgeSecurityServicesClient) Insert(ctx context.Context, req *computepb.InsertNetworkEdgeSecurityServiceRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new service in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEdgeSecurityServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertNetworkEdgeSecurityServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertNetworkEdgeSecurityServiceRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkEdgeSecurityServicesClient) Patch ¶
func (c *NetworkEdgeSecurityServicesClient) Patch(ctx context.Context, req *computepb.PatchNetworkEdgeSecurityServiceRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified policy with the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEdgeSecurityServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchNetworkEdgeSecurityServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchNetworkEdgeSecurityServiceRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type NetworkEdgeSecurityServicesScopedListPair ¶
type NetworkEdgeSecurityServicesScopedListPair struct {
Key string
Value *computepb.NetworkEdgeSecurityServicesScopedList
}
NetworkEdgeSecurityServicesScopedListPair is a holder type for string/*computepb.NetworkEdgeSecurityServicesScopedList map entries
type NetworkEdgeSecurityServicesScopedListPairIterator ¶
type NetworkEdgeSecurityServicesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []NetworkEdgeSecurityServicesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
NetworkEdgeSecurityServicesScopedListPairIterator manages a stream of NetworkEdgeSecurityServicesScopedListPair.
func (*NetworkEdgeSecurityServicesScopedListPairIterator) All ¶
func (it *NetworkEdgeSecurityServicesScopedListPairIterator) All() iter.Seq2[NetworkEdgeSecurityServicesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NetworkEdgeSecurityServicesScopedListPairIterator) Next ¶
func (it *NetworkEdgeSecurityServicesScopedListPairIterator) Next() (NetworkEdgeSecurityServicesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NetworkEdgeSecurityServicesScopedListPairIterator) PageInfo ¶
func (it *NetworkEdgeSecurityServicesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NetworkEndpointGroupIterator ¶
type NetworkEndpointGroupIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.NetworkEndpointGroup, nextPageToken string, err error)
// contains filtered or unexported fields
}
NetworkEndpointGroupIterator manages a stream of *computepb.NetworkEndpointGroup.
func (*NetworkEndpointGroupIterator) All ¶
func (it *NetworkEndpointGroupIterator) All() iter.Seq2[*computepb.NetworkEndpointGroup, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NetworkEndpointGroupIterator) Next ¶
func (it *NetworkEndpointGroupIterator) Next() (*computepb.NetworkEndpointGroup, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NetworkEndpointGroupIterator) PageInfo ¶
func (it *NetworkEndpointGroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NetworkEndpointGroupsCallOptions ¶
type NetworkEndpointGroupsCallOptions struct {
AggregatedList []gax.CallOption
AttachNetworkEndpoints []gax.CallOption
Delete []gax.CallOption
DetachNetworkEndpoints []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListNetworkEndpoints []gax.CallOption
TestIamPermissions []gax.CallOption
}
NetworkEndpointGroupsCallOptions contains the retry settings for each method of NetworkEndpointGroupsClient.
type NetworkEndpointGroupsClient ¶
type NetworkEndpointGroupsClient struct {
// The call options for this service.
CallOptions *NetworkEndpointGroupsCallOptions
// contains filtered or unexported fields
}
NetworkEndpointGroupsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The NetworkEndpointGroups API.
func NewNetworkEndpointGroupsRESTClient ¶
func NewNetworkEndpointGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*NetworkEndpointGroupsClient, error)
NewNetworkEndpointGroupsRESTClient creates a new network endpoint groups rest client.
The NetworkEndpointGroups API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*NetworkEndpointGroupsClient) AggregatedList ¶
func (c *NetworkEndpointGroupsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNetworkEndpointGroupsRequest, opts ...gax.CallOption) *NetworkEndpointGroupsScopedListPairIterator
AggregatedList retrieves the list of network endpoint groups and sorts them by zone.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNetworkEndpointGroupsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkEndpointGroupAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNetworkEndpointGroupsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NetworkEndpointGroupsClient) AttachNetworkEndpoints ¶
func (c *NetworkEndpointGroupsClient) AttachNetworkEndpoints(ctx context.Context, req *computepb.AttachNetworkEndpointsNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
AttachNetworkEndpoints attach a list of network endpoints to the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AttachNetworkEndpointsNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AttachNetworkEndpointsNetworkEndpointGroupRequest.
}
op, err := c.AttachNetworkEndpoints(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkEndpointGroupsClient) Close ¶
func (c *NetworkEndpointGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*NetworkEndpointGroupsClient) Connection
deprecated
func (c *NetworkEndpointGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*NetworkEndpointGroupsClient) Delete ¶
func (c *NetworkEndpointGroupsClient) Delete(ctx context.Context, req *computepb.DeleteNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteNetworkEndpointGroupRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkEndpointGroupsClient) DetachNetworkEndpoints ¶
func (c *NetworkEndpointGroupsClient) DetachNetworkEndpoints(ctx context.Context, req *computepb.DetachNetworkEndpointsNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
DetachNetworkEndpoints detach a list of network endpoints from the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DetachNetworkEndpointsNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DetachNetworkEndpointsNetworkEndpointGroupRequest.
}
op, err := c.DetachNetworkEndpoints(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkEndpointGroupsClient) Get ¶
func (c *NetworkEndpointGroupsClient) Get(ctx context.Context, req *computepb.GetNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroup, error)
Get returns the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNetworkEndpointGroupRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkEndpointGroupsClient) Insert ¶
func (c *NetworkEndpointGroupsClient) Insert(ctx context.Context, req *computepb.InsertNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a network endpoint group in the specified project using the parameters that are included in the request.
Note: Use the following APIs to manage network endpoint groups:
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertNetworkEndpointGroupRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkEndpointGroupsClient) List ¶
func (c *NetworkEndpointGroupsClient) List(ctx context.Context, req *computepb.ListNetworkEndpointGroupsRequest, opts ...gax.CallOption) *NetworkEndpointGroupIterator
List retrieves the list of network endpoint groups that are located in the specified project and zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkEndpointGroupsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkEndpointGroupList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkEndpointGroupsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NetworkEndpointGroupsClient) ListNetworkEndpoints ¶
func (c *NetworkEndpointGroupsClient) ListNetworkEndpoints(ctx context.Context, req *computepb.ListNetworkEndpointsNetworkEndpointGroupsRequest, opts ...gax.CallOption) *NetworkEndpointWithHealthStatusIterator
ListNetworkEndpoints lists the network endpoints in the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkEndpointsNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkEndpointsNetworkEndpointGroupsRequest.
}
it := c.ListNetworkEndpoints(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkEndpointGroupsListNetworkEndpoints)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkEndpointsNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkEndpointsNetworkEndpointGroupsRequest.
}
for resp, err := range c.ListNetworkEndpoints(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NetworkEndpointGroupsClient) TestIamPermissions ¶
func (c *NetworkEndpointGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsNetworkEndpointGroupRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type NetworkEndpointGroupsScopedListPair ¶
type NetworkEndpointGroupsScopedListPair struct {
Key string
Value *computepb.NetworkEndpointGroupsScopedList
}
NetworkEndpointGroupsScopedListPair is a holder type for string/*computepb.NetworkEndpointGroupsScopedList map entries
type NetworkEndpointGroupsScopedListPairIterator ¶
type NetworkEndpointGroupsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []NetworkEndpointGroupsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
NetworkEndpointGroupsScopedListPairIterator manages a stream of NetworkEndpointGroupsScopedListPair.
func (*NetworkEndpointGroupsScopedListPairIterator) All ¶
func (it *NetworkEndpointGroupsScopedListPairIterator) All() iter.Seq2[NetworkEndpointGroupsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NetworkEndpointGroupsScopedListPairIterator) Next ¶
func (it *NetworkEndpointGroupsScopedListPairIterator) Next() (NetworkEndpointGroupsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NetworkEndpointGroupsScopedListPairIterator) PageInfo ¶
func (it *NetworkEndpointGroupsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NetworkEndpointWithHealthStatusIterator ¶
type NetworkEndpointWithHealthStatusIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.NetworkEndpointWithHealthStatus, nextPageToken string, err error)
// contains filtered or unexported fields
}
NetworkEndpointWithHealthStatusIterator manages a stream of *computepb.NetworkEndpointWithHealthStatus.
func (*NetworkEndpointWithHealthStatusIterator) All ¶
func (it *NetworkEndpointWithHealthStatusIterator) All() iter.Seq2[*computepb.NetworkEndpointWithHealthStatus, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NetworkEndpointWithHealthStatusIterator) Next ¶
func (it *NetworkEndpointWithHealthStatusIterator) Next() (*computepb.NetworkEndpointWithHealthStatus, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NetworkEndpointWithHealthStatusIterator) PageInfo ¶
func (it *NetworkEndpointWithHealthStatusIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NetworkFirewallPoliciesCallOptions ¶
type NetworkFirewallPoliciesCallOptions struct {
AddAssociation []gax.CallOption
AddPacketMirroringRule []gax.CallOption
AddRule []gax.CallOption
AggregatedList []gax.CallOption
CloneRules []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetAssociation []gax.CallOption
GetIamPolicy []gax.CallOption
GetPacketMirroringRule []gax.CallOption
GetRule []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
PatchPacketMirroringRule []gax.CallOption
PatchRule []gax.CallOption
RemoveAssociation []gax.CallOption
RemovePacketMirroringRule []gax.CallOption
RemoveRule []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
NetworkFirewallPoliciesCallOptions contains the retry settings for each method of NetworkFirewallPoliciesClient.
type NetworkFirewallPoliciesClient ¶
type NetworkFirewallPoliciesClient struct {
// The call options for this service.
CallOptions *NetworkFirewallPoliciesCallOptions
// contains filtered or unexported fields
}
NetworkFirewallPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The NetworkFirewallPolicies API.
func NewNetworkFirewallPoliciesRESTClient ¶
func NewNetworkFirewallPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*NetworkFirewallPoliciesClient, error)
NewNetworkFirewallPoliciesRESTClient creates a new network firewall policies rest client.
The NetworkFirewallPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*NetworkFirewallPoliciesClient) AddAssociation ¶
func (c *NetworkFirewallPoliciesClient) AddAssociation(ctx context.Context, req *computepb.AddAssociationNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddAssociation inserts an association for the specified firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddAssociationNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddAssociationNetworkFirewallPolicyRequest.
}
op, err := c.AddAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) AddPacketMirroringRule ¶
func (c *NetworkFirewallPoliciesClient) AddPacketMirroringRule(ctx context.Context, req *computepb.AddPacketMirroringRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddPacketMirroringRule inserts a packet mirroring rule into a firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddPacketMirroringRuleNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddPacketMirroringRuleNetworkFirewallPolicyRequest.
}
op, err := c.AddPacketMirroringRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) AddRule ¶
func (c *NetworkFirewallPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddRule inserts a rule into a firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddRuleNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddRuleNetworkFirewallPolicyRequest.
}
op, err := c.AddRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) AggregatedList ¶
func (c *NetworkFirewallPoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNetworkFirewallPoliciesRequest, opts ...gax.CallOption) *FirewallPoliciesScopedListPairIterator
AggregatedList retrieves an aggregated list of network firewall policies, listing network firewall policies from all applicable scopes (global and regional) and grouping the results per scope.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNetworkFirewallPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNetworkFirewallPoliciesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkFirewallPolicyAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNetworkFirewallPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNetworkFirewallPoliciesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NetworkFirewallPoliciesClient) CloneRules ¶
func (c *NetworkFirewallPoliciesClient) CloneRules(ctx context.Context, req *computepb.CloneRulesNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
CloneRules copies rules to the specified firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CloneRulesNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CloneRulesNetworkFirewallPolicyRequest.
}
op, err := c.CloneRules(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) Close ¶
func (c *NetworkFirewallPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*NetworkFirewallPoliciesClient) Connection
deprecated
func (c *NetworkFirewallPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*NetworkFirewallPoliciesClient) Delete ¶
func (c *NetworkFirewallPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteNetworkFirewallPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) Get ¶
func (c *NetworkFirewallPoliciesClient) Get(ctx context.Context, req *computepb.GetNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicy, error)
Get returns the specified network firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNetworkFirewallPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkFirewallPoliciesClient) GetAssociation ¶
func (c *NetworkFirewallPoliciesClient) GetAssociation(ctx context.Context, req *computepb.GetAssociationNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyAssociation, error)
GetAssociation gets an association with the specified name.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetAssociationNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetAssociationNetworkFirewallPolicyRequest.
}
resp, err := c.GetAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkFirewallPoliciesClient) GetIamPolicy ¶
func (c *NetworkFirewallPoliciesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyNetworkFirewallPolicyRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkFirewallPoliciesClient) GetPacketMirroringRule ¶
func (c *NetworkFirewallPoliciesClient) GetPacketMirroringRule(ctx context.Context, req *computepb.GetPacketMirroringRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyRule, error)
GetPacketMirroringRule gets a packet mirroring rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetPacketMirroringRuleNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetPacketMirroringRuleNetworkFirewallPolicyRequest.
}
resp, err := c.GetPacketMirroringRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkFirewallPoliciesClient) GetRule ¶
func (c *NetworkFirewallPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyRule, error)
GetRule gets a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRuleNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRuleNetworkFirewallPolicyRequest.
}
resp, err := c.GetRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkFirewallPoliciesClient) Insert ¶
func (c *NetworkFirewallPoliciesClient) Insert(ctx context.Context, req *computepb.InsertNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new policy in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertNetworkFirewallPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) List ¶
func (c *NetworkFirewallPoliciesClient) List(ctx context.Context, req *computepb.ListNetworkFirewallPoliciesRequest, opts ...gax.CallOption) *FirewallPolicyIterator
List lists all the policies that have been configured for the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkFirewallPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkFirewallPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.FirewallPolicyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkFirewallPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkFirewallPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NetworkFirewallPoliciesClient) Patch ¶
func (c *NetworkFirewallPoliciesClient) Patch(ctx context.Context, req *computepb.PatchNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified policy with the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchNetworkFirewallPolicyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) PatchPacketMirroringRule ¶
func (c *NetworkFirewallPoliciesClient) PatchPacketMirroringRule(ctx context.Context, req *computepb.PatchPacketMirroringRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
PatchPacketMirroringRule patches a packet mirroring rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchPacketMirroringRuleNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchPacketMirroringRuleNetworkFirewallPolicyRequest.
}
op, err := c.PatchPacketMirroringRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) PatchRule ¶
func (c *NetworkFirewallPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
PatchRule patches a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRuleNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRuleNetworkFirewallPolicyRequest.
}
op, err := c.PatchRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) RemoveAssociation ¶
func (c *NetworkFirewallPoliciesClient) RemoveAssociation(ctx context.Context, req *computepb.RemoveAssociationNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveAssociation removes an association for the specified firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveAssociationNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveAssociationNetworkFirewallPolicyRequest.
}
op, err := c.RemoveAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) RemovePacketMirroringRule ¶
func (c *NetworkFirewallPoliciesClient) RemovePacketMirroringRule(ctx context.Context, req *computepb.RemovePacketMirroringRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemovePacketMirroringRule deletes a packet mirroring rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemovePacketMirroringRuleNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemovePacketMirroringRuleNetworkFirewallPolicyRequest.
}
op, err := c.RemovePacketMirroringRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) RemoveRule ¶
func (c *NetworkFirewallPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveRule deletes a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveRuleNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveRuleNetworkFirewallPolicyRequest.
}
op, err := c.RemoveRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworkFirewallPoliciesClient) SetIamPolicy ¶
func (c *NetworkFirewallPoliciesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyNetworkFirewallPolicyRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkFirewallPoliciesClient) TestIamPermissions ¶
func (c *NetworkFirewallPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsNetworkFirewallPolicyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type NetworkIterator ¶
type NetworkIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Network, nextPageToken string, err error)
// contains filtered or unexported fields
}
NetworkIterator manages a stream of *computepb.Network.
func (*NetworkIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NetworkIterator) Next ¶
func (it *NetworkIterator) Next() (*computepb.Network, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NetworkIterator) PageInfo ¶
func (it *NetworkIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NetworkPoliciesScopedListPair ¶ added in v1.49.0
type NetworkPoliciesScopedListPair struct {
Key string
Value *computepb.NetworkPoliciesScopedList
}
NetworkPoliciesScopedListPair is a holder type for string/*computepb.NetworkPoliciesScopedList map entries
type NetworkPoliciesScopedListPairIterator ¶ added in v1.49.0
type NetworkPoliciesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []NetworkPoliciesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
NetworkPoliciesScopedListPairIterator manages a stream of NetworkPoliciesScopedListPair.
func (*NetworkPoliciesScopedListPairIterator) All ¶ added in v1.49.0
func (it *NetworkPoliciesScopedListPairIterator) All() iter.Seq2[NetworkPoliciesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NetworkPoliciesScopedListPairIterator) Next ¶ added in v1.49.0
func (it *NetworkPoliciesScopedListPairIterator) Next() (NetworkPoliciesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NetworkPoliciesScopedListPairIterator) PageInfo ¶ added in v1.49.0
func (it *NetworkPoliciesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NetworkPolicyIterator ¶ added in v1.49.0
type NetworkPolicyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.NetworkPolicy, nextPageToken string, err error)
// contains filtered or unexported fields
}
NetworkPolicyIterator manages a stream of *computepb.NetworkPolicy.
func (*NetworkPolicyIterator) All ¶ added in v1.49.0
func (it *NetworkPolicyIterator) All() iter.Seq2[*computepb.NetworkPolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NetworkPolicyIterator) Next ¶ added in v1.49.0
func (it *NetworkPolicyIterator) Next() (*computepb.NetworkPolicy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NetworkPolicyIterator) PageInfo ¶ added in v1.49.0
func (it *NetworkPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NetworkProfileIterator ¶
type NetworkProfileIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.NetworkProfile, nextPageToken string, err error)
// contains filtered or unexported fields
}
NetworkProfileIterator manages a stream of *computepb.NetworkProfile.
func (*NetworkProfileIterator) All ¶
func (it *NetworkProfileIterator) All() iter.Seq2[*computepb.NetworkProfile, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NetworkProfileIterator) Next ¶
func (it *NetworkProfileIterator) Next() (*computepb.NetworkProfile, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NetworkProfileIterator) PageInfo ¶
func (it *NetworkProfileIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NetworkProfilesCallOptions ¶
type NetworkProfilesCallOptions struct {
Get []gax.CallOption
List []gax.CallOption
}
NetworkProfilesCallOptions contains the retry settings for each method of NetworkProfilesClient.
type NetworkProfilesClient ¶
type NetworkProfilesClient struct {
// The call options for this service.
CallOptions *NetworkProfilesCallOptions
// contains filtered or unexported fields
}
NetworkProfilesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The NetworkProfiles API.
func NewNetworkProfilesRESTClient ¶
func NewNetworkProfilesRESTClient(ctx context.Context, opts ...option.ClientOption) (*NetworkProfilesClient, error)
NewNetworkProfilesRESTClient creates a new network profiles rest client.
The NetworkProfiles API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkProfilesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*NetworkProfilesClient) Close ¶
func (c *NetworkProfilesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*NetworkProfilesClient) Connection
deprecated
func (c *NetworkProfilesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*NetworkProfilesClient) Get ¶
func (c *NetworkProfilesClient) Get(ctx context.Context, req *computepb.GetNetworkProfileRequest, opts ...gax.CallOption) (*computepb.NetworkProfile, error)
Get returns the specified network profile.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkProfilesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNetworkProfileRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNetworkProfileRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworkProfilesClient) List ¶
func (c *NetworkProfilesClient) List(ctx context.Context, req *computepb.ListNetworkProfilesRequest, opts ...gax.CallOption) *NetworkProfileIterator
List retrieves a list of network profiles available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkProfilesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkProfilesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkProfilesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkProfilesListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworkProfilesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkProfilesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkProfilesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type NetworksCallOptions ¶
type NetworksCallOptions struct {
AddPeering []gax.CallOption
CancelRequestRemovePeering []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetEffectiveFirewalls []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListPeeringRoutes []gax.CallOption
Patch []gax.CallOption
RemovePeering []gax.CallOption
RequestRemovePeering []gax.CallOption
SwitchToCustomMode []gax.CallOption
TestIamPermissions []gax.CallOption
UpdatePeering []gax.CallOption
}
NetworksCallOptions contains the retry settings for each method of NetworksClient.
type NetworksClient ¶
type NetworksClient struct {
// The call options for this service.
CallOptions *NetworksCallOptions
// contains filtered or unexported fields
}
NetworksClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Networks API.
func NewNetworksRESTClient ¶
func NewNetworksRESTClient(ctx context.Context, opts ...option.ClientOption) (*NetworksClient, error)
NewNetworksRESTClient creates a new networks rest client.
The Networks API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*NetworksClient) AddPeering ¶
func (c *NetworksClient) AddPeering(ctx context.Context, req *computepb.AddPeeringNetworkRequest, opts ...gax.CallOption) (*Operation, error)
AddPeering adds a peering to the specified network.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddPeeringNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddPeeringNetworkRequest.
}
op, err := c.AddPeering(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworksClient) CancelRequestRemovePeering ¶ added in v1.52.0
func (c *NetworksClient) CancelRequestRemovePeering(ctx context.Context, req *computepb.CancelRequestRemovePeeringNetworkRequest, opts ...gax.CallOption) (*Operation, error)
CancelRequestRemovePeering cancel requests to remove a peering from the specified network. Applicable only for PeeringConnection with update_strategy=CONSENSUS. Cancels a request to remove a peering from the specified network.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CancelRequestRemovePeeringNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CancelRequestRemovePeeringNetworkRequest.
}
op, err := c.CancelRequestRemovePeering(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworksClient) Close ¶
func (c *NetworksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*NetworksClient) Connection
deprecated
func (c *NetworksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*NetworksClient) Delete ¶
func (c *NetworksClient) Delete(ctx context.Context, req *computepb.DeleteNetworkRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified network.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteNetworkRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworksClient) Get ¶
func (c *NetworksClient) Get(ctx context.Context, req *computepb.GetNetworkRequest, opts ...gax.CallOption) (*computepb.Network, error)
Get returns the specified network.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNetworkRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworksClient) GetEffectiveFirewalls ¶
func (c *NetworksClient) GetEffectiveFirewalls(ctx context.Context, req *computepb.GetEffectiveFirewallsNetworkRequest, opts ...gax.CallOption) (*computepb.NetworksGetEffectiveFirewallsResponse, error)
GetEffectiveFirewalls returns the effective firewalls on a given network.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetEffectiveFirewallsNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetEffectiveFirewallsNetworkRequest.
}
resp, err := c.GetEffectiveFirewalls(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworksClient) Insert ¶
func (c *NetworksClient) Insert(ctx context.Context, req *computepb.InsertNetworkRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a network in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertNetworkRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworksClient) List ¶
func (c *NetworksClient) List(ctx context.Context, req *computepb.ListNetworksRequest, opts ...gax.CallOption) *NetworkIterator
List retrieves the list of networks available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworksRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworksRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NetworksClient) ListPeeringRoutes ¶
func (c *NetworksClient) ListPeeringRoutes(ctx context.Context, req *computepb.ListPeeringRoutesNetworksRequest, opts ...gax.CallOption) *ExchangedPeeringRouteIterator
ListPeeringRoutes lists the peering routes exchanged over peering connection.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPeeringRoutesNetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPeeringRoutesNetworksRequest.
}
it := c.ListPeeringRoutes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ExchangedPeeringRoutesList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPeeringRoutesNetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPeeringRoutesNetworksRequest.
}
for resp, err := range c.ListPeeringRoutes(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NetworksClient) Patch ¶
func (c *NetworksClient) Patch(ctx context.Context, req *computepb.PatchNetworkRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified network with the data included in the request. Only routingConfig can be modified.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchNetworkRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworksClient) RemovePeering ¶
func (c *NetworksClient) RemovePeering(ctx context.Context, req *computepb.RemovePeeringNetworkRequest, opts ...gax.CallOption) (*Operation, error)
RemovePeering removes a peering from the specified network.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemovePeeringNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemovePeeringNetworkRequest.
}
op, err := c.RemovePeering(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworksClient) RequestRemovePeering ¶
func (c *NetworksClient) RequestRemovePeering(ctx context.Context, req *computepb.RequestRemovePeeringNetworkRequest, opts ...gax.CallOption) (*Operation, error)
RequestRemovePeering requests to remove a peering from the specified network. Applicable only for PeeringConnection with update_strategy=CONSENSUS.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RequestRemovePeeringNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RequestRemovePeeringNetworkRequest.
}
op, err := c.RequestRemovePeering(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworksClient) SwitchToCustomMode ¶
func (c *NetworksClient) SwitchToCustomMode(ctx context.Context, req *computepb.SwitchToCustomModeNetworkRequest, opts ...gax.CallOption) (*Operation, error)
SwitchToCustomMode switches the network mode from auto subnet mode to custom subnet mode.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SwitchToCustomModeNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SwitchToCustomModeNetworkRequest.
}
op, err := c.SwitchToCustomMode(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NetworksClient) TestIamPermissions ¶
func (c *NetworksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNetworkRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsNetworkRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NetworksClient) UpdatePeering ¶
func (c *NetworksClient) UpdatePeering(ctx context.Context, req *computepb.UpdatePeeringNetworkRequest, opts ...gax.CallOption) (*Operation, error)
UpdatePeering updates the specified network peering with the data included in the request. You can only modify the NetworkPeering.export_custom_routes field and the NetworkPeering.import_custom_routes field.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdatePeeringNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdatePeeringNetworkRequest.
}
op, err := c.UpdatePeering(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type NodeGroupIterator ¶
type NodeGroupIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.NodeGroup, nextPageToken string, err error)
// contains filtered or unexported fields
}
NodeGroupIterator manages a stream of *computepb.NodeGroup.
func (*NodeGroupIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NodeGroupIterator) Next ¶
func (it *NodeGroupIterator) Next() (*computepb.NodeGroup, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NodeGroupIterator) PageInfo ¶
func (it *NodeGroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NodeGroupNodeIterator ¶
type NodeGroupNodeIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.NodeGroupNode, nextPageToken string, err error)
// contains filtered or unexported fields
}
NodeGroupNodeIterator manages a stream of *computepb.NodeGroupNode.
func (*NodeGroupNodeIterator) All ¶
func (it *NodeGroupNodeIterator) All() iter.Seq2[*computepb.NodeGroupNode, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NodeGroupNodeIterator) Next ¶
func (it *NodeGroupNodeIterator) Next() (*computepb.NodeGroupNode, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NodeGroupNodeIterator) PageInfo ¶
func (it *NodeGroupNodeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NodeGroupsCallOptions ¶
type NodeGroupsCallOptions struct {
AddNodes []gax.CallOption
AggregatedList []gax.CallOption
Delete []gax.CallOption
DeleteNodes []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListNodes []gax.CallOption
Patch []gax.CallOption
PerformMaintenance []gax.CallOption
SetIamPolicy []gax.CallOption
SetNodeTemplate []gax.CallOption
SimulateMaintenanceEvent []gax.CallOption
TestIamPermissions []gax.CallOption
}
NodeGroupsCallOptions contains the retry settings for each method of NodeGroupsClient.
type NodeGroupsClient ¶
type NodeGroupsClient struct {
// The call options for this service.
CallOptions *NodeGroupsCallOptions
// contains filtered or unexported fields
}
NodeGroupsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The NodeGroups API.
func NewNodeGroupsRESTClient ¶
func NewNodeGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*NodeGroupsClient, error)
NewNodeGroupsRESTClient creates a new node groups rest client.
The NodeGroups API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*NodeGroupsClient) AddNodes ¶
func (c *NodeGroupsClient) AddNodes(ctx context.Context, req *computepb.AddNodesNodeGroupRequest, opts ...gax.CallOption) (*Operation, error)
AddNodes adds specified number of nodes to the node group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddNodesNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddNodesNodeGroupRequest.
}
op, err := c.AddNodes(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NodeGroupsClient) AggregatedList ¶
func (c *NodeGroupsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeGroupsRequest, opts ...gax.CallOption) *NodeGroupsScopedListPairIterator
AggregatedList retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNodeGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNodeGroupsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NodeGroupAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNodeGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNodeGroupsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NodeGroupsClient) Close ¶
func (c *NodeGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*NodeGroupsClient) Connection
deprecated
func (c *NodeGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*NodeGroupsClient) Delete ¶
func (c *NodeGroupsClient) Delete(ctx context.Context, req *computepb.DeleteNodeGroupRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified NodeGroup resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteNodeGroupRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NodeGroupsClient) DeleteNodes ¶
func (c *NodeGroupsClient) DeleteNodes(ctx context.Context, req *computepb.DeleteNodesNodeGroupRequest, opts ...gax.CallOption) (*Operation, error)
DeleteNodes deletes specified nodes from the node group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteNodesNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteNodesNodeGroupRequest.
}
op, err := c.DeleteNodes(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NodeGroupsClient) Get ¶
func (c *NodeGroupsClient) Get(ctx context.Context, req *computepb.GetNodeGroupRequest, opts ...gax.CallOption) (*computepb.NodeGroup, error)
Get returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the “nodes” field should not be used. Use nodeGroups.listNodes instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNodeGroupRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NodeGroupsClient) GetIamPolicy ¶
func (c *NodeGroupsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNodeGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyNodeGroupRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NodeGroupsClient) Insert ¶
func (c *NodeGroupsClient) Insert(ctx context.Context, req *computepb.InsertNodeGroupRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a NodeGroup resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertNodeGroupRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NodeGroupsClient) List ¶
func (c *NodeGroupsClient) List(ctx context.Context, req *computepb.ListNodeGroupsRequest, opts ...gax.CallOption) *NodeGroupIterator
List retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNodeGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNodeGroupsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NodeGroupList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNodeGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNodeGroupsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NodeGroupsClient) ListNodes ¶
func (c *NodeGroupsClient) ListNodes(ctx context.Context, req *computepb.ListNodesNodeGroupsRequest, opts ...gax.CallOption) *NodeGroupNodeIterator
ListNodes lists nodes in the node group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNodesNodeGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNodesNodeGroupsRequest.
}
it := c.ListNodes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NodeGroupsListNodes)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNodesNodeGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNodesNodeGroupsRequest.
}
for resp, err := range c.ListNodes(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NodeGroupsClient) Patch ¶
func (c *NodeGroupsClient) Patch(ctx context.Context, req *computepb.PatchNodeGroupRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified node group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchNodeGroupRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NodeGroupsClient) PerformMaintenance ¶
func (c *NodeGroupsClient) PerformMaintenance(ctx context.Context, req *computepb.PerformMaintenanceNodeGroupRequest, opts ...gax.CallOption) (*Operation, error)
PerformMaintenance perform maintenance on a subset of nodes in the node group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PerformMaintenanceNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PerformMaintenanceNodeGroupRequest.
}
op, err := c.PerformMaintenance(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NodeGroupsClient) SetIamPolicy ¶
func (c *NodeGroupsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNodeGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyNodeGroupRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NodeGroupsClient) SetNodeTemplate ¶
func (c *NodeGroupsClient) SetNodeTemplate(ctx context.Context, req *computepb.SetNodeTemplateNodeGroupRequest, opts ...gax.CallOption) (*Operation, error)
SetNodeTemplate updates the node template of the node group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetNodeTemplateNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetNodeTemplateNodeGroupRequest.
}
op, err := c.SetNodeTemplate(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NodeGroupsClient) SimulateMaintenanceEvent ¶
func (c *NodeGroupsClient) SimulateMaintenanceEvent(ctx context.Context, req *computepb.SimulateMaintenanceEventNodeGroupRequest, opts ...gax.CallOption) (*Operation, error)
SimulateMaintenanceEvent simulates maintenance event on specified nodes from the node group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SimulateMaintenanceEventNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SimulateMaintenanceEventNodeGroupRequest.
}
op, err := c.SimulateMaintenanceEvent(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NodeGroupsClient) TestIamPermissions ¶
func (c *NodeGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNodeGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsNodeGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsNodeGroupRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type NodeGroupsScopedListPair ¶
type NodeGroupsScopedListPair struct {
Key string
Value *computepb.NodeGroupsScopedList
}
NodeGroupsScopedListPair is a holder type for string/*computepb.NodeGroupsScopedList map entries
type NodeGroupsScopedListPairIterator ¶
type NodeGroupsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []NodeGroupsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
NodeGroupsScopedListPairIterator manages a stream of NodeGroupsScopedListPair.
func (*NodeGroupsScopedListPairIterator) All ¶
func (it *NodeGroupsScopedListPairIterator) All() iter.Seq2[NodeGroupsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NodeGroupsScopedListPairIterator) Next ¶
func (it *NodeGroupsScopedListPairIterator) Next() (NodeGroupsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NodeGroupsScopedListPairIterator) PageInfo ¶
func (it *NodeGroupsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NodeTemplateIterator ¶
type NodeTemplateIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.NodeTemplate, nextPageToken string, err error)
// contains filtered or unexported fields
}
NodeTemplateIterator manages a stream of *computepb.NodeTemplate.
func (*NodeTemplateIterator) All ¶
func (it *NodeTemplateIterator) All() iter.Seq2[*computepb.NodeTemplate, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NodeTemplateIterator) Next ¶
func (it *NodeTemplateIterator) Next() (*computepb.NodeTemplate, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NodeTemplateIterator) PageInfo ¶
func (it *NodeTemplateIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NodeTemplatesCallOptions ¶
type NodeTemplatesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
NodeTemplatesCallOptions contains the retry settings for each method of NodeTemplatesClient.
type NodeTemplatesClient ¶
type NodeTemplatesClient struct {
// The call options for this service.
CallOptions *NodeTemplatesCallOptions
// contains filtered or unexported fields
}
NodeTemplatesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The NodeTemplates API.
func NewNodeTemplatesRESTClient ¶
func NewNodeTemplatesRESTClient(ctx context.Context, opts ...option.ClientOption) (*NodeTemplatesClient, error)
NewNodeTemplatesRESTClient creates a new node templates rest client.
The NodeTemplates API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*NodeTemplatesClient) AggregatedList ¶
func (c *NodeTemplatesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeTemplatesRequest, opts ...gax.CallOption) *NodeTemplatesScopedListPairIterator
AggregatedList retrieves an aggregated list of node templates.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNodeTemplatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNodeTemplatesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NodeTemplateAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNodeTemplatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNodeTemplatesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NodeTemplatesClient) Close ¶
func (c *NodeTemplatesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*NodeTemplatesClient) Connection
deprecated
func (c *NodeTemplatesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*NodeTemplatesClient) Delete ¶
func (c *NodeTemplatesClient) Delete(ctx context.Context, req *computepb.DeleteNodeTemplateRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified NodeTemplate resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteNodeTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteNodeTemplateRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NodeTemplatesClient) Get ¶
func (c *NodeTemplatesClient) Get(ctx context.Context, req *computepb.GetNodeTemplateRequest, opts ...gax.CallOption) (*computepb.NodeTemplate, error)
Get returns the specified node template.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNodeTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNodeTemplateRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NodeTemplatesClient) GetIamPolicy ¶
func (c *NodeTemplatesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNodeTemplateRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyNodeTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyNodeTemplateRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NodeTemplatesClient) Insert ¶
func (c *NodeTemplatesClient) Insert(ctx context.Context, req *computepb.InsertNodeTemplateRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a NodeTemplate resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertNodeTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertNodeTemplateRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*NodeTemplatesClient) List ¶
func (c *NodeTemplatesClient) List(ctx context.Context, req *computepb.ListNodeTemplatesRequest, opts ...gax.CallOption) *NodeTemplateIterator
List retrieves a list of node templates available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNodeTemplatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNodeTemplatesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NodeTemplateList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNodeTemplatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNodeTemplatesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NodeTemplatesClient) SetIamPolicy ¶
func (c *NodeTemplatesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNodeTemplateRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyNodeTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyNodeTemplateRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NodeTemplatesClient) TestIamPermissions ¶
func (c *NodeTemplatesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNodeTemplateRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsNodeTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsNodeTemplateRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type NodeTemplatesScopedListPair ¶
type NodeTemplatesScopedListPair struct {
Key string
Value *computepb.NodeTemplatesScopedList
}
NodeTemplatesScopedListPair is a holder type for string/*computepb.NodeTemplatesScopedList map entries
type NodeTemplatesScopedListPairIterator ¶
type NodeTemplatesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []NodeTemplatesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
NodeTemplatesScopedListPairIterator manages a stream of NodeTemplatesScopedListPair.
func (*NodeTemplatesScopedListPairIterator) All ¶
func (it *NodeTemplatesScopedListPairIterator) All() iter.Seq2[NodeTemplatesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NodeTemplatesScopedListPairIterator) Next ¶
func (it *NodeTemplatesScopedListPairIterator) Next() (NodeTemplatesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NodeTemplatesScopedListPairIterator) PageInfo ¶
func (it *NodeTemplatesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NodeTypeIterator ¶
type NodeTypeIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.NodeType, nextPageToken string, err error)
// contains filtered or unexported fields
}
NodeTypeIterator manages a stream of *computepb.NodeType.
func (*NodeTypeIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NodeTypeIterator) Next ¶
func (it *NodeTypeIterator) Next() (*computepb.NodeType, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NodeTypeIterator) PageInfo ¶
func (it *NodeTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NodeTypesCallOptions ¶
type NodeTypesCallOptions struct {
AggregatedList []gax.CallOption
Get []gax.CallOption
List []gax.CallOption
}
NodeTypesCallOptions contains the retry settings for each method of NodeTypesClient.
type NodeTypesClient ¶
type NodeTypesClient struct {
// The call options for this service.
CallOptions *NodeTypesCallOptions
// contains filtered or unexported fields
}
NodeTypesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The NodeTypes API.
func NewNodeTypesRESTClient ¶
func NewNodeTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*NodeTypesClient, error)
NewNodeTypesRESTClient creates a new node types rest client.
The NodeTypes API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*NodeTypesClient) AggregatedList ¶
func (c *NodeTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeTypesRequest, opts ...gax.CallOption) *NodeTypesScopedListPairIterator
AggregatedList retrieves an aggregated list of node types.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNodeTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNodeTypesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NodeTypeAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListNodeTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListNodeTypesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*NodeTypesClient) Close ¶
func (c *NodeTypesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*NodeTypesClient) Connection
deprecated
func (c *NodeTypesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*NodeTypesClient) Get ¶
func (c *NodeTypesClient) Get(ctx context.Context, req *computepb.GetNodeTypeRequest, opts ...gax.CallOption) (*computepb.NodeType, error)
Get returns the specified node type.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNodeTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNodeTypeRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*NodeTypesClient) List ¶
func (c *NodeTypesClient) List(ctx context.Context, req *computepb.ListNodeTypesRequest, opts ...gax.CallOption) *NodeTypeIterator
List retrieves a list of node types available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNodeTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNodeTypesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NodeTypeList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewNodeTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNodeTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNodeTypesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type NodeTypesScopedListPair ¶
type NodeTypesScopedListPair struct {
Key string
Value *computepb.NodeTypesScopedList
}
NodeTypesScopedListPair is a holder type for string/*computepb.NodeTypesScopedList map entries
type NodeTypesScopedListPairIterator ¶
type NodeTypesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []NodeTypesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
NodeTypesScopedListPairIterator manages a stream of NodeTypesScopedListPair.
func (*NodeTypesScopedListPairIterator) All ¶
func (it *NodeTypesScopedListPairIterator) All() iter.Seq2[NodeTypesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NodeTypesScopedListPairIterator) Next ¶
func (it *NodeTypesScopedListPairIterator) Next() (NodeTypesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NodeTypesScopedListPairIterator) PageInfo ¶
func (it *NodeTypesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NotificationEndpointIterator ¶
type NotificationEndpointIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.NotificationEndpoint, nextPageToken string, err error)
// contains filtered or unexported fields
}
NotificationEndpointIterator manages a stream of *computepb.NotificationEndpoint.
func (*NotificationEndpointIterator) All ¶
func (it *NotificationEndpointIterator) All() iter.Seq2[*computepb.NotificationEndpoint, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NotificationEndpointIterator) Next ¶
func (it *NotificationEndpointIterator) Next() (*computepb.NotificationEndpoint, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*NotificationEndpointIterator) PageInfo ¶
func (it *NotificationEndpointIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type Operation ¶
type Operation struct {
// contains filtered or unexported fields
}
Operation represents a long-running operation for this API.
type OperationIterator ¶
type OperationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Operation, nextPageToken string, err error)
// contains filtered or unexported fields
}
OperationIterator manages a stream of *computepb.Operation.
func (*OperationIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next ¶
func (it *OperationIterator) Next() (*computepb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo ¶
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type OperationsScopedListPair ¶
type OperationsScopedListPair struct {
Key string
Value *computepb.OperationsScopedList
}
OperationsScopedListPair is a holder type for string/*computepb.OperationsScopedList map entries
type OperationsScopedListPairIterator ¶
type OperationsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []OperationsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
OperationsScopedListPairIterator manages a stream of OperationsScopedListPair.
func (*OperationsScopedListPairIterator) All ¶
func (it *OperationsScopedListPairIterator) All() iter.Seq2[OperationsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationsScopedListPairIterator) Next ¶
func (it *OperationsScopedListPairIterator) Next() (OperationsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationsScopedListPairIterator) PageInfo ¶
func (it *OperationsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type OrganizationSecurityPoliciesCallOptions ¶
type OrganizationSecurityPoliciesCallOptions struct {
AddAssociation []gax.CallOption
AddRule []gax.CallOption
CopyRules []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetAssociation []gax.CallOption
GetRule []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListAssociations []gax.CallOption
ListPreconfiguredExpressionSets []gax.CallOption
Move []gax.CallOption
Patch []gax.CallOption
PatchRule []gax.CallOption
RemoveAssociation []gax.CallOption
RemoveRule []gax.CallOption
}
OrganizationSecurityPoliciesCallOptions contains the retry settings for each method of OrganizationSecurityPoliciesClient.
type OrganizationSecurityPoliciesClient ¶
type OrganizationSecurityPoliciesClient struct {
// The call options for this service.
CallOptions *OrganizationSecurityPoliciesCallOptions
// contains filtered or unexported fields
}
OrganizationSecurityPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The OrganizationSecurityPolicies API.
func NewOrganizationSecurityPoliciesRESTClient ¶
func NewOrganizationSecurityPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*OrganizationSecurityPoliciesClient, error)
NewOrganizationSecurityPoliciesRESTClient creates a new organization security policies rest client.
The OrganizationSecurityPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*OrganizationSecurityPoliciesClient) AddAssociation ¶
func (c *OrganizationSecurityPoliciesClient) AddAssociation(ctx context.Context, req *computepb.AddAssociationOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddAssociation inserts an association for the specified security policy.
This has billing implications. Projects in the hierarchy with effective hierarchical security policies will be automatically enrolled into Cloud Armor Enterprise if not already enrolled.
Use this API to modify Cloud Armor policies. Previously, alpha and beta versions of this API were used to modify firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.addAssociation instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddAssociationOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddAssociationOrganizationSecurityPolicyRequest.
}
op, err := c.AddAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*OrganizationSecurityPoliciesClient) AddRule ¶
func (c *OrganizationSecurityPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddRule inserts a rule into a security policy.
Use this API to modify Cloud Armor policies. Previously, alpha and beta versions of this API were used to modify firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.addRule instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddRuleOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddRuleOrganizationSecurityPolicyRequest.
}
op, err := c.AddRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*OrganizationSecurityPoliciesClient) Close ¶
func (c *OrganizationSecurityPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*OrganizationSecurityPoliciesClient) Connection
deprecated
func (c *OrganizationSecurityPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*OrganizationSecurityPoliciesClient) CopyRules ¶
func (c *OrganizationSecurityPoliciesClient) CopyRules(ctx context.Context, req *computepb.CopyRulesOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
CopyRules copies rules to the specified security policy.
Use this API to modify Cloud Armor policies. Previously, alpha and beta versions of this API were used to modify firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.cloneRules instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CopyRulesOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CopyRulesOrganizationSecurityPolicyRequest.
}
op, err := c.CopyRules(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*OrganizationSecurityPoliciesClient) Delete ¶
func (c *OrganizationSecurityPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified policy.
Use this API to remove Cloud Armor policies. Previously, alpha and beta versions of this API were used to remove firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.delete instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteOrganizationSecurityPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*OrganizationSecurityPoliciesClient) Get ¶
func (c *OrganizationSecurityPoliciesClient) Get(ctx context.Context, req *computepb.GetOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicy, error)
Get list all of the ordered rules present in a single specified policy.
Use this API to read Cloud Armor policies. Previously, alpha and beta versions of this API were used to read firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.get instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetOrganizationSecurityPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*OrganizationSecurityPoliciesClient) GetAssociation ¶
func (c *OrganizationSecurityPoliciesClient) GetAssociation(ctx context.Context, req *computepb.GetAssociationOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicyAssociation, error)
GetAssociation gets an association with the specified name.
Use this API to read Cloud Armor policies. Previously, alpha and beta versions of this API were used to read firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.getAssociation instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetAssociationOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetAssociationOrganizationSecurityPolicyRequest.
}
resp, err := c.GetAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*OrganizationSecurityPoliciesClient) GetRule ¶
func (c *OrganizationSecurityPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicyRule, error)
GetRule gets a rule at the specified priority.
Use this API to read Cloud Armor policies. Previously, alpha and beta versions of this API were used to read firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.getRule instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRuleOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRuleOrganizationSecurityPolicyRequest.
}
resp, err := c.GetRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*OrganizationSecurityPoliciesClient) Insert ¶
func (c *OrganizationSecurityPoliciesClient) Insert(ctx context.Context, req *computepb.InsertOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new policy in the specified organization using the data included in the request.
Use this API to add Cloud Armor policies. Previously, alpha and beta versions of this API were used to add firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.insert instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertOrganizationSecurityPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*OrganizationSecurityPoliciesClient) List ¶
func (c *OrganizationSecurityPoliciesClient) List(ctx context.Context, req *computepb.ListOrganizationSecurityPoliciesRequest, opts ...gax.CallOption) *SecurityPolicyIterator
List list all the policies that have been configured for the specified organization.
Use this API to read Cloud Armor policies. Previously, alpha and beta versions of this API were used to read firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.list instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListOrganizationSecurityPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListOrganizationSecurityPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SecurityPolicyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListOrganizationSecurityPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListOrganizationSecurityPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*OrganizationSecurityPoliciesClient) ListAssociations ¶
func (c *OrganizationSecurityPoliciesClient) ListAssociations(ctx context.Context, req *computepb.ListAssociationsOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.OrganizationSecurityPoliciesListAssociationsResponse, error)
ListAssociations lists associations of a specified target, i.e., organization or folder.
Use this API to read Cloud Armor policies. Previously, alpha and beta versions of this API were used to read firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.listAssociations instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListAssociationsOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListAssociationsOrganizationSecurityPolicyRequest.
}
resp, err := c.ListAssociations(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*OrganizationSecurityPoliciesClient) ListPreconfiguredExpressionSets ¶
func (c *OrganizationSecurityPoliciesClient) ListPreconfiguredExpressionSets(ctx context.Context, req *computepb.ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest, opts ...gax.CallOption) (*computepb.SecurityPoliciesListPreconfiguredExpressionSetsResponse, error)
ListPreconfiguredExpressionSets gets the current list of preconfigured Web Application Firewall (WAF) expressions.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest.
}
resp, err := c.ListPreconfiguredExpressionSets(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*OrganizationSecurityPoliciesClient) Move ¶
func (c *OrganizationSecurityPoliciesClient) Move(ctx context.Context, req *computepb.MoveOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Move moves the specified security policy.
Use this API to modify Cloud Armor policies. Previously, alpha and beta versions of this API were used to modify firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.move instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.MoveOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#MoveOrganizationSecurityPolicyRequest.
}
op, err := c.Move(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*OrganizationSecurityPoliciesClient) Patch ¶
func (c *OrganizationSecurityPoliciesClient) Patch(ctx context.Context, req *computepb.PatchOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified policy with the data included in the request.
Use this API to modify Cloud Armor policies. Previously, alpha and beta versions of this API were used to modify firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.patch instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchOrganizationSecurityPolicyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*OrganizationSecurityPoliciesClient) PatchRule ¶
func (c *OrganizationSecurityPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
PatchRule patches a rule at the specified priority.
Use this API to modify Cloud Armor policies. Previously, alpha and beta versions of this API were used to modify firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.patchRule instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRuleOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRuleOrganizationSecurityPolicyRequest.
}
op, err := c.PatchRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*OrganizationSecurityPoliciesClient) RemoveAssociation ¶
func (c *OrganizationSecurityPoliciesClient) RemoveAssociation(ctx context.Context, req *computepb.RemoveAssociationOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveAssociation removes an association for the specified security policy.
Use this API to modify Cloud Armor policies. Previously, alpha and beta versions of this API were used to modify firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.removeAssociation instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveAssociationOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveAssociationOrganizationSecurityPolicyRequest.
}
op, err := c.RemoveAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*OrganizationSecurityPoliciesClient) RemoveRule ¶
func (c *OrganizationSecurityPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleOrganizationSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveRule deletes a rule at the specified priority.
Use this API to modify Cloud Armor policies. Previously, alpha and beta versions of this API were used to modify firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.removeRule instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewOrganizationSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveRuleOrganizationSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveRuleOrganizationSecurityPolicyRequest.
}
op, err := c.RemoveRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type PacketMirroringIterator ¶
type PacketMirroringIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.PacketMirroring, nextPageToken string, err error)
// contains filtered or unexported fields
}
PacketMirroringIterator manages a stream of *computepb.PacketMirroring.
func (*PacketMirroringIterator) All ¶
func (it *PacketMirroringIterator) All() iter.Seq2[*computepb.PacketMirroring, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PacketMirroringIterator) Next ¶
func (it *PacketMirroringIterator) Next() (*computepb.PacketMirroring, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*PacketMirroringIterator) PageInfo ¶
func (it *PacketMirroringIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type PacketMirroringsCallOptions ¶
type PacketMirroringsCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
}
PacketMirroringsCallOptions contains the retry settings for each method of PacketMirroringsClient.
type PacketMirroringsClient ¶
type PacketMirroringsClient struct {
// The call options for this service.
CallOptions *PacketMirroringsCallOptions
// contains filtered or unexported fields
}
PacketMirroringsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The PacketMirrorings API.
func NewPacketMirroringsRESTClient ¶
func NewPacketMirroringsRESTClient(ctx context.Context, opts ...option.ClientOption) (*PacketMirroringsClient, error)
NewPacketMirroringsRESTClient creates a new packet mirrorings rest client.
The PacketMirrorings API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPacketMirroringsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*PacketMirroringsClient) AggregatedList ¶
func (c *PacketMirroringsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListPacketMirroringsRequest, opts ...gax.CallOption) *PacketMirroringsScopedListPairIterator
AggregatedList retrieves an aggregated list of packetMirrorings.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPacketMirroringsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListPacketMirroringsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListPacketMirroringsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.PacketMirroringAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPacketMirroringsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListPacketMirroringsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListPacketMirroringsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PacketMirroringsClient) Close ¶
func (c *PacketMirroringsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*PacketMirroringsClient) Connection
deprecated
func (c *PacketMirroringsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*PacketMirroringsClient) Delete ¶
func (c *PacketMirroringsClient) Delete(ctx context.Context, req *computepb.DeletePacketMirroringRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified PacketMirroring resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPacketMirroringsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeletePacketMirroringRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeletePacketMirroringRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PacketMirroringsClient) Get ¶
func (c *PacketMirroringsClient) Get(ctx context.Context, req *computepb.GetPacketMirroringRequest, opts ...gax.CallOption) (*computepb.PacketMirroring, error)
Get returns the specified PacketMirroring resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPacketMirroringsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetPacketMirroringRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetPacketMirroringRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PacketMirroringsClient) Insert ¶
func (c *PacketMirroringsClient) Insert(ctx context.Context, req *computepb.InsertPacketMirroringRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a PacketMirroring resource in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPacketMirroringsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertPacketMirroringRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertPacketMirroringRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PacketMirroringsClient) List ¶
func (c *PacketMirroringsClient) List(ctx context.Context, req *computepb.ListPacketMirroringsRequest, opts ...gax.CallOption) *PacketMirroringIterator
List retrieves a list of PacketMirroring resources available to the specified project and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPacketMirroringsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPacketMirroringsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPacketMirroringsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.PacketMirroringList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPacketMirroringsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPacketMirroringsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPacketMirroringsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PacketMirroringsClient) Patch ¶
func (c *PacketMirroringsClient) Patch(ctx context.Context, req *computepb.PatchPacketMirroringRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified PacketMirroring resource with the data included in the request. This method supportsPATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPacketMirroringsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchPacketMirroringRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchPacketMirroringRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PacketMirroringsClient) TestIamPermissions ¶
func (c *PacketMirroringsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsPacketMirroringRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPacketMirroringsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsPacketMirroringRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsPacketMirroringRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type PacketMirroringsScopedListPair ¶
type PacketMirroringsScopedListPair struct {
Key string
Value *computepb.PacketMirroringsScopedList
}
PacketMirroringsScopedListPair is a holder type for string/*computepb.PacketMirroringsScopedList map entries
type PacketMirroringsScopedListPairIterator ¶
type PacketMirroringsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []PacketMirroringsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
PacketMirroringsScopedListPairIterator manages a stream of PacketMirroringsScopedListPair.
func (*PacketMirroringsScopedListPairIterator) All ¶
func (it *PacketMirroringsScopedListPairIterator) All() iter.Seq2[PacketMirroringsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PacketMirroringsScopedListPairIterator) Next ¶
func (it *PacketMirroringsScopedListPairIterator) Next() (PacketMirroringsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*PacketMirroringsScopedListPairIterator) PageInfo ¶
func (it *PacketMirroringsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type PerInstanceConfigIterator ¶
type PerInstanceConfigIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.PerInstanceConfig, nextPageToken string, err error)
// contains filtered or unexported fields
}
PerInstanceConfigIterator manages a stream of *computepb.PerInstanceConfig.
func (*PerInstanceConfigIterator) All ¶
func (it *PerInstanceConfigIterator) All() iter.Seq2[*computepb.PerInstanceConfig, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PerInstanceConfigIterator) Next ¶
func (it *PerInstanceConfigIterator) Next() (*computepb.PerInstanceConfig, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*PerInstanceConfigIterator) PageInfo ¶
func (it *PerInstanceConfigIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type PreviewFeatureIterator ¶
type PreviewFeatureIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.PreviewFeature, nextPageToken string, err error)
// contains filtered or unexported fields
}
PreviewFeatureIterator manages a stream of *computepb.PreviewFeature.
func (*PreviewFeatureIterator) All ¶
func (it *PreviewFeatureIterator) All() iter.Seq2[*computepb.PreviewFeature, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PreviewFeatureIterator) Next ¶
func (it *PreviewFeatureIterator) Next() (*computepb.PreviewFeature, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*PreviewFeatureIterator) PageInfo ¶
func (it *PreviewFeatureIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type PreviewFeaturesCallOptions ¶
type PreviewFeaturesCallOptions struct {
Get []gax.CallOption
List []gax.CallOption
Update []gax.CallOption
}
PreviewFeaturesCallOptions contains the retry settings for each method of PreviewFeaturesClient.
type PreviewFeaturesClient ¶
type PreviewFeaturesClient struct {
// The call options for this service.
CallOptions *PreviewFeaturesCallOptions
// contains filtered or unexported fields
}
PreviewFeaturesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The PreviewFeatures API.
func NewPreviewFeaturesRESTClient ¶
func NewPreviewFeaturesRESTClient(ctx context.Context, opts ...option.ClientOption) (*PreviewFeaturesClient, error)
NewPreviewFeaturesRESTClient creates a new preview features rest client.
The PreviewFeatures API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPreviewFeaturesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*PreviewFeaturesClient) Close ¶
func (c *PreviewFeaturesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*PreviewFeaturesClient) Connection
deprecated
func (c *PreviewFeaturesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*PreviewFeaturesClient) Get ¶
func (c *PreviewFeaturesClient) Get(ctx context.Context, req *computepb.GetPreviewFeatureRequest, opts ...gax.CallOption) (*computepb.PreviewFeature, error)
Get returns the details of the given PreviewFeature.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPreviewFeaturesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetPreviewFeatureRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetPreviewFeatureRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PreviewFeaturesClient) List ¶
func (c *PreviewFeaturesClient) List(ctx context.Context, req *computepb.ListPreviewFeaturesRequest, opts ...gax.CallOption) *PreviewFeatureIterator
List returns the details of the given PreviewFeature.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPreviewFeaturesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPreviewFeaturesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPreviewFeaturesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.PreviewFeatureList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPreviewFeaturesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPreviewFeaturesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPreviewFeaturesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PreviewFeaturesClient) Update ¶
func (c *PreviewFeaturesClient) Update(ctx context.Context, req *computepb.UpdatePreviewFeatureRequest, opts ...gax.CallOption) (*Operation, error)
Update patches the given PreviewFeature. This method is used to enable or disable a PreviewFeature.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPreviewFeaturesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdatePreviewFeatureRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdatePreviewFeatureRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type ProjectIterator ¶
type ProjectIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Project, nextPageToken string, err error)
// contains filtered or unexported fields
}
ProjectIterator manages a stream of *computepb.Project.
func (*ProjectIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ProjectIterator) Next ¶
func (it *ProjectIterator) Next() (*computepb.Project, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ProjectIterator) PageInfo ¶
func (it *ProjectIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ProjectsCallOptions ¶
type ProjectsCallOptions struct {
DisableXpnHost []gax.CallOption
DisableXpnResource []gax.CallOption
EnableXpnHost []gax.CallOption
EnableXpnResource []gax.CallOption
Get []gax.CallOption
GetXpnHost []gax.CallOption
GetXpnResources []gax.CallOption
ListXpnHosts []gax.CallOption
MoveDisk []gax.CallOption
MoveInstance []gax.CallOption
SetCloudArmorTier []gax.CallOption
SetCommonInstanceMetadata []gax.CallOption
SetDefaultNetworkTier []gax.CallOption
SetManagedProtectionTier []gax.CallOption
SetUsageExportBucket []gax.CallOption
}
ProjectsCallOptions contains the retry settings for each method of ProjectsClient.
type ProjectsClient ¶
type ProjectsClient struct {
// The call options for this service.
CallOptions *ProjectsCallOptions
// contains filtered or unexported fields
}
ProjectsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Projects API.
func NewProjectsRESTClient ¶
func NewProjectsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ProjectsClient, error)
NewProjectsRESTClient creates a new projects rest client.
The Projects API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ProjectsClient) Close ¶
func (c *ProjectsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ProjectsClient) Connection
deprecated
func (c *ProjectsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ProjectsClient) DisableXpnHost ¶
func (c *ProjectsClient) DisableXpnHost(ctx context.Context, req *computepb.DisableXpnHostProjectRequest, opts ...gax.CallOption) (*Operation, error)
DisableXpnHost disable this project as a shared VPC host project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DisableXpnHostProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DisableXpnHostProjectRequest.
}
op, err := c.DisableXpnHost(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ProjectsClient) DisableXpnResource ¶
func (c *ProjectsClient) DisableXpnResource(ctx context.Context, req *computepb.DisableXpnResourceProjectRequest, opts ...gax.CallOption) (*Operation, error)
DisableXpnResource disable a service resource (also known as service project) associated with this host project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DisableXpnResourceProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DisableXpnResourceProjectRequest.
}
op, err := c.DisableXpnResource(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ProjectsClient) EnableXpnHost ¶
func (c *ProjectsClient) EnableXpnHost(ctx context.Context, req *computepb.EnableXpnHostProjectRequest, opts ...gax.CallOption) (*Operation, error)
EnableXpnHost enable this project as a shared VPC host project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.EnableXpnHostProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#EnableXpnHostProjectRequest.
}
op, err := c.EnableXpnHost(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ProjectsClient) EnableXpnResource ¶
func (c *ProjectsClient) EnableXpnResource(ctx context.Context, req *computepb.EnableXpnResourceProjectRequest, opts ...gax.CallOption) (*Operation, error)
EnableXpnResource enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.EnableXpnResourceProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#EnableXpnResourceProjectRequest.
}
op, err := c.EnableXpnResource(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ProjectsClient) Get ¶
func (c *ProjectsClient) Get(ctx context.Context, req *computepb.GetProjectRequest, opts ...gax.CallOption) (*computepb.Project, error)
Get returns the specified Project resource.
To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the quotas field). To exclude one or more fields, set your request’s fields query parameter to only include the fields you need. For example, to only include the id and selfLink fields, add the query parameter ?fields=id,selfLink to your request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetProjectRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ProjectsClient) GetXpnHost ¶
func (c *ProjectsClient) GetXpnHost(ctx context.Context, req *computepb.GetXpnHostProjectRequest, opts ...gax.CallOption) (*computepb.Project, error)
GetXpnHost gets the shared VPC host project that this project links to. May be empty if no link exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetXpnHostProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetXpnHostProjectRequest.
}
resp, err := c.GetXpnHost(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ProjectsClient) GetXpnResources ¶
func (c *ProjectsClient) GetXpnResources(ctx context.Context, req *computepb.GetXpnResourcesProjectsRequest, opts ...gax.CallOption) *XpnResourceIdIterator
GetXpnResources gets service resources (a.k.a service project) associated with this host project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetXpnResourcesProjectsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetXpnResourcesProjectsRequest.
}
it := c.GetXpnResources(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ProjectsGetXpnResources)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetXpnResourcesProjectsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetXpnResourcesProjectsRequest.
}
for resp, err := range c.GetXpnResources(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ProjectsClient) ListXpnHosts ¶
func (c *ProjectsClient) ListXpnHosts(ctx context.Context, req *computepb.ListXpnHostsProjectsRequest, opts ...gax.CallOption) *ProjectIterator
ListXpnHosts lists all shared VPC host projects visible to the user in an organization.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListXpnHostsProjectsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListXpnHostsProjectsRequest.
}
it := c.ListXpnHosts(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.XpnHostList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListXpnHostsProjectsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListXpnHostsProjectsRequest.
}
for resp, err := range c.ListXpnHosts(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ProjectsClient) MoveDisk ¶
func (c *ProjectsClient) MoveDisk(ctx context.Context, req *computepb.MoveDiskProjectRequest, opts ...gax.CallOption) (*Operation, error)
MoveDisk moves a persistent disk from one zone to another. Note: The moveDisk API will be deprecated on September 29, 2026.
Starting September 29, 2025, you can’t use the moveDisk API on new projects. To move a disk to a different region or zone, follow the steps in Change the location of a disk (at https://cloud.google.com/compute/docs/disks/migrate-to-hyperdisk#migrate-to-hd).
Projects that already use the moveDisk API can continue usage until September 29, 2026.
Starting November 1, 2025, API responses will include a warning message in the response body about the upcoming deprecation. You can skip the message to continue using the service without interruption.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.MoveDiskProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#MoveDiskProjectRequest.
}
op, err := c.MoveDisk(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ProjectsClient) MoveInstance ¶
func (c *ProjectsClient) MoveInstance(ctx context.Context, req *computepb.MoveInstanceProjectRequest, opts ...gax.CallOption) (*Operation, error)
MoveInstance moves an instance and its attached persistent disks from one zone to another. Note: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the known issue (at /compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior). [Deprecated] This method is deprecated. See moving instance across zones (at /compute/docs/instances/moving-instance-across-zones) instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.MoveInstanceProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#MoveInstanceProjectRequest.
}
op, err := c.MoveInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ProjectsClient) SetCloudArmorTier ¶
func (c *ProjectsClient) SetCloudArmorTier(ctx context.Context, req *computepb.SetCloudArmorTierProjectRequest, opts ...gax.CallOption) (*Operation, error)
SetCloudArmorTier sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more information.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetCloudArmorTierProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetCloudArmorTierProjectRequest.
}
op, err := c.SetCloudArmorTier(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ProjectsClient) SetCommonInstanceMetadata ¶
func (c *ProjectsClient) SetCommonInstanceMetadata(ctx context.Context, req *computepb.SetCommonInstanceMetadataProjectRequest, opts ...gax.CallOption) (*Operation, error)
SetCommonInstanceMetadata sets metadata common to all instances within the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetCommonInstanceMetadataProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetCommonInstanceMetadataProjectRequest.
}
op, err := c.SetCommonInstanceMetadata(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ProjectsClient) SetDefaultNetworkTier ¶
func (c *ProjectsClient) SetDefaultNetworkTier(ctx context.Context, req *computepb.SetDefaultNetworkTierProjectRequest, opts ...gax.CallOption) (*Operation, error)
SetDefaultNetworkTier sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetDefaultNetworkTierProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetDefaultNetworkTierProjectRequest.
}
op, err := c.SetDefaultNetworkTier(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ProjectsClient) SetManagedProtectionTier ¶
func (c *ProjectsClient) SetManagedProtectionTier(ctx context.Context, req *computepb.SetManagedProtectionTierProjectRequest, opts ...gax.CallOption) (*Operation, error)
SetManagedProtectionTier sets the Cloud Armor Managed Protection (CAMP) tier of the project. To set PLUS or above the billing account of the project must be subscribed to Managed Protection Plus. See Subscribing to Managed Protection Plus for more information.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetManagedProtectionTierProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetManagedProtectionTierProjectRequest.
}
op, err := c.SetManagedProtectionTier(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ProjectsClient) SetUsageExportBucket ¶
func (c *ProjectsClient) SetUsageExportBucket(ctx context.Context, req *computepb.SetUsageExportBucketProjectRequest, opts ...gax.CallOption) (*Operation, error)
SetUsageExportBucket enables the usage export feature and sets theusage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewProjectsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetUsageExportBucketProjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetUsageExportBucketProjectRequest.
}
op, err := c.SetUsageExportBucket(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type PublicAdvertisedPrefixIterator ¶
type PublicAdvertisedPrefixIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.PublicAdvertisedPrefix, nextPageToken string, err error)
// contains filtered or unexported fields
}
PublicAdvertisedPrefixIterator manages a stream of *computepb.PublicAdvertisedPrefix.
func (*PublicAdvertisedPrefixIterator) All ¶
func (it *PublicAdvertisedPrefixIterator) All() iter.Seq2[*computepb.PublicAdvertisedPrefix, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PublicAdvertisedPrefixIterator) Next ¶
func (it *PublicAdvertisedPrefixIterator) Next() (*computepb.PublicAdvertisedPrefix, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*PublicAdvertisedPrefixIterator) PageInfo ¶
func (it *PublicAdvertisedPrefixIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type PublicAdvertisedPrefixesCallOptions ¶
type PublicAdvertisedPrefixesCallOptions struct {
Announce []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
Withdraw []gax.CallOption
}
PublicAdvertisedPrefixesCallOptions contains the retry settings for each method of PublicAdvertisedPrefixesClient.
type PublicAdvertisedPrefixesClient ¶
type PublicAdvertisedPrefixesClient struct {
// The call options for this service.
CallOptions *PublicAdvertisedPrefixesCallOptions
// contains filtered or unexported fields
}
PublicAdvertisedPrefixesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The PublicAdvertisedPrefixes API.
func NewPublicAdvertisedPrefixesRESTClient ¶
func NewPublicAdvertisedPrefixesRESTClient(ctx context.Context, opts ...option.ClientOption) (*PublicAdvertisedPrefixesClient, error)
NewPublicAdvertisedPrefixesRESTClient creates a new public advertised prefixes rest client.
The PublicAdvertisedPrefixes API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*PublicAdvertisedPrefixesClient) Announce ¶
func (c *PublicAdvertisedPrefixesClient) Announce(ctx context.Context, req *computepb.AnnouncePublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Announce announces the specified PublicAdvertisedPrefix
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AnnouncePublicAdvertisedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AnnouncePublicAdvertisedPrefixeRequest.
}
op, err := c.Announce(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PublicAdvertisedPrefixesClient) Close ¶
func (c *PublicAdvertisedPrefixesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*PublicAdvertisedPrefixesClient) Connection
deprecated
func (c *PublicAdvertisedPrefixesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*PublicAdvertisedPrefixesClient) Delete ¶
func (c *PublicAdvertisedPrefixesClient) Delete(ctx context.Context, req *computepb.DeletePublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified PublicAdvertisedPrefix
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeletePublicAdvertisedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeletePublicAdvertisedPrefixeRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PublicAdvertisedPrefixesClient) Get ¶
func (c *PublicAdvertisedPrefixesClient) Get(ctx context.Context, req *computepb.GetPublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*computepb.PublicAdvertisedPrefix, error)
Get returns the specified PublicAdvertisedPrefix resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetPublicAdvertisedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetPublicAdvertisedPrefixeRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PublicAdvertisedPrefixesClient) Insert ¶
func (c *PublicAdvertisedPrefixesClient) Insert(ctx context.Context, req *computepb.InsertPublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertPublicAdvertisedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertPublicAdvertisedPrefixeRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PublicAdvertisedPrefixesClient) List ¶
func (c *PublicAdvertisedPrefixesClient) List(ctx context.Context, req *computepb.ListPublicAdvertisedPrefixesRequest, opts ...gax.CallOption) *PublicAdvertisedPrefixIterator
List lists the PublicAdvertisedPrefixes for a project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPublicAdvertisedPrefixesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPublicAdvertisedPrefixesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.PublicAdvertisedPrefixList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPublicAdvertisedPrefixesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPublicAdvertisedPrefixesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PublicAdvertisedPrefixesClient) Patch ¶
func (c *PublicAdvertisedPrefixesClient) Patch(ctx context.Context, req *computepb.PatchPublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified Router resource with the data included in the request. This method supportsPATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchPublicAdvertisedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchPublicAdvertisedPrefixeRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PublicAdvertisedPrefixesClient) Withdraw ¶
func (c *PublicAdvertisedPrefixesClient) Withdraw(ctx context.Context, req *computepb.WithdrawPublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Withdraw withdraws the specified PublicAdvertisedPrefix
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.WithdrawPublicAdvertisedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#WithdrawPublicAdvertisedPrefixeRequest.
}
op, err := c.Withdraw(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type PublicDelegatedPrefixIterator ¶
type PublicDelegatedPrefixIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.PublicDelegatedPrefix, nextPageToken string, err error)
// contains filtered or unexported fields
}
PublicDelegatedPrefixIterator manages a stream of *computepb.PublicDelegatedPrefix.
func (*PublicDelegatedPrefixIterator) All ¶
func (it *PublicDelegatedPrefixIterator) All() iter.Seq2[*computepb.PublicDelegatedPrefix, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PublicDelegatedPrefixIterator) Next ¶
func (it *PublicDelegatedPrefixIterator) Next() (*computepb.PublicDelegatedPrefix, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*PublicDelegatedPrefixIterator) PageInfo ¶
func (it *PublicDelegatedPrefixIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type PublicDelegatedPrefixesCallOptions ¶
type PublicDelegatedPrefixesCallOptions struct {
AggregatedList []gax.CallOption
Announce []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
Withdraw []gax.CallOption
}
PublicDelegatedPrefixesCallOptions contains the retry settings for each method of PublicDelegatedPrefixesClient.
type PublicDelegatedPrefixesClient ¶
type PublicDelegatedPrefixesClient struct {
// The call options for this service.
CallOptions *PublicDelegatedPrefixesCallOptions
// contains filtered or unexported fields
}
PublicDelegatedPrefixesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The PublicDelegatedPrefixes API.
func NewPublicDelegatedPrefixesRESTClient ¶
func NewPublicDelegatedPrefixesRESTClient(ctx context.Context, opts ...option.ClientOption) (*PublicDelegatedPrefixesClient, error)
NewPublicDelegatedPrefixesRESTClient creates a new public delegated prefixes rest client.
The PublicDelegatedPrefixes API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*PublicDelegatedPrefixesClient) AggregatedList ¶
func (c *PublicDelegatedPrefixesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListPublicDelegatedPrefixesRequest, opts ...gax.CallOption) *PublicDelegatedPrefixesScopedListPairIterator
AggregatedList lists all PublicDelegatedPrefix resources owned by the specific project across all scopes.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListPublicDelegatedPrefixesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListPublicDelegatedPrefixesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.PublicDelegatedPrefixAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListPublicDelegatedPrefixesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListPublicDelegatedPrefixesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PublicDelegatedPrefixesClient) Announce ¶
func (c *PublicDelegatedPrefixesClient) Announce(ctx context.Context, req *computepb.AnnouncePublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Announce announces the specified PublicDelegatedPrefix in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AnnouncePublicDelegatedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AnnouncePublicDelegatedPrefixeRequest.
}
op, err := c.Announce(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PublicDelegatedPrefixesClient) Close ¶
func (c *PublicDelegatedPrefixesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*PublicDelegatedPrefixesClient) Connection
deprecated
func (c *PublicDelegatedPrefixesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*PublicDelegatedPrefixesClient) Delete ¶
func (c *PublicDelegatedPrefixesClient) Delete(ctx context.Context, req *computepb.DeletePublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified PublicDelegatedPrefix in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeletePublicDelegatedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeletePublicDelegatedPrefixeRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PublicDelegatedPrefixesClient) Get ¶
func (c *PublicDelegatedPrefixesClient) Get(ctx context.Context, req *computepb.GetPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefix, error)
Get returns the specified PublicDelegatedPrefix resource in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetPublicDelegatedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetPublicDelegatedPrefixeRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PublicDelegatedPrefixesClient) Insert ¶
func (c *PublicDelegatedPrefixesClient) Insert(ctx context.Context, req *computepb.InsertPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertPublicDelegatedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertPublicDelegatedPrefixeRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PublicDelegatedPrefixesClient) List ¶
func (c *PublicDelegatedPrefixesClient) List(ctx context.Context, req *computepb.ListPublicDelegatedPrefixesRequest, opts ...gax.CallOption) *PublicDelegatedPrefixIterator
List lists the PublicDelegatedPrefixes for a project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPublicDelegatedPrefixesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPublicDelegatedPrefixesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.PublicDelegatedPrefixList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPublicDelegatedPrefixesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPublicDelegatedPrefixesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PublicDelegatedPrefixesClient) Patch ¶
func (c *PublicDelegatedPrefixesClient) Patch(ctx context.Context, req *computepb.PatchPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supportsPATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchPublicDelegatedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchPublicDelegatedPrefixeRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PublicDelegatedPrefixesClient) Withdraw ¶
func (c *PublicDelegatedPrefixesClient) Withdraw(ctx context.Context, req *computepb.WithdrawPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error)
Withdraw withdraws the specified PublicDelegatedPrefix in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.WithdrawPublicDelegatedPrefixeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#WithdrawPublicDelegatedPrefixeRequest.
}
op, err := c.Withdraw(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type PublicDelegatedPrefixesScopedListPair ¶
type PublicDelegatedPrefixesScopedListPair struct {
Key string
Value *computepb.PublicDelegatedPrefixesScopedList
}
PublicDelegatedPrefixesScopedListPair is a holder type for string/*computepb.PublicDelegatedPrefixesScopedList map entries
type PublicDelegatedPrefixesScopedListPairIterator ¶
type PublicDelegatedPrefixesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []PublicDelegatedPrefixesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
PublicDelegatedPrefixesScopedListPairIterator manages a stream of PublicDelegatedPrefixesScopedListPair.
func (*PublicDelegatedPrefixesScopedListPairIterator) All ¶
func (it *PublicDelegatedPrefixesScopedListPairIterator) All() iter.Seq2[PublicDelegatedPrefixesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PublicDelegatedPrefixesScopedListPairIterator) Next ¶
func (it *PublicDelegatedPrefixesScopedListPairIterator) Next() (PublicDelegatedPrefixesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*PublicDelegatedPrefixesScopedListPairIterator) PageInfo ¶
func (it *PublicDelegatedPrefixesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ReferenceIterator ¶
type ReferenceIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Reference, nextPageToken string, err error)
// contains filtered or unexported fields
}
ReferenceIterator manages a stream of *computepb.Reference.
func (*ReferenceIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ReferenceIterator) Next ¶
func (it *ReferenceIterator) Next() (*computepb.Reference, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ReferenceIterator) PageInfo ¶
func (it *ReferenceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RegionAutoscalersCallOptions ¶
type RegionAutoscalersCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
RegionAutoscalersCallOptions contains the retry settings for each method of RegionAutoscalersClient.
type RegionAutoscalersClient ¶
type RegionAutoscalersClient struct {
// The call options for this service.
CallOptions *RegionAutoscalersCallOptions
// contains filtered or unexported fields
}
RegionAutoscalersClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionAutoscalers API.
func NewRegionAutoscalersRESTClient ¶
func NewRegionAutoscalersRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionAutoscalersClient, error)
NewRegionAutoscalersRESTClient creates a new region autoscalers rest client.
The RegionAutoscalers API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionAutoscalersClient) Close ¶
func (c *RegionAutoscalersClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionAutoscalersClient) Connection
deprecated
func (c *RegionAutoscalersClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionAutoscalersClient) Delete ¶
func (c *RegionAutoscalersClient) Delete(ctx context.Context, req *computepb.DeleteRegionAutoscalerRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified autoscaler.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionAutoscalerRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionAutoscalersClient) Get ¶
func (c *RegionAutoscalersClient) Get(ctx context.Context, req *computepb.GetRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.Autoscaler, error)
Get returns the specified autoscaler.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionAutoscalerRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionAutoscalersClient) Insert ¶
func (c *RegionAutoscalersClient) Insert(ctx context.Context, req *computepb.InsertRegionAutoscalerRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an autoscaler in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionAutoscalerRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionAutoscalersClient) List ¶
func (c *RegionAutoscalersClient) List(ctx context.Context, req *computepb.ListRegionAutoscalersRequest, opts ...gax.CallOption) *AutoscalerIterator
List retrieves a list of autoscalers contained within the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionAutoscalersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionAutoscalersRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RegionAutoscalerList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionAutoscalersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionAutoscalersRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionAutoscalersClient) Patch ¶
func (c *RegionAutoscalersClient) Patch(ctx context.Context, req *computepb.PatchRegionAutoscalerRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates an autoscaler in the specified project using the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionAutoscalerRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionAutoscalersClient) TestIamPermissions ¶
func (c *RegionAutoscalersClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionAutoscalerRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionAutoscalersClient) Update ¶
func (c *RegionAutoscalersClient) Update(ctx context.Context, req *computepb.UpdateRegionAutoscalerRequest, opts ...gax.CallOption) (*Operation, error)
Update updates an autoscaler in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionAutoscalersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateRegionAutoscalerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateRegionAutoscalerRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type RegionBackendBucketsCallOptions ¶ added in v1.50.0
type RegionBackendBucketsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListUsable []gax.CallOption
Patch []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionBackendBucketsCallOptions contains the retry settings for each method of RegionBackendBucketsClient.
type RegionBackendBucketsClient ¶ added in v1.50.0
type RegionBackendBucketsClient struct {
// The call options for this service.
CallOptions *RegionBackendBucketsCallOptions
// contains filtered or unexported fields
}
RegionBackendBucketsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionBackendBuckets API.
func NewRegionBackendBucketsRESTClient ¶ added in v1.50.0
func NewRegionBackendBucketsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionBackendBucketsClient, error)
NewRegionBackendBucketsRESTClient creates a new region backend buckets rest client.
The RegionBackendBuckets API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionBackendBucketsClient) Close ¶ added in v1.50.0
func (c *RegionBackendBucketsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionBackendBucketsClient) Connection
deprecated
added in
v1.50.0
func (c *RegionBackendBucketsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionBackendBucketsClient) Delete ¶ added in v1.50.0
func (c *RegionBackendBucketsClient) Delete(ctx context.Context, req *computepb.DeleteRegionBackendBucketRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified regional BackendBucket resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionBackendBucketRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionBackendBucketsClient) Get ¶ added in v1.50.0
func (c *RegionBackendBucketsClient) Get(ctx context.Context, req *computepb.GetRegionBackendBucketRequest, opts ...gax.CallOption) (*computepb.BackendBucket, error)
Get returns the specified regional BackendBucket resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionBackendBucketRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionBackendBucketsClient) GetIamPolicy ¶ added in v1.50.0
func (c *RegionBackendBucketsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionBackendBucketRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyRegionBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyRegionBackendBucketRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionBackendBucketsClient) Insert ¶ added in v1.50.0
func (c *RegionBackendBucketsClient) Insert(ctx context.Context, req *computepb.InsertRegionBackendBucketRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a RegionBackendBucket in the specified project in the given scope using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionBackendBucketRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionBackendBucketsClient) List ¶ added in v1.50.0
func (c *RegionBackendBucketsClient) List(ctx context.Context, req *computepb.ListRegionBackendBucketsRequest, opts ...gax.CallOption) *BackendBucketIterator
List retrieves the list of BackendBucket resources available to the specified project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionBackendBucketsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionBackendBucketsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.BackendBucketList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionBackendBucketsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionBackendBucketsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionBackendBucketsClient) ListUsable ¶ added in v1.50.0
func (c *RegionBackendBucketsClient) ListUsable(ctx context.Context, req *computepb.ListUsableRegionBackendBucketsRequest, opts ...gax.CallOption) *BackendBucketIterator
ListUsable retrieves a list of all usable backend buckets in the specified project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUsableRegionBackendBucketsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUsableRegionBackendBucketsRequest.
}
it := c.ListUsable(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.BackendBucketListUsable)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUsableRegionBackendBucketsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUsableRegionBackendBucketsRequest.
}
for resp, err := range c.ListUsable(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionBackendBucketsClient) Patch ¶ added in v1.50.0
func (c *RegionBackendBucketsClient) Patch(ctx context.Context, req *computepb.PatchRegionBackendBucketRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified BackendBucket resource with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionBackendBucketRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionBackendBucketsClient) SetIamPolicy ¶ added in v1.50.0
func (c *RegionBackendBucketsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionBackendBucketRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyRegionBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyRegionBackendBucketRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionBackendBucketsClient) TestIamPermissions ¶ added in v1.50.0
func (c *RegionBackendBucketsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionBackendBucketRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendBucketsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionBackendBucketRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionBackendBucketRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionBackendServicesCallOptions ¶
type RegionBackendServicesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
GetHealth []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListUsable []gax.CallOption
Patch []gax.CallOption
SetIamPolicy []gax.CallOption
SetSecurityPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
RegionBackendServicesCallOptions contains the retry settings for each method of RegionBackendServicesClient.
type RegionBackendServicesClient ¶
type RegionBackendServicesClient struct {
// The call options for this service.
CallOptions *RegionBackendServicesCallOptions
// contains filtered or unexported fields
}
RegionBackendServicesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionBackendServices API.
func NewRegionBackendServicesRESTClient ¶
func NewRegionBackendServicesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionBackendServicesClient, error)
NewRegionBackendServicesRESTClient creates a new region backend services rest client.
The RegionBackendServices API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionBackendServicesClient) Close ¶
func (c *RegionBackendServicesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionBackendServicesClient) Connection
deprecated
func (c *RegionBackendServicesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionBackendServicesClient) Delete ¶
func (c *RegionBackendServicesClient) Delete(ctx context.Context, req *computepb.DeleteRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified regional BackendService resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionBackendServiceRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionBackendServicesClient) Get ¶
func (c *RegionBackendServicesClient) Get(ctx context.Context, req *computepb.GetRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendService, error)
Get returns the specified regional BackendService resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionBackendServiceRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionBackendServicesClient) GetHealth ¶
func (c *RegionBackendServicesClient) GetHealth(ctx context.Context, req *computepb.GetHealthRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendServiceGroupHealth, error)
GetHealth gets the most recent health check results for this regional BackendService.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetHealthRegionBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetHealthRegionBackendServiceRequest.
}
resp, err := c.GetHealth(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionBackendServicesClient) GetIamPolicy ¶
func (c *RegionBackendServicesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyRegionBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyRegionBackendServiceRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionBackendServicesClient) Insert ¶
func (c *RegionBackendServicesClient) Insert(ctx context.Context, req *computepb.InsertRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionBackendServiceRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionBackendServicesClient) List ¶
func (c *RegionBackendServicesClient) List(ctx context.Context, req *computepb.ListRegionBackendServicesRequest, opts ...gax.CallOption) *BackendServiceIterator
List retrieves the list of regional BackendService resources available to the specified project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionBackendServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionBackendServicesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.BackendServiceList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionBackendServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionBackendServicesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionBackendServicesClient) ListUsable ¶
func (c *RegionBackendServicesClient) ListUsable(ctx context.Context, req *computepb.ListUsableRegionBackendServicesRequest, opts ...gax.CallOption) *BackendServiceIterator
ListUsable retrieves a list of all usable backend services in the specified project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUsableRegionBackendServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUsableRegionBackendServicesRequest.
}
it := c.ListUsable(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.BackendServiceListUsable)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUsableRegionBackendServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUsableRegionBackendServicesRequest.
}
for resp, err := range c.ListUsable(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionBackendServicesClient) Patch ¶
func (c *RegionBackendServicesClient) Patch(ctx context.Context, req *computepb.PatchRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified regional BackendService resource with the data included in the request. For more information, see Understanding backend services This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionBackendServiceRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionBackendServicesClient) SetIamPolicy ¶
func (c *RegionBackendServicesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyRegionBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyRegionBackendServiceRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionBackendServicesClient) SetSecurityPolicy ¶
func (c *RegionBackendServicesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
SetSecurityPolicy sets the Google Cloud Armor security policy for the specified backend service. For more information, seeGoogle Cloud Armor Overview
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSecurityPolicyRegionBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetSecurityPolicyRegionBackendServiceRequest.
}
op, err := c.SetSecurityPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionBackendServicesClient) TestIamPermissions ¶
func (c *RegionBackendServicesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionBackendServiceRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionBackendServicesClient) Update ¶
func (c *RegionBackendServicesClient) Update(ctx context.Context, req *computepb.UpdateRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error)
Update updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionBackendServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateRegionBackendServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateRegionBackendServiceRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type RegionCommitmentsCallOptions ¶
type RegionCommitmentsCallOptions struct {
AggregatedList []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
UpdateReservations []gax.CallOption
}
RegionCommitmentsCallOptions contains the retry settings for each method of RegionCommitmentsClient.
type RegionCommitmentsClient ¶
type RegionCommitmentsClient struct {
// The call options for this service.
CallOptions *RegionCommitmentsCallOptions
// contains filtered or unexported fields
}
RegionCommitmentsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionCommitments API.
func NewRegionCommitmentsRESTClient ¶
func NewRegionCommitmentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionCommitmentsClient, error)
NewRegionCommitmentsRESTClient creates a new region commitments rest client.
The RegionCommitments API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCommitmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionCommitmentsClient) AggregatedList ¶
func (c *RegionCommitmentsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRegionCommitmentsRequest, opts ...gax.CallOption) *CommitmentsScopedListPairIterator
AggregatedList retrieves an aggregated list of commitments by region.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCommitmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRegionCommitmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRegionCommitmentsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.CommitmentAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCommitmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRegionCommitmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRegionCommitmentsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionCommitmentsClient) Close ¶
func (c *RegionCommitmentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionCommitmentsClient) Connection
deprecated
func (c *RegionCommitmentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionCommitmentsClient) Get ¶
func (c *RegionCommitmentsClient) Get(ctx context.Context, req *computepb.GetRegionCommitmentRequest, opts ...gax.CallOption) (*computepb.Commitment, error)
Get returns the specified commitment resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCommitmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionCommitmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionCommitmentRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionCommitmentsClient) Insert ¶
func (c *RegionCommitmentsClient) Insert(ctx context.Context, req *computepb.InsertRegionCommitmentRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a commitment in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCommitmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionCommitmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionCommitmentRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionCommitmentsClient) List ¶
func (c *RegionCommitmentsClient) List(ctx context.Context, req *computepb.ListRegionCommitmentsRequest, opts ...gax.CallOption) *CommitmentIterator
List retrieves a list of commitments contained within the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCommitmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionCommitmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionCommitmentsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.CommitmentList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCommitmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionCommitmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionCommitmentsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionCommitmentsClient) TestIamPermissions ¶
func (c *RegionCommitmentsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionCommitmentRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCommitmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionCommitmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionCommitmentRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionCommitmentsClient) Update ¶
func (c *RegionCommitmentsClient) Update(ctx context.Context, req *computepb.UpdateRegionCommitmentRequest, opts ...gax.CallOption) (*Operation, error)
Update updates the specified commitment with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be updated: auto_renew and plan.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCommitmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateRegionCommitmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateRegionCommitmentRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionCommitmentsClient) UpdateReservations ¶
func (c *RegionCommitmentsClient) UpdateReservations(ctx context.Context, req *computepb.UpdateReservationsRegionCommitmentRequest, opts ...gax.CallOption) (*Operation, error)
UpdateReservations transfers GPUs or Local SSD disks between reservations that are attached to the same commitment.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCommitmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateReservationsRegionCommitmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateReservationsRegionCommitmentRequest.
}
op, err := c.UpdateReservations(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type RegionCompositeHealthChecksCallOptions ¶ added in v1.50.0
type RegionCompositeHealthChecksCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionCompositeHealthChecksCallOptions contains the retry settings for each method of RegionCompositeHealthChecksClient.
type RegionCompositeHealthChecksClient ¶ added in v1.50.0
type RegionCompositeHealthChecksClient struct {
// The call options for this service.
CallOptions *RegionCompositeHealthChecksCallOptions
// contains filtered or unexported fields
}
RegionCompositeHealthChecksClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionCompositeHealthChecks API.
func NewRegionCompositeHealthChecksRESTClient ¶ added in v1.50.0
func NewRegionCompositeHealthChecksRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionCompositeHealthChecksClient, error)
NewRegionCompositeHealthChecksRESTClient creates a new region composite health checks rest client.
The RegionCompositeHealthChecks API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCompositeHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionCompositeHealthChecksClient) AggregatedList ¶ added in v1.50.0
func (c *RegionCompositeHealthChecksClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRegionCompositeHealthChecksRequest, opts ...gax.CallOption) *CompositeHealthChecksScopedListPairIterator
AggregatedList retrieves the list of all CompositeHealthCheck resources (all regional) available to the specified project.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCompositeHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRegionCompositeHealthChecksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRegionCompositeHealthChecksRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.CompositeHealthCheckAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCompositeHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRegionCompositeHealthChecksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRegionCompositeHealthChecksRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionCompositeHealthChecksClient) Close ¶ added in v1.50.0
func (c *RegionCompositeHealthChecksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionCompositeHealthChecksClient) Connection
deprecated
added in
v1.50.0
func (c *RegionCompositeHealthChecksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionCompositeHealthChecksClient) Delete ¶ added in v1.50.0
func (c *RegionCompositeHealthChecksClient) Delete(ctx context.Context, req *computepb.DeleteRegionCompositeHealthCheckRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified CompositeHealthCheck in the given region
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCompositeHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionCompositeHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionCompositeHealthCheckRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionCompositeHealthChecksClient) Get ¶ added in v1.50.0
func (c *RegionCompositeHealthChecksClient) Get(ctx context.Context, req *computepb.GetRegionCompositeHealthCheckRequest, opts ...gax.CallOption) (*computepb.CompositeHealthCheck, error)
Get returns the specified CompositeHealthCheck resource in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCompositeHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionCompositeHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionCompositeHealthCheckRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionCompositeHealthChecksClient) Insert ¶ added in v1.50.0
func (c *RegionCompositeHealthChecksClient) Insert(ctx context.Context, req *computepb.InsertRegionCompositeHealthCheckRequest, opts ...gax.CallOption) (*Operation, error)
Insert create a CompositeHealthCheck in the specified project in the given region using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCompositeHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionCompositeHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionCompositeHealthCheckRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionCompositeHealthChecksClient) List ¶ added in v1.50.0
func (c *RegionCompositeHealthChecksClient) List(ctx context.Context, req *computepb.ListRegionCompositeHealthChecksRequest, opts ...gax.CallOption) *CompositeHealthCheckIterator
List lists the CompositeHealthChecks for a project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCompositeHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionCompositeHealthChecksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionCompositeHealthChecksRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.CompositeHealthCheckList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCompositeHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionCompositeHealthChecksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionCompositeHealthChecksRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionCompositeHealthChecksClient) Patch ¶ added in v1.50.0
func (c *RegionCompositeHealthChecksClient) Patch(ctx context.Context, req *computepb.PatchRegionCompositeHealthCheckRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified regional CompositeHealthCheck resource with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCompositeHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionCompositeHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionCompositeHealthCheckRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionCompositeHealthChecksClient) TestIamPermissions ¶ added in v1.50.0
func (c *RegionCompositeHealthChecksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionCompositeHealthCheckRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionCompositeHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionCompositeHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionCompositeHealthCheckRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionDiskSettingsCallOptions ¶
type RegionDiskSettingsCallOptions struct {
Get []gax.CallOption
Patch []gax.CallOption
}
RegionDiskSettingsCallOptions contains the retry settings for each method of RegionDiskSettingsClient.
type RegionDiskSettingsClient ¶
type RegionDiskSettingsClient struct {
// The call options for this service.
CallOptions *RegionDiskSettingsCallOptions
// contains filtered or unexported fields
}
RegionDiskSettingsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionDiskSettings API.
func NewRegionDiskSettingsRESTClient ¶
func NewRegionDiskSettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionDiskSettingsClient, error)
NewRegionDiskSettingsRESTClient creates a new region disk settings rest client.
The RegionDiskSettings API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDiskSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionDiskSettingsClient) Close ¶
func (c *RegionDiskSettingsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionDiskSettingsClient) Connection
deprecated
func (c *RegionDiskSettingsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionDiskSettingsClient) Get ¶
func (c *RegionDiskSettingsClient) Get(ctx context.Context, req *computepb.GetRegionDiskSettingRequest, opts ...gax.CallOption) (*computepb.DiskSettings, error)
Get get Regional Disk Settings.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDiskSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionDiskSettingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionDiskSettingRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionDiskSettingsClient) Patch ¶
func (c *RegionDiskSettingsClient) Patch(ctx context.Context, req *computepb.PatchRegionDiskSettingRequest, opts ...gax.CallOption) (*Operation, error)
Patch patch Regional Disk Settings
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDiskSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionDiskSettingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionDiskSettingRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type RegionDiskTypesCallOptions ¶
type RegionDiskTypesCallOptions struct {
Get []gax.CallOption
List []gax.CallOption
}
RegionDiskTypesCallOptions contains the retry settings for each method of RegionDiskTypesClient.
type RegionDiskTypesClient ¶
type RegionDiskTypesClient struct {
// The call options for this service.
CallOptions *RegionDiskTypesCallOptions
// contains filtered or unexported fields
}
RegionDiskTypesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionDiskTypes API.
func NewRegionDiskTypesRESTClient ¶
func NewRegionDiskTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionDiskTypesClient, error)
NewRegionDiskTypesRESTClient creates a new region disk types rest client.
The RegionDiskTypes API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDiskTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionDiskTypesClient) Close ¶
func (c *RegionDiskTypesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionDiskTypesClient) Connection
deprecated
func (c *RegionDiskTypesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionDiskTypesClient) Get ¶
func (c *RegionDiskTypesClient) Get(ctx context.Context, req *computepb.GetRegionDiskTypeRequest, opts ...gax.CallOption) (*computepb.DiskType, error)
Get returns the specified regional disk type.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDiskTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionDiskTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionDiskTypeRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionDiskTypesClient) List ¶
func (c *RegionDiskTypesClient) List(ctx context.Context, req *computepb.ListRegionDiskTypesRequest, opts ...gax.CallOption) *DiskTypeIterator
List retrieves a list of regional disk types available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDiskTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionDiskTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionDiskTypesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RegionDiskTypeList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDiskTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionDiskTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionDiskTypesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type RegionDisksCallOptions ¶
type RegionDisksCallOptions struct {
AddResourcePolicies []gax.CallOption
BulkInsert []gax.CallOption
CreateSnapshot []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
RemoveResourcePolicies []gax.CallOption
Resize []gax.CallOption
SetIamPolicy []gax.CallOption
SetLabels []gax.CallOption
StartAsyncReplication []gax.CallOption
StopAsyncReplication []gax.CallOption
StopGroupAsyncReplication []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
RegionDisksCallOptions contains the retry settings for each method of RegionDisksClient.
type RegionDisksClient ¶
type RegionDisksClient struct {
// The call options for this service.
CallOptions *RegionDisksCallOptions
// contains filtered or unexported fields
}
RegionDisksClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionDisks API.
func NewRegionDisksRESTClient ¶
func NewRegionDisksRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionDisksClient, error)
NewRegionDisksRESTClient creates a new region disks rest client.
The RegionDisks API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionDisksClient) AddResourcePolicies ¶
func (c *RegionDisksClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
AddResourcePolicies adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddResourcePoliciesRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddResourcePoliciesRegionDiskRequest.
}
op, err := c.AddResourcePolicies(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionDisksClient) BulkInsert ¶
func (c *RegionDisksClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
BulkInsert bulk create a set of disks.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.BulkInsertRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#BulkInsertRegionDiskRequest.
}
op, err := c.BulkInsert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionDisksClient) Close ¶
func (c *RegionDisksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionDisksClient) Connection
deprecated
func (c *RegionDisksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionDisksClient) CreateSnapshot ¶
func (c *RegionDisksClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
CreateSnapshot creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CreateSnapshotRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CreateSnapshotRegionDiskRequest.
}
op, err := c.CreateSnapshot(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionDisksClient) Delete ¶
func (c *RegionDisksClient) Delete(ctx context.Context, req *computepb.DeleteRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete anysnapshots previously made from the disk. You must separatelydelete snapshots.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionDiskRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionDisksClient) Get ¶
func (c *RegionDisksClient) Get(ctx context.Context, req *computepb.GetRegionDiskRequest, opts ...gax.CallOption) (*computepb.Disk, error)
Get returns a specified regional persistent disk.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionDiskRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionDisksClient) GetIamPolicy ¶
func (c *RegionDisksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyRegionDiskRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionDisksClient) Insert ¶
func (c *RegionDisksClient) Insert(ctx context.Context, req *computepb.InsertRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a persistent regional disk in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionDiskRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionDisksClient) List ¶
func (c *RegionDisksClient) List(ctx context.Context, req *computepb.ListRegionDisksRequest, opts ...gax.CallOption) *DiskIterator
List retrieves the list of persistent disks contained within the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionDisksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionDisksRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.DiskList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionDisksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionDisksRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionDisksClient) RemoveResourcePolicies ¶
func (c *RegionDisksClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
RemoveResourcePolicies removes resource policies from a regional disk.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveResourcePoliciesRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveResourcePoliciesRegionDiskRequest.
}
op, err := c.RemoveResourcePolicies(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionDisksClient) Resize ¶
func (c *RegionDisksClient) Resize(ctx context.Context, req *computepb.ResizeRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
Resize resizes the specified regional persistent disk.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResizeRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ResizeRegionDiskRequest.
}
op, err := c.Resize(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionDisksClient) SetIamPolicy ¶
func (c *RegionDisksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyRegionDiskRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionDisksClient) SetLabels ¶
func (c *RegionDisksClient) SetLabels(ctx context.Context, req *computepb.SetLabelsRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on the target regional disk.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsRegionDiskRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionDisksClient) StartAsyncReplication ¶
func (c *RegionDisksClient) StartAsyncReplication(ctx context.Context, req *computepb.StartAsyncReplicationRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
StartAsyncReplication starts asynchronous replication. Must be invoked on the primary disk.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StartAsyncReplicationRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StartAsyncReplicationRegionDiskRequest.
}
op, err := c.StartAsyncReplication(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionDisksClient) StopAsyncReplication ¶
func (c *RegionDisksClient) StopAsyncReplication(ctx context.Context, req *computepb.StopAsyncReplicationRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
StopAsyncReplication stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StopAsyncReplicationRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StopAsyncReplicationRegionDiskRequest.
}
op, err := c.StopAsyncReplication(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionDisksClient) StopGroupAsyncReplication ¶
func (c *RegionDisksClient) StopGroupAsyncReplication(ctx context.Context, req *computepb.StopGroupAsyncReplicationRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
StopGroupAsyncReplication stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StopGroupAsyncReplicationRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StopGroupAsyncReplicationRegionDiskRequest.
}
op, err := c.StopGroupAsyncReplication(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionDisksClient) TestIamPermissions ¶
func (c *RegionDisksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionDiskRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionDiskRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionDisksClient) Update ¶
func (c *RegionDisksClient) Update(ctx context.Context, req *computepb.UpdateRegionDiskRequest, opts ...gax.CallOption) (*Operation, error)
Update update the specified disk with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateRegionDiskRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateRegionDiskRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type RegionHealthAggregationPoliciesCallOptions ¶ added in v1.50.0
type RegionHealthAggregationPoliciesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionHealthAggregationPoliciesCallOptions contains the retry settings for each method of RegionHealthAggregationPoliciesClient.
type RegionHealthAggregationPoliciesClient ¶ added in v1.50.0
type RegionHealthAggregationPoliciesClient struct {
// The call options for this service.
CallOptions *RegionHealthAggregationPoliciesCallOptions
// contains filtered or unexported fields
}
RegionHealthAggregationPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionHealthAggregationPolicies API.
func NewRegionHealthAggregationPoliciesRESTClient ¶ added in v1.50.0
func NewRegionHealthAggregationPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionHealthAggregationPoliciesClient, error)
NewRegionHealthAggregationPoliciesRESTClient creates a new region health aggregation policies rest client.
The RegionHealthAggregationPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthAggregationPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionHealthAggregationPoliciesClient) AggregatedList ¶ added in v1.50.0
func (c *RegionHealthAggregationPoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRegionHealthAggregationPoliciesRequest, opts ...gax.CallOption) *HealthAggregationPoliciesScopedListPairIterator
AggregatedList retrieves the list of all HealthAggregationPolicy resources, regional and global, available to the specified project.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthAggregationPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRegionHealthAggregationPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRegionHealthAggregationPoliciesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.HealthAggregationPolicyAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthAggregationPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRegionHealthAggregationPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRegionHealthAggregationPoliciesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionHealthAggregationPoliciesClient) Close ¶ added in v1.50.0
func (c *RegionHealthAggregationPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionHealthAggregationPoliciesClient) Connection
deprecated
added in
v1.50.0
func (c *RegionHealthAggregationPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionHealthAggregationPoliciesClient) Delete ¶ added in v1.50.0
func (c *RegionHealthAggregationPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthAggregationPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified HealthAggregationPolicy in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthAggregationPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionHealthAggregationPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionHealthAggregationPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthAggregationPoliciesClient) Get ¶ added in v1.50.0
func (c *RegionHealthAggregationPoliciesClient) Get(ctx context.Context, req *computepb.GetRegionHealthAggregationPolicyRequest, opts ...gax.CallOption) (*computepb.HealthAggregationPolicy, error)
Get returns the specified HealthAggregationPolicy resource in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthAggregationPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionHealthAggregationPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionHealthAggregationPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionHealthAggregationPoliciesClient) Insert ¶ added in v1.50.0
func (c *RegionHealthAggregationPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthAggregationPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert create a HealthAggregationPolicy in the specified project in the given region using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthAggregationPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionHealthAggregationPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionHealthAggregationPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthAggregationPoliciesClient) List ¶ added in v1.50.0
func (c *RegionHealthAggregationPoliciesClient) List(ctx context.Context, req *computepb.ListRegionHealthAggregationPoliciesRequest, opts ...gax.CallOption) *HealthAggregationPolicyIterator
List lists the HealthAggregationPolicies for a project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthAggregationPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionHealthAggregationPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionHealthAggregationPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.HealthAggregationPolicyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthAggregationPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionHealthAggregationPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionHealthAggregationPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionHealthAggregationPoliciesClient) Patch ¶ added in v1.50.0
func (c *RegionHealthAggregationPoliciesClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthAggregationPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified regional HealthAggregationPolicy resource with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthAggregationPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionHealthAggregationPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionHealthAggregationPolicyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthAggregationPoliciesClient) TestIamPermissions ¶ added in v1.50.0
func (c *RegionHealthAggregationPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionHealthAggregationPolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthAggregationPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionHealthAggregationPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionHealthAggregationPolicyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionHealthCheckServicesCallOptions ¶
type RegionHealthCheckServicesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionHealthCheckServicesCallOptions contains the retry settings for each method of RegionHealthCheckServicesClient.
type RegionHealthCheckServicesClient ¶
type RegionHealthCheckServicesClient struct {
// The call options for this service.
CallOptions *RegionHealthCheckServicesCallOptions
// contains filtered or unexported fields
}
RegionHealthCheckServicesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionHealthCheckServices API.
func NewRegionHealthCheckServicesRESTClient ¶
func NewRegionHealthCheckServicesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionHealthCheckServicesClient, error)
NewRegionHealthCheckServicesRESTClient creates a new region health check services rest client.
The RegionHealthCheckServices API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionHealthCheckServicesClient) Close ¶
func (c *RegionHealthCheckServicesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionHealthCheckServicesClient) Connection
deprecated
func (c *RegionHealthCheckServicesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionHealthCheckServicesClient) Delete ¶
func (c *RegionHealthCheckServicesClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified regional HealthCheckService.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionHealthCheckServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionHealthCheckServiceRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthCheckServicesClient) Get ¶
func (c *RegionHealthCheckServicesClient) Get(ctx context.Context, req *computepb.GetRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*computepb.HealthCheckService, error)
Get returns the specified regional HealthCheckService resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionHealthCheckServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionHealthCheckServiceRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionHealthCheckServicesClient) Insert ¶
func (c *RegionHealthCheckServicesClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a regional HealthCheckService resource in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionHealthCheckServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionHealthCheckServiceRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthCheckServicesClient) List ¶
func (c *RegionHealthCheckServicesClient) List(ctx context.Context, req *computepb.ListRegionHealthCheckServicesRequest, opts ...gax.CallOption) *HealthCheckServiceIterator
List lists all the HealthCheckService resources that have been configured for the specified project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionHealthCheckServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionHealthCheckServicesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.HealthCheckServicesList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionHealthCheckServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionHealthCheckServicesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionHealthCheckServicesClient) Patch ¶
func (c *RegionHealthCheckServicesClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified regional HealthCheckService resource with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionHealthCheckServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionHealthCheckServiceRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthCheckServicesClient) TestIamPermissions ¶
func (c *RegionHealthCheckServicesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionHealthCheckServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionHealthCheckServiceRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionHealthChecksCallOptions ¶
type RegionHealthChecksCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
RegionHealthChecksCallOptions contains the retry settings for each method of RegionHealthChecksClient.
type RegionHealthChecksClient ¶
type RegionHealthChecksClient struct {
// The call options for this service.
CallOptions *RegionHealthChecksCallOptions
// contains filtered or unexported fields
}
RegionHealthChecksClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionHealthChecks API.
func NewRegionHealthChecksRESTClient ¶
func NewRegionHealthChecksRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionHealthChecksClient, error)
NewRegionHealthChecksRESTClient creates a new region health checks rest client.
The RegionHealthChecks API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionHealthChecksClient) Close ¶
func (c *RegionHealthChecksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionHealthChecksClient) Connection
deprecated
func (c *RegionHealthChecksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionHealthChecksClient) Delete ¶
func (c *RegionHealthChecksClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthCheckRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified HealthCheck resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionHealthCheckRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthChecksClient) Get ¶
func (c *RegionHealthChecksClient) Get(ctx context.Context, req *computepb.GetRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.HealthCheck, error)
Get returns the specified HealthCheck resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionHealthCheckRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionHealthChecksClient) Insert ¶
func (c *RegionHealthChecksClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthCheckRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a HealthCheck resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionHealthCheckRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthChecksClient) List ¶
func (c *RegionHealthChecksClient) List(ctx context.Context, req *computepb.ListRegionHealthChecksRequest, opts ...gax.CallOption) *HealthCheckIterator
List retrieves the list of HealthCheck resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionHealthChecksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionHealthChecksRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.HealthCheckList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionHealthChecksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionHealthChecksRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionHealthChecksClient) Patch ¶
func (c *RegionHealthChecksClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthCheckRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates a HealthCheck resource in the specified project using the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionHealthCheckRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthChecksClient) TestIamPermissions ¶
func (c *RegionHealthChecksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionHealthCheckRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionHealthChecksClient) Update ¶
func (c *RegionHealthChecksClient) Update(ctx context.Context, req *computepb.UpdateRegionHealthCheckRequest, opts ...gax.CallOption) (*Operation, error)
Update updates a HealthCheck resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthChecksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateRegionHealthCheckRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateRegionHealthCheckRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type RegionHealthSourcesCallOptions ¶ added in v1.49.0
type RegionHealthSourcesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionHealthSourcesCallOptions contains the retry settings for each method of RegionHealthSourcesClient.
type RegionHealthSourcesClient ¶ added in v1.49.0
type RegionHealthSourcesClient struct {
// The call options for this service.
CallOptions *RegionHealthSourcesCallOptions
// contains filtered or unexported fields
}
RegionHealthSourcesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionHealthSources API.
func NewRegionHealthSourcesRESTClient ¶ added in v1.49.0
func NewRegionHealthSourcesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionHealthSourcesClient, error)
NewRegionHealthSourcesRESTClient creates a new region health sources rest client.
The RegionHealthSources API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthSourcesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionHealthSourcesClient) AggregatedList ¶ added in v1.49.0
func (c *RegionHealthSourcesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRegionHealthSourcesRequest, opts ...gax.CallOption) *HealthSourcesScopedListPairIterator
AggregatedList retrieves the list of all HealthSource resources (all regional) available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthSourcesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRegionHealthSourcesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRegionHealthSourcesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.HealthSourceAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthSourcesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRegionHealthSourcesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRegionHealthSourcesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionHealthSourcesClient) Close ¶ added in v1.49.0
func (c *RegionHealthSourcesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionHealthSourcesClient) Connection
deprecated
added in
v1.49.0
func (c *RegionHealthSourcesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionHealthSourcesClient) Delete ¶ added in v1.49.0
func (c *RegionHealthSourcesClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthSourceRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified HealthSource in the given region
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthSourcesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionHealthSourceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionHealthSourceRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthSourcesClient) Get ¶ added in v1.49.0
func (c *RegionHealthSourcesClient) Get(ctx context.Context, req *computepb.GetRegionHealthSourceRequest, opts ...gax.CallOption) (*computepb.HealthSource, error)
Get returns the specified HealthSource resource in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthSourcesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionHealthSourceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionHealthSourceRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionHealthSourcesClient) Insert ¶ added in v1.49.0
func (c *RegionHealthSourcesClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthSourceRequest, opts ...gax.CallOption) (*Operation, error)
Insert create a HealthSource in the specified project in the given region using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthSourcesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionHealthSourceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionHealthSourceRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthSourcesClient) List ¶ added in v1.49.0
func (c *RegionHealthSourcesClient) List(ctx context.Context, req *computepb.ListRegionHealthSourcesRequest, opts ...gax.CallOption) *HealthSourceIterator
List lists the HealthSources for a project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthSourcesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionHealthSourcesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionHealthSourcesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.HealthSourceList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthSourcesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionHealthSourcesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionHealthSourcesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionHealthSourcesClient) Patch ¶ added in v1.49.0
func (c *RegionHealthSourcesClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthSourceRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified regional HealthSource resource with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthSourcesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionHealthSourceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionHealthSourceRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionHealthSourcesClient) TestIamPermissions ¶ added in v1.49.0
func (c *RegionHealthSourcesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionHealthSourceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionHealthSourcesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionHealthSourceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionHealthSourceRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionInstanceGroupManagerResizeRequestsCallOptions ¶
type RegionInstanceGroupManagerResizeRequestsCallOptions struct {
Cancel []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
}
RegionInstanceGroupManagerResizeRequestsCallOptions contains the retry settings for each method of RegionInstanceGroupManagerResizeRequestsClient.
type RegionInstanceGroupManagerResizeRequestsClient ¶
type RegionInstanceGroupManagerResizeRequestsClient struct {
// The call options for this service.
CallOptions *RegionInstanceGroupManagerResizeRequestsCallOptions
// contains filtered or unexported fields
}
RegionInstanceGroupManagerResizeRequestsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionInstanceGroupManagerResizeRequests API.
func NewRegionInstanceGroupManagerResizeRequestsRESTClient ¶
func NewRegionInstanceGroupManagerResizeRequestsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionInstanceGroupManagerResizeRequestsClient, error)
NewRegionInstanceGroupManagerResizeRequestsRESTClient creates a new region instance group manager resize requests rest client.
The RegionInstanceGroupManagerResizeRequests API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionInstanceGroupManagerResizeRequestsClient) Cancel ¶
func (c *RegionInstanceGroupManagerResizeRequestsClient) Cancel(ctx context.Context, req *computepb.CancelRegionInstanceGroupManagerResizeRequestRequest, opts ...gax.CallOption) (*Operation, error)
Cancel cancels the specified resize request. Cancelled resize request no longer waits for the resources to be provisioned. Cancel is only possible for requests that are in accepted state.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CancelRegionInstanceGroupManagerResizeRequestRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CancelRegionInstanceGroupManagerResizeRequestRequest.
}
op, err := c.Cancel(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagerResizeRequestsClient) Close ¶
func (c *RegionInstanceGroupManagerResizeRequestsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionInstanceGroupManagerResizeRequestsClient) Connection
deprecated
func (c *RegionInstanceGroupManagerResizeRequestsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionInstanceGroupManagerResizeRequestsClient) Delete ¶
func (c *RegionInstanceGroupManagerResizeRequestsClient) Delete(ctx context.Context, req *computepb.DeleteRegionInstanceGroupManagerResizeRequestRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified, inactive resize request. Requests that are still active cannot be deleted. Deleting request does not delete instances that were provisioned previously.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionInstanceGroupManagerResizeRequestRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionInstanceGroupManagerResizeRequestRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagerResizeRequestsClient) Get ¶
func (c *RegionInstanceGroupManagerResizeRequestsClient) Get(ctx context.Context, req *computepb.GetRegionInstanceGroupManagerResizeRequestRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagerResizeRequest, error)
Get returns all of the details about the specified resize request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionInstanceGroupManagerResizeRequestRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionInstanceGroupManagerResizeRequestRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionInstanceGroupManagerResizeRequestsClient) Insert ¶
func (c *RegionInstanceGroupManagerResizeRequestsClient) Insert(ctx context.Context, req *computepb.InsertRegionInstanceGroupManagerResizeRequestRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new Resize Request that starts provisioning VMs immediately or queues VM creation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionInstanceGroupManagerResizeRequestRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionInstanceGroupManagerResizeRequestRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagerResizeRequestsClient) List ¶
func (c *RegionInstanceGroupManagerResizeRequestsClient) List(ctx context.Context, req *computepb.ListRegionInstanceGroupManagerResizeRequestsRequest, opts ...gax.CallOption) *InstanceGroupManagerResizeRequestIterator
List retrieves a list of Resize Requests that are contained in the managed instance group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstanceGroupManagerResizeRequestsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstanceGroupManagerResizeRequestsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RegionInstanceGroupManagerResizeRequestsListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagerResizeRequestsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstanceGroupManagerResizeRequestsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstanceGroupManagerResizeRequestsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type RegionInstanceGroupManagersCallOptions ¶
type RegionInstanceGroupManagersCallOptions struct {
AbandonInstances []gax.CallOption
AdoptInstances []gax.CallOption
ApplyUpdatesToInstances []gax.CallOption
CreateInstances []gax.CallOption
Delete []gax.CallOption
DeleteInstances []gax.CallOption
DeletePerInstanceConfigs []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListErrors []gax.CallOption
ListManagedInstances []gax.CallOption
ListPerInstanceConfigs []gax.CallOption
Patch []gax.CallOption
PatchPerInstanceConfigs []gax.CallOption
RecreateInstances []gax.CallOption
Resize []gax.CallOption
ResizeAdvanced []gax.CallOption
ResumeInstances []gax.CallOption
SetAutoHealingPolicies []gax.CallOption
SetInstanceTemplate []gax.CallOption
SetTargetPools []gax.CallOption
StartInstances []gax.CallOption
StopInstances []gax.CallOption
SuspendInstances []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
UpdatePerInstanceConfigs []gax.CallOption
}
RegionInstanceGroupManagersCallOptions contains the retry settings for each method of RegionInstanceGroupManagersClient.
type RegionInstanceGroupManagersClient ¶
type RegionInstanceGroupManagersClient struct {
// The call options for this service.
CallOptions *RegionInstanceGroupManagersCallOptions
// contains filtered or unexported fields
}
RegionInstanceGroupManagersClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionInstanceGroupManagers API.
func NewRegionInstanceGroupManagersRESTClient ¶
func NewRegionInstanceGroupManagersRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionInstanceGroupManagersClient, error)
NewRegionInstanceGroupManagersRESTClient creates a new region instance group managers rest client.
The RegionInstanceGroupManagers API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionInstanceGroupManagersClient) AbandonInstances ¶
func (c *RegionInstanceGroupManagersClient) AbandonInstances(ctx context.Context, req *computepb.AbandonInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
AbandonInstances flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with thelistmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AbandonInstancesRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AbandonInstancesRegionInstanceGroupManagerRequest.
}
op, err := c.AbandonInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) AdoptInstances ¶ added in v1.52.0
func (c *RegionInstanceGroupManagersClient) AdoptInstances(ctx context.Context, req *computepb.AdoptInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
AdoptInstances flags the specified instances to be adopted to the managed instance group. Adopting an instance does not change the instance status, but it adds the instance to any target pools that are applied by the managed instance group. This method increases the targetSize of the managed instance group by the number of instances that you adopt. This operation is marked as DONE when the action is scheduled even if the instances have not been adopted to the group yet. You must separately verify the status of the adopting action with the listManagedInstances method.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AdoptInstancesRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AdoptInstancesRegionInstanceGroupManagerRequest.
}
op, err := c.AdoptInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) ApplyUpdatesToInstances ¶
func (c *RegionInstanceGroupManagersClient) ApplyUpdatesToInstances(ctx context.Context, req *computepb.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
ApplyUpdatesToInstances apply updates to selected instances the managed instance group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.
}
op, err := c.ApplyUpdatesToInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) Close ¶
func (c *RegionInstanceGroupManagersClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionInstanceGroupManagersClient) Connection
deprecated
func (c *RegionInstanceGroupManagersClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionInstanceGroupManagersClient) CreateInstances ¶
func (c *RegionInstanceGroupManagersClient) CreateInstances(ctx context.Context, req *computepb.CreateInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
CreateInstances creates instances with per-instance configurations in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances method.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CreateInstancesRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CreateInstancesRegionInstanceGroupManagerRequest.
}
op, err := c.CreateInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) Delete ¶
func (c *RegionInstanceGroupManagersClient) Delete(ctx context.Context, req *computepb.DeleteRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified managed instance group and all of the instances in that group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionInstanceGroupManagerRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) DeleteInstances ¶
func (c *RegionInstanceGroupManagersClient) DeleteInstances(ctx context.Context, req *computepb.DeleteInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
DeleteInstances flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of thedeleting action with thelistmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteInstancesRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteInstancesRegionInstanceGroupManagerRequest.
}
op, err := c.DeleteInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) DeletePerInstanceConfigs ¶
func (c *RegionInstanceGroupManagersClient) DeletePerInstanceConfigs(ctx context.Context, req *computepb.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
DeletePerInstanceConfigs deletes selected per-instance configurations for the managed instance group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.
}
op, err := c.DeletePerInstanceConfigs(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) Get ¶
func (c *RegionInstanceGroupManagersClient) Get(ctx context.Context, req *computepb.GetRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManager, error)
Get returns all of the details about the specified managed instance group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionInstanceGroupManagerRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionInstanceGroupManagersClient) Insert ¶
func (c *RegionInstanceGroupManagersClient) Insert(ctx context.Context, req *computepb.InsertRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with thelistmanagedinstances method.
A regional managed instance group can contain up to 2000 instances.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionInstanceGroupManagerRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) List ¶
func (c *RegionInstanceGroupManagersClient) List(ctx context.Context, req *computepb.ListRegionInstanceGroupManagersRequest, opts ...gax.CallOption) *InstanceGroupManagerIterator
List retrieves the list of managed instance groups that are contained within the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstanceGroupManagersRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RegionInstanceGroupManagerList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstanceGroupManagersRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionInstanceGroupManagersClient) ListErrors ¶
func (c *RegionInstanceGroupManagersClient) ListErrors(ctx context.Context, req *computepb.ListErrorsRegionInstanceGroupManagersRequest, opts ...gax.CallOption) *InstanceManagedByIgmErrorIterator
ListErrors lists all errors thrown by actions on instances for a given regional managed instance group. The filter andorderBy query parameters are not supported.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListErrorsRegionInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListErrorsRegionInstanceGroupManagersRequest.
}
it := c.ListErrors(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RegionInstanceGroupManagersListErrorsResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListErrorsRegionInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListErrorsRegionInstanceGroupManagersRequest.
}
for resp, err := range c.ListErrors(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionInstanceGroupManagersClient) ListManagedInstances ¶
func (c *RegionInstanceGroupManagersClient) ListManagedInstances(ctx context.Context, req *computepb.ListManagedInstancesRegionInstanceGroupManagersRequest, opts ...gax.CallOption) *ManagedInstanceIterator
ListManagedInstances lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. The pageToken query parameter is supported only if the group’s listManagedInstancesResults field is set to PAGINATED.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListManagedInstancesRegionInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListManagedInstancesRegionInstanceGroupManagersRequest.
}
it := c.ListManagedInstances(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RegionInstanceGroupManagersListInstancesResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListManagedInstancesRegionInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListManagedInstancesRegionInstanceGroupManagersRequest.
}
for resp, err := range c.ListManagedInstances(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionInstanceGroupManagersClient) ListPerInstanceConfigs ¶
func (c *RegionInstanceGroupManagersClient) ListPerInstanceConfigs(ctx context.Context, req *computepb.ListPerInstanceConfigsRegionInstanceGroupManagersRequest, opts ...gax.CallOption) *PerInstanceConfigIterator
ListPerInstanceConfigs lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPerInstanceConfigsRegionInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPerInstanceConfigsRegionInstanceGroupManagersRequest.
}
it := c.ListPerInstanceConfigs(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RegionInstanceGroupManagersListInstanceConfigsResp)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPerInstanceConfigsRegionInstanceGroupManagersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPerInstanceConfigsRegionInstanceGroupManagersRequest.
}
for resp, err := range c.ListPerInstanceConfigs(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionInstanceGroupManagersClient) Patch ¶
func (c *RegionInstanceGroupManagersClient) Patch(ctx context.Context, req *computepb.PatchRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
If you update your group to specify a new template or instance configuration, it’s possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, seeUpdating instances in a MIG.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionInstanceGroupManagerRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) PatchPerInstanceConfigs ¶
func (c *RegionInstanceGroupManagersClient) PatchPerInstanceConfigs(ctx context.Context, req *computepb.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
PatchPerInstanceConfigs inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.
}
op, err := c.PatchPerInstanceConfigs(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) RecreateInstances ¶
func (c *RegionInstanceGroupManagersClient) RecreateInstances(ctx context.Context, req *computepb.RecreateInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
RecreateInstances flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group’s current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking the status of managed instances.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RecreateInstancesRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RecreateInstancesRegionInstanceGroupManagerRequest.
}
op, err := c.RecreateInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) Resize ¶
func (c *RegionInstanceGroupManagersClient) Resize(ctx context.Context, req *computepb.ResizeRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
Resize changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances.
The resize operation is marked DONE if theresize request is successful. The underlying actions take additional time. You must separately verify the status of thecreating or deleting actions with thelistmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResizeRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ResizeRegionInstanceGroupManagerRequest.
}
op, err := c.Resize(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) ResizeAdvanced ¶
func (c *RegionInstanceGroupManagersClient) ResizeAdvanced(ctx context.Context, req *computepb.ResizeAdvancedRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
ResizeAdvanced resizes the regional managed instance group with advanced configuration options like disabling creation retries. This is an extended version of theresize method.
If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances.
The resize operation is marked DONE if theresize request is successful. The underlying actions take additional time. You must separately verify the status of thecreating or deleting actions with the get orlistmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResizeAdvancedRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ResizeAdvancedRegionInstanceGroupManagerRequest.
}
op, err := c.ResizeAdvanced(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) ResumeInstances ¶
func (c *RegionInstanceGroupManagersClient) ResumeInstances(ctx context.Context, req *computepb.ResumeInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
ResumeInstances flags the specified instances in the managed instance group to be resumed. This method increases thetargetSize and decreases the targetSuspendedSize of the managed instance group by the number of instances that you resume. The resumeInstances operation is marked DONE if the resumeInstances request is successful. The underlying actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances method.
In this request, you can only specify instances that are suspended. For example, if an instance was previously suspended using the suspendInstances method, it can be resumed using the resumeInstances method.
If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are resumed.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResumeInstancesRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ResumeInstancesRegionInstanceGroupManagerRequest.
}
op, err := c.ResumeInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) SetAutoHealingPolicies ¶
func (c *RegionInstanceGroupManagersClient) SetAutoHealingPolicies(ctx context.Context, req *computepb.SetAutoHealingPoliciesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
SetAutoHealingPolicies modifies the autohealing policy for the instances in this managed instance group. [Deprecated] This method is deprecated. UseregionInstanceGroupManagers.patch instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetAutoHealingPoliciesRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetAutoHealingPoliciesRegionInstanceGroupManagerRequest.
}
op, err := c.SetAutoHealingPolicies(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) SetInstanceTemplate ¶
func (c *RegionInstanceGroupManagersClient) SetInstanceTemplate(ctx context.Context, req *computepb.SetInstanceTemplateRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
SetInstanceTemplate sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetInstanceTemplateRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetInstanceTemplateRegionInstanceGroupManagerRequest.
}
op, err := c.SetInstanceTemplate(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) SetTargetPools ¶
func (c *RegionInstanceGroupManagersClient) SetTargetPools(ctx context.Context, req *computepb.SetTargetPoolsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
SetTargetPools modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetTargetPoolsRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetTargetPoolsRegionInstanceGroupManagerRequest.
}
op, err := c.SetTargetPools(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) StartInstances ¶
func (c *RegionInstanceGroupManagersClient) StartInstances(ctx context.Context, req *computepb.StartInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
StartInstances flags the specified instances in the managed instance group to be started. This method increases thetargetSize and decreases the targetStoppedSize of the managed instance group by the number of instances that you start. The startInstances operation is marked DONE if the startInstances request is successful. The underlying actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances method.
In this request, you can only specify instances that are stopped. For example, if an instance was previously stopped using the stopInstances method, it can be started using the startInstances method.
If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are started.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StartInstancesRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StartInstancesRegionInstanceGroupManagerRequest.
}
op, err := c.StartInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) StopInstances ¶
func (c *RegionInstanceGroupManagersClient) StopInstances(ctx context.Context, req *computepb.StopInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
StopInstances flags the specified instances in the managed instance group to be immediately stopped. You can only specify instances that are running in this request. This method reduces thetargetSize and increases the targetStoppedSize of the managed instance group by the number of instances that you stop. The stopInstances operation is marked DONE if the stopInstances request is successful. The underlying actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances method.
If the standbyPolicy.initialDelaySec field is set, the group delays stopping the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there will be zero delay.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is stopped.
Stopped instances can be started using the startInstances method.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.StopInstancesRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#StopInstancesRegionInstanceGroupManagerRequest.
}
op, err := c.StopInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) SuspendInstances ¶
func (c *RegionInstanceGroupManagersClient) SuspendInstances(ctx context.Context, req *computepb.SuspendInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
SuspendInstances flags the specified instances in the managed instance group to be immediately suspended. You can only specify instances that are running in this request. This method reduces thetargetSize and increases the targetSuspendedSize of the managed instance group by the number of instances that you suspend. The suspendInstances operation is marked DONE if the suspendInstances request is successful. The underlying actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances method.
If the standbyPolicy.initialDelaySec field is set, the group delays suspension of the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there will be zero delay.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is suspended.
Suspended instances can be resumed using the resumeInstances method.
You can specify a maximum of 1000 instances with this method per request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SuspendInstancesRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SuspendInstancesRegionInstanceGroupManagerRequest.
}
op, err := c.SuspendInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) TestIamPermissions ¶
func (c *RegionInstanceGroupManagersClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionInstanceGroupManagerRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionInstanceGroupManagersClient) Update ¶
func (c *RegionInstanceGroupManagersClient) Update(ctx context.Context, req *computepb.UpdateRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
Update updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with thelistmanagedinstances method.
If you update your group to specify a new template or instance configuration, it’s possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, seeUpdating instances in a MIG.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateRegionInstanceGroupManagerRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupManagersClient) UpdatePerInstanceConfigs ¶
func (c *RegionInstanceGroupManagersClient) UpdatePerInstanceConfigs(ctx context.Context, req *computepb.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error)
UpdatePerInstanceConfigs inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.
}
op, err := c.UpdatePerInstanceConfigs(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type RegionInstanceGroupsCallOptions ¶
type RegionInstanceGroupsCallOptions struct {
Get []gax.CallOption
List []gax.CallOption
ListInstances []gax.CallOption
SetNamedPorts []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionInstanceGroupsCallOptions contains the retry settings for each method of RegionInstanceGroupsClient.
type RegionInstanceGroupsClient ¶
type RegionInstanceGroupsClient struct {
// The call options for this service.
CallOptions *RegionInstanceGroupsCallOptions
// contains filtered or unexported fields
}
RegionInstanceGroupsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionInstanceGroups API.
func NewRegionInstanceGroupsRESTClient ¶
func NewRegionInstanceGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionInstanceGroupsClient, error)
NewRegionInstanceGroupsRESTClient creates a new region instance groups rest client.
The RegionInstanceGroups API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionInstanceGroupsClient) Close ¶
func (c *RegionInstanceGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionInstanceGroupsClient) Connection
deprecated
func (c *RegionInstanceGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionInstanceGroupsClient) Get ¶
func (c *RegionInstanceGroupsClient) Get(ctx context.Context, req *computepb.GetRegionInstanceGroupRequest, opts ...gax.CallOption) (*computepb.InstanceGroup, error)
Get returns the specified instance group resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionInstanceGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionInstanceGroupRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionInstanceGroupsClient) List ¶
func (c *RegionInstanceGroupsClient) List(ctx context.Context, req *computepb.ListRegionInstanceGroupsRequest, opts ...gax.CallOption) *InstanceGroupIterator
List retrieves the list of instance group resources contained within the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstanceGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstanceGroupsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RegionInstanceGroupList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstanceGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstanceGroupsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionInstanceGroupsClient) ListInstances ¶
func (c *RegionInstanceGroupsClient) ListInstances(ctx context.Context, req *computepb.ListInstancesRegionInstanceGroupsRequest, opts ...gax.CallOption) *InstanceWithNamedPortsIterator
ListInstances lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstancesRegionInstanceGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstancesRegionInstanceGroupsRequest.
}
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
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RegionInstanceGroupsListInstances)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListInstancesRegionInstanceGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListInstancesRegionInstanceGroupsRequest.
}
for resp, err := range c.ListInstances(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionInstanceGroupsClient) SetNamedPorts ¶
func (c *RegionInstanceGroupsClient) SetNamedPorts(ctx context.Context, req *computepb.SetNamedPortsRegionInstanceGroupRequest, opts ...gax.CallOption) (*Operation, error)
SetNamedPorts sets the named ports for the specified regional instance group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetNamedPortsRegionInstanceGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetNamedPortsRegionInstanceGroupRequest.
}
op, err := c.SetNamedPorts(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceGroupsClient) TestIamPermissions ¶
func (c *RegionInstanceGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionInstanceGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionInstanceGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionInstanceGroupRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionInstanceTemplatesCallOptions ¶
type RegionInstanceTemplatesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
}
RegionInstanceTemplatesCallOptions contains the retry settings for each method of RegionInstanceTemplatesClient.
type RegionInstanceTemplatesClient ¶
type RegionInstanceTemplatesClient struct {
// The call options for this service.
CallOptions *RegionInstanceTemplatesCallOptions
// contains filtered or unexported fields
}
RegionInstanceTemplatesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionInstanceTemplates API.
func NewRegionInstanceTemplatesRESTClient ¶
func NewRegionInstanceTemplatesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionInstanceTemplatesClient, error)
NewRegionInstanceTemplatesRESTClient creates a new region instance templates rest client.
The RegionInstanceTemplates API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionInstanceTemplatesClient) Close ¶
func (c *RegionInstanceTemplatesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionInstanceTemplatesClient) Connection
deprecated
func (c *RegionInstanceTemplatesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionInstanceTemplatesClient) Delete ¶
func (c *RegionInstanceTemplatesClient) Delete(ctx context.Context, req *computepb.DeleteRegionInstanceTemplateRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified instance template. Deleting an instance template is permanent and cannot be undone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionInstanceTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionInstanceTemplateRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceTemplatesClient) Get ¶
func (c *RegionInstanceTemplatesClient) Get(ctx context.Context, req *computepb.GetRegionInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.InstanceTemplate, error)
Get returns the specified instance template.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionInstanceTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionInstanceTemplateRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionInstanceTemplatesClient) Insert ¶
func (c *RegionInstanceTemplatesClient) Insert(ctx context.Context, req *computepb.InsertRegionInstanceTemplateRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an instance template in the specified project and region using the global instance template whose URL is included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionInstanceTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionInstanceTemplateRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstanceTemplatesClient) List ¶
func (c *RegionInstanceTemplatesClient) List(ctx context.Context, req *computepb.ListRegionInstanceTemplatesRequest, opts ...gax.CallOption) *InstanceTemplateIterator
List retrieves a list of instance templates that are contained within the specified project and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstanceTemplatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstanceTemplatesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstanceTemplateList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstanceTemplatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstanceTemplatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstanceTemplatesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type RegionInstancesCallOptions ¶
type RegionInstancesCallOptions struct {
BulkInsert []gax.CallOption
}
RegionInstancesCallOptions contains the retry settings for each method of RegionInstancesClient.
type RegionInstancesClient ¶
type RegionInstancesClient struct {
// The call options for this service.
CallOptions *RegionInstancesCallOptions
// contains filtered or unexported fields
}
RegionInstancesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionInstances API.
func NewRegionInstancesRESTClient ¶
func NewRegionInstancesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionInstancesClient, error)
NewRegionInstancesRESTClient creates a new region instances rest client.
The RegionInstances API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionInstancesClient) BulkInsert ¶
func (c *RegionInstancesClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertRegionInstanceRequest, opts ...gax.CallOption) (*Operation, error)
BulkInsert creates multiple instances in a given region. Count specifies the number of instances to create.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.BulkInsertRegionInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#BulkInsertRegionInstanceRequest.
}
op, err := c.BulkInsert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstancesClient) Close ¶
func (c *RegionInstancesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionInstancesClient) Connection
deprecated
func (c *RegionInstancesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
type RegionInstantSnapshotGroupsCallOptions ¶ added in v1.55.0
type RegionInstantSnapshotGroupsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionInstantSnapshotGroupsCallOptions contains the retry settings for each method of RegionInstantSnapshotGroupsClient.
type RegionInstantSnapshotGroupsClient ¶ added in v1.55.0
type RegionInstantSnapshotGroupsClient struct {
// The call options for this service.
CallOptions *RegionInstantSnapshotGroupsCallOptions
// contains filtered or unexported fields
}
RegionInstantSnapshotGroupsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionInstantSnapshotGroups API.
func NewRegionInstantSnapshotGroupsRESTClient ¶ added in v1.55.0
func NewRegionInstantSnapshotGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionInstantSnapshotGroupsClient, error)
NewRegionInstantSnapshotGroupsRESTClient creates a new region instant snapshot groups rest client.
The RegionInstantSnapshotGroups API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionInstantSnapshotGroupsClient) Close ¶ added in v1.55.0
func (c *RegionInstantSnapshotGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionInstantSnapshotGroupsClient) Connection
deprecated
added in
v1.55.0
func (c *RegionInstantSnapshotGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionInstantSnapshotGroupsClient) Delete ¶ added in v1.55.0
func (c *RegionInstantSnapshotGroupsClient) Delete(ctx context.Context, req *computepb.DeleteRegionInstantSnapshotGroupRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes a Regional InstantSnapshotGroup resource
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionInstantSnapshotGroupRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstantSnapshotGroupsClient) Get ¶ added in v1.55.0
func (c *RegionInstantSnapshotGroupsClient) Get(ctx context.Context, req *computepb.GetRegionInstantSnapshotGroupRequest, opts ...gax.CallOption) (*computepb.InstantSnapshotGroup, error)
Get returns the specified InstantSnapshotGroup resource in the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionInstantSnapshotGroupRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionInstantSnapshotGroupsClient) GetIamPolicy ¶ added in v1.55.0
func (c *RegionInstantSnapshotGroupsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionInstantSnapshotGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyRegionInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyRegionInstantSnapshotGroupRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionInstantSnapshotGroupsClient) Insert ¶ added in v1.55.0
func (c *RegionInstantSnapshotGroupsClient) Insert(ctx context.Context, req *computepb.InsertRegionInstantSnapshotGroupRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a Regional InstantSnapshotGroup resource
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionInstantSnapshotGroupRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstantSnapshotGroupsClient) List ¶ added in v1.55.0
func (c *RegionInstantSnapshotGroupsClient) List(ctx context.Context, req *computepb.ListRegionInstantSnapshotGroupsRequest, opts ...gax.CallOption) *InstantSnapshotGroupIterator
List retrieves the list of InstantSnapshotGroup resources contained within the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstantSnapshotGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstantSnapshotGroupsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ListInstantSnapshotGroups)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstantSnapshotGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstantSnapshotGroupsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionInstantSnapshotGroupsClient) SetIamPolicy ¶ added in v1.55.0
func (c *RegionInstantSnapshotGroupsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionInstantSnapshotGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyRegionInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyRegionInstantSnapshotGroupRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionInstantSnapshotGroupsClient) TestIamPermissions ¶ added in v1.55.0
func (c *RegionInstantSnapshotGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionInstantSnapshotGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionInstantSnapshotGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionInstantSnapshotGroupRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionInstantSnapshotsCallOptions ¶
type RegionInstantSnapshotsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetIamPolicy []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionInstantSnapshotsCallOptions contains the retry settings for each method of RegionInstantSnapshotsClient.
type RegionInstantSnapshotsClient ¶
type RegionInstantSnapshotsClient struct {
// The call options for this service.
CallOptions *RegionInstantSnapshotsCallOptions
// contains filtered or unexported fields
}
RegionInstantSnapshotsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionInstantSnapshots API.
func NewRegionInstantSnapshotsRESTClient ¶
func NewRegionInstantSnapshotsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionInstantSnapshotsClient, error)
NewRegionInstantSnapshotsRESTClient creates a new region instant snapshots rest client.
The RegionInstantSnapshots API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionInstantSnapshotsClient) Close ¶
func (c *RegionInstantSnapshotsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionInstantSnapshotsClient) Connection
deprecated
func (c *RegionInstantSnapshotsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionInstantSnapshotsClient) Delete ¶
func (c *RegionInstantSnapshotsClient) Delete(ctx context.Context, req *computepb.DeleteRegionInstantSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified InstantSnapshot resource. Keep in mind that deleting a single instantSnapshot might not necessarily delete all the data on that instantSnapshot. If any data on the instantSnapshot that is marked for deletion is needed for subsequent instantSnapshots, the data will be moved to the next corresponding instantSnapshot.
For more information, seeDeleting instantSnapshots.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionInstantSnapshotRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstantSnapshotsClient) Get ¶
func (c *RegionInstantSnapshotsClient) Get(ctx context.Context, req *computepb.GetRegionInstantSnapshotRequest, opts ...gax.CallOption) (*computepb.InstantSnapshot, error)
Get returns the specified InstantSnapshot resource in the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionInstantSnapshotRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionInstantSnapshotsClient) GetIamPolicy ¶
func (c *RegionInstantSnapshotsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionInstantSnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyRegionInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyRegionInstantSnapshotRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionInstantSnapshotsClient) Insert ¶
func (c *RegionInstantSnapshotsClient) Insert(ctx context.Context, req *computepb.InsertRegionInstantSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates an instant snapshot in the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionInstantSnapshotRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstantSnapshotsClient) List ¶
func (c *RegionInstantSnapshotsClient) List(ctx context.Context, req *computepb.ListRegionInstantSnapshotsRequest, opts ...gax.CallOption) *InstantSnapshotIterator
List retrieves the list of InstantSnapshot resources contained within the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstantSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstantSnapshotsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.InstantSnapshotList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionInstantSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionInstantSnapshotsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionInstantSnapshotsClient) SetIamPolicy ¶
func (c *RegionInstantSnapshotsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionInstantSnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyRegionInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyRegionInstantSnapshotRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionInstantSnapshotsClient) SetLabels ¶
func (c *RegionInstantSnapshotsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsRegionInstantSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a instantSnapshot in the given region. To learn more about labels, read the Labeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsRegionInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsRegionInstantSnapshotRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionInstantSnapshotsClient) TestIamPermissions ¶
func (c *RegionInstantSnapshotsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionInstantSnapshotRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionInstantSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionInstantSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionInstantSnapshotRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionIterator ¶
type RegionIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Region, nextPageToken string, err error)
// contains filtered or unexported fields
}
RegionIterator manages a stream of *computepb.Region.
func (*RegionIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RegionIterator) Next ¶
func (it *RegionIterator) Next() (*computepb.Region, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*RegionIterator) PageInfo ¶
func (it *RegionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RegionMultiMigMembersCallOptions ¶ added in v1.54.0
type RegionMultiMigMembersCallOptions struct {
Get []gax.CallOption
List []gax.CallOption
}
RegionMultiMigMembersCallOptions contains the retry settings for each method of RegionMultiMigMembersClient.
type RegionMultiMigMembersClient ¶ added in v1.54.0
type RegionMultiMigMembersClient struct {
// The call options for this service.
CallOptions *RegionMultiMigMembersCallOptions
// contains filtered or unexported fields
}
RegionMultiMigMembersClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionMultiMigMembers API.
func NewRegionMultiMigMembersRESTClient ¶ added in v1.54.0
func NewRegionMultiMigMembersRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionMultiMigMembersClient, error)
NewRegionMultiMigMembersRESTClient creates a new region multi mig members rest client.
The RegionMultiMigMembers API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionMultiMigMembersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionMultiMigMembersClient) Close ¶ added in v1.54.0
func (c *RegionMultiMigMembersClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionMultiMigMembersClient) Connection
deprecated
added in
v1.54.0
func (c *RegionMultiMigMembersClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionMultiMigMembersClient) Get ¶ added in v1.54.0
func (c *RegionMultiMigMembersClient) Get(ctx context.Context, req *computepb.GetRegionMultiMigMemberRequest, opts ...gax.CallOption) (*computepb.MultiMigMember, error)
Get retrieves information about the specified multi-MIG member.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionMultiMigMembersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionMultiMigMemberRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionMultiMigMemberRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionMultiMigMembersClient) List ¶ added in v1.54.0
func (c *RegionMultiMigMembersClient) List(ctx context.Context, req *computepb.ListRegionMultiMigMembersRequest, opts ...gax.CallOption) *MultiMigMemberIterator
List retrieves a list of members of a specific multi-MIG.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionMultiMigMembersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionMultiMigMembersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionMultiMigMembersRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.MultiMigMemberList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionMultiMigMembersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionMultiMigMembersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionMultiMigMembersRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type RegionMultiMigsCallOptions ¶
type RegionMultiMigsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
}
RegionMultiMigsCallOptions contains the retry settings for each method of RegionMultiMigsClient.
type RegionMultiMigsClient ¶
type RegionMultiMigsClient struct {
// The call options for this service.
CallOptions *RegionMultiMigsCallOptions
// contains filtered or unexported fields
}
RegionMultiMigsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionMultiMigs API.
func NewRegionMultiMigsRESTClient ¶
func NewRegionMultiMigsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionMultiMigsClient, error)
NewRegionMultiMigsRESTClient creates a new region multi migs rest client.
The RegionMultiMigs API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionMultiMigsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionMultiMigsClient) Close ¶
func (c *RegionMultiMigsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionMultiMigsClient) Connection
deprecated
func (c *RegionMultiMigsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionMultiMigsClient) Delete ¶
func (c *RegionMultiMigsClient) Delete(ctx context.Context, req *computepb.DeleteRegionMultiMigRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes a multi-MIG in the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionMultiMigsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionMultiMigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionMultiMigRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionMultiMigsClient) Get ¶
func (c *RegionMultiMigsClient) Get(ctx context.Context, req *computepb.GetRegionMultiMigRequest, opts ...gax.CallOption) (*computepb.MultiMig, error)
Get returns all the details of a specific multi-MIG.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionMultiMigsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionMultiMigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionMultiMigRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionMultiMigsClient) Insert ¶
func (c *RegionMultiMigsClient) Insert(ctx context.Context, req *computepb.InsertRegionMultiMigRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a multi-MIG in the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionMultiMigsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionMultiMigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionMultiMigRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionMultiMigsClient) List ¶
func (c *RegionMultiMigsClient) List(ctx context.Context, req *computepb.ListRegionMultiMigsRequest, opts ...gax.CallOption) *MultiMigIterator
List retrieves a list of multi-MIGs in a project and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionMultiMigsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionMultiMigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionMultiMigsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.MultiMigsList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionMultiMigsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionMultiMigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionMultiMigsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type RegionNetworkEndpointGroupsCallOptions ¶
type RegionNetworkEndpointGroupsCallOptions struct {
AttachNetworkEndpoints []gax.CallOption
Delete []gax.CallOption
DetachNetworkEndpoints []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListNetworkEndpoints []gax.CallOption
}
RegionNetworkEndpointGroupsCallOptions contains the retry settings for each method of RegionNetworkEndpointGroupsClient.
type RegionNetworkEndpointGroupsClient ¶
type RegionNetworkEndpointGroupsClient struct {
// The call options for this service.
CallOptions *RegionNetworkEndpointGroupsCallOptions
// contains filtered or unexported fields
}
RegionNetworkEndpointGroupsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionNetworkEndpointGroups API.
func NewRegionNetworkEndpointGroupsRESTClient ¶
func NewRegionNetworkEndpointGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionNetworkEndpointGroupsClient, error)
NewRegionNetworkEndpointGroupsRESTClient creates a new region network endpoint groups rest client.
The RegionNetworkEndpointGroups API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionNetworkEndpointGroupsClient) AttachNetworkEndpoints ¶
func (c *RegionNetworkEndpointGroupsClient) AttachNetworkEndpoints(ctx context.Context, req *computepb.AttachNetworkEndpointsRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
AttachNetworkEndpoints attach a list of network endpoints to the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AttachNetworkEndpointsRegionNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AttachNetworkEndpointsRegionNetworkEndpointGroupRequest.
}
op, err := c.AttachNetworkEndpoints(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkEndpointGroupsClient) Close ¶
func (c *RegionNetworkEndpointGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionNetworkEndpointGroupsClient) Connection
deprecated
func (c *RegionNetworkEndpointGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionNetworkEndpointGroupsClient) Delete ¶
func (c *RegionNetworkEndpointGroupsClient) Delete(ctx context.Context, req *computepb.DeleteRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified network endpoint group. Note that the NEG cannot be deleted if it is configured as a backend of a backend service.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionNetworkEndpointGroupRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkEndpointGroupsClient) DetachNetworkEndpoints ¶
func (c *RegionNetworkEndpointGroupsClient) DetachNetworkEndpoints(ctx context.Context, req *computepb.DetachNetworkEndpointsRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
DetachNetworkEndpoints detach the network endpoint from the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DetachNetworkEndpointsRegionNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DetachNetworkEndpointsRegionNetworkEndpointGroupRequest.
}
op, err := c.DetachNetworkEndpoints(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkEndpointGroupsClient) Get ¶
func (c *RegionNetworkEndpointGroupsClient) Get(ctx context.Context, req *computepb.GetRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroup, error)
Get returns the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionNetworkEndpointGroupRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionNetworkEndpointGroupsClient) Insert ¶
func (c *RegionNetworkEndpointGroupsClient) Insert(ctx context.Context, req *computepb.InsertRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a network endpoint group in the specified project using the parameters that are included in the request.
Note: Use the following APIs to manage network endpoint groups:
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionNetworkEndpointGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionNetworkEndpointGroupRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkEndpointGroupsClient) List ¶
func (c *RegionNetworkEndpointGroupsClient) List(ctx context.Context, req *computepb.ListRegionNetworkEndpointGroupsRequest, opts ...gax.CallOption) *NetworkEndpointGroupIterator
List retrieves the list of regional network endpoint groups available to the specified project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionNetworkEndpointGroupsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkEndpointGroupList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionNetworkEndpointGroupsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionNetworkEndpointGroupsClient) ListNetworkEndpoints ¶
func (c *RegionNetworkEndpointGroupsClient) ListNetworkEndpoints(ctx context.Context, req *computepb.ListNetworkEndpointsRegionNetworkEndpointGroupsRequest, opts ...gax.CallOption) *NetworkEndpointWithHealthStatusIterator
ListNetworkEndpoints lists the network endpoints in the specified network endpoint group.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkEndpointsRegionNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkEndpointsRegionNetworkEndpointGroupsRequest.
}
it := c.ListNetworkEndpoints(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkEndpointGroupsListNetworkEndpoints)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListNetworkEndpointsRegionNetworkEndpointGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListNetworkEndpointsRegionNetworkEndpointGroupsRequest.
}
for resp, err := range c.ListNetworkEndpoints(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type RegionNetworkFirewallPoliciesCallOptions ¶
type RegionNetworkFirewallPoliciesCallOptions struct {
AddAssociation []gax.CallOption
AddRule []gax.CallOption
CloneRules []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetAssociation []gax.CallOption
GetEffectiveFirewalls []gax.CallOption
GetIamPolicy []gax.CallOption
GetRule []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
PatchAssociation []gax.CallOption
PatchRule []gax.CallOption
RemoveAssociation []gax.CallOption
RemoveRule []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionNetworkFirewallPoliciesCallOptions contains the retry settings for each method of RegionNetworkFirewallPoliciesClient.
type RegionNetworkFirewallPoliciesClient ¶
type RegionNetworkFirewallPoliciesClient struct {
// The call options for this service.
CallOptions *RegionNetworkFirewallPoliciesCallOptions
// contains filtered or unexported fields
}
RegionNetworkFirewallPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionNetworkFirewallPolicies API.
func NewRegionNetworkFirewallPoliciesRESTClient ¶
func NewRegionNetworkFirewallPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionNetworkFirewallPoliciesClient, error)
NewRegionNetworkFirewallPoliciesRESTClient creates a new region network firewall policies rest client.
The RegionNetworkFirewallPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionNetworkFirewallPoliciesClient) AddAssociation ¶
func (c *RegionNetworkFirewallPoliciesClient) AddAssociation(ctx context.Context, req *computepb.AddAssociationRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddAssociation inserts an association for the specified network firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddAssociationRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddAssociationRegionNetworkFirewallPolicyRequest.
}
op, err := c.AddAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkFirewallPoliciesClient) AddRule ¶
func (c *RegionNetworkFirewallPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddRule inserts a rule into a network firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddRuleRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddRuleRegionNetworkFirewallPolicyRequest.
}
op, err := c.AddRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkFirewallPoliciesClient) CloneRules ¶
func (c *RegionNetworkFirewallPoliciesClient) CloneRules(ctx context.Context, req *computepb.CloneRulesRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
CloneRules copies rules to the specified network firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CloneRulesRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CloneRulesRegionNetworkFirewallPolicyRequest.
}
op, err := c.CloneRules(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkFirewallPoliciesClient) Close ¶
func (c *RegionNetworkFirewallPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionNetworkFirewallPoliciesClient) Connection
deprecated
func (c *RegionNetworkFirewallPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionNetworkFirewallPoliciesClient) Delete ¶
func (c *RegionNetworkFirewallPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified network firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionNetworkFirewallPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkFirewallPoliciesClient) Get ¶
func (c *RegionNetworkFirewallPoliciesClient) Get(ctx context.Context, req *computepb.GetRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicy, error)
Get returns the specified network firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionNetworkFirewallPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionNetworkFirewallPoliciesClient) GetAssociation ¶
func (c *RegionNetworkFirewallPoliciesClient) GetAssociation(ctx context.Context, req *computepb.GetAssociationRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyAssociation, error)
GetAssociation gets an association with the specified name.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetAssociationRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetAssociationRegionNetworkFirewallPolicyRequest.
}
resp, err := c.GetAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionNetworkFirewallPoliciesClient) GetEffectiveFirewalls ¶
func (c *RegionNetworkFirewallPoliciesClient) GetEffectiveFirewalls(ctx context.Context, req *computepb.GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse, error)
GetEffectiveFirewalls returns the effective firewalls on a given network.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest.
}
resp, err := c.GetEffectiveFirewalls(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionNetworkFirewallPoliciesClient) GetIamPolicy ¶
func (c *RegionNetworkFirewallPoliciesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyRegionNetworkFirewallPolicyRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionNetworkFirewallPoliciesClient) GetRule ¶
func (c *RegionNetworkFirewallPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyRule, error)
GetRule gets a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRuleRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRuleRegionNetworkFirewallPolicyRequest.
}
resp, err := c.GetRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionNetworkFirewallPoliciesClient) Insert ¶
func (c *RegionNetworkFirewallPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new network firewall policy in the specified project and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionNetworkFirewallPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkFirewallPoliciesClient) List ¶
func (c *RegionNetworkFirewallPoliciesClient) List(ctx context.Context, req *computepb.ListRegionNetworkFirewallPoliciesRequest, opts ...gax.CallOption) *FirewallPolicyIterator
List lists all the network firewall policies that have been configured for the specified project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionNetworkFirewallPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionNetworkFirewallPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.FirewallPolicyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionNetworkFirewallPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionNetworkFirewallPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionNetworkFirewallPoliciesClient) Patch ¶
func (c *RegionNetworkFirewallPoliciesClient) Patch(ctx context.Context, req *computepb.PatchRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified network firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionNetworkFirewallPolicyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkFirewallPoliciesClient) PatchAssociation ¶
func (c *RegionNetworkFirewallPoliciesClient) PatchAssociation(ctx context.Context, req *computepb.PatchAssociationRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
PatchAssociation updates an association for the specified network firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchAssociationRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchAssociationRegionNetworkFirewallPolicyRequest.
}
op, err := c.PatchAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkFirewallPoliciesClient) PatchRule ¶
func (c *RegionNetworkFirewallPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
PatchRule patches a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRuleRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRuleRegionNetworkFirewallPolicyRequest.
}
op, err := c.PatchRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkFirewallPoliciesClient) RemoveAssociation ¶
func (c *RegionNetworkFirewallPoliciesClient) RemoveAssociation(ctx context.Context, req *computepb.RemoveAssociationRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveAssociation removes an association for the specified network firewall policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveAssociationRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveAssociationRegionNetworkFirewallPolicyRequest.
}
op, err := c.RemoveAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkFirewallPoliciesClient) RemoveRule ¶
func (c *RegionNetworkFirewallPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveRule deletes a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveRuleRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveRuleRegionNetworkFirewallPolicyRequest.
}
op, err := c.RemoveRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkFirewallPoliciesClient) SetIamPolicy ¶
func (c *RegionNetworkFirewallPoliciesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyRegionNetworkFirewallPolicyRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionNetworkFirewallPoliciesClient) TestIamPermissions ¶
func (c *RegionNetworkFirewallPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkFirewallPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionNetworkFirewallPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionNetworkFirewallPolicyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionNetworkPoliciesCallOptions ¶ added in v1.49.0
type RegionNetworkPoliciesCallOptions struct {
AddAssociation []gax.CallOption
AddTrafficClassificationRule []gax.CallOption
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetAssociation []gax.CallOption
GetTrafficClassificationRule []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
PatchTrafficClassificationRule []gax.CallOption
RemoveAssociation []gax.CallOption
RemoveTrafficClassificationRule []gax.CallOption
}
RegionNetworkPoliciesCallOptions contains the retry settings for each method of RegionNetworkPoliciesClient.
type RegionNetworkPoliciesClient ¶ added in v1.49.0
type RegionNetworkPoliciesClient struct {
// The call options for this service.
CallOptions *RegionNetworkPoliciesCallOptions
// contains filtered or unexported fields
}
RegionNetworkPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionNetworkPolicies API.
func NewRegionNetworkPoliciesRESTClient ¶ added in v1.49.0
func NewRegionNetworkPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionNetworkPoliciesClient, error)
NewRegionNetworkPoliciesRESTClient creates a new region network policies rest client.
The RegionNetworkPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionNetworkPoliciesClient) AddAssociation ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) AddAssociation(ctx context.Context, req *computepb.AddAssociationRegionNetworkPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddAssociation inserts an association for the specified network policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddAssociationRegionNetworkPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddAssociationRegionNetworkPolicyRequest.
}
op, err := c.AddAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkPoliciesClient) AddTrafficClassificationRule ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) AddTrafficClassificationRule(ctx context.Context, req *computepb.AddTrafficClassificationRuleRegionNetworkPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddTrafficClassificationRule inserts a rule into a network policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddTrafficClassificationRuleRegionNetworkPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddTrafficClassificationRuleRegionNetworkPolicyRequest.
}
op, err := c.AddTrafficClassificationRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkPoliciesClient) AggregatedList ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRegionNetworkPoliciesRequest, opts ...gax.CallOption) *NetworkPoliciesScopedListPairIterator
AggregatedList retrieves an aggregated list of network policies.
To prevent failure, it’s recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRegionNetworkPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRegionNetworkPoliciesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkPolicyAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRegionNetworkPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRegionNetworkPoliciesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionNetworkPoliciesClient) Close ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionNetworkPoliciesClient) Connection
deprecated
added in
v1.49.0
func (c *RegionNetworkPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionNetworkPoliciesClient) Delete ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionNetworkPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionNetworkPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionNetworkPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkPoliciesClient) Get ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) Get(ctx context.Context, req *computepb.GetRegionNetworkPolicyRequest, opts ...gax.CallOption) (*computepb.NetworkPolicy, error)
Get returns the specified network policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionNetworkPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionNetworkPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionNetworkPoliciesClient) GetAssociation ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) GetAssociation(ctx context.Context, req *computepb.GetAssociationRegionNetworkPolicyRequest, opts ...gax.CallOption) (*computepb.NetworkPolicyAssociation, error)
GetAssociation gets an association with the specified name.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetAssociationRegionNetworkPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetAssociationRegionNetworkPolicyRequest.
}
resp, err := c.GetAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionNetworkPoliciesClient) GetTrafficClassificationRule ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) GetTrafficClassificationRule(ctx context.Context, req *computepb.GetTrafficClassificationRuleRegionNetworkPolicyRequest, opts ...gax.CallOption) (*computepb.NetworkPolicyTrafficClassificationRule, error)
GetTrafficClassificationRule gets a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetTrafficClassificationRuleRegionNetworkPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetTrafficClassificationRuleRegionNetworkPolicyRequest.
}
resp, err := c.GetTrafficClassificationRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionNetworkPoliciesClient) Insert ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionNetworkPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new policy in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionNetworkPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionNetworkPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkPoliciesClient) List ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) List(ctx context.Context, req *computepb.ListRegionNetworkPoliciesRequest, opts ...gax.CallOption) *NetworkPolicyIterator
List lists all the policies that have been configured for the specified project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionNetworkPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionNetworkPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NetworkPolicyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionNetworkPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionNetworkPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionNetworkPoliciesClient) Patch ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) Patch(ctx context.Context, req *computepb.PatchRegionNetworkPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified policy with the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionNetworkPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionNetworkPolicyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkPoliciesClient) PatchTrafficClassificationRule ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) PatchTrafficClassificationRule(ctx context.Context, req *computepb.PatchTrafficClassificationRuleRegionNetworkPolicyRequest, opts ...gax.CallOption) (*Operation, error)
PatchTrafficClassificationRule patches a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchTrafficClassificationRuleRegionNetworkPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchTrafficClassificationRuleRegionNetworkPolicyRequest.
}
op, err := c.PatchTrafficClassificationRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkPoliciesClient) RemoveAssociation ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) RemoveAssociation(ctx context.Context, req *computepb.RemoveAssociationRegionNetworkPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveAssociation removes an association for the specified network policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveAssociationRegionNetworkPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveAssociationRegionNetworkPolicyRequest.
}
op, err := c.RemoveAssociation(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNetworkPoliciesClient) RemoveTrafficClassificationRule ¶ added in v1.49.0
func (c *RegionNetworkPoliciesClient) RemoveTrafficClassificationRule(ctx context.Context, req *computepb.RemoveTrafficClassificationRuleRegionNetworkPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveTrafficClassificationRule deletes a rule of the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNetworkPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveTrafficClassificationRuleRegionNetworkPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveTrafficClassificationRuleRegionNetworkPolicyRequest.
}
op, err := c.RemoveTrafficClassificationRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type RegionNotificationEndpointsCallOptions ¶
type RegionNotificationEndpointsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionNotificationEndpointsCallOptions contains the retry settings for each method of RegionNotificationEndpointsClient.
type RegionNotificationEndpointsClient ¶
type RegionNotificationEndpointsClient struct {
// The call options for this service.
CallOptions *RegionNotificationEndpointsCallOptions
// contains filtered or unexported fields
}
RegionNotificationEndpointsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionNotificationEndpoints API.
func NewRegionNotificationEndpointsRESTClient ¶
func NewRegionNotificationEndpointsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionNotificationEndpointsClient, error)
NewRegionNotificationEndpointsRESTClient creates a new region notification endpoints rest client.
The RegionNotificationEndpoints API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionNotificationEndpointsClient) Close ¶
func (c *RegionNotificationEndpointsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionNotificationEndpointsClient) Connection
deprecated
func (c *RegionNotificationEndpointsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionNotificationEndpointsClient) Delete ¶
func (c *RegionNotificationEndpointsClient) Delete(ctx context.Context, req *computepb.DeleteRegionNotificationEndpointRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified NotificationEndpoint in the given region
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionNotificationEndpointRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionNotificationEndpointRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNotificationEndpointsClient) Get ¶
func (c *RegionNotificationEndpointsClient) Get(ctx context.Context, req *computepb.GetRegionNotificationEndpointRequest, opts ...gax.CallOption) (*computepb.NotificationEndpoint, error)
Get returns the specified NotificationEndpoint resource in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionNotificationEndpointRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionNotificationEndpointRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionNotificationEndpointsClient) Insert ¶
func (c *RegionNotificationEndpointsClient) Insert(ctx context.Context, req *computepb.InsertRegionNotificationEndpointRequest, opts ...gax.CallOption) (*Operation, error)
Insert create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionNotificationEndpointRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionNotificationEndpointRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionNotificationEndpointsClient) List ¶
func (c *RegionNotificationEndpointsClient) List(ctx context.Context, req *computepb.ListRegionNotificationEndpointsRequest, opts ...gax.CallOption) *NotificationEndpointIterator
List lists the NotificationEndpoints for a project in the given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionNotificationEndpointsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionNotificationEndpointsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.NotificationEndpointList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionNotificationEndpointsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionNotificationEndpointsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionNotificationEndpointsClient) TestIamPermissions ¶
func (c *RegionNotificationEndpointsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionNotificationEndpointRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionNotificationEndpointRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionNotificationEndpointRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionOperationsCallOptions ¶
type RegionOperationsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
List []gax.CallOption
Wait []gax.CallOption
}
RegionOperationsCallOptions contains the retry settings for each method of RegionOperationsClient.
type RegionOperationsClient ¶
type RegionOperationsClient struct {
// The call options for this service.
CallOptions *RegionOperationsCallOptions
// contains filtered or unexported fields
}
RegionOperationsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionOperations API.
func NewRegionOperationsRESTClient ¶
func NewRegionOperationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionOperationsClient, error)
NewRegionOperationsRESTClient creates a new region operations rest client.
The RegionOperations API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionOperationsClient) Close ¶
func (c *RegionOperationsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionOperationsClient) Connection
deprecated
func (c *RegionOperationsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionOperationsClient) Delete ¶
func (c *RegionOperationsClient) Delete(ctx context.Context, req *computepb.DeleteRegionOperationRequest, opts ...gax.CallOption) (*computepb.DeleteRegionOperationResponse, error)
Delete deletes the specified region-specific Operations resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionOperationRequest.
}
resp, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionOperationsClient) Get ¶
func (c *RegionOperationsClient) Get(ctx context.Context, req *computepb.GetRegionOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error)
Get retrieves the specified region-specific Operations resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionOperationRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionOperationsClient) List ¶
func (c *RegionOperationsClient) List(ctx context.Context, req *computepb.ListRegionOperationsRequest, opts ...gax.CallOption) *OperationIterator
List retrieves a list of Operation resources contained within the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionOperationsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.OperationList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionOperationsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionOperationsClient) Wait ¶
func (c *RegionOperationsClient) Wait(ctx context.Context, req *computepb.WaitRegionOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error)
Wait waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the GET method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be DONE or still in progress.
This method is called on a best-effort basis. Specifically:
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.WaitRegionOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#WaitRegionOperationRequest.
}
resp, err := c.Wait(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionSecurityPoliciesCallOptions ¶
type RegionSecurityPoliciesCallOptions struct {
AddRule []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetRule []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
PatchRule []gax.CallOption
RemoveRule []gax.CallOption
SetLabels []gax.CallOption
}
RegionSecurityPoliciesCallOptions contains the retry settings for each method of RegionSecurityPoliciesClient.
type RegionSecurityPoliciesClient ¶
type RegionSecurityPoliciesClient struct {
// The call options for this service.
CallOptions *RegionSecurityPoliciesCallOptions
// contains filtered or unexported fields
}
RegionSecurityPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionSecurityPolicies API.
func NewRegionSecurityPoliciesRESTClient ¶
func NewRegionSecurityPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionSecurityPoliciesClient, error)
NewRegionSecurityPoliciesRESTClient creates a new region security policies rest client.
The RegionSecurityPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionSecurityPoliciesClient) AddRule ¶
func (c *RegionSecurityPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddRule inserts a rule into a security policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddRuleRegionSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddRuleRegionSecurityPolicyRequest.
}
op, err := c.AddRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSecurityPoliciesClient) Close ¶
func (c *RegionSecurityPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionSecurityPoliciesClient) Connection
deprecated
func (c *RegionSecurityPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionSecurityPoliciesClient) Delete ¶
func (c *RegionSecurityPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionSecurityPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSecurityPoliciesClient) Get ¶
func (c *RegionSecurityPoliciesClient) Get(ctx context.Context, req *computepb.GetRegionSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicy, error)
Get list all of the ordered rules present in a single specified policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionSecurityPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionSecurityPoliciesClient) GetRule ¶
func (c *RegionSecurityPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleRegionSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicyRule, error)
GetRule gets a rule at the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRuleRegionSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRuleRegionSecurityPolicyRequest.
}
resp, err := c.GetRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionSecurityPoliciesClient) Insert ¶
func (c *RegionSecurityPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new policy in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionSecurityPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSecurityPoliciesClient) List ¶
func (c *RegionSecurityPoliciesClient) List(ctx context.Context, req *computepb.ListRegionSecurityPoliciesRequest, opts ...gax.CallOption) *SecurityPolicyIterator
List list all the policies that have been configured for the specified project and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionSecurityPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionSecurityPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SecurityPolicyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionSecurityPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionSecurityPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionSecurityPoliciesClient) Patch ¶
func (c *RegionSecurityPoliciesClient) Patch(ctx context.Context, req *computepb.PatchRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionSecurityPolicyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSecurityPoliciesClient) PatchRule ¶
func (c *RegionSecurityPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
PatchRule patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRuleRegionSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRuleRegionSecurityPolicyRequest.
}
op, err := c.PatchRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSecurityPoliciesClient) RemoveRule ¶
func (c *RegionSecurityPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveRule deletes a rule at the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveRuleRegionSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveRuleRegionSecurityPolicyRequest.
}
op, err := c.RemoveRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSecurityPoliciesClient) SetLabels ¶
func (c *RegionSecurityPoliciesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsRegionSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsRegionSecurityPolicyRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type RegionSnapshotSettingsCallOptions ¶
type RegionSnapshotSettingsCallOptions struct {
Get []gax.CallOption
Patch []gax.CallOption
}
RegionSnapshotSettingsCallOptions contains the retry settings for each method of RegionSnapshotSettingsClient.
type RegionSnapshotSettingsClient ¶
type RegionSnapshotSettingsClient struct {
// The call options for this service.
CallOptions *RegionSnapshotSettingsCallOptions
// contains filtered or unexported fields
}
RegionSnapshotSettingsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionSnapshotSettings API.
func NewRegionSnapshotSettingsRESTClient ¶
func NewRegionSnapshotSettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionSnapshotSettingsClient, error)
NewRegionSnapshotSettingsRESTClient creates a new region snapshot settings rest client.
The RegionSnapshotSettings API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionSnapshotSettingsClient) Close ¶
func (c *RegionSnapshotSettingsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionSnapshotSettingsClient) Connection
deprecated
func (c *RegionSnapshotSettingsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionSnapshotSettingsClient) Get ¶
func (c *RegionSnapshotSettingsClient) Get(ctx context.Context, req *computepb.GetRegionSnapshotSettingRequest, opts ...gax.CallOption) (*computepb.SnapshotSettings, error)
Get get region snapshot settings.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionSnapshotSettingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionSnapshotSettingRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionSnapshotSettingsClient) Patch ¶
func (c *RegionSnapshotSettingsClient) Patch(ctx context.Context, req *computepb.PatchRegionSnapshotSettingRequest, opts ...gax.CallOption) (*Operation, error)
Patch patch region snapshot settings.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionSnapshotSettingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionSnapshotSettingRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type RegionSnapshotsCallOptions ¶
type RegionSnapshotsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetIamPolicy []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionSnapshotsCallOptions contains the retry settings for each method of RegionSnapshotsClient.
type RegionSnapshotsClient ¶
type RegionSnapshotsClient struct {
// The call options for this service.
CallOptions *RegionSnapshotsCallOptions
// contains filtered or unexported fields
}
RegionSnapshotsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionSnapshots API.
func NewRegionSnapshotsRESTClient ¶
func NewRegionSnapshotsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionSnapshotsClient, error)
NewRegionSnapshotsRESTClient creates a new region snapshots rest client.
The RegionSnapshots API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionSnapshotsClient) Close ¶
func (c *RegionSnapshotsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionSnapshotsClient) Connection
deprecated
func (c *RegionSnapshotsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionSnapshotsClient) Delete ¶
func (c *RegionSnapshotsClient) Delete(ctx context.Context, req *computepb.DeleteRegionSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.
For more information, seeDeleting snapshots.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionSnapshotRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSnapshotsClient) Get ¶
func (c *RegionSnapshotsClient) Get(ctx context.Context, req *computepb.GetRegionSnapshotRequest, opts ...gax.CallOption) (*computepb.Snapshot, error)
Get returns the specified Snapshot resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionSnapshotRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionSnapshotsClient) GetIamPolicy ¶
func (c *RegionSnapshotsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionSnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyRegionSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyRegionSnapshotRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionSnapshotsClient) Insert ¶
func (c *RegionSnapshotsClient) Insert(ctx context.Context, req *computepb.InsertRegionSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a snapshot in the specified region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionSnapshotRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSnapshotsClient) List ¶
func (c *RegionSnapshotsClient) List(ctx context.Context, req *computepb.ListRegionSnapshotsRequest, opts ...gax.CallOption) *SnapshotIterator
List retrieves the list of Snapshot resources contained within the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionSnapshotsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SnapshotList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionSnapshotsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionSnapshotsClient) SetIamPolicy ¶
func (c *RegionSnapshotsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionSnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyRegionSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyRegionSnapshotRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionSnapshotsClient) SetLabels ¶
func (c *RegionSnapshotsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsRegionSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a regional snapshot. To learn more about labels, read the Labeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsRegionSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsRegionSnapshotRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSnapshotsClient) TestIamPermissions ¶
func (c *RegionSnapshotsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionSnapshotRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionSnapshotRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionSslCertificatesCallOptions ¶
type RegionSslCertificatesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionSslCertificatesCallOptions contains the retry settings for each method of RegionSslCertificatesClient.
type RegionSslCertificatesClient ¶
type RegionSslCertificatesClient struct {
// The call options for this service.
CallOptions *RegionSslCertificatesCallOptions
// contains filtered or unexported fields
}
RegionSslCertificatesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionSslCertificates API.
func NewRegionSslCertificatesRESTClient ¶
func NewRegionSslCertificatesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionSslCertificatesClient, error)
NewRegionSslCertificatesRESTClient creates a new region ssl certificates rest client.
The RegionSslCertificates API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionSslCertificatesClient) Close ¶
func (c *RegionSslCertificatesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionSslCertificatesClient) Connection
deprecated
func (c *RegionSslCertificatesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionSslCertificatesClient) Delete ¶
func (c *RegionSslCertificatesClient) Delete(ctx context.Context, req *computepb.DeleteRegionSslCertificateRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified SslCertificate resource in the region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionSslCertificateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionSslCertificateRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSslCertificatesClient) Get ¶
func (c *RegionSslCertificatesClient) Get(ctx context.Context, req *computepb.GetRegionSslCertificateRequest, opts ...gax.CallOption) (*computepb.SslCertificate, error)
Get returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionSslCertificateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionSslCertificateRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionSslCertificatesClient) Insert ¶
func (c *RegionSslCertificatesClient) Insert(ctx context.Context, req *computepb.InsertRegionSslCertificateRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a SslCertificate resource in the specified project and region using the data included in the request
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionSslCertificateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionSslCertificateRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSslCertificatesClient) List ¶
func (c *RegionSslCertificatesClient) List(ctx context.Context, req *computepb.ListRegionSslCertificatesRequest, opts ...gax.CallOption) *SslCertificateIterator
List retrieves the list of SslCertificate resources available to the specified project in the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionSslCertificatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionSslCertificatesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SslCertificateList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionSslCertificatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionSslCertificatesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionSslCertificatesClient) TestIamPermissions ¶
func (c *RegionSslCertificatesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionSslCertificateRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionSslCertificateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionSslCertificateRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionSslPoliciesCallOptions ¶
type RegionSslPoliciesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListAvailableFeatures []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionSslPoliciesCallOptions contains the retry settings for each method of RegionSslPoliciesClient.
type RegionSslPoliciesClient ¶
type RegionSslPoliciesClient struct {
// The call options for this service.
CallOptions *RegionSslPoliciesCallOptions
// contains filtered or unexported fields
}
RegionSslPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionSslPolicies API.
func NewRegionSslPoliciesRESTClient ¶
func NewRegionSslPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionSslPoliciesClient, error)
NewRegionSslPoliciesRESTClient creates a new region ssl policies rest client.
The RegionSslPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionSslPoliciesClient) Close ¶
func (c *RegionSslPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionSslPoliciesClient) Connection
deprecated
func (c *RegionSslPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionSslPoliciesClient) Delete ¶
func (c *RegionSslPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionSslPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionSslPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionSslPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSslPoliciesClient) Get ¶
func (c *RegionSslPoliciesClient) Get(ctx context.Context, req *computepb.GetRegionSslPolicyRequest, opts ...gax.CallOption) (*computepb.SslPolicy, error)
Get lists all of the ordered rules present in a single specified policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionSslPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionSslPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionSslPoliciesClient) Insert ¶
func (c *RegionSslPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionSslPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new policy in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionSslPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionSslPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSslPoliciesClient) List ¶
func (c *RegionSslPoliciesClient) List(ctx context.Context, req *computepb.ListRegionSslPoliciesRequest, opts ...gax.CallOption) *SslPolicyIterator
List lists all the SSL policies that have been configured for the specified project and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionSslPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionSslPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SslPoliciesList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionSslPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionSslPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionSslPoliciesClient) ListAvailableFeatures ¶
func (c *RegionSslPoliciesClient) ListAvailableFeatures(ctx context.Context, req *computepb.ListAvailableFeaturesRegionSslPoliciesRequest, opts ...gax.CallOption) (*computepb.SslPoliciesListAvailableFeaturesResponse, error)
ListAvailableFeatures lists all features that can be specified in the SSL policy when using custom profile.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListAvailableFeaturesRegionSslPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListAvailableFeaturesRegionSslPoliciesRequest.
}
resp, err := c.ListAvailableFeatures(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionSslPoliciesClient) Patch ¶
func (c *RegionSslPoliciesClient) Patch(ctx context.Context, req *computepb.PatchRegionSslPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified SSL policy with the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionSslPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionSslPolicyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionSslPoliciesClient) TestIamPermissions ¶
func (c *RegionSslPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionSslPolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionSslPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionSslPolicyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionTargetHttpProxiesCallOptions ¶
type RegionTargetHttpProxiesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetUrlMap []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionTargetHttpProxiesCallOptions contains the retry settings for each method of RegionTargetHttpProxiesClient.
type RegionTargetHttpProxiesClient ¶
type RegionTargetHttpProxiesClient struct {
// The call options for this service.
CallOptions *RegionTargetHttpProxiesCallOptions
// contains filtered or unexported fields
}
RegionTargetHttpProxiesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionTargetHttpProxies API.
func NewRegionTargetHttpProxiesRESTClient ¶
func NewRegionTargetHttpProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionTargetHttpProxiesClient, error)
NewRegionTargetHttpProxiesRESTClient creates a new region target http proxies rest client.
The RegionTargetHttpProxies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionTargetHttpProxiesClient) Close ¶
func (c *RegionTargetHttpProxiesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionTargetHttpProxiesClient) Connection
deprecated
func (c *RegionTargetHttpProxiesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionTargetHttpProxiesClient) Delete ¶
func (c *RegionTargetHttpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified TargetHttpProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionTargetHttpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionTargetHttpProxyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionTargetHttpProxiesClient) Get ¶
func (c *RegionTargetHttpProxiesClient) Get(ctx context.Context, req *computepb.GetRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxy, error)
Get returns the specified TargetHttpProxy resource in the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionTargetHttpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionTargetHttpProxyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionTargetHttpProxiesClient) Insert ¶
func (c *RegionTargetHttpProxiesClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a TargetHttpProxy resource in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionTargetHttpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionTargetHttpProxyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionTargetHttpProxiesClient) List ¶
func (c *RegionTargetHttpProxiesClient) List(ctx context.Context, req *computepb.ListRegionTargetHttpProxiesRequest, opts ...gax.CallOption) *TargetHttpProxyIterator
List retrieves the list of TargetHttpProxy resources available to the specified project in the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionTargetHttpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionTargetHttpProxiesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetHttpProxyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionTargetHttpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionTargetHttpProxiesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionTargetHttpProxiesClient) SetUrlMap ¶
func (c *RegionTargetHttpProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetUrlMap changes the URL map for TargetHttpProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetUrlMapRegionTargetHttpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetUrlMapRegionTargetHttpProxyRequest.
}
op, err := c.SetUrlMap(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionTargetHttpProxiesClient) TestIamPermissions ¶
func (c *RegionTargetHttpProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionTargetHttpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionTargetHttpProxyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionTargetHttpsProxiesCallOptions ¶
type RegionTargetHttpsProxiesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetSslCertificates []gax.CallOption
SetUrlMap []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionTargetHttpsProxiesCallOptions contains the retry settings for each method of RegionTargetHttpsProxiesClient.
type RegionTargetHttpsProxiesClient ¶
type RegionTargetHttpsProxiesClient struct {
// The call options for this service.
CallOptions *RegionTargetHttpsProxiesCallOptions
// contains filtered or unexported fields
}
RegionTargetHttpsProxiesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionTargetHttpsProxies API.
func NewRegionTargetHttpsProxiesRESTClient ¶
func NewRegionTargetHttpsProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionTargetHttpsProxiesClient, error)
NewRegionTargetHttpsProxiesRESTClient creates a new region target https proxies rest client.
The RegionTargetHttpsProxies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionTargetHttpsProxiesClient) Close ¶
func (c *RegionTargetHttpsProxiesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionTargetHttpsProxiesClient) Connection
deprecated
func (c *RegionTargetHttpsProxiesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionTargetHttpsProxiesClient) Delete ¶
func (c *RegionTargetHttpsProxiesClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified TargetHttpsProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionTargetHttpsProxyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionTargetHttpsProxiesClient) Get ¶
func (c *RegionTargetHttpsProxiesClient) Get(ctx context.Context, req *computepb.GetRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxy, error)
Get returns the specified TargetHttpsProxy resource in the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionTargetHttpsProxyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionTargetHttpsProxiesClient) Insert ¶
func (c *RegionTargetHttpsProxiesClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a TargetHttpsProxy resource in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionTargetHttpsProxyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionTargetHttpsProxiesClient) List ¶
func (c *RegionTargetHttpsProxiesClient) List(ctx context.Context, req *computepb.ListRegionTargetHttpsProxiesRequest, opts ...gax.CallOption) *TargetHttpsProxyIterator
List retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionTargetHttpsProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionTargetHttpsProxiesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetHttpsProxyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionTargetHttpsProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionTargetHttpsProxiesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionTargetHttpsProxiesClient) Patch ¶
func (c *RegionTargetHttpsProxiesClient) Patch(ctx context.Context, req *computepb.PatchRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified regional TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionTargetHttpsProxyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionTargetHttpsProxiesClient) SetSslCertificates ¶
func (c *RegionTargetHttpsProxiesClient) SetSslCertificates(ctx context.Context, req *computepb.SetSslCertificatesRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetSslCertificates replaces SslCertificates for TargetHttpsProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSslCertificatesRegionTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetSslCertificatesRegionTargetHttpsProxyRequest.
}
op, err := c.SetSslCertificates(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionTargetHttpsProxiesClient) SetUrlMap ¶
func (c *RegionTargetHttpsProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetUrlMap changes the URL map for TargetHttpsProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetUrlMapRegionTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetUrlMapRegionTargetHttpsProxyRequest.
}
op, err := c.SetUrlMap(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionTargetHttpsProxiesClient) TestIamPermissions ¶
func (c *RegionTargetHttpsProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionTargetHttpsProxyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionTargetTcpProxiesCallOptions ¶
type RegionTargetTcpProxiesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
TestIamPermissions []gax.CallOption
}
RegionTargetTcpProxiesCallOptions contains the retry settings for each method of RegionTargetTcpProxiesClient.
type RegionTargetTcpProxiesClient ¶
type RegionTargetTcpProxiesClient struct {
// The call options for this service.
CallOptions *RegionTargetTcpProxiesCallOptions
// contains filtered or unexported fields
}
RegionTargetTcpProxiesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionTargetTcpProxies API.
func NewRegionTargetTcpProxiesRESTClient ¶
func NewRegionTargetTcpProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionTargetTcpProxiesClient, error)
NewRegionTargetTcpProxiesRESTClient creates a new region target tcp proxies rest client.
The RegionTargetTcpProxies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionTargetTcpProxiesClient) Close ¶
func (c *RegionTargetTcpProxiesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionTargetTcpProxiesClient) Connection
deprecated
func (c *RegionTargetTcpProxiesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionTargetTcpProxiesClient) Delete ¶
func (c *RegionTargetTcpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetTcpProxyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified TargetTcpProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionTargetTcpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionTargetTcpProxyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionTargetTcpProxiesClient) Get ¶
func (c *RegionTargetTcpProxiesClient) Get(ctx context.Context, req *computepb.GetRegionTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.TargetTcpProxy, error)
Get returns the specified TargetTcpProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionTargetTcpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionTargetTcpProxyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionTargetTcpProxiesClient) Insert ¶
func (c *RegionTargetTcpProxiesClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetTcpProxyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a TargetTcpProxy resource in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionTargetTcpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionTargetTcpProxyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionTargetTcpProxiesClient) List ¶
func (c *RegionTargetTcpProxiesClient) List(ctx context.Context, req *computepb.ListRegionTargetTcpProxiesRequest, opts ...gax.CallOption) *TargetTcpProxyIterator
List retrieves a list of TargetTcpProxy resources available to the specified project in a given region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionTargetTcpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionTargetTcpProxiesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetTcpProxyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionTargetTcpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionTargetTcpProxiesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionTargetTcpProxiesClient) TestIamPermissions ¶
func (c *RegionTargetTcpProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionTargetTcpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionTargetTcpProxyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionUrlMapsCallOptions ¶
type RegionUrlMapsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
InvalidateCache []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
Validate []gax.CallOption
}
RegionUrlMapsCallOptions contains the retry settings for each method of RegionUrlMapsClient.
type RegionUrlMapsClient ¶
type RegionUrlMapsClient struct {
// The call options for this service.
CallOptions *RegionUrlMapsCallOptions
// contains filtered or unexported fields
}
RegionUrlMapsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionUrlMaps API.
func NewRegionUrlMapsRESTClient ¶
func NewRegionUrlMapsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionUrlMapsClient, error)
NewRegionUrlMapsRESTClient creates a new region url maps rest client.
The RegionUrlMaps API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionUrlMapsClient) Close ¶
func (c *RegionUrlMapsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionUrlMapsClient) Connection
deprecated
func (c *RegionUrlMapsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionUrlMapsClient) Delete ¶
func (c *RegionUrlMapsClient) Delete(ctx context.Context, req *computepb.DeleteRegionUrlMapRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified UrlMap resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRegionUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRegionUrlMapRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionUrlMapsClient) Get ¶
func (c *RegionUrlMapsClient) Get(ctx context.Context, req *computepb.GetRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMap, error)
Get returns the specified UrlMap resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionUrlMapRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionUrlMapsClient) Insert ¶
func (c *RegionUrlMapsClient) Insert(ctx context.Context, req *computepb.InsertRegionUrlMapRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a UrlMap resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRegionUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRegionUrlMapRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionUrlMapsClient) InvalidateCache ¶
func (c *RegionUrlMapsClient) InvalidateCache(ctx context.Context, req *computepb.InvalidateCacheRegionUrlMapRequest, opts ...gax.CallOption) (*Operation, error)
InvalidateCache initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.
For more information, see Invalidating cached content (at /cdn/docs/invalidating-cached-content).
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InvalidateCacheRegionUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InvalidateCacheRegionUrlMapRequest.
}
op, err := c.InvalidateCache(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionUrlMapsClient) List ¶
func (c *RegionUrlMapsClient) List(ctx context.Context, req *computepb.ListRegionUrlMapsRequest, opts ...gax.CallOption) *UrlMapIterator
List retrieves the list of UrlMap resources available to the specified project in the specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionUrlMapsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionUrlMapsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.UrlMapList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionUrlMapsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionUrlMapsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RegionUrlMapsClient) Patch ¶
func (c *RegionUrlMapsClient) Patch(ctx context.Context, req *computepb.PatchRegionUrlMapRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified UrlMap resource with the data included in the request. This method supportsPATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRegionUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRegionUrlMapRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionUrlMapsClient) TestIamPermissions ¶
func (c *RegionUrlMapsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRegionUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRegionUrlMapRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionUrlMapsClient) Update ¶
func (c *RegionUrlMapsClient) Update(ctx context.Context, req *computepb.UpdateRegionUrlMapRequest, opts ...gax.CallOption) (*Operation, error)
Update updates the specified UrlMap resource with the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateRegionUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateRegionUrlMapRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RegionUrlMapsClient) Validate ¶
func (c *RegionUrlMapsClient) Validate(ctx context.Context, req *computepb.ValidateRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMapsValidateResponse, error)
Validate runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ValidateRegionUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ValidateRegionUrlMapRequest.
}
resp, err := c.Validate(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RegionZonesCallOptions ¶
type RegionZonesCallOptions struct {
List []gax.CallOption
}
RegionZonesCallOptions contains the retry settings for each method of RegionZonesClient.
type RegionZonesClient ¶
type RegionZonesClient struct {
// The call options for this service.
CallOptions *RegionZonesCallOptions
// contains filtered or unexported fields
}
RegionZonesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RegionZones API.
func NewRegionZonesRESTClient ¶
func NewRegionZonesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionZonesClient, error)
NewRegionZonesRESTClient creates a new region zones rest client.
The RegionZones API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionZonesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionZonesClient) Close ¶
func (c *RegionZonesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionZonesClient) Connection
deprecated
func (c *RegionZonesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionZonesClient) List ¶
func (c *RegionZonesClient) List(ctx context.Context, req *computepb.ListRegionZonesRequest, opts ...gax.CallOption) *ZoneIterator
List retrieves the list of Zone resources under the specific region available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionZonesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionZonesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionZonesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ZoneList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionZonesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionZonesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionZonesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type RegionsCallOptions ¶
type RegionsCallOptions struct {
Get []gax.CallOption
List []gax.CallOption
}
RegionsCallOptions contains the retry settings for each method of RegionsClient.
type RegionsClient ¶
type RegionsClient struct {
// The call options for this service.
CallOptions *RegionsCallOptions
// contains filtered or unexported fields
}
RegionsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Regions API.
func NewRegionsRESTClient ¶
func NewRegionsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionsClient, error)
NewRegionsRESTClient creates a new regions rest client.
The Regions API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RegionsClient) Close ¶
func (c *RegionsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegionsClient) Connection
deprecated
func (c *RegionsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegionsClient) Get ¶
func (c *RegionsClient) Get(ctx context.Context, req *computepb.GetRegionRequest, opts ...gax.CallOption) (*computepb.Region, error)
Get returns the specified Region resource.
To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the quotas field). To exclude one or more fields, set your request’s fields query parameter to only include the fields you need. For example, to only include the id and selfLink fields, add the query parameter ?fields=id,selfLink to your request.
This method fails if the quota information is unavailable for the region and if the organization policy constraint compute.requireBasicQuotaInResponse is enforced. This constraint, when enforced, disables the fail-open behaviour when quota information (the items.quotas field) is unavailable for the region. It is recommended to use the default setting for the constraint unless your application requires the fail-closed behaviour for this method.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRegionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRegionRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RegionsClient) List ¶
func (c *RegionsClient) List(ctx context.Context, req *computepb.ListRegionsRequest, opts ...gax.CallOption) *RegionIterator
List retrieves the list of region resources available to the specified project.
To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the items.quotas field). To exclude one or more fields, set your request’s fields query parameter to only include the fields you need. For example, to only include the id and selfLink fields, add the query parameter ?fields=id,selfLink to your request.
This method fails if the quota information is unavailable for the region and if the organization policy constraint compute.requireBasicQuotaInResponse is enforced. This constraint, when enforced, disables the fail-open behaviour when quota information (the items.quotas field) is unavailable for the region. It is recommended to use the default setting for the constraint unless your application requires the fail-closed behaviour for this method.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RegionList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRegionsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRegionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRegionsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type ReservationBlockIterator ¶
type ReservationBlockIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.ReservationBlock, nextPageToken string, err error)
// contains filtered or unexported fields
}
ReservationBlockIterator manages a stream of *computepb.ReservationBlock.
func (*ReservationBlockIterator) All ¶
func (it *ReservationBlockIterator) All() iter.Seq2[*computepb.ReservationBlock, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ReservationBlockIterator) Next ¶
func (it *ReservationBlockIterator) Next() (*computepb.ReservationBlock, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ReservationBlockIterator) PageInfo ¶
func (it *ReservationBlockIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ReservationBlocksCallOptions ¶
type ReservationBlocksCallOptions struct {
Get []gax.CallOption
GetIamPolicy []gax.CallOption
List []gax.CallOption
PerformMaintenance []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
ReservationBlocksCallOptions contains the retry settings for each method of ReservationBlocksClient.
type ReservationBlocksClient ¶
type ReservationBlocksClient struct {
// The call options for this service.
CallOptions *ReservationBlocksCallOptions
// contains filtered or unexported fields
}
ReservationBlocksClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ReservationBlocks API.
func NewReservationBlocksRESTClient ¶
func NewReservationBlocksRESTClient(ctx context.Context, opts ...option.ClientOption) (*ReservationBlocksClient, error)
NewReservationBlocksRESTClient creates a new reservation blocks rest client.
The ReservationBlocks API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ReservationBlocksClient) Close ¶
func (c *ReservationBlocksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ReservationBlocksClient) Connection
deprecated
func (c *ReservationBlocksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ReservationBlocksClient) Get ¶
func (c *ReservationBlocksClient) Get(ctx context.Context, req *computepb.GetReservationBlockRequest, opts ...gax.CallOption) (*computepb.ReservationBlocksGetResponse, error)
Get retrieves information about the specified reservation block.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetReservationBlockRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetReservationBlockRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReservationBlocksClient) GetIamPolicy ¶ added in v1.50.0
func (c *ReservationBlocksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyReservationBlockRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyReservationBlockRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyReservationBlockRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReservationBlocksClient) List ¶
func (c *ReservationBlocksClient) List(ctx context.Context, req *computepb.ListReservationBlocksRequest, opts ...gax.CallOption) *ReservationBlockIterator
List retrieves a list of reservation blocks under a single reservation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListReservationBlocksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListReservationBlocksRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ReservationBlocksListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListReservationBlocksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListReservationBlocksRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ReservationBlocksClient) PerformMaintenance ¶
func (c *ReservationBlocksClient) PerformMaintenance(ctx context.Context, req *computepb.PerformMaintenanceReservationBlockRequest, opts ...gax.CallOption) (*Operation, error)
PerformMaintenance allows customers to perform maintenance on a reservation block
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PerformMaintenanceReservationBlockRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PerformMaintenanceReservationBlockRequest.
}
op, err := c.PerformMaintenance(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ReservationBlocksClient) SetIamPolicy ¶ added in v1.50.0
func (c *ReservationBlocksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyReservationBlockRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyReservationBlockRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyReservationBlockRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReservationBlocksClient) TestIamPermissions ¶ added in v1.50.0
func (c *ReservationBlocksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsReservationBlockRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsReservationBlockRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsReservationBlockRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ReservationIterator ¶
type ReservationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Reservation, nextPageToken string, err error)
// contains filtered or unexported fields
}
ReservationIterator manages a stream of *computepb.Reservation.
func (*ReservationIterator) All ¶
func (it *ReservationIterator) All() iter.Seq2[*computepb.Reservation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ReservationIterator) Next ¶
func (it *ReservationIterator) Next() (*computepb.Reservation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ReservationIterator) PageInfo ¶
func (it *ReservationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ReservationSlotIterator ¶ added in v1.55.0
type ReservationSlotIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.ReservationSlot, nextPageToken string, err error)
// contains filtered or unexported fields
}
ReservationSlotIterator manages a stream of *computepb.ReservationSlot.
func (*ReservationSlotIterator) All ¶ added in v1.55.0
func (it *ReservationSlotIterator) All() iter.Seq2[*computepb.ReservationSlot, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ReservationSlotIterator) Next ¶ added in v1.55.0
func (it *ReservationSlotIterator) Next() (*computepb.ReservationSlot, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ReservationSlotIterator) PageInfo ¶ added in v1.55.0
func (it *ReservationSlotIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ReservationSlotsCallOptions ¶ added in v1.55.0
type ReservationSlotsCallOptions struct {
Get []gax.CallOption
List []gax.CallOption
Update []gax.CallOption
}
ReservationSlotsCallOptions contains the retry settings for each method of ReservationSlotsClient.
type ReservationSlotsClient ¶ added in v1.55.0
type ReservationSlotsClient struct {
// The call options for this service.
CallOptions *ReservationSlotsCallOptions
// contains filtered or unexported fields
}
ReservationSlotsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ReservationSlots API.
func NewReservationSlotsRESTClient ¶ added in v1.55.0
func NewReservationSlotsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ReservationSlotsClient, error)
NewReservationSlotsRESTClient creates a new reservation slots rest client.
The ReservationSlots API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSlotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ReservationSlotsClient) Close ¶ added in v1.55.0
func (c *ReservationSlotsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ReservationSlotsClient) Connection
deprecated
added in
v1.55.0
func (c *ReservationSlotsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ReservationSlotsClient) Get ¶ added in v1.55.0
func (c *ReservationSlotsClient) Get(ctx context.Context, req *computepb.GetReservationSlotRequest, opts ...gax.CallOption) (*computepb.ReservationSlotsGetResponse, error)
Get retrieves information about the specified reservation slot.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSlotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetReservationSlotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetReservationSlotRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReservationSlotsClient) List ¶ added in v1.55.0
func (c *ReservationSlotsClient) List(ctx context.Context, req *computepb.ListReservationSlotsRequest, opts ...gax.CallOption) *ReservationSlotIterator
List retrieves a list of reservation slots under a single reservation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSlotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListReservationSlotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListReservationSlotsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ReservationSlotsListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSlotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListReservationSlotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListReservationSlotsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ReservationSlotsClient) Update ¶ added in v1.55.0
func (c *ReservationSlotsClient) Update(ctx context.Context, req *computepb.UpdateReservationSlotRequest, opts ...gax.CallOption) (*Operation, error)
Update update a reservation slot in the specified sub-block.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSlotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateReservationSlotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateReservationSlotRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type ReservationSubBlockIterator ¶ added in v1.39.0
type ReservationSubBlockIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.ReservationSubBlock, nextPageToken string, err error)
// contains filtered or unexported fields
}
ReservationSubBlockIterator manages a stream of *computepb.ReservationSubBlock.
func (*ReservationSubBlockIterator) All ¶ added in v1.39.0
func (it *ReservationSubBlockIterator) All() iter.Seq2[*computepb.ReservationSubBlock, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ReservationSubBlockIterator) Next ¶ added in v1.39.0
func (it *ReservationSubBlockIterator) Next() (*computepb.ReservationSubBlock, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ReservationSubBlockIterator) PageInfo ¶ added in v1.39.0
func (it *ReservationSubBlockIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ReservationSubBlocksCallOptions ¶ added in v1.39.0
type ReservationSubBlocksCallOptions struct {
Get []gax.CallOption
GetIamPolicy []gax.CallOption
List []gax.CallOption
PerformMaintenance []gax.CallOption
ReportFaulty []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
ReservationSubBlocksCallOptions contains the retry settings for each method of ReservationSubBlocksClient.
type ReservationSubBlocksClient ¶ added in v1.39.0
type ReservationSubBlocksClient struct {
// The call options for this service.
CallOptions *ReservationSubBlocksCallOptions
// contains filtered or unexported fields
}
ReservationSubBlocksClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ReservationSubBlocks API.
func NewReservationSubBlocksRESTClient ¶ added in v1.39.0
func NewReservationSubBlocksRESTClient(ctx context.Context, opts ...option.ClientOption) (*ReservationSubBlocksClient, error)
NewReservationSubBlocksRESTClient creates a new reservation sub blocks rest client.
The ReservationSubBlocks API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSubBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ReservationSubBlocksClient) Close ¶ added in v1.39.0
func (c *ReservationSubBlocksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ReservationSubBlocksClient) Connection
deprecated
added in
v1.39.0
func (c *ReservationSubBlocksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ReservationSubBlocksClient) Get ¶ added in v1.39.0
func (c *ReservationSubBlocksClient) Get(ctx context.Context, req *computepb.GetReservationSubBlockRequest, opts ...gax.CallOption) (*computepb.ReservationSubBlocksGetResponse, error)
Get retrieves information about the specified reservation subBlock.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSubBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetReservationSubBlockRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetReservationSubBlockRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReservationSubBlocksClient) GetIamPolicy ¶ added in v1.50.0
func (c *ReservationSubBlocksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyReservationSubBlockRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSubBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyReservationSubBlockRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyReservationSubBlockRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReservationSubBlocksClient) List ¶ added in v1.39.0
func (c *ReservationSubBlocksClient) List(ctx context.Context, req *computepb.ListReservationSubBlocksRequest, opts ...gax.CallOption) *ReservationSubBlockIterator
List retrieves a list of reservation subBlocks under a single reservation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSubBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListReservationSubBlocksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListReservationSubBlocksRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ReservationSubBlocksListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSubBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListReservationSubBlocksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListReservationSubBlocksRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ReservationSubBlocksClient) PerformMaintenance ¶ added in v1.40.0
func (c *ReservationSubBlocksClient) PerformMaintenance(ctx context.Context, req *computepb.PerformMaintenanceReservationSubBlockRequest, opts ...gax.CallOption) (*Operation, error)
PerformMaintenance allows customers to perform maintenance on a reservation subBlock
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSubBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PerformMaintenanceReservationSubBlockRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PerformMaintenanceReservationSubBlockRequest.
}
op, err := c.PerformMaintenance(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ReservationSubBlocksClient) ReportFaulty ¶ added in v1.49.0
func (c *ReservationSubBlocksClient) ReportFaulty(ctx context.Context, req *computepb.ReportFaultyReservationSubBlockRequest, opts ...gax.CallOption) (*Operation, error)
ReportFaulty allows customers to report a faulty subBlock.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSubBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ReportFaultyReservationSubBlockRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ReportFaultyReservationSubBlockRequest.
}
op, err := c.ReportFaulty(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ReservationSubBlocksClient) SetIamPolicy ¶ added in v1.50.0
func (c *ReservationSubBlocksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyReservationSubBlockRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSubBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyReservationSubBlockRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyReservationSubBlockRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReservationSubBlocksClient) TestIamPermissions ¶ added in v1.50.0
func (c *ReservationSubBlocksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsReservationSubBlockRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationSubBlocksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsReservationSubBlockRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsReservationSubBlockRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ReservationsCallOptions ¶
type ReservationsCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
PerformMaintenance []gax.CallOption
Resize []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
ReservationsCallOptions contains the retry settings for each method of ReservationsClient.
type ReservationsClient ¶
type ReservationsClient struct {
// The call options for this service.
CallOptions *ReservationsCallOptions
// contains filtered or unexported fields
}
ReservationsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Reservations API.
func NewReservationsRESTClient ¶
func NewReservationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ReservationsClient, error)
NewReservationsRESTClient creates a new reservations rest client.
The Reservations API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ReservationsClient) AggregatedList ¶
func (c *ReservationsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListReservationsRequest, opts ...gax.CallOption) *ReservationsScopedListPairIterator
AggregatedList retrieves an aggregated list of reservations.
To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListReservationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListReservationsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ReservationAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListReservationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListReservationsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ReservationsClient) Close ¶
func (c *ReservationsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ReservationsClient) Connection
deprecated
func (c *ReservationsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ReservationsClient) Delete ¶
func (c *ReservationsClient) Delete(ctx context.Context, req *computepb.DeleteReservationRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified reservation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteReservationRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ReservationsClient) Get ¶
func (c *ReservationsClient) Get(ctx context.Context, req *computepb.GetReservationRequest, opts ...gax.CallOption) (*computepb.Reservation, error)
Get retrieves information about the specified reservation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetReservationRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReservationsClient) GetIamPolicy ¶
func (c *ReservationsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyReservationRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyReservationRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReservationsClient) Insert ¶
func (c *ReservationsClient) Insert(ctx context.Context, req *computepb.InsertReservationRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new reservation. For more information, readReserving zonal resources.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertReservationRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ReservationsClient) List ¶
func (c *ReservationsClient) List(ctx context.Context, req *computepb.ListReservationsRequest, opts ...gax.CallOption) *ReservationIterator
List a list of all the reservations that have been configured for the specified project in specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListReservationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListReservationsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ReservationList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListReservationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListReservationsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ReservationsClient) PerformMaintenance ¶
func (c *ReservationsClient) PerformMaintenance(ctx context.Context, req *computepb.PerformMaintenanceReservationRequest, opts ...gax.CallOption) (*Operation, error)
PerformMaintenance perform maintenance on an extended reservation
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PerformMaintenanceReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PerformMaintenanceReservationRequest.
}
op, err := c.PerformMaintenance(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ReservationsClient) Resize ¶
func (c *ReservationsClient) Resize(ctx context.Context, req *computepb.ResizeReservationRequest, opts ...gax.CallOption) (*Operation, error)
Resize resizes the reservation (applicable to standalone reservations only). For more information, readModifying reservations.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ResizeReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ResizeReservationRequest.
}
op, err := c.Resize(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ReservationsClient) SetIamPolicy ¶
func (c *ReservationsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyReservationRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyReservationRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReservationsClient) TestIamPermissions ¶
func (c *ReservationsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsReservationRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsReservationRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReservationsClient) Update ¶
func (c *ReservationsClient) Update(ctx context.Context, req *computepb.UpdateReservationRequest, opts ...gax.CallOption) (*Operation, error)
Update update share settings of the reservation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewReservationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateReservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateReservationRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type ReservationsScopedListPair ¶
type ReservationsScopedListPair struct {
Key string
Value *computepb.ReservationsScopedList
}
ReservationsScopedListPair is a holder type for string/*computepb.ReservationsScopedList map entries
type ReservationsScopedListPairIterator ¶
type ReservationsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []ReservationsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
ReservationsScopedListPairIterator manages a stream of ReservationsScopedListPair.
func (*ReservationsScopedListPairIterator) All ¶
func (it *ReservationsScopedListPairIterator) All() iter.Seq2[ReservationsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ReservationsScopedListPairIterator) Next ¶
func (it *ReservationsScopedListPairIterator) Next() (ReservationsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ReservationsScopedListPairIterator) PageInfo ¶
func (it *ReservationsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ResourcePoliciesCallOptions ¶
type ResourcePoliciesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
ResourcePoliciesCallOptions contains the retry settings for each method of ResourcePoliciesClient.
type ResourcePoliciesClient ¶
type ResourcePoliciesClient struct {
// The call options for this service.
CallOptions *ResourcePoliciesCallOptions
// contains filtered or unexported fields
}
ResourcePoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ResourcePolicies API.
func NewResourcePoliciesRESTClient ¶
func NewResourcePoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ResourcePoliciesClient, error)
NewResourcePoliciesRESTClient creates a new resource policies rest client.
The ResourcePolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ResourcePoliciesClient) AggregatedList ¶
func (c *ResourcePoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListResourcePoliciesRequest, opts ...gax.CallOption) *ResourcePoliciesScopedListPairIterator
AggregatedList retrieves an aggregated list of resource policies.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListResourcePoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListResourcePoliciesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ResourcePolicyAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListResourcePoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListResourcePoliciesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ResourcePoliciesClient) Close ¶
func (c *ResourcePoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ResourcePoliciesClient) Connection
deprecated
func (c *ResourcePoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ResourcePoliciesClient) Delete ¶
func (c *ResourcePoliciesClient) Delete(ctx context.Context, req *computepb.DeleteResourcePolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified resource policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteResourcePolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteResourcePolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ResourcePoliciesClient) Get ¶
func (c *ResourcePoliciesClient) Get(ctx context.Context, req *computepb.GetResourcePolicyRequest, opts ...gax.CallOption) (*computepb.ResourcePolicy, error)
Get retrieves all information of the specified resource policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetResourcePolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetResourcePolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ResourcePoliciesClient) GetIamPolicy ¶
func (c *ResourcePoliciesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyResourcePolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyResourcePolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyResourcePolicyRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ResourcePoliciesClient) Insert ¶
func (c *ResourcePoliciesClient) Insert(ctx context.Context, req *computepb.InsertResourcePolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new resource policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertResourcePolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertResourcePolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ResourcePoliciesClient) List ¶
func (c *ResourcePoliciesClient) List(ctx context.Context, req *computepb.ListResourcePoliciesRequest, opts ...gax.CallOption) *ResourcePolicyIterator
List a list all the resource policies that have been configured for the specified project in specified region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListResourcePoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListResourcePoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ResourcePolicyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListResourcePoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListResourcePoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ResourcePoliciesClient) Patch ¶
func (c *ResourcePoliciesClient) Patch(ctx context.Context, req *computepb.PatchResourcePolicyRequest, opts ...gax.CallOption) (*Operation, error)
Patch modify the specified resource policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchResourcePolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchResourcePolicyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ResourcePoliciesClient) SetIamPolicy ¶
func (c *ResourcePoliciesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyResourcePolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyResourcePolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyResourcePolicyRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ResourcePoliciesClient) TestIamPermissions ¶
func (c *ResourcePoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsResourcePolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewResourcePoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsResourcePolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsResourcePolicyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ResourcePoliciesScopedListPair ¶
type ResourcePoliciesScopedListPair struct {
Key string
Value *computepb.ResourcePoliciesScopedList
}
ResourcePoliciesScopedListPair is a holder type for string/*computepb.ResourcePoliciesScopedList map entries
type ResourcePoliciesScopedListPairIterator ¶
type ResourcePoliciesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []ResourcePoliciesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
ResourcePoliciesScopedListPairIterator manages a stream of ResourcePoliciesScopedListPair.
func (*ResourcePoliciesScopedListPairIterator) All ¶
func (it *ResourcePoliciesScopedListPairIterator) All() iter.Seq2[ResourcePoliciesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ResourcePoliciesScopedListPairIterator) Next ¶
func (it *ResourcePoliciesScopedListPairIterator) Next() (ResourcePoliciesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ResourcePoliciesScopedListPairIterator) PageInfo ¶
func (it *ResourcePoliciesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ResourcePolicyIterator ¶
type ResourcePolicyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.ResourcePolicy, nextPageToken string, err error)
// contains filtered or unexported fields
}
ResourcePolicyIterator manages a stream of *computepb.ResourcePolicy.
func (*ResourcePolicyIterator) All ¶
func (it *ResourcePolicyIterator) All() iter.Seq2[*computepb.ResourcePolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ResourcePolicyIterator) Next ¶
func (it *ResourcePolicyIterator) Next() (*computepb.ResourcePolicy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ResourcePolicyIterator) PageInfo ¶
func (it *ResourcePolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RolloutIterator ¶ added in v1.51.0
type RolloutIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Rollout, nextPageToken string, err error)
// contains filtered or unexported fields
}
RolloutIterator manages a stream of *computepb.Rollout.
func (*RolloutIterator) All ¶ added in v1.51.0
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RolloutIterator) Next ¶ added in v1.51.0
func (it *RolloutIterator) Next() (*computepb.Rollout, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*RolloutIterator) PageInfo ¶ added in v1.51.0
func (it *RolloutIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RolloutPlanIterator ¶ added in v1.51.0
type RolloutPlanIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.RolloutPlan, nextPageToken string, err error)
// contains filtered or unexported fields
}
RolloutPlanIterator manages a stream of *computepb.RolloutPlan.
func (*RolloutPlanIterator) All ¶ added in v1.51.0
func (it *RolloutPlanIterator) All() iter.Seq2[*computepb.RolloutPlan, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RolloutPlanIterator) Next ¶ added in v1.51.0
func (it *RolloutPlanIterator) Next() (*computepb.RolloutPlan, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*RolloutPlanIterator) PageInfo ¶ added in v1.51.0
func (it *RolloutPlanIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RolloutPlansCallOptions ¶ added in v1.51.0
type RolloutPlansCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
}
RolloutPlansCallOptions contains the retry settings for each method of RolloutPlansClient.
type RolloutPlansClient ¶ added in v1.51.0
type RolloutPlansClient struct {
// The call options for this service.
CallOptions *RolloutPlansCallOptions
// contains filtered or unexported fields
}
RolloutPlansClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The RolloutPlans API.
func NewRolloutPlansRESTClient ¶ added in v1.51.0
func NewRolloutPlansRESTClient(ctx context.Context, opts ...option.ClientOption) (*RolloutPlansClient, error)
NewRolloutPlansRESTClient creates a new rollout plans rest client.
The RolloutPlans API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutPlansRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RolloutPlansClient) Close ¶ added in v1.51.0
func (c *RolloutPlansClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RolloutPlansClient) Connection
deprecated
added in
v1.51.0
func (c *RolloutPlansClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RolloutPlansClient) Delete ¶ added in v1.51.0
func (c *RolloutPlansClient) Delete(ctx context.Context, req *computepb.DeleteRolloutPlanRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes a RolloutPlan.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutPlansRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRolloutPlanRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRolloutPlanRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RolloutPlansClient) Get ¶ added in v1.51.0
func (c *RolloutPlansClient) Get(ctx context.Context, req *computepb.GetRolloutPlanRequest, opts ...gax.CallOption) (*computepb.RolloutPlan, error)
Get gets details of a single project-scoped RolloutPlan.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutPlansRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRolloutPlanRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRolloutPlanRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RolloutPlansClient) Insert ¶ added in v1.51.0
func (c *RolloutPlansClient) Insert(ctx context.Context, req *computepb.InsertRolloutPlanRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new RolloutPlan in a given project and location.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutPlansRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRolloutPlanRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRolloutPlanRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RolloutPlansClient) List ¶ added in v1.51.0
func (c *RolloutPlansClient) List(ctx context.Context, req *computepb.ListRolloutPlansRequest, opts ...gax.CallOption) *RolloutPlanIterator
List lists RolloutPlans in a given project and location.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutPlansRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRolloutPlansRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRolloutPlansRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RolloutPlansListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutPlansRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRolloutPlansRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRolloutPlansRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type RolloutsCallOptions ¶ added in v1.51.0
type RolloutsCallOptions struct {
Cancel []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
List []gax.CallOption
}
RolloutsCallOptions contains the retry settings for each method of RolloutsClient.
type RolloutsClient ¶ added in v1.51.0
type RolloutsClient struct {
// The call options for this service.
CallOptions *RolloutsCallOptions
// contains filtered or unexported fields
}
RolloutsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Rollouts API.
func NewRolloutsRESTClient ¶ added in v1.51.0
func NewRolloutsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RolloutsClient, error)
NewRolloutsRESTClient creates a new rollouts rest client.
The Rollouts API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RolloutsClient) Cancel ¶ added in v1.51.0
func (c *RolloutsClient) Cancel(ctx context.Context, req *computepb.CancelRolloutRequest, opts ...gax.CallOption) (*Operation, error)
Cancel cancels a Rollout.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.CancelRolloutRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#CancelRolloutRequest.
}
op, err := c.Cancel(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RolloutsClient) Close ¶ added in v1.51.0
func (c *RolloutsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RolloutsClient) Connection
deprecated
added in
v1.51.0
func (c *RolloutsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RolloutsClient) Delete ¶ added in v1.51.0
func (c *RolloutsClient) Delete(ctx context.Context, req *computepb.DeleteRolloutRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes a Rollout.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRolloutRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRolloutRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RolloutsClient) Get ¶ added in v1.51.0
func (c *RolloutsClient) Get(ctx context.Context, req *computepb.GetRolloutRequest, opts ...gax.CallOption) (*computepb.Rollout, error)
Get gets details of a single project-scoped Rollout.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRolloutRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRolloutRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RolloutsClient) List ¶ added in v1.51.0
func (c *RolloutsClient) List(ctx context.Context, req *computepb.ListRolloutsRequest, opts ...gax.CallOption) *RolloutIterator
List lists Rollouts in a given project and location.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRolloutsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRolloutsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RolloutsListResponse)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRolloutsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRolloutsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRolloutsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type RouteIterator ¶
type RouteIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Route, nextPageToken string, err error)
// contains filtered or unexported fields
}
RouteIterator manages a stream of *computepb.Route.
func (*RouteIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RouteIterator) Next ¶
func (it *RouteIterator) Next() (*computepb.Route, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*RouteIterator) PageInfo ¶
func (it *RouteIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RoutePolicyIterator ¶
type RoutePolicyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.RoutePolicy, nextPageToken string, err error)
// contains filtered or unexported fields
}
RoutePolicyIterator manages a stream of *computepb.RoutePolicy.
func (*RoutePolicyIterator) All ¶
func (it *RoutePolicyIterator) All() iter.Seq2[*computepb.RoutePolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RoutePolicyIterator) Next ¶
func (it *RoutePolicyIterator) Next() (*computepb.RoutePolicy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*RoutePolicyIterator) PageInfo ¶
func (it *RoutePolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RouterIterator ¶
type RouterIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Router, nextPageToken string, err error)
// contains filtered or unexported fields
}
RouterIterator manages a stream of *computepb.Router.
func (*RouterIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RouterIterator) Next ¶
func (it *RouterIterator) Next() (*computepb.Router, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*RouterIterator) PageInfo ¶
func (it *RouterIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RoutersCallOptions ¶
type RoutersCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
DeleteRoutePolicy []gax.CallOption
Get []gax.CallOption
GetNatIpInfo []gax.CallOption
GetNatMappingInfo []gax.CallOption
GetRoutePolicy []gax.CallOption
GetRouterStatus []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListBgpRoutes []gax.CallOption
ListRoutePolicies []gax.CallOption
Patch []gax.CallOption
PatchRoutePolicy []gax.CallOption
Preview []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
UpdateRoutePolicy []gax.CallOption
}
RoutersCallOptions contains the retry settings for each method of RoutersClient.
type RoutersClient ¶
type RoutersClient struct {
// The call options for this service.
CallOptions *RoutersCallOptions
// contains filtered or unexported fields
}
RoutersClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Routers API.
func NewRoutersRESTClient ¶
func NewRoutersRESTClient(ctx context.Context, opts ...option.ClientOption) (*RoutersClient, error)
NewRoutersRESTClient creates a new routers rest client.
The Routers API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RoutersClient) AggregatedList ¶
func (c *RoutersClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRoutersRequest, opts ...gax.CallOption) *RoutersScopedListPairIterator
AggregatedList retrieves an aggregated list of routers.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRoutersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRoutersRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RouterAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListRoutersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListRoutersRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RoutersClient) Close ¶
func (c *RoutersClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RoutersClient) Connection
deprecated
func (c *RoutersClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RoutersClient) Delete ¶
func (c *RoutersClient) Delete(ctx context.Context, req *computepb.DeleteRouterRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified Router resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRouterRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RoutersClient) DeleteRoutePolicy ¶
func (c *RoutersClient) DeleteRoutePolicy(ctx context.Context, req *computepb.DeleteRoutePolicyRouterRequest, opts ...gax.CallOption) (*Operation, error)
DeleteRoutePolicy deletes Route Policy
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRoutePolicyRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRoutePolicyRouterRequest.
}
op, err := c.DeleteRoutePolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RoutersClient) Get ¶
func (c *RoutersClient) Get(ctx context.Context, req *computepb.GetRouterRequest, opts ...gax.CallOption) (*computepb.Router, error)
Get returns the specified Router resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRouterRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RoutersClient) GetNatIpInfo ¶
func (c *RoutersClient) GetNatIpInfo(ctx context.Context, req *computepb.GetNatIpInfoRouterRequest, opts ...gax.CallOption) (*computepb.NatIpInfoResponse, error)
GetNatIpInfo retrieves runtime NAT IP information.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNatIpInfoRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNatIpInfoRouterRequest.
}
resp, err := c.GetNatIpInfo(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RoutersClient) GetNatMappingInfo ¶
func (c *RoutersClient) GetNatMappingInfo(ctx context.Context, req *computepb.GetNatMappingInfoRoutersRequest, opts ...gax.CallOption) *VmEndpointNatMappingsIterator
GetNatMappingInfo retrieves runtime Nat mapping information of VM endpoints.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNatMappingInfoRoutersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNatMappingInfoRoutersRequest.
}
it := c.GetNatMappingInfo(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.VmEndpointNatMappingsList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetNatMappingInfoRoutersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetNatMappingInfoRoutersRequest.
}
for resp, err := range c.GetNatMappingInfo(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RoutersClient) GetRoutePolicy ¶
func (c *RoutersClient) GetRoutePolicy(ctx context.Context, req *computepb.GetRoutePolicyRouterRequest, opts ...gax.CallOption) (*computepb.RoutersGetRoutePolicyResponse, error)
GetRoutePolicy returns specified Route Policy
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRoutePolicyRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRoutePolicyRouterRequest.
}
resp, err := c.GetRoutePolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RoutersClient) GetRouterStatus ¶
func (c *RoutersClient) GetRouterStatus(ctx context.Context, req *computepb.GetRouterStatusRouterRequest, opts ...gax.CallOption) (*computepb.RouterStatusResponse, error)
GetRouterStatus retrieves runtime information of the specified router.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRouterStatusRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRouterStatusRouterRequest.
}
resp, err := c.GetRouterStatus(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RoutersClient) Insert ¶
func (c *RoutersClient) Insert(ctx context.Context, req *computepb.InsertRouterRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a Router resource in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRouterRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RoutersClient) List ¶
func (c *RoutersClient) List(ctx context.Context, req *computepb.ListRoutersRequest, opts ...gax.CallOption) *RouterIterator
List retrieves a list of Router resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRoutersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRoutersRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RouterList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRoutersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRoutersRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RoutersClient) ListBgpRoutes ¶
func (c *RoutersClient) ListBgpRoutes(ctx context.Context, req *computepb.ListBgpRoutesRoutersRequest, opts ...gax.CallOption) *BgpRouteIterator
ListBgpRoutes retrieves a list of router bgp routes available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListBgpRoutesRoutersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListBgpRoutesRoutersRequest.
}
it := c.ListBgpRoutes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RoutersListBgpRoutes)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListBgpRoutesRoutersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListBgpRoutesRoutersRequest.
}
for resp, err := range c.ListBgpRoutes(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RoutersClient) ListRoutePolicies ¶
func (c *RoutersClient) ListRoutePolicies(ctx context.Context, req *computepb.ListRoutePoliciesRoutersRequest, opts ...gax.CallOption) *RoutePolicyIterator
ListRoutePolicies retrieves a list of router route policy subresources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRoutePoliciesRoutersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRoutePoliciesRoutersRequest.
}
it := c.ListRoutePolicies(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RoutersListRoutePolicies)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRoutePoliciesRoutersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRoutePoliciesRoutersRequest.
}
for resp, err := range c.ListRoutePolicies(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RoutersClient) Patch ¶
func (c *RoutersClient) Patch(ctx context.Context, req *computepb.PatchRouterRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified Router resource with the data included in the request. This method supportsPATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRouterRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RoutersClient) PatchRoutePolicy ¶
func (c *RoutersClient) PatchRoutePolicy(ctx context.Context, req *computepb.PatchRoutePolicyRouterRequest, opts ...gax.CallOption) (*Operation, error)
PatchRoutePolicy patches Route Policy
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRoutePolicyRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRoutePolicyRouterRequest.
}
op, err := c.PatchRoutePolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RoutersClient) Preview ¶
func (c *RoutersClient) Preview(ctx context.Context, req *computepb.PreviewRouterRequest, opts ...gax.CallOption) (*computepb.RoutersPreviewResponse, error)
Preview preview fields auto-generated during router create andupdate operations. Calling this method does NOT create or update the router.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PreviewRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PreviewRouterRequest.
}
resp, err := c.Preview(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RoutersClient) TestIamPermissions ¶
func (c *RoutersClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRouterRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRouterRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RoutersClient) Update ¶
func (c *RoutersClient) Update(ctx context.Context, req *computepb.UpdateRouterRequest, opts ...gax.CallOption) (*Operation, error)
Update updates the specified Router resource with the data included in the request. This method conforms toPUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateRouterRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RoutersClient) UpdateRoutePolicy ¶
func (c *RoutersClient) UpdateRoutePolicy(ctx context.Context, req *computepb.UpdateRoutePolicyRouterRequest, opts ...gax.CallOption) (*Operation, error)
UpdateRoutePolicy updates or creates new Route Policy
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutersRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateRoutePolicyRouterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateRoutePolicyRouterRequest.
}
op, err := c.UpdateRoutePolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type RoutersScopedListPair ¶
type RoutersScopedListPair struct {
Key string
Value *computepb.RoutersScopedList
}
RoutersScopedListPair is a holder type for string/*computepb.RoutersScopedList map entries
type RoutersScopedListPairIterator ¶
type RoutersScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []RoutersScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
RoutersScopedListPairIterator manages a stream of RoutersScopedListPair.
func (*RoutersScopedListPairIterator) All ¶
func (it *RoutersScopedListPairIterator) All() iter.Seq2[RoutersScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RoutersScopedListPairIterator) Next ¶
func (it *RoutersScopedListPairIterator) Next() (RoutersScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*RoutersScopedListPairIterator) PageInfo ¶
func (it *RoutersScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RoutesCallOptions ¶
type RoutesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
TestIamPermissions []gax.CallOption
}
RoutesCallOptions contains the retry settings for each method of RoutesClient.
type RoutesClient ¶
type RoutesClient struct {
// The call options for this service.
CallOptions *RoutesCallOptions
// contains filtered or unexported fields
}
RoutesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Routes API.
func NewRoutesRESTClient ¶
func NewRoutesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RoutesClient, error)
NewRoutesRESTClient creates a new routes rest client.
The Routes API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RoutesClient) Close ¶
func (c *RoutesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RoutesClient) Connection
deprecated
func (c *RoutesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RoutesClient) Delete ¶
func (c *RoutesClient) Delete(ctx context.Context, req *computepb.DeleteRouteRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified Route resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteRouteRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RoutesClient) Get ¶
func (c *RoutesClient) Get(ctx context.Context, req *computepb.GetRouteRequest, opts ...gax.CallOption) (*computepb.Route, error)
Get returns the specified Route resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRouteRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RoutesClient) Insert ¶
func (c *RoutesClient) Insert(ctx context.Context, req *computepb.InsertRouteRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a Route resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertRouteRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*RoutesClient) List ¶
func (c *RoutesClient) List(ctx context.Context, req *computepb.ListRoutesRequest, opts ...gax.CallOption) *RouteIterator
List retrieves the list of Route resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRoutesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRoutesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.RouteList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListRoutesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListRoutesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RoutesClient) TestIamPermissions ¶
func (c *RoutesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRouteRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewRoutesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsRouteRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type SecurityPoliciesCallOptions ¶
type SecurityPoliciesCallOptions struct {
AddRule []gax.CallOption
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetRule []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListPreconfiguredExpressionSets []gax.CallOption
Patch []gax.CallOption
PatchRule []gax.CallOption
RemoveRule []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
SecurityPoliciesCallOptions contains the retry settings for each method of SecurityPoliciesClient.
type SecurityPoliciesClient ¶
type SecurityPoliciesClient struct {
// The call options for this service.
CallOptions *SecurityPoliciesCallOptions
// contains filtered or unexported fields
}
SecurityPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The SecurityPolicies API.
func NewSecurityPoliciesRESTClient ¶
func NewSecurityPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*SecurityPoliciesClient, error)
NewSecurityPoliciesRESTClient creates a new security policies rest client.
The SecurityPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*SecurityPoliciesClient) AddRule ¶
func (c *SecurityPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
AddRule inserts a rule into a security policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddRuleSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddRuleSecurityPolicyRequest.
}
op, err := c.AddRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SecurityPoliciesClient) AggregatedList ¶
func (c *SecurityPoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSecurityPoliciesRequest, opts ...gax.CallOption) *SecurityPoliciesScopedListPairIterator
AggregatedList retrieves the list of all SecurityPolicy resources, regional and global, available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListSecurityPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListSecurityPoliciesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SecurityPoliciesAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListSecurityPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListSecurityPoliciesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SecurityPoliciesClient) Close ¶
func (c *SecurityPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SecurityPoliciesClient) Connection
deprecated
func (c *SecurityPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SecurityPoliciesClient) Delete ¶
func (c *SecurityPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteSecurityPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SecurityPoliciesClient) Get ¶
func (c *SecurityPoliciesClient) Get(ctx context.Context, req *computepb.GetSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicy, error)
Get list all of the ordered rules present in a single specified policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetSecurityPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SecurityPoliciesClient) GetRule ¶
func (c *SecurityPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicyRule, error)
GetRule gets a rule at the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetRuleSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetRuleSecurityPolicyRequest.
}
resp, err := c.GetRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SecurityPoliciesClient) Insert ¶
func (c *SecurityPoliciesClient) Insert(ctx context.Context, req *computepb.InsertSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new policy in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertSecurityPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SecurityPoliciesClient) List ¶
func (c *SecurityPoliciesClient) List(ctx context.Context, req *computepb.ListSecurityPoliciesRequest, opts ...gax.CallOption) *SecurityPolicyIterator
List list all the policies that have been configured for the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListSecurityPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListSecurityPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SecurityPolicyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListSecurityPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListSecurityPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SecurityPoliciesClient) ListPreconfiguredExpressionSets ¶
func (c *SecurityPoliciesClient) ListPreconfiguredExpressionSets(ctx context.Context, req *computepb.ListPreconfiguredExpressionSetsSecurityPoliciesRequest, opts ...gax.CallOption) (*computepb.SecurityPoliciesListPreconfiguredExpressionSetsResponse, error)
ListPreconfiguredExpressionSets gets the current list of preconfigured Web Application Firewall (WAF) expressions.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListPreconfiguredExpressionSetsSecurityPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListPreconfiguredExpressionSetsSecurityPoliciesRequest.
}
resp, err := c.ListPreconfiguredExpressionSets(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SecurityPoliciesClient) Patch ¶
func (c *SecurityPoliciesClient) Patch(ctx context.Context, req *computepb.PatchSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchSecurityPolicyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SecurityPoliciesClient) PatchRule ¶
func (c *SecurityPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
PatchRule patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchRuleSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchRuleSecurityPolicyRequest.
}
op, err := c.PatchRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SecurityPoliciesClient) RemoveRule ¶
func (c *SecurityPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
RemoveRule deletes a rule at the specified priority.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveRuleSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveRuleSecurityPolicyRequest.
}
op, err := c.RemoveRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SecurityPoliciesClient) SetLabels ¶
func (c *SecurityPoliciesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsSecurityPolicyRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SecurityPoliciesClient) TestIamPermissions ¶
func (c *SecurityPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSecurityPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsSecurityPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsSecurityPolicyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type SecurityPoliciesScopedListPair ¶
type SecurityPoliciesScopedListPair struct {
Key string
Value *computepb.SecurityPoliciesScopedList
}
SecurityPoliciesScopedListPair is a holder type for string/*computepb.SecurityPoliciesScopedList map entries
type SecurityPoliciesScopedListPairIterator ¶
type SecurityPoliciesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []SecurityPoliciesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
SecurityPoliciesScopedListPairIterator manages a stream of SecurityPoliciesScopedListPair.
func (*SecurityPoliciesScopedListPairIterator) All ¶
func (it *SecurityPoliciesScopedListPairIterator) All() iter.Seq2[SecurityPoliciesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SecurityPoliciesScopedListPairIterator) Next ¶
func (it *SecurityPoliciesScopedListPairIterator) Next() (SecurityPoliciesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SecurityPoliciesScopedListPairIterator) PageInfo ¶
func (it *SecurityPoliciesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SecurityPolicyIterator ¶
type SecurityPolicyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.SecurityPolicy, nextPageToken string, err error)
// contains filtered or unexported fields
}
SecurityPolicyIterator manages a stream of *computepb.SecurityPolicy.
func (*SecurityPolicyIterator) All ¶
func (it *SecurityPolicyIterator) All() iter.Seq2[*computepb.SecurityPolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SecurityPolicyIterator) Next ¶
func (it *SecurityPolicyIterator) Next() (*computepb.SecurityPolicy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SecurityPolicyIterator) PageInfo ¶
func (it *SecurityPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ServiceAttachmentIterator ¶
type ServiceAttachmentIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.ServiceAttachment, nextPageToken string, err error)
// contains filtered or unexported fields
}
ServiceAttachmentIterator manages a stream of *computepb.ServiceAttachment.
func (*ServiceAttachmentIterator) All ¶
func (it *ServiceAttachmentIterator) All() iter.Seq2[*computepb.ServiceAttachment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ServiceAttachmentIterator) Next ¶
func (it *ServiceAttachmentIterator) Next() (*computepb.ServiceAttachment, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ServiceAttachmentIterator) PageInfo ¶
func (it *ServiceAttachmentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ServiceAttachmentsCallOptions ¶
type ServiceAttachmentsCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
ServiceAttachmentsCallOptions contains the retry settings for each method of ServiceAttachmentsClient.
type ServiceAttachmentsClient ¶
type ServiceAttachmentsClient struct {
// The call options for this service.
CallOptions *ServiceAttachmentsCallOptions
// contains filtered or unexported fields
}
ServiceAttachmentsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ServiceAttachments API.
func NewServiceAttachmentsRESTClient ¶
func NewServiceAttachmentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ServiceAttachmentsClient, error)
NewServiceAttachmentsRESTClient creates a new service attachments rest client.
The ServiceAttachments API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ServiceAttachmentsClient) AggregatedList ¶
func (c *ServiceAttachmentsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListServiceAttachmentsRequest, opts ...gax.CallOption) *ServiceAttachmentsScopedListPairIterator
AggregatedList retrieves the list of all ServiceAttachment resources, regional and global, available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListServiceAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListServiceAttachmentsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ServiceAttachmentAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListServiceAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListServiceAttachmentsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ServiceAttachmentsClient) Close ¶
func (c *ServiceAttachmentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ServiceAttachmentsClient) Connection
deprecated
func (c *ServiceAttachmentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ServiceAttachmentsClient) Delete ¶
func (c *ServiceAttachmentsClient) Delete(ctx context.Context, req *computepb.DeleteServiceAttachmentRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified ServiceAttachment in the given scope
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteServiceAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteServiceAttachmentRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ServiceAttachmentsClient) Get ¶
func (c *ServiceAttachmentsClient) Get(ctx context.Context, req *computepb.GetServiceAttachmentRequest, opts ...gax.CallOption) (*computepb.ServiceAttachment, error)
Get returns the specified ServiceAttachment resource in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetServiceAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetServiceAttachmentRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ServiceAttachmentsClient) GetIamPolicy ¶
func (c *ServiceAttachmentsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyServiceAttachmentRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyServiceAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyServiceAttachmentRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ServiceAttachmentsClient) Insert ¶
func (c *ServiceAttachmentsClient) Insert(ctx context.Context, req *computepb.InsertServiceAttachmentRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a ServiceAttachment in the specified project in the given scope using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertServiceAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertServiceAttachmentRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ServiceAttachmentsClient) List ¶
func (c *ServiceAttachmentsClient) List(ctx context.Context, req *computepb.ListServiceAttachmentsRequest, opts ...gax.CallOption) *ServiceAttachmentIterator
List lists the ServiceAttachments for a project in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListServiceAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListServiceAttachmentsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ServiceAttachmentList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListServiceAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListServiceAttachmentsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ServiceAttachmentsClient) Patch ¶
func (c *ServiceAttachmentsClient) Patch(ctx context.Context, req *computepb.PatchServiceAttachmentRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified ServiceAttachment resource with the data included in the request. This method supports PATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchServiceAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchServiceAttachmentRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ServiceAttachmentsClient) SetIamPolicy ¶
func (c *ServiceAttachmentsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyServiceAttachmentRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyServiceAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyServiceAttachmentRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ServiceAttachmentsClient) TestIamPermissions ¶
func (c *ServiceAttachmentsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsServiceAttachmentRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewServiceAttachmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsServiceAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsServiceAttachmentRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ServiceAttachmentsScopedListPair ¶
type ServiceAttachmentsScopedListPair struct {
Key string
Value *computepb.ServiceAttachmentsScopedList
}
ServiceAttachmentsScopedListPair is a holder type for string/*computepb.ServiceAttachmentsScopedList map entries
type ServiceAttachmentsScopedListPairIterator ¶
type ServiceAttachmentsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []ServiceAttachmentsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
ServiceAttachmentsScopedListPairIterator manages a stream of ServiceAttachmentsScopedListPair.
func (*ServiceAttachmentsScopedListPairIterator) All ¶
func (it *ServiceAttachmentsScopedListPairIterator) All() iter.Seq2[ServiceAttachmentsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ServiceAttachmentsScopedListPairIterator) Next ¶
func (it *ServiceAttachmentsScopedListPairIterator) Next() (ServiceAttachmentsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ServiceAttachmentsScopedListPairIterator) PageInfo ¶
func (it *ServiceAttachmentsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SnapshotIterator ¶
type SnapshotIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Snapshot, nextPageToken string, err error)
// contains filtered or unexported fields
}
SnapshotIterator manages a stream of *computepb.Snapshot.
func (*SnapshotIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SnapshotIterator) Next ¶
func (it *SnapshotIterator) Next() (*computepb.Snapshot, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SnapshotIterator) PageInfo ¶
func (it *SnapshotIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SnapshotSettingsCallOptions ¶
type SnapshotSettingsCallOptions struct {
Get []gax.CallOption
Patch []gax.CallOption
}
SnapshotSettingsCallOptions contains the retry settings for each method of SnapshotSettingsClient.
type SnapshotSettingsClient ¶
type SnapshotSettingsClient struct {
// The call options for this service.
CallOptions *SnapshotSettingsCallOptions
// contains filtered or unexported fields
}
SnapshotSettingsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The SnapshotSettings API.
func NewSnapshotSettingsRESTClient ¶
func NewSnapshotSettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*SnapshotSettingsClient, error)
NewSnapshotSettingsRESTClient creates a new snapshot settings service rest client.
The SnapshotSettings API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*SnapshotSettingsClient) Close ¶
func (c *SnapshotSettingsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SnapshotSettingsClient) Connection
deprecated
func (c *SnapshotSettingsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SnapshotSettingsClient) Get ¶
func (c *SnapshotSettingsClient) Get(ctx context.Context, req *computepb.GetSnapshotSettingRequest, opts ...gax.CallOption) (*computepb.SnapshotSettings, error)
Get get snapshot settings.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetSnapshotSettingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetSnapshotSettingRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SnapshotSettingsClient) Patch ¶
func (c *SnapshotSettingsClient) Patch(ctx context.Context, req *computepb.PatchSnapshotSettingRequest, opts ...gax.CallOption) (*Operation, error)
Patch patch snapshot settings.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotSettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchSnapshotSettingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchSnapshotSettingRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type SnapshotsCallOptions ¶
type SnapshotsCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetIamPolicy []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
SnapshotsCallOptions contains the retry settings for each method of SnapshotsClient.
type SnapshotsClient ¶
type SnapshotsClient struct {
// The call options for this service.
CallOptions *SnapshotsCallOptions
// contains filtered or unexported fields
}
SnapshotsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Snapshots API.
func NewSnapshotsRESTClient ¶
func NewSnapshotsRESTClient(ctx context.Context, opts ...option.ClientOption) (*SnapshotsClient, error)
NewSnapshotsRESTClient creates a new snapshots rest client.
The Snapshots API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*SnapshotsClient) AggregatedList ¶
func (c *SnapshotsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSnapshotsRequest, opts ...gax.CallOption) *SnapshotsScopedListPairIterator
AggregatedList retrieves an aggregated list of all of the snapshots in your project across all regions and global scope.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListSnapshotsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SnapshotAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListSnapshotsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SnapshotsClient) Close ¶
func (c *SnapshotsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SnapshotsClient) Connection
deprecated
func (c *SnapshotsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SnapshotsClient) Delete ¶
func (c *SnapshotsClient) Delete(ctx context.Context, req *computepb.DeleteSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.
For more information, seeDeleting snapshots.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteSnapshotRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SnapshotsClient) Get ¶
func (c *SnapshotsClient) Get(ctx context.Context, req *computepb.GetSnapshotRequest, opts ...gax.CallOption) (*computepb.Snapshot, error)
Get returns the specified Snapshot resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetSnapshotRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SnapshotsClient) GetIamPolicy ¶
func (c *SnapshotsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicySnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicySnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicySnapshotRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SnapshotsClient) Insert ¶
func (c *SnapshotsClient) Insert(ctx context.Context, req *computepb.InsertSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertSnapshotRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SnapshotsClient) List ¶
func (c *SnapshotsClient) List(ctx context.Context, req *computepb.ListSnapshotsRequest, opts ...gax.CallOption) *SnapshotIterator
List retrieves the list of Snapshot resources contained within the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListSnapshotsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SnapshotList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListSnapshotsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SnapshotsClient) SetIamPolicy ¶
func (c *SnapshotsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicySnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicySnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicySnapshotRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SnapshotsClient) SetLabels ¶
func (c *SnapshotsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsSnapshotRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a snapshot. To learn more about labels, read theLabeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsSnapshotRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SnapshotsClient) TestIamPermissions ¶
func (c *SnapshotsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSnapshotRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSnapshotsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsSnapshotRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type SnapshotsScopedListPair ¶
type SnapshotsScopedListPair struct {
Key string
Value *computepb.SnapshotsScopedList
}
SnapshotsScopedListPair is a holder type for string/*computepb.SnapshotsScopedList map entries
type SnapshotsScopedListPairIterator ¶
type SnapshotsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []SnapshotsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
SnapshotsScopedListPairIterator manages a stream of SnapshotsScopedListPair.
func (*SnapshotsScopedListPairIterator) All ¶
func (it *SnapshotsScopedListPairIterator) All() iter.Seq2[SnapshotsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SnapshotsScopedListPairIterator) Next ¶
func (it *SnapshotsScopedListPairIterator) Next() (SnapshotsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SnapshotsScopedListPairIterator) PageInfo ¶
func (it *SnapshotsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SslCertificateIterator ¶
type SslCertificateIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.SslCertificate, nextPageToken string, err error)
// contains filtered or unexported fields
}
SslCertificateIterator manages a stream of *computepb.SslCertificate.
func (*SslCertificateIterator) All ¶
func (it *SslCertificateIterator) All() iter.Seq2[*computepb.SslCertificate, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SslCertificateIterator) Next ¶
func (it *SslCertificateIterator) Next() (*computepb.SslCertificate, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SslCertificateIterator) PageInfo ¶
func (it *SslCertificateIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SslCertificatesCallOptions ¶
type SslCertificatesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
TestIamPermissions []gax.CallOption
}
SslCertificatesCallOptions contains the retry settings for each method of SslCertificatesClient.
type SslCertificatesClient ¶
type SslCertificatesClient struct {
// The call options for this service.
CallOptions *SslCertificatesCallOptions
// contains filtered or unexported fields
}
SslCertificatesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The SslCertificates API.
func NewSslCertificatesRESTClient ¶
func NewSslCertificatesRESTClient(ctx context.Context, opts ...option.ClientOption) (*SslCertificatesClient, error)
NewSslCertificatesRESTClient creates a new ssl certificates rest client.
The SslCertificates API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*SslCertificatesClient) AggregatedList ¶
func (c *SslCertificatesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSslCertificatesRequest, opts ...gax.CallOption) *SslCertificatesScopedListPairIterator
AggregatedList retrieves the list of all SslCertificate resources, regional and global, available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListSslCertificatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListSslCertificatesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SslCertificateAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListSslCertificatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListSslCertificatesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SslCertificatesClient) Close ¶
func (c *SslCertificatesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SslCertificatesClient) Connection
deprecated
func (c *SslCertificatesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SslCertificatesClient) Delete ¶
func (c *SslCertificatesClient) Delete(ctx context.Context, req *computepb.DeleteSslCertificateRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified SslCertificate resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteSslCertificateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteSslCertificateRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SslCertificatesClient) Get ¶
func (c *SslCertificatesClient) Get(ctx context.Context, req *computepb.GetSslCertificateRequest, opts ...gax.CallOption) (*computepb.SslCertificate, error)
Get returns the specified SslCertificate resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetSslCertificateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetSslCertificateRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SslCertificatesClient) Insert ¶
func (c *SslCertificatesClient) Insert(ctx context.Context, req *computepb.InsertSslCertificateRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a SslCertificate resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertSslCertificateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertSslCertificateRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SslCertificatesClient) List ¶
func (c *SslCertificatesClient) List(ctx context.Context, req *computepb.ListSslCertificatesRequest, opts ...gax.CallOption) *SslCertificateIterator
List retrieves the list of SslCertificate resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListSslCertificatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListSslCertificatesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SslCertificateList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListSslCertificatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListSslCertificatesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SslCertificatesClient) TestIamPermissions ¶
func (c *SslCertificatesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSslCertificateRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslCertificatesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsSslCertificateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsSslCertificateRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type SslCertificatesScopedListPair ¶
type SslCertificatesScopedListPair struct {
Key string
Value *computepb.SslCertificatesScopedList
}
SslCertificatesScopedListPair is a holder type for string/*computepb.SslCertificatesScopedList map entries
type SslCertificatesScopedListPairIterator ¶
type SslCertificatesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []SslCertificatesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
SslCertificatesScopedListPairIterator manages a stream of SslCertificatesScopedListPair.
func (*SslCertificatesScopedListPairIterator) All ¶
func (it *SslCertificatesScopedListPairIterator) All() iter.Seq2[SslCertificatesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SslCertificatesScopedListPairIterator) Next ¶
func (it *SslCertificatesScopedListPairIterator) Next() (SslCertificatesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SslCertificatesScopedListPairIterator) PageInfo ¶
func (it *SslCertificatesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SslPoliciesCallOptions ¶
type SslPoliciesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListAvailableFeatures []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
}
SslPoliciesCallOptions contains the retry settings for each method of SslPoliciesClient.
type SslPoliciesClient ¶
type SslPoliciesClient struct {
// The call options for this service.
CallOptions *SslPoliciesCallOptions
// contains filtered or unexported fields
}
SslPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The SslPolicies API.
func NewSslPoliciesRESTClient ¶
func NewSslPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*SslPoliciesClient, error)
NewSslPoliciesRESTClient creates a new ssl policies rest client.
The SslPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*SslPoliciesClient) AggregatedList ¶
func (c *SslPoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSslPoliciesRequest, opts ...gax.CallOption) *SslPoliciesScopedListPairIterator
AggregatedList retrieves the list of all SslPolicy resources, regional and global, available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListSslPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListSslPoliciesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SslPoliciesAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListSslPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListSslPoliciesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SslPoliciesClient) Close ¶
func (c *SslPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SslPoliciesClient) Connection
deprecated
func (c *SslPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SslPoliciesClient) Delete ¶
func (c *SslPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteSslPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteSslPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteSslPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SslPoliciesClient) Get ¶
func (c *SslPoliciesClient) Get(ctx context.Context, req *computepb.GetSslPolicyRequest, opts ...gax.CallOption) (*computepb.SslPolicy, error)
Get lists all of the ordered rules present in a single specified policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetSslPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetSslPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SslPoliciesClient) Insert ¶
func (c *SslPoliciesClient) Insert(ctx context.Context, req *computepb.InsertSslPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert returns the specified SSL policy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertSslPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertSslPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SslPoliciesClient) List ¶
func (c *SslPoliciesClient) List(ctx context.Context, req *computepb.ListSslPoliciesRequest, opts ...gax.CallOption) *SslPolicyIterator
List lists all the SSL policies that have been configured for the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListSslPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListSslPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SslPoliciesList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListSslPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListSslPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SslPoliciesClient) ListAvailableFeatures ¶
func (c *SslPoliciesClient) ListAvailableFeatures(ctx context.Context, req *computepb.ListAvailableFeaturesSslPoliciesRequest, opts ...gax.CallOption) (*computepb.SslPoliciesListAvailableFeaturesResponse, error)
ListAvailableFeatures lists all features that can be specified in the SSL policy when using custom profile.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListAvailableFeaturesSslPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListAvailableFeaturesSslPoliciesRequest.
}
resp, err := c.ListAvailableFeatures(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SslPoliciesClient) Patch ¶
func (c *SslPoliciesClient) Patch(ctx context.Context, req *computepb.PatchSslPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified SSL policy with the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchSslPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchSslPolicyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SslPoliciesClient) TestIamPermissions ¶
func (c *SslPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSslPolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSslPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsSslPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsSslPolicyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type SslPoliciesScopedListPair ¶
type SslPoliciesScopedListPair struct {
Key string
Value *computepb.SslPoliciesScopedList
}
SslPoliciesScopedListPair is a holder type for string/*computepb.SslPoliciesScopedList map entries
type SslPoliciesScopedListPairIterator ¶
type SslPoliciesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []SslPoliciesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
SslPoliciesScopedListPairIterator manages a stream of SslPoliciesScopedListPair.
func (*SslPoliciesScopedListPairIterator) All ¶
func (it *SslPoliciesScopedListPairIterator) All() iter.Seq2[SslPoliciesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SslPoliciesScopedListPairIterator) Next ¶
func (it *SslPoliciesScopedListPairIterator) Next() (SslPoliciesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SslPoliciesScopedListPairIterator) PageInfo ¶
func (it *SslPoliciesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SslPolicyIterator ¶
type SslPolicyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.SslPolicy, nextPageToken string, err error)
// contains filtered or unexported fields
}
SslPolicyIterator manages a stream of *computepb.SslPolicy.
func (*SslPolicyIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SslPolicyIterator) Next ¶
func (it *SslPolicyIterator) Next() (*computepb.SslPolicy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SslPolicyIterator) PageInfo ¶
func (it *SslPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type StoragePoolDiskIterator ¶
type StoragePoolDiskIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.StoragePoolDisk, nextPageToken string, err error)
// contains filtered or unexported fields
}
StoragePoolDiskIterator manages a stream of *computepb.StoragePoolDisk.
func (*StoragePoolDiskIterator) All ¶
func (it *StoragePoolDiskIterator) All() iter.Seq2[*computepb.StoragePoolDisk, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*StoragePoolDiskIterator) Next ¶
func (it *StoragePoolDiskIterator) Next() (*computepb.StoragePoolDisk, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*StoragePoolDiskIterator) PageInfo ¶
func (it *StoragePoolDiskIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type StoragePoolIterator ¶
type StoragePoolIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.StoragePool, nextPageToken string, err error)
// contains filtered or unexported fields
}
StoragePoolIterator manages a stream of *computepb.StoragePool.
func (*StoragePoolIterator) All ¶
func (it *StoragePoolIterator) All() iter.Seq2[*computepb.StoragePool, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*StoragePoolIterator) Next ¶
func (it *StoragePoolIterator) Next() (*computepb.StoragePool, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*StoragePoolIterator) PageInfo ¶
func (it *StoragePoolIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type StoragePoolTypeIterator ¶
type StoragePoolTypeIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.StoragePoolType, nextPageToken string, err error)
// contains filtered or unexported fields
}
StoragePoolTypeIterator manages a stream of *computepb.StoragePoolType.
func (*StoragePoolTypeIterator) All ¶
func (it *StoragePoolTypeIterator) All() iter.Seq2[*computepb.StoragePoolType, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*StoragePoolTypeIterator) Next ¶
func (it *StoragePoolTypeIterator) Next() (*computepb.StoragePoolType, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*StoragePoolTypeIterator) PageInfo ¶
func (it *StoragePoolTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type StoragePoolTypesCallOptions ¶
type StoragePoolTypesCallOptions struct {
AggregatedList []gax.CallOption
Get []gax.CallOption
List []gax.CallOption
}
StoragePoolTypesCallOptions contains the retry settings for each method of StoragePoolTypesClient.
type StoragePoolTypesClient ¶
type StoragePoolTypesClient struct {
// The call options for this service.
CallOptions *StoragePoolTypesCallOptions
// contains filtered or unexported fields
}
StoragePoolTypesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The StoragePoolTypes API.
func NewStoragePoolTypesRESTClient ¶
func NewStoragePoolTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*StoragePoolTypesClient, error)
NewStoragePoolTypesRESTClient creates a new storage pool types rest client.
The StoragePoolTypes API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*StoragePoolTypesClient) AggregatedList ¶
func (c *StoragePoolTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListStoragePoolTypesRequest, opts ...gax.CallOption) *StoragePoolTypesScopedListPairIterator
AggregatedList retrieves an aggregated list of storage pool types.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListStoragePoolTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListStoragePoolTypesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.StoragePoolTypeAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListStoragePoolTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListStoragePoolTypesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*StoragePoolTypesClient) Close ¶
func (c *StoragePoolTypesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*StoragePoolTypesClient) Connection
deprecated
func (c *StoragePoolTypesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*StoragePoolTypesClient) Get ¶
func (c *StoragePoolTypesClient) Get(ctx context.Context, req *computepb.GetStoragePoolTypeRequest, opts ...gax.CallOption) (*computepb.StoragePoolType, error)
Get returns the specified storage pool type.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetStoragePoolTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetStoragePoolTypeRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*StoragePoolTypesClient) List ¶
func (c *StoragePoolTypesClient) List(ctx context.Context, req *computepb.ListStoragePoolTypesRequest, opts ...gax.CallOption) *StoragePoolTypeIterator
List retrieves a list of storage pool types available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListStoragePoolTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListStoragePoolTypesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.StoragePoolTypeList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListStoragePoolTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListStoragePoolTypesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type StoragePoolTypesScopedListPair ¶
type StoragePoolTypesScopedListPair struct {
Key string
Value *computepb.StoragePoolTypesScopedList
}
StoragePoolTypesScopedListPair is a holder type for string/*computepb.StoragePoolTypesScopedList map entries
type StoragePoolTypesScopedListPairIterator ¶
type StoragePoolTypesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []StoragePoolTypesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
StoragePoolTypesScopedListPairIterator manages a stream of StoragePoolTypesScopedListPair.
func (*StoragePoolTypesScopedListPairIterator) All ¶
func (it *StoragePoolTypesScopedListPairIterator) All() iter.Seq2[StoragePoolTypesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*StoragePoolTypesScopedListPairIterator) Next ¶
func (it *StoragePoolTypesScopedListPairIterator) Next() (StoragePoolTypesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*StoragePoolTypesScopedListPairIterator) PageInfo ¶
func (it *StoragePoolTypesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type StoragePoolsCallOptions ¶
type StoragePoolsCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListDisks []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
StoragePoolsCallOptions contains the retry settings for each method of StoragePoolsClient.
type StoragePoolsClient ¶
type StoragePoolsClient struct {
// The call options for this service.
CallOptions *StoragePoolsCallOptions
// contains filtered or unexported fields
}
StoragePoolsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The StoragePools API.
func NewStoragePoolsRESTClient ¶
func NewStoragePoolsRESTClient(ctx context.Context, opts ...option.ClientOption) (*StoragePoolsClient, error)
NewStoragePoolsRESTClient creates a new storage pools rest client.
The StoragePools API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*StoragePoolsClient) AggregatedList ¶
func (c *StoragePoolsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListStoragePoolsRequest, opts ...gax.CallOption) *StoragePoolsScopedListPairIterator
AggregatedList retrieves an aggregated list of storage pools.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListStoragePoolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListStoragePoolsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.StoragePoolAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListStoragePoolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListStoragePoolsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*StoragePoolsClient) Close ¶
func (c *StoragePoolsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*StoragePoolsClient) Connection
deprecated
func (c *StoragePoolsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*StoragePoolsClient) Delete ¶
func (c *StoragePoolsClient) Delete(ctx context.Context, req *computepb.DeleteStoragePoolRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified storage pool. Deleting a storagePool removes its data permanently and is irreversible. However, deleting a storagePool does not delete any snapshots previously made from the storagePool. You must separately delete snapshots.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteStoragePoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteStoragePoolRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*StoragePoolsClient) Get ¶
func (c *StoragePoolsClient) Get(ctx context.Context, req *computepb.GetStoragePoolRequest, opts ...gax.CallOption) (*computepb.StoragePool, error)
Get returns a specified storage pool. Gets a list of available storage pools by making a list() request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetStoragePoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetStoragePoolRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*StoragePoolsClient) GetIamPolicy ¶
func (c *StoragePoolsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyStoragePoolRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicyStoragePoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicyStoragePoolRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*StoragePoolsClient) Insert ¶
func (c *StoragePoolsClient) Insert(ctx context.Context, req *computepb.InsertStoragePoolRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a storage pool in the specified project using the data in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertStoragePoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertStoragePoolRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*StoragePoolsClient) List ¶
func (c *StoragePoolsClient) List(ctx context.Context, req *computepb.ListStoragePoolsRequest, opts ...gax.CallOption) *StoragePoolIterator
List retrieves a list of storage pools contained within the specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListStoragePoolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListStoragePoolsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.StoragePoolList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListStoragePoolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListStoragePoolsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*StoragePoolsClient) ListDisks ¶
func (c *StoragePoolsClient) ListDisks(ctx context.Context, req *computepb.ListDisksStoragePoolsRequest, opts ...gax.CallOption) *StoragePoolDiskIterator
ListDisks lists the disks in a specified storage pool.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListDisksStoragePoolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListDisksStoragePoolsRequest.
}
it := c.ListDisks(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.StoragePoolListDisks)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListDisksStoragePoolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListDisksStoragePoolsRequest.
}
for resp, err := range c.ListDisks(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*StoragePoolsClient) SetIamPolicy ¶
func (c *StoragePoolsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyStoragePoolRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicyStoragePoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicyStoragePoolRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*StoragePoolsClient) TestIamPermissions ¶
func (c *StoragePoolsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsStoragePoolRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsStoragePoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsStoragePoolRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*StoragePoolsClient) Update ¶
func (c *StoragePoolsClient) Update(ctx context.Context, req *computepb.UpdateStoragePoolRequest, opts ...gax.CallOption) (*Operation, error)
Update updates the specified storagePool with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: pool_provisioned_capacity_gb, pool_provisioned_iops and pool_provisioned_throughput.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewStoragePoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateStoragePoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateStoragePoolRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type StoragePoolsScopedListPair ¶
type StoragePoolsScopedListPair struct {
Key string
Value *computepb.StoragePoolsScopedList
}
StoragePoolsScopedListPair is a holder type for string/*computepb.StoragePoolsScopedList map entries
type StoragePoolsScopedListPairIterator ¶
type StoragePoolsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []StoragePoolsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
StoragePoolsScopedListPairIterator manages a stream of StoragePoolsScopedListPair.
func (*StoragePoolsScopedListPairIterator) All ¶
func (it *StoragePoolsScopedListPairIterator) All() iter.Seq2[StoragePoolsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*StoragePoolsScopedListPairIterator) Next ¶
func (it *StoragePoolsScopedListPairIterator) Next() (StoragePoolsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*StoragePoolsScopedListPairIterator) PageInfo ¶
func (it *StoragePoolsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SubnetworkIterator ¶
type SubnetworkIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Subnetwork, nextPageToken string, err error)
// contains filtered or unexported fields
}
SubnetworkIterator manages a stream of *computepb.Subnetwork.
func (*SubnetworkIterator) All ¶
func (it *SubnetworkIterator) All() iter.Seq2[*computepb.Subnetwork, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SubnetworkIterator) Next ¶
func (it *SubnetworkIterator) Next() (*computepb.Subnetwork, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SubnetworkIterator) PageInfo ¶
func (it *SubnetworkIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SubnetworksCallOptions ¶
type SubnetworksCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
ExpandIpCidrRange []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListUsable []gax.CallOption
Patch []gax.CallOption
SetIamPolicy []gax.CallOption
SetPrivateIpGoogleAccess []gax.CallOption
TestIamPermissions []gax.CallOption
}
SubnetworksCallOptions contains the retry settings for each method of SubnetworksClient.
type SubnetworksClient ¶
type SubnetworksClient struct {
// The call options for this service.
CallOptions *SubnetworksCallOptions
// contains filtered or unexported fields
}
SubnetworksClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Subnetworks API.
func NewSubnetworksRESTClient ¶
func NewSubnetworksRESTClient(ctx context.Context, opts ...option.ClientOption) (*SubnetworksClient, error)
NewSubnetworksRESTClient creates a new subnetworks rest client.
The Subnetworks API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*SubnetworksClient) AggregatedList ¶
func (c *SubnetworksClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSubnetworksRequest, opts ...gax.CallOption) *SubnetworksScopedListPairIterator
AggregatedList retrieves an aggregated list of subnetworks.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListSubnetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListSubnetworksRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SubnetworkAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListSubnetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListSubnetworksRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SubnetworksClient) Close ¶
func (c *SubnetworksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SubnetworksClient) Connection
deprecated
func (c *SubnetworksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SubnetworksClient) Delete ¶
func (c *SubnetworksClient) Delete(ctx context.Context, req *computepb.DeleteSubnetworkRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified subnetwork.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteSubnetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteSubnetworkRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SubnetworksClient) ExpandIpCidrRange ¶
func (c *SubnetworksClient) ExpandIpCidrRange(ctx context.Context, req *computepb.ExpandIpCidrRangeSubnetworkRequest, opts ...gax.CallOption) (*Operation, error)
ExpandIpCidrRange expands the IP CIDR range of the subnetwork to a specified value.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ExpandIpCidrRangeSubnetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ExpandIpCidrRangeSubnetworkRequest.
}
op, err := c.ExpandIpCidrRange(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SubnetworksClient) Get ¶
func (c *SubnetworksClient) Get(ctx context.Context, req *computepb.GetSubnetworkRequest, opts ...gax.CallOption) (*computepb.Subnetwork, error)
Get returns the specified subnetwork.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetSubnetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetSubnetworkRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SubnetworksClient) GetIamPolicy ¶
func (c *SubnetworksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicySubnetworkRequest, opts ...gax.CallOption) (*computepb.Policy, error)
GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetIamPolicySubnetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetIamPolicySubnetworkRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SubnetworksClient) Insert ¶
func (c *SubnetworksClient) Insert(ctx context.Context, req *computepb.InsertSubnetworkRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a subnetwork in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertSubnetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertSubnetworkRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SubnetworksClient) List ¶
func (c *SubnetworksClient) List(ctx context.Context, req *computepb.ListSubnetworksRequest, opts ...gax.CallOption) *SubnetworkIterator
List retrieves a list of subnetworks available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListSubnetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListSubnetworksRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.SubnetworkList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListSubnetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListSubnetworksRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SubnetworksClient) ListUsable ¶
func (c *SubnetworksClient) ListUsable(ctx context.Context, req *computepb.ListUsableSubnetworksRequest, opts ...gax.CallOption) *UsableSubnetworkIterator
ListUsable retrieves an aggregated list of all usable subnetworks in the project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUsableSubnetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUsableSubnetworksRequest.
}
it := c.ListUsable(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.UsableSubnetworksAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUsableSubnetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUsableSubnetworksRequest.
}
for resp, err := range c.ListUsable(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SubnetworksClient) Patch ¶
func (c *SubnetworksClient) Patch(ctx context.Context, req *computepb.PatchSubnetworkRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchSubnetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchSubnetworkRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SubnetworksClient) SetIamPolicy ¶
func (c *SubnetworksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicySubnetworkRequest, opts ...gax.CallOption) (*computepb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetIamPolicySubnetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetIamPolicySubnetworkRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SubnetworksClient) SetPrivateIpGoogleAccess ¶
func (c *SubnetworksClient) SetPrivateIpGoogleAccess(ctx context.Context, req *computepb.SetPrivateIpGoogleAccessSubnetworkRequest, opts ...gax.CallOption) (*Operation, error)
SetPrivateIpGoogleAccess set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetPrivateIpGoogleAccessSubnetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetPrivateIpGoogleAccessSubnetworkRequest.
}
op, err := c.SetPrivateIpGoogleAccess(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*SubnetworksClient) TestIamPermissions ¶
func (c *SubnetworksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSubnetworkRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewSubnetworksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsSubnetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsSubnetworkRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type SubnetworksScopedListPair ¶
type SubnetworksScopedListPair struct {
Key string
Value *computepb.SubnetworksScopedList
}
SubnetworksScopedListPair is a holder type for string/*computepb.SubnetworksScopedList map entries
type SubnetworksScopedListPairIterator ¶
type SubnetworksScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []SubnetworksScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
SubnetworksScopedListPairIterator manages a stream of SubnetworksScopedListPair.
func (*SubnetworksScopedListPairIterator) All ¶
func (it *SubnetworksScopedListPairIterator) All() iter.Seq2[SubnetworksScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SubnetworksScopedListPairIterator) Next ¶
func (it *SubnetworksScopedListPairIterator) Next() (SubnetworksScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SubnetworksScopedListPairIterator) PageInfo ¶
func (it *SubnetworksScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetGrpcProxiesCallOptions ¶
type TargetGrpcProxiesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
}
TargetGrpcProxiesCallOptions contains the retry settings for each method of TargetGrpcProxiesClient.
type TargetGrpcProxiesClient ¶
type TargetGrpcProxiesClient struct {
// The call options for this service.
CallOptions *TargetGrpcProxiesCallOptions
// contains filtered or unexported fields
}
TargetGrpcProxiesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The TargetGrpcProxies API.
func NewTargetGrpcProxiesRESTClient ¶
func NewTargetGrpcProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetGrpcProxiesClient, error)
NewTargetGrpcProxiesRESTClient creates a new target grpc proxies rest client.
The TargetGrpcProxies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetGrpcProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*TargetGrpcProxiesClient) Close ¶
func (c *TargetGrpcProxiesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*TargetGrpcProxiesClient) Connection
deprecated
func (c *TargetGrpcProxiesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*TargetGrpcProxiesClient) Delete ¶
func (c *TargetGrpcProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetGrpcProxyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified TargetGrpcProxy in the given scope
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetGrpcProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteTargetGrpcProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteTargetGrpcProxyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetGrpcProxiesClient) Get ¶
func (c *TargetGrpcProxiesClient) Get(ctx context.Context, req *computepb.GetTargetGrpcProxyRequest, opts ...gax.CallOption) (*computepb.TargetGrpcProxy, error)
Get returns the specified TargetGrpcProxy resource in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetGrpcProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetTargetGrpcProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetTargetGrpcProxyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TargetGrpcProxiesClient) Insert ¶
func (c *TargetGrpcProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetGrpcProxyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetGrpcProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertTargetGrpcProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertTargetGrpcProxyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetGrpcProxiesClient) List ¶
func (c *TargetGrpcProxiesClient) List(ctx context.Context, req *computepb.ListTargetGrpcProxiesRequest, opts ...gax.CallOption) *TargetGrpcProxyIterator
List lists the TargetGrpcProxies for a project in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetGrpcProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetGrpcProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetGrpcProxiesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetGrpcProxyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetGrpcProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetGrpcProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetGrpcProxiesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetGrpcProxiesClient) Patch ¶
func (c *TargetGrpcProxiesClient) Patch(ctx context.Context, req *computepb.PatchTargetGrpcProxyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetGrpcProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchTargetGrpcProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchTargetGrpcProxyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetGrpcProxiesClient) TestIamPermissions ¶
func (c *TargetGrpcProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetGrpcProxyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetGrpcProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsTargetGrpcProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsTargetGrpcProxyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type TargetGrpcProxyIterator ¶
type TargetGrpcProxyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.TargetGrpcProxy, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetGrpcProxyIterator manages a stream of *computepb.TargetGrpcProxy.
func (*TargetGrpcProxyIterator) All ¶
func (it *TargetGrpcProxyIterator) All() iter.Seq2[*computepb.TargetGrpcProxy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetGrpcProxyIterator) Next ¶
func (it *TargetGrpcProxyIterator) Next() (*computepb.TargetGrpcProxy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetGrpcProxyIterator) PageInfo ¶
func (it *TargetGrpcProxyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetHttpProxiesCallOptions ¶
type TargetHttpProxiesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetUrlMap []gax.CallOption
TestIamPermissions []gax.CallOption
}
TargetHttpProxiesCallOptions contains the retry settings for each method of TargetHttpProxiesClient.
type TargetHttpProxiesClient ¶
type TargetHttpProxiesClient struct {
// The call options for this service.
CallOptions *TargetHttpProxiesCallOptions
// contains filtered or unexported fields
}
TargetHttpProxiesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The TargetHttpProxies API.
func NewTargetHttpProxiesRESTClient ¶
func NewTargetHttpProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetHttpProxiesClient, error)
NewTargetHttpProxiesRESTClient creates a new target http proxies rest client.
The TargetHttpProxies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*TargetHttpProxiesClient) AggregatedList ¶
func (c *TargetHttpProxiesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetHttpProxiesRequest, opts ...gax.CallOption) *TargetHttpProxiesScopedListPairIterator
AggregatedList retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetHttpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetHttpProxiesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetHttpProxyAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetHttpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetHttpProxiesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetHttpProxiesClient) Close ¶
func (c *TargetHttpProxiesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*TargetHttpProxiesClient) Connection
deprecated
func (c *TargetHttpProxiesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*TargetHttpProxiesClient) Delete ¶
func (c *TargetHttpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetHttpProxyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified TargetHttpProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteTargetHttpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteTargetHttpProxyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpProxiesClient) Get ¶
func (c *TargetHttpProxiesClient) Get(ctx context.Context, req *computepb.GetTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxy, error)
Get returns the specified TargetHttpProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetTargetHttpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetTargetHttpProxyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TargetHttpProxiesClient) Insert ¶
func (c *TargetHttpProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetHttpProxyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a TargetHttpProxy resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertTargetHttpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertTargetHttpProxyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpProxiesClient) List ¶
func (c *TargetHttpProxiesClient) List(ctx context.Context, req *computepb.ListTargetHttpProxiesRequest, opts ...gax.CallOption) *TargetHttpProxyIterator
List retrieves the list of TargetHttpProxy resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetHttpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetHttpProxiesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetHttpProxyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetHttpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetHttpProxiesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetHttpProxiesClient) Patch ¶
func (c *TargetHttpProxiesClient) Patch(ctx context.Context, req *computepb.PatchTargetHttpProxyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchTargetHttpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchTargetHttpProxyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpProxiesClient) SetUrlMap ¶
func (c *TargetHttpProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapTargetHttpProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetUrlMap changes the URL map for TargetHttpProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetUrlMapTargetHttpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetUrlMapTargetHttpProxyRequest.
}
op, err := c.SetUrlMap(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpProxiesClient) TestIamPermissions ¶
func (c *TargetHttpProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsTargetHttpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsTargetHttpProxyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type TargetHttpProxiesScopedListPair ¶
type TargetHttpProxiesScopedListPair struct {
Key string
Value *computepb.TargetHttpProxiesScopedList
}
TargetHttpProxiesScopedListPair is a holder type for string/*computepb.TargetHttpProxiesScopedList map entries
type TargetHttpProxiesScopedListPairIterator ¶
type TargetHttpProxiesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []TargetHttpProxiesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetHttpProxiesScopedListPairIterator manages a stream of TargetHttpProxiesScopedListPair.
func (*TargetHttpProxiesScopedListPairIterator) All ¶
func (it *TargetHttpProxiesScopedListPairIterator) All() iter.Seq2[TargetHttpProxiesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetHttpProxiesScopedListPairIterator) Next ¶
func (it *TargetHttpProxiesScopedListPairIterator) Next() (TargetHttpProxiesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetHttpProxiesScopedListPairIterator) PageInfo ¶
func (it *TargetHttpProxiesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetHttpProxyIterator ¶
type TargetHttpProxyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.TargetHttpProxy, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetHttpProxyIterator manages a stream of *computepb.TargetHttpProxy.
func (*TargetHttpProxyIterator) All ¶
func (it *TargetHttpProxyIterator) All() iter.Seq2[*computepb.TargetHttpProxy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetHttpProxyIterator) Next ¶
func (it *TargetHttpProxyIterator) Next() (*computepb.TargetHttpProxy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetHttpProxyIterator) PageInfo ¶
func (it *TargetHttpProxyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetHttpsProxiesCallOptions ¶
type TargetHttpsProxiesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetCertificateMap []gax.CallOption
SetQuicOverride []gax.CallOption
SetSslCertificates []gax.CallOption
SetSslPolicy []gax.CallOption
SetUrlMap []gax.CallOption
TestIamPermissions []gax.CallOption
}
TargetHttpsProxiesCallOptions contains the retry settings for each method of TargetHttpsProxiesClient.
type TargetHttpsProxiesClient ¶
type TargetHttpsProxiesClient struct {
// The call options for this service.
CallOptions *TargetHttpsProxiesCallOptions
// contains filtered or unexported fields
}
TargetHttpsProxiesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The TargetHttpsProxies API.
func NewTargetHttpsProxiesRESTClient ¶
func NewTargetHttpsProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetHttpsProxiesClient, error)
NewTargetHttpsProxiesRESTClient creates a new target https proxies rest client.
The TargetHttpsProxies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*TargetHttpsProxiesClient) AggregatedList ¶
func (c *TargetHttpsProxiesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetHttpsProxiesRequest, opts ...gax.CallOption) *TargetHttpsProxiesScopedListPairIterator
AggregatedList retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetHttpsProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetHttpsProxiesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetHttpsProxyAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetHttpsProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetHttpsProxiesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetHttpsProxiesClient) Close ¶
func (c *TargetHttpsProxiesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*TargetHttpsProxiesClient) Connection
deprecated
func (c *TargetHttpsProxiesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*TargetHttpsProxiesClient) Delete ¶
func (c *TargetHttpsProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified TargetHttpsProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteTargetHttpsProxyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpsProxiesClient) Get ¶
func (c *TargetHttpsProxiesClient) Get(ctx context.Context, req *computepb.GetTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxy, error)
Get returns the specified TargetHttpsProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetTargetHttpsProxyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TargetHttpsProxiesClient) Insert ¶
func (c *TargetHttpsProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a TargetHttpsProxy resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertTargetHttpsProxyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpsProxiesClient) List ¶
func (c *TargetHttpsProxiesClient) List(ctx context.Context, req *computepb.ListTargetHttpsProxiesRequest, opts ...gax.CallOption) *TargetHttpsProxyIterator
List retrieves the list of TargetHttpsProxy resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetHttpsProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetHttpsProxiesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetHttpsProxyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetHttpsProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetHttpsProxiesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetHttpsProxiesClient) Patch ¶
func (c *TargetHttpsProxiesClient) Patch(ctx context.Context, req *computepb.PatchTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchTargetHttpsProxyRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpsProxiesClient) SetCertificateMap ¶
func (c *TargetHttpsProxiesClient) SetCertificateMap(ctx context.Context, req *computepb.SetCertificateMapTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetCertificateMap changes the Certificate Map for TargetHttpsProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetCertificateMapTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetCertificateMapTargetHttpsProxyRequest.
}
op, err := c.SetCertificateMap(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpsProxiesClient) SetQuicOverride ¶
func (c *TargetHttpsProxiesClient) SetQuicOverride(ctx context.Context, req *computepb.SetQuicOverrideTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetQuicOverride sets the QUIC override policy for TargetHttpsProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetQuicOverrideTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetQuicOverrideTargetHttpsProxyRequest.
}
op, err := c.SetQuicOverride(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpsProxiesClient) SetSslCertificates ¶
func (c *TargetHttpsProxiesClient) SetSslCertificates(ctx context.Context, req *computepb.SetSslCertificatesTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetSslCertificates replaces SslCertificates for TargetHttpsProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSslCertificatesTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetSslCertificatesTargetHttpsProxyRequest.
}
op, err := c.SetSslCertificates(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpsProxiesClient) SetSslPolicy ¶
func (c *TargetHttpsProxiesClient) SetSslPolicy(ctx context.Context, req *computepb.SetSslPolicyTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetSslPolicy sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSslPolicyTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetSslPolicyTargetHttpsProxyRequest.
}
op, err := c.SetSslPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpsProxiesClient) SetUrlMap ¶
func (c *TargetHttpsProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetUrlMap changes the URL map for TargetHttpsProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetUrlMapTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetUrlMapTargetHttpsProxyRequest.
}
op, err := c.SetUrlMap(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetHttpsProxiesClient) TestIamPermissions ¶
func (c *TargetHttpsProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetHttpsProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsTargetHttpsProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsTargetHttpsProxyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type TargetHttpsProxiesScopedListPair ¶
type TargetHttpsProxiesScopedListPair struct {
Key string
Value *computepb.TargetHttpsProxiesScopedList
}
TargetHttpsProxiesScopedListPair is a holder type for string/*computepb.TargetHttpsProxiesScopedList map entries
type TargetHttpsProxiesScopedListPairIterator ¶
type TargetHttpsProxiesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []TargetHttpsProxiesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetHttpsProxiesScopedListPairIterator manages a stream of TargetHttpsProxiesScopedListPair.
func (*TargetHttpsProxiesScopedListPairIterator) All ¶
func (it *TargetHttpsProxiesScopedListPairIterator) All() iter.Seq2[TargetHttpsProxiesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetHttpsProxiesScopedListPairIterator) Next ¶
func (it *TargetHttpsProxiesScopedListPairIterator) Next() (TargetHttpsProxiesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetHttpsProxiesScopedListPairIterator) PageInfo ¶
func (it *TargetHttpsProxiesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetHttpsProxyIterator ¶
type TargetHttpsProxyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.TargetHttpsProxy, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetHttpsProxyIterator manages a stream of *computepb.TargetHttpsProxy.
func (*TargetHttpsProxyIterator) All ¶
func (it *TargetHttpsProxyIterator) All() iter.Seq2[*computepb.TargetHttpsProxy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetHttpsProxyIterator) Next ¶
func (it *TargetHttpsProxyIterator) Next() (*computepb.TargetHttpsProxy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetHttpsProxyIterator) PageInfo ¶
func (it *TargetHttpsProxyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetInstanceIterator ¶
type TargetInstanceIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.TargetInstance, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetInstanceIterator manages a stream of *computepb.TargetInstance.
func (*TargetInstanceIterator) All ¶
func (it *TargetInstanceIterator) All() iter.Seq2[*computepb.TargetInstance, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetInstanceIterator) Next ¶
func (it *TargetInstanceIterator) Next() (*computepb.TargetInstance, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetInstanceIterator) PageInfo ¶
func (it *TargetInstanceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetInstancesCallOptions ¶
type TargetInstancesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetSecurityPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
TargetInstancesCallOptions contains the retry settings for each method of TargetInstancesClient.
type TargetInstancesClient ¶
type TargetInstancesClient struct {
// The call options for this service.
CallOptions *TargetInstancesCallOptions
// contains filtered or unexported fields
}
TargetInstancesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The TargetInstances API.
func NewTargetInstancesRESTClient ¶
func NewTargetInstancesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetInstancesClient, error)
NewTargetInstancesRESTClient creates a new target instances rest client.
The TargetInstances API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*TargetInstancesClient) AggregatedList ¶
func (c *TargetInstancesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetInstancesRequest, opts ...gax.CallOption) *TargetInstancesScopedListPairIterator
AggregatedList retrieves an aggregated list of target instances.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetInstancesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetInstanceAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetInstancesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetInstancesClient) Close ¶
func (c *TargetInstancesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*TargetInstancesClient) Connection
deprecated
func (c *TargetInstancesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*TargetInstancesClient) Delete ¶
func (c *TargetInstancesClient) Delete(ctx context.Context, req *computepb.DeleteTargetInstanceRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified TargetInstance resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteTargetInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteTargetInstanceRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetInstancesClient) Get ¶
func (c *TargetInstancesClient) Get(ctx context.Context, req *computepb.GetTargetInstanceRequest, opts ...gax.CallOption) (*computepb.TargetInstance, error)
Get returns the specified TargetInstance resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetTargetInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetTargetInstanceRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TargetInstancesClient) Insert ¶
func (c *TargetInstancesClient) Insert(ctx context.Context, req *computepb.InsertTargetInstanceRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a TargetInstance resource in the specified project and zone using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertTargetInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertTargetInstanceRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetInstancesClient) List ¶
func (c *TargetInstancesClient) List(ctx context.Context, req *computepb.ListTargetInstancesRequest, opts ...gax.CallOption) *TargetInstanceIterator
List retrieves a list of TargetInstance resources available to the specified project and zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetInstancesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetInstanceList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetInstancesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetInstancesClient) SetSecurityPolicy ¶
func (c *TargetInstancesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyTargetInstanceRequest, opts ...gax.CallOption) (*Operation, error)
SetSecurityPolicy sets the Google Cloud Armor security policy for the specified target instance. For more information, seeGoogle Cloud Armor Overview
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSecurityPolicyTargetInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetSecurityPolicyTargetInstanceRequest.
}
op, err := c.SetSecurityPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetInstancesClient) TestIamPermissions ¶
func (c *TargetInstancesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetInstanceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetInstancesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsTargetInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsTargetInstanceRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type TargetInstancesScopedListPair ¶
type TargetInstancesScopedListPair struct {
Key string
Value *computepb.TargetInstancesScopedList
}
TargetInstancesScopedListPair is a holder type for string/*computepb.TargetInstancesScopedList map entries
type TargetInstancesScopedListPairIterator ¶
type TargetInstancesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []TargetInstancesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetInstancesScopedListPairIterator manages a stream of TargetInstancesScopedListPair.
func (*TargetInstancesScopedListPairIterator) All ¶
func (it *TargetInstancesScopedListPairIterator) All() iter.Seq2[TargetInstancesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetInstancesScopedListPairIterator) Next ¶
func (it *TargetInstancesScopedListPairIterator) Next() (TargetInstancesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetInstancesScopedListPairIterator) PageInfo ¶
func (it *TargetInstancesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetPoolIterator ¶
type TargetPoolIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.TargetPool, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetPoolIterator manages a stream of *computepb.TargetPool.
func (*TargetPoolIterator) All ¶
func (it *TargetPoolIterator) All() iter.Seq2[*computepb.TargetPool, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetPoolIterator) Next ¶
func (it *TargetPoolIterator) Next() (*computepb.TargetPool, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetPoolIterator) PageInfo ¶
func (it *TargetPoolIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetPoolsCallOptions ¶
type TargetPoolsCallOptions struct {
AddHealthCheck []gax.CallOption
AddInstance []gax.CallOption
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetHealth []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
RemoveHealthCheck []gax.CallOption
RemoveInstance []gax.CallOption
SetBackup []gax.CallOption
SetSecurityPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
TargetPoolsCallOptions contains the retry settings for each method of TargetPoolsClient.
type TargetPoolsClient ¶
type TargetPoolsClient struct {
// The call options for this service.
CallOptions *TargetPoolsCallOptions
// contains filtered or unexported fields
}
TargetPoolsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The TargetPools API.
func NewTargetPoolsRESTClient ¶
func NewTargetPoolsRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetPoolsClient, error)
NewTargetPoolsRESTClient creates a new target pools rest client.
The TargetPools API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*TargetPoolsClient) AddHealthCheck ¶
func (c *TargetPoolsClient) AddHealthCheck(ctx context.Context, req *computepb.AddHealthCheckTargetPoolRequest, opts ...gax.CallOption) (*Operation, error)
AddHealthCheck adds health check URLs to a target pool.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddHealthCheckTargetPoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddHealthCheckTargetPoolRequest.
}
op, err := c.AddHealthCheck(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetPoolsClient) AddInstance ¶
func (c *TargetPoolsClient) AddInstance(ctx context.Context, req *computepb.AddInstanceTargetPoolRequest, opts ...gax.CallOption) (*Operation, error)
AddInstance adds an instance to a target pool.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AddInstanceTargetPoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AddInstanceTargetPoolRequest.
}
op, err := c.AddInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetPoolsClient) AggregatedList ¶
func (c *TargetPoolsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetPoolsRequest, opts ...gax.CallOption) *TargetPoolsScopedListPairIterator
AggregatedList retrieves an aggregated list of target pools.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetPoolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetPoolsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetPoolAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetPoolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetPoolsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetPoolsClient) Close ¶
func (c *TargetPoolsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*TargetPoolsClient) Connection
deprecated
func (c *TargetPoolsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*TargetPoolsClient) Delete ¶
func (c *TargetPoolsClient) Delete(ctx context.Context, req *computepb.DeleteTargetPoolRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified target pool.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteTargetPoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteTargetPoolRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetPoolsClient) Get ¶
func (c *TargetPoolsClient) Get(ctx context.Context, req *computepb.GetTargetPoolRequest, opts ...gax.CallOption) (*computepb.TargetPool, error)
Get returns the specified target pool.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetTargetPoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetTargetPoolRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TargetPoolsClient) GetHealth ¶
func (c *TargetPoolsClient) GetHealth(ctx context.Context, req *computepb.GetHealthTargetPoolRequest, opts ...gax.CallOption) (*computepb.TargetPoolInstanceHealth, error)
GetHealth gets the most recent health check results for each IP for the instance that is referenced by the given target pool.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetHealthTargetPoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetHealthTargetPoolRequest.
}
resp, err := c.GetHealth(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TargetPoolsClient) Insert ¶
func (c *TargetPoolsClient) Insert(ctx context.Context, req *computepb.InsertTargetPoolRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a target pool in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertTargetPoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertTargetPoolRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetPoolsClient) List ¶
func (c *TargetPoolsClient) List(ctx context.Context, req *computepb.ListTargetPoolsRequest, opts ...gax.CallOption) *TargetPoolIterator
List retrieves a list of target pools available to the specified project and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetPoolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetPoolsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetPoolList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetPoolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetPoolsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetPoolsClient) RemoveHealthCheck ¶
func (c *TargetPoolsClient) RemoveHealthCheck(ctx context.Context, req *computepb.RemoveHealthCheckTargetPoolRequest, opts ...gax.CallOption) (*Operation, error)
RemoveHealthCheck removes health check URL from a target pool.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveHealthCheckTargetPoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveHealthCheckTargetPoolRequest.
}
op, err := c.RemoveHealthCheck(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetPoolsClient) RemoveInstance ¶
func (c *TargetPoolsClient) RemoveInstance(ctx context.Context, req *computepb.RemoveInstanceTargetPoolRequest, opts ...gax.CallOption) (*Operation, error)
RemoveInstance removes instance URL from a target pool.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.RemoveInstanceTargetPoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#RemoveInstanceTargetPoolRequest.
}
op, err := c.RemoveInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetPoolsClient) SetBackup ¶
func (c *TargetPoolsClient) SetBackup(ctx context.Context, req *computepb.SetBackupTargetPoolRequest, opts ...gax.CallOption) (*Operation, error)
SetBackup changes a backup target pool’s configurations.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetBackupTargetPoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetBackupTargetPoolRequest.
}
op, err := c.SetBackup(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetPoolsClient) SetSecurityPolicy ¶
func (c *TargetPoolsClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyTargetPoolRequest, opts ...gax.CallOption) (*Operation, error)
SetSecurityPolicy sets the Google Cloud Armor security policy for the specified target pool. For more information, seeGoogle Cloud Armor Overview
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSecurityPolicyTargetPoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetSecurityPolicyTargetPoolRequest.
}
op, err := c.SetSecurityPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetPoolsClient) TestIamPermissions ¶
func (c *TargetPoolsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetPoolRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetPoolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsTargetPoolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsTargetPoolRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type TargetPoolsScopedListPair ¶
type TargetPoolsScopedListPair struct {
Key string
Value *computepb.TargetPoolsScopedList
}
TargetPoolsScopedListPair is a holder type for string/*computepb.TargetPoolsScopedList map entries
type TargetPoolsScopedListPairIterator ¶
type TargetPoolsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []TargetPoolsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetPoolsScopedListPairIterator manages a stream of TargetPoolsScopedListPair.
func (*TargetPoolsScopedListPairIterator) All ¶
func (it *TargetPoolsScopedListPairIterator) All() iter.Seq2[TargetPoolsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetPoolsScopedListPairIterator) Next ¶
func (it *TargetPoolsScopedListPairIterator) Next() (TargetPoolsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetPoolsScopedListPairIterator) PageInfo ¶
func (it *TargetPoolsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetSslProxiesCallOptions ¶
type TargetSslProxiesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetBackendService []gax.CallOption
SetCertificateMap []gax.CallOption
SetProxyHeader []gax.CallOption
SetSslCertificates []gax.CallOption
SetSslPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
TargetSslProxiesCallOptions contains the retry settings for each method of TargetSslProxiesClient.
type TargetSslProxiesClient ¶
type TargetSslProxiesClient struct {
// The call options for this service.
CallOptions *TargetSslProxiesCallOptions
// contains filtered or unexported fields
}
TargetSslProxiesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The TargetSslProxies API.
func NewTargetSslProxiesRESTClient ¶
func NewTargetSslProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetSslProxiesClient, error)
NewTargetSslProxiesRESTClient creates a new target ssl proxies rest client.
The TargetSslProxies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*TargetSslProxiesClient) Close ¶
func (c *TargetSslProxiesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*TargetSslProxiesClient) Connection
deprecated
func (c *TargetSslProxiesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*TargetSslProxiesClient) Delete ¶
func (c *TargetSslProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetSslProxyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified TargetSslProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteTargetSslProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteTargetSslProxyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetSslProxiesClient) Get ¶
func (c *TargetSslProxiesClient) Get(ctx context.Context, req *computepb.GetTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.TargetSslProxy, error)
Get returns the specified TargetSslProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetTargetSslProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetTargetSslProxyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TargetSslProxiesClient) Insert ¶
func (c *TargetSslProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetSslProxyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a TargetSslProxy resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertTargetSslProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertTargetSslProxyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetSslProxiesClient) List ¶
func (c *TargetSslProxiesClient) List(ctx context.Context, req *computepb.ListTargetSslProxiesRequest, opts ...gax.CallOption) *TargetSslProxyIterator
List retrieves the list of TargetSslProxy resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetSslProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetSslProxiesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetSslProxyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetSslProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetSslProxiesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetSslProxiesClient) SetBackendService ¶
func (c *TargetSslProxiesClient) SetBackendService(ctx context.Context, req *computepb.SetBackendServiceTargetSslProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetBackendService changes the BackendService for TargetSslProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetBackendServiceTargetSslProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetBackendServiceTargetSslProxyRequest.
}
op, err := c.SetBackendService(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetSslProxiesClient) SetCertificateMap ¶
func (c *TargetSslProxiesClient) SetCertificateMap(ctx context.Context, req *computepb.SetCertificateMapTargetSslProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetCertificateMap changes the Certificate Map for TargetSslProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetCertificateMapTargetSslProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetCertificateMapTargetSslProxyRequest.
}
op, err := c.SetCertificateMap(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetSslProxiesClient) SetProxyHeader ¶
func (c *TargetSslProxiesClient) SetProxyHeader(ctx context.Context, req *computepb.SetProxyHeaderTargetSslProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetProxyHeader changes the ProxyHeaderType for TargetSslProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetProxyHeaderTargetSslProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetProxyHeaderTargetSslProxyRequest.
}
op, err := c.SetProxyHeader(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetSslProxiesClient) SetSslCertificates ¶
func (c *TargetSslProxiesClient) SetSslCertificates(ctx context.Context, req *computepb.SetSslCertificatesTargetSslProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetSslCertificates changes SslCertificates for TargetSslProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSslCertificatesTargetSslProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetSslCertificatesTargetSslProxyRequest.
}
op, err := c.SetSslCertificates(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetSslProxiesClient) SetSslPolicy ¶
func (c *TargetSslProxiesClient) SetSslPolicy(ctx context.Context, req *computepb.SetSslPolicyTargetSslProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetSslPolicy sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the load balancer. They do not affect the connection between the load balancer and the backends.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetSslPolicyTargetSslProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetSslPolicyTargetSslProxyRequest.
}
op, err := c.SetSslPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetSslProxiesClient) TestIamPermissions ¶
func (c *TargetSslProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetSslProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsTargetSslProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsTargetSslProxyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type TargetSslProxyIterator ¶
type TargetSslProxyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.TargetSslProxy, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetSslProxyIterator manages a stream of *computepb.TargetSslProxy.
func (*TargetSslProxyIterator) All ¶
func (it *TargetSslProxyIterator) All() iter.Seq2[*computepb.TargetSslProxy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetSslProxyIterator) Next ¶
func (it *TargetSslProxyIterator) Next() (*computepb.TargetSslProxy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetSslProxyIterator) PageInfo ¶
func (it *TargetSslProxyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetTcpProxiesCallOptions ¶
type TargetTcpProxiesCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetBackendService []gax.CallOption
SetProxyHeader []gax.CallOption
TestIamPermissions []gax.CallOption
}
TargetTcpProxiesCallOptions contains the retry settings for each method of TargetTcpProxiesClient.
type TargetTcpProxiesClient ¶
type TargetTcpProxiesClient struct {
// The call options for this service.
CallOptions *TargetTcpProxiesCallOptions
// contains filtered or unexported fields
}
TargetTcpProxiesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The TargetTcpProxies API.
func NewTargetTcpProxiesRESTClient ¶
func NewTargetTcpProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetTcpProxiesClient, error)
NewTargetTcpProxiesRESTClient creates a new target tcp proxies rest client.
The TargetTcpProxies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*TargetTcpProxiesClient) AggregatedList ¶
func (c *TargetTcpProxiesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetTcpProxiesRequest, opts ...gax.CallOption) *TargetTcpProxiesScopedListPairIterator
AggregatedList retrieves the list of all TargetTcpProxy resources, regional and global, available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetTcpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetTcpProxiesRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetTcpProxyAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetTcpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetTcpProxiesRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetTcpProxiesClient) Close ¶
func (c *TargetTcpProxiesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*TargetTcpProxiesClient) Connection
deprecated
func (c *TargetTcpProxiesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*TargetTcpProxiesClient) Delete ¶
func (c *TargetTcpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetTcpProxyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified TargetTcpProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteTargetTcpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteTargetTcpProxyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetTcpProxiesClient) Get ¶
func (c *TargetTcpProxiesClient) Get(ctx context.Context, req *computepb.GetTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.TargetTcpProxy, error)
Get returns the specified TargetTcpProxy resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetTargetTcpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetTargetTcpProxyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TargetTcpProxiesClient) Insert ¶
func (c *TargetTcpProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetTcpProxyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a TargetTcpProxy resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertTargetTcpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertTargetTcpProxyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetTcpProxiesClient) List ¶
func (c *TargetTcpProxiesClient) List(ctx context.Context, req *computepb.ListTargetTcpProxiesRequest, opts ...gax.CallOption) *TargetTcpProxyIterator
List retrieves the list of TargetTcpProxy resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetTcpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetTcpProxiesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetTcpProxyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetTcpProxiesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetTcpProxiesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetTcpProxiesClient) SetBackendService ¶
func (c *TargetTcpProxiesClient) SetBackendService(ctx context.Context, req *computepb.SetBackendServiceTargetTcpProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetBackendService changes the BackendService for TargetTcpProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetBackendServiceTargetTcpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetBackendServiceTargetTcpProxyRequest.
}
op, err := c.SetBackendService(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetTcpProxiesClient) SetProxyHeader ¶
func (c *TargetTcpProxiesClient) SetProxyHeader(ctx context.Context, req *computepb.SetProxyHeaderTargetTcpProxyRequest, opts ...gax.CallOption) (*Operation, error)
SetProxyHeader changes the ProxyHeaderType for TargetTcpProxy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetProxyHeaderTargetTcpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetProxyHeaderTargetTcpProxyRequest.
}
op, err := c.SetProxyHeader(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetTcpProxiesClient) TestIamPermissions ¶
func (c *TargetTcpProxiesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetTcpProxiesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsTargetTcpProxyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsTargetTcpProxyRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type TargetTcpProxiesScopedListPair ¶
type TargetTcpProxiesScopedListPair struct {
Key string
Value *computepb.TargetTcpProxiesScopedList
}
TargetTcpProxiesScopedListPair is a holder type for string/*computepb.TargetTcpProxiesScopedList map entries
type TargetTcpProxiesScopedListPairIterator ¶
type TargetTcpProxiesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []TargetTcpProxiesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetTcpProxiesScopedListPairIterator manages a stream of TargetTcpProxiesScopedListPair.
func (*TargetTcpProxiesScopedListPairIterator) All ¶
func (it *TargetTcpProxiesScopedListPairIterator) All() iter.Seq2[TargetTcpProxiesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetTcpProxiesScopedListPairIterator) Next ¶
func (it *TargetTcpProxiesScopedListPairIterator) Next() (TargetTcpProxiesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetTcpProxiesScopedListPairIterator) PageInfo ¶
func (it *TargetTcpProxiesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetTcpProxyIterator ¶
type TargetTcpProxyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.TargetTcpProxy, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetTcpProxyIterator manages a stream of *computepb.TargetTcpProxy.
func (*TargetTcpProxyIterator) All ¶
func (it *TargetTcpProxyIterator) All() iter.Seq2[*computepb.TargetTcpProxy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetTcpProxyIterator) Next ¶
func (it *TargetTcpProxyIterator) Next() (*computepb.TargetTcpProxy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetTcpProxyIterator) PageInfo ¶
func (it *TargetTcpProxyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetVpnGatewayIterator ¶
type TargetVpnGatewayIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.TargetVpnGateway, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetVpnGatewayIterator manages a stream of *computepb.TargetVpnGateway.
func (*TargetVpnGatewayIterator) All ¶
func (it *TargetVpnGatewayIterator) All() iter.Seq2[*computepb.TargetVpnGateway, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetVpnGatewayIterator) Next ¶
func (it *TargetVpnGatewayIterator) Next() (*computepb.TargetVpnGateway, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetVpnGatewayIterator) PageInfo ¶
func (it *TargetVpnGatewayIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TargetVpnGatewaysCallOptions ¶
type TargetVpnGatewaysCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
TargetVpnGatewaysCallOptions contains the retry settings for each method of TargetVpnGatewaysClient.
type TargetVpnGatewaysClient ¶
type TargetVpnGatewaysClient struct {
// The call options for this service.
CallOptions *TargetVpnGatewaysCallOptions
// contains filtered or unexported fields
}
TargetVpnGatewaysClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The TargetVpnGateways API.
func NewTargetVpnGatewaysRESTClient ¶
func NewTargetVpnGatewaysRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetVpnGatewaysClient, error)
NewTargetVpnGatewaysRESTClient creates a new target vpn gateways rest client.
The TargetVpnGateways API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*TargetVpnGatewaysClient) AggregatedList ¶
func (c *TargetVpnGatewaysClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetVpnGatewaysRequest, opts ...gax.CallOption) *TargetVpnGatewaysScopedListPairIterator
AggregatedList retrieves an aggregated list of target VPN gateways.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetVpnGatewaysRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetVpnGatewaysRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetVpnGatewayAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListTargetVpnGatewaysRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListTargetVpnGatewaysRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetVpnGatewaysClient) Close ¶
func (c *TargetVpnGatewaysClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*TargetVpnGatewaysClient) Connection
deprecated
func (c *TargetVpnGatewaysClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*TargetVpnGatewaysClient) Delete ¶
func (c *TargetVpnGatewaysClient) Delete(ctx context.Context, req *computepb.DeleteTargetVpnGatewayRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified target VPN gateway.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteTargetVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteTargetVpnGatewayRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetVpnGatewaysClient) Get ¶
func (c *TargetVpnGatewaysClient) Get(ctx context.Context, req *computepb.GetTargetVpnGatewayRequest, opts ...gax.CallOption) (*computepb.TargetVpnGateway, error)
Get returns the specified target VPN gateway.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetTargetVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetTargetVpnGatewayRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TargetVpnGatewaysClient) Insert ¶
func (c *TargetVpnGatewaysClient) Insert(ctx context.Context, req *computepb.InsertTargetVpnGatewayRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a target VPN gateway in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertTargetVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertTargetVpnGatewayRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetVpnGatewaysClient) List ¶
func (c *TargetVpnGatewaysClient) List(ctx context.Context, req *computepb.ListTargetVpnGatewaysRequest, opts ...gax.CallOption) *TargetVpnGatewayIterator
List retrieves a list of target VPN gateways available to the specified project and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetVpnGatewaysRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetVpnGatewaysRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.TargetVpnGatewayList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListTargetVpnGatewaysRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListTargetVpnGatewaysRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TargetVpnGatewaysClient) SetLabels ¶
func (c *TargetVpnGatewaysClient) SetLabels(ctx context.Context, req *computepb.SetLabelsTargetVpnGatewayRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a TargetVpnGateway. To learn more about labels, read theLabeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsTargetVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsTargetVpnGatewayRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TargetVpnGatewaysClient) TestIamPermissions ¶
func (c *TargetVpnGatewaysClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsTargetVpnGatewayRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewTargetVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsTargetVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsTargetVpnGatewayRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type TargetVpnGatewaysScopedListPair ¶
type TargetVpnGatewaysScopedListPair struct {
Key string
Value *computepb.TargetVpnGatewaysScopedList
}
TargetVpnGatewaysScopedListPair is a holder type for string/*computepb.TargetVpnGatewaysScopedList map entries
type TargetVpnGatewaysScopedListPairIterator ¶
type TargetVpnGatewaysScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []TargetVpnGatewaysScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
TargetVpnGatewaysScopedListPairIterator manages a stream of TargetVpnGatewaysScopedListPair.
func (*TargetVpnGatewaysScopedListPairIterator) All ¶
func (it *TargetVpnGatewaysScopedListPairIterator) All() iter.Seq2[TargetVpnGatewaysScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TargetVpnGatewaysScopedListPairIterator) Next ¶
func (it *TargetVpnGatewaysScopedListPairIterator) Next() (TargetVpnGatewaysScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TargetVpnGatewaysScopedListPairIterator) PageInfo ¶
func (it *TargetVpnGatewaysScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UrlMapIterator ¶
type UrlMapIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.UrlMap, nextPageToken string, err error)
// contains filtered or unexported fields
}
UrlMapIterator manages a stream of *computepb.UrlMap.
func (*UrlMapIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*UrlMapIterator) Next ¶
func (it *UrlMapIterator) Next() (*computepb.UrlMap, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*UrlMapIterator) PageInfo ¶
func (it *UrlMapIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UrlMapsCallOptions ¶
type UrlMapsCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
InvalidateCache []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
Validate []gax.CallOption
}
UrlMapsCallOptions contains the retry settings for each method of UrlMapsClient.
type UrlMapsClient ¶
type UrlMapsClient struct {
// The call options for this service.
CallOptions *UrlMapsCallOptions
// contains filtered or unexported fields
}
UrlMapsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The UrlMaps API.
func NewUrlMapsRESTClient ¶
func NewUrlMapsRESTClient(ctx context.Context, opts ...option.ClientOption) (*UrlMapsClient, error)
NewUrlMapsRESTClient creates a new url maps rest client.
The UrlMaps API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*UrlMapsClient) AggregatedList ¶
func (c *UrlMapsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListUrlMapsRequest, opts ...gax.CallOption) *UrlMapsScopedListPairIterator
AggregatedList retrieves the list of all UrlMap resources, regional and global, available to the specified project.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListUrlMapsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListUrlMapsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.UrlMapsAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListUrlMapsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListUrlMapsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*UrlMapsClient) Close ¶
func (c *UrlMapsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*UrlMapsClient) Connection
deprecated
func (c *UrlMapsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*UrlMapsClient) Delete ¶
func (c *UrlMapsClient) Delete(ctx context.Context, req *computepb.DeleteUrlMapRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified UrlMap resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteUrlMapRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*UrlMapsClient) Get ¶
func (c *UrlMapsClient) Get(ctx context.Context, req *computepb.GetUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMap, error)
Get returns the specified UrlMap resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetUrlMapRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*UrlMapsClient) Insert ¶
func (c *UrlMapsClient) Insert(ctx context.Context, req *computepb.InsertUrlMapRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a UrlMap resource in the specified project using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertUrlMapRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*UrlMapsClient) InvalidateCache ¶
func (c *UrlMapsClient) InvalidateCache(ctx context.Context, req *computepb.InvalidateCacheUrlMapRequest, opts ...gax.CallOption) (*Operation, error)
InvalidateCache initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.
For more information, see Invalidating cached content (at /cdn/docs/invalidating-cached-content).
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InvalidateCacheUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InvalidateCacheUrlMapRequest.
}
op, err := c.InvalidateCache(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*UrlMapsClient) List ¶
func (c *UrlMapsClient) List(ctx context.Context, req *computepb.ListUrlMapsRequest, opts ...gax.CallOption) *UrlMapIterator
List retrieves the list of UrlMap resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUrlMapsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUrlMapsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.UrlMapList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListUrlMapsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListUrlMapsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*UrlMapsClient) Patch ¶
func (c *UrlMapsClient) Patch(ctx context.Context, req *computepb.PatchUrlMapRequest, opts ...gax.CallOption) (*Operation, error)
Patch patches the specified UrlMap resource with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchUrlMapRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*UrlMapsClient) TestIamPermissions ¶
func (c *UrlMapsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsUrlMapRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsUrlMapRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*UrlMapsClient) Update ¶
func (c *UrlMapsClient) Update(ctx context.Context, req *computepb.UpdateUrlMapRequest, opts ...gax.CallOption) (*Operation, error)
Update updates the specified UrlMap resource with the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateUrlMapRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*UrlMapsClient) Validate ¶
func (c *UrlMapsClient) Validate(ctx context.Context, req *computepb.ValidateUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMapsValidateResponse, error)
Validate runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewUrlMapsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ValidateUrlMapRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ValidateUrlMapRequest.
}
resp, err := c.Validate(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type UrlMapsScopedListPair ¶
type UrlMapsScopedListPair struct {
Key string
Value *computepb.UrlMapsScopedList
}
UrlMapsScopedListPair is a holder type for string/*computepb.UrlMapsScopedList map entries
type UrlMapsScopedListPairIterator ¶
type UrlMapsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []UrlMapsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
UrlMapsScopedListPairIterator manages a stream of UrlMapsScopedListPair.
func (*UrlMapsScopedListPairIterator) All ¶
func (it *UrlMapsScopedListPairIterator) All() iter.Seq2[UrlMapsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*UrlMapsScopedListPairIterator) Next ¶
func (it *UrlMapsScopedListPairIterator) Next() (UrlMapsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*UrlMapsScopedListPairIterator) PageInfo ¶
func (it *UrlMapsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UsableSubnetworkIterator ¶
type UsableSubnetworkIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.UsableSubnetwork, nextPageToken string, err error)
// contains filtered or unexported fields
}
UsableSubnetworkIterator manages a stream of *computepb.UsableSubnetwork.
func (*UsableSubnetworkIterator) All ¶
func (it *UsableSubnetworkIterator) All() iter.Seq2[*computepb.UsableSubnetwork, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*UsableSubnetworkIterator) Next ¶
func (it *UsableSubnetworkIterator) Next() (*computepb.UsableSubnetwork, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*UsableSubnetworkIterator) PageInfo ¶
func (it *UsableSubnetworkIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type VmEndpointNatMappingsIterator ¶
type VmEndpointNatMappingsIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.VmEndpointNatMappings, nextPageToken string, err error)
// contains filtered or unexported fields
}
VmEndpointNatMappingsIterator manages a stream of *computepb.VmEndpointNatMappings.
func (*VmEndpointNatMappingsIterator) All ¶
func (it *VmEndpointNatMappingsIterator) All() iter.Seq2[*computepb.VmEndpointNatMappings, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*VmEndpointNatMappingsIterator) Next ¶
func (it *VmEndpointNatMappingsIterator) Next() (*computepb.VmEndpointNatMappings, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*VmEndpointNatMappingsIterator) PageInfo ¶
func (it *VmEndpointNatMappingsIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type VmExtensionPoliciesScopedListPair ¶ added in v1.50.0
type VmExtensionPoliciesScopedListPair struct {
Key string
Value *computepb.VmExtensionPoliciesScopedList
}
VmExtensionPoliciesScopedListPair is a holder type for string/*computepb.VmExtensionPoliciesScopedList map entries
type VmExtensionPoliciesScopedListPairIterator ¶ added in v1.50.0
type VmExtensionPoliciesScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []VmExtensionPoliciesScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
VmExtensionPoliciesScopedListPairIterator manages a stream of VmExtensionPoliciesScopedListPair.
func (*VmExtensionPoliciesScopedListPairIterator) All ¶ added in v1.50.0
func (it *VmExtensionPoliciesScopedListPairIterator) All() iter.Seq2[VmExtensionPoliciesScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*VmExtensionPoliciesScopedListPairIterator) Next ¶ added in v1.50.0
func (it *VmExtensionPoliciesScopedListPairIterator) Next() (VmExtensionPoliciesScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*VmExtensionPoliciesScopedListPairIterator) PageInfo ¶ added in v1.50.0
func (it *VmExtensionPoliciesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type VmExtensionPolicyIterator ¶ added in v1.50.0
type VmExtensionPolicyIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.VmExtensionPolicy, nextPageToken string, err error)
// contains filtered or unexported fields
}
VmExtensionPolicyIterator manages a stream of *computepb.VmExtensionPolicy.
func (*VmExtensionPolicyIterator) All ¶ added in v1.50.0
func (it *VmExtensionPolicyIterator) All() iter.Seq2[*computepb.VmExtensionPolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*VmExtensionPolicyIterator) Next ¶ added in v1.50.0
func (it *VmExtensionPolicyIterator) Next() (*computepb.VmExtensionPolicy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*VmExtensionPolicyIterator) PageInfo ¶ added in v1.50.0
func (it *VmExtensionPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type VpnGatewayIterator ¶
type VpnGatewayIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.VpnGateway, nextPageToken string, err error)
// contains filtered or unexported fields
}
VpnGatewayIterator manages a stream of *computepb.VpnGateway.
func (*VpnGatewayIterator) All ¶
func (it *VpnGatewayIterator) All() iter.Seq2[*computepb.VpnGateway, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*VpnGatewayIterator) Next ¶
func (it *VpnGatewayIterator) Next() (*computepb.VpnGateway, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*VpnGatewayIterator) PageInfo ¶
func (it *VpnGatewayIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type VpnGatewaysCallOptions ¶
type VpnGatewaysCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetStatus []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
VpnGatewaysCallOptions contains the retry settings for each method of VpnGatewaysClient.
type VpnGatewaysClient ¶
type VpnGatewaysClient struct {
// The call options for this service.
CallOptions *VpnGatewaysCallOptions
// contains filtered or unexported fields
}
VpnGatewaysClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The VpnGateways API.
func NewVpnGatewaysRESTClient ¶
func NewVpnGatewaysRESTClient(ctx context.Context, opts ...option.ClientOption) (*VpnGatewaysClient, error)
NewVpnGatewaysRESTClient creates a new vpn gateways rest client.
The VpnGateways API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*VpnGatewaysClient) AggregatedList ¶
func (c *VpnGatewaysClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListVpnGatewaysRequest, opts ...gax.CallOption) *VpnGatewaysScopedListPairIterator
AggregatedList retrieves an aggregated list of VPN gateways.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListVpnGatewaysRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListVpnGatewaysRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.VpnGatewayAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListVpnGatewaysRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListVpnGatewaysRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*VpnGatewaysClient) Close ¶
func (c *VpnGatewaysClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*VpnGatewaysClient) Connection
deprecated
func (c *VpnGatewaysClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*VpnGatewaysClient) Delete ¶
func (c *VpnGatewaysClient) Delete(ctx context.Context, req *computepb.DeleteVpnGatewayRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified VPN gateway.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteVpnGatewayRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*VpnGatewaysClient) Get ¶
func (c *VpnGatewaysClient) Get(ctx context.Context, req *computepb.GetVpnGatewayRequest, opts ...gax.CallOption) (*computepb.VpnGateway, error)
Get returns the specified VPN gateway.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetVpnGatewayRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*VpnGatewaysClient) GetStatus ¶
func (c *VpnGatewaysClient) GetStatus(ctx context.Context, req *computepb.GetStatusVpnGatewayRequest, opts ...gax.CallOption) (*computepb.VpnGatewaysGetStatusResponse, error)
GetStatus returns the status for the specified VPN gateway.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetStatusVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetStatusVpnGatewayRequest.
}
resp, err := c.GetStatus(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*VpnGatewaysClient) Insert ¶
func (c *VpnGatewaysClient) Insert(ctx context.Context, req *computepb.InsertVpnGatewayRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a VPN gateway in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertVpnGatewayRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*VpnGatewaysClient) List ¶
func (c *VpnGatewaysClient) List(ctx context.Context, req *computepb.ListVpnGatewaysRequest, opts ...gax.CallOption) *VpnGatewayIterator
List retrieves a list of VPN gateways available to the specified project and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListVpnGatewaysRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListVpnGatewaysRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.VpnGatewayList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListVpnGatewaysRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListVpnGatewaysRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*VpnGatewaysClient) SetLabels ¶
func (c *VpnGatewaysClient) SetLabels(ctx context.Context, req *computepb.SetLabelsVpnGatewayRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a VpnGateway. To learn more about labels, read theLabeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsVpnGatewayRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*VpnGatewaysClient) TestIamPermissions ¶
func (c *VpnGatewaysClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsVpnGatewayRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsVpnGatewayRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsVpnGatewayRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type VpnGatewaysScopedListPair ¶
type VpnGatewaysScopedListPair struct {
Key string
Value *computepb.VpnGatewaysScopedList
}
VpnGatewaysScopedListPair is a holder type for string/*computepb.VpnGatewaysScopedList map entries
type VpnGatewaysScopedListPairIterator ¶
type VpnGatewaysScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []VpnGatewaysScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
VpnGatewaysScopedListPairIterator manages a stream of VpnGatewaysScopedListPair.
func (*VpnGatewaysScopedListPairIterator) All ¶
func (it *VpnGatewaysScopedListPairIterator) All() iter.Seq2[VpnGatewaysScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*VpnGatewaysScopedListPairIterator) Next ¶
func (it *VpnGatewaysScopedListPairIterator) Next() (VpnGatewaysScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*VpnGatewaysScopedListPairIterator) PageInfo ¶
func (it *VpnGatewaysScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type VpnTunnelIterator ¶
type VpnTunnelIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.VpnTunnel, nextPageToken string, err error)
// contains filtered or unexported fields
}
VpnTunnelIterator manages a stream of *computepb.VpnTunnel.
func (*VpnTunnelIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*VpnTunnelIterator) Next ¶
func (it *VpnTunnelIterator) Next() (*computepb.VpnTunnel, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*VpnTunnelIterator) PageInfo ¶
func (it *VpnTunnelIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type VpnTunnelsCallOptions ¶
type VpnTunnelsCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetLabels []gax.CallOption
TestIamPermissions []gax.CallOption
}
VpnTunnelsCallOptions contains the retry settings for each method of VpnTunnelsClient.
type VpnTunnelsClient ¶
type VpnTunnelsClient struct {
// The call options for this service.
CallOptions *VpnTunnelsCallOptions
// contains filtered or unexported fields
}
VpnTunnelsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The VpnTunnels API.
func NewVpnTunnelsRESTClient ¶
func NewVpnTunnelsRESTClient(ctx context.Context, opts ...option.ClientOption) (*VpnTunnelsClient, error)
NewVpnTunnelsRESTClient creates a new vpn tunnels rest client.
The VpnTunnels API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnTunnelsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*VpnTunnelsClient) AggregatedList ¶
func (c *VpnTunnelsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListVpnTunnelsRequest, opts ...gax.CallOption) *VpnTunnelsScopedListPairIterator
AggregatedList retrieves an aggregated list of VPN tunnels.
To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnTunnelsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListVpnTunnelsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListVpnTunnelsRequest.
}
it := c.AggregatedList(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.VpnTunnelAggregatedList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnTunnelsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListVpnTunnelsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#AggregatedListVpnTunnelsRequest.
}
for resp, err := range c.AggregatedList(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*VpnTunnelsClient) Close ¶
func (c *VpnTunnelsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*VpnTunnelsClient) Connection
deprecated
func (c *VpnTunnelsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*VpnTunnelsClient) Delete ¶
func (c *VpnTunnelsClient) Delete(ctx context.Context, req *computepb.DeleteVpnTunnelRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified VpnTunnel resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnTunnelsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteVpnTunnelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteVpnTunnelRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*VpnTunnelsClient) Get ¶
func (c *VpnTunnelsClient) Get(ctx context.Context, req *computepb.GetVpnTunnelRequest, opts ...gax.CallOption) (*computepb.VpnTunnel, error)
Get returns the specified VpnTunnel resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnTunnelsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetVpnTunnelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetVpnTunnelRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*VpnTunnelsClient) Insert ¶
func (c *VpnTunnelsClient) Insert(ctx context.Context, req *computepb.InsertVpnTunnelRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a VpnTunnel resource in the specified project and region using the data included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnTunnelsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertVpnTunnelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertVpnTunnelRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*VpnTunnelsClient) List ¶
func (c *VpnTunnelsClient) List(ctx context.Context, req *computepb.ListVpnTunnelsRequest, opts ...gax.CallOption) *VpnTunnelIterator
List retrieves a list of VpnTunnel resources contained in the specified project and region.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnTunnelsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListVpnTunnelsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListVpnTunnelsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.VpnTunnelList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnTunnelsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListVpnTunnelsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListVpnTunnelsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*VpnTunnelsClient) SetLabels ¶
func (c *VpnTunnelsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsVpnTunnelRequest, opts ...gax.CallOption) (*Operation, error)
SetLabels sets the labels on a VpnTunnel. To learn more about labels, read theLabeling Resources documentation.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnTunnelsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.SetLabelsVpnTunnelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#SetLabelsVpnTunnelRequest.
}
op, err := c.SetLabels(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*VpnTunnelsClient) TestIamPermissions ¶
func (c *VpnTunnelsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsVpnTunnelRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewVpnTunnelsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.TestIamPermissionsVpnTunnelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#TestIamPermissionsVpnTunnelRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type VpnTunnelsScopedListPair ¶
type VpnTunnelsScopedListPair struct {
Key string
Value *computepb.VpnTunnelsScopedList
}
VpnTunnelsScopedListPair is a holder type for string/*computepb.VpnTunnelsScopedList map entries
type VpnTunnelsScopedListPairIterator ¶
type VpnTunnelsScopedListPairIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []VpnTunnelsScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
VpnTunnelsScopedListPairIterator manages a stream of VpnTunnelsScopedListPair.
func (*VpnTunnelsScopedListPairIterator) All ¶
func (it *VpnTunnelsScopedListPairIterator) All() iter.Seq2[VpnTunnelsScopedListPair, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*VpnTunnelsScopedListPairIterator) Next ¶
func (it *VpnTunnelsScopedListPairIterator) Next() (VpnTunnelsScopedListPair, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*VpnTunnelsScopedListPairIterator) PageInfo ¶
func (it *VpnTunnelsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type WireGroupIterator ¶
type WireGroupIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.WireGroup, nextPageToken string, err error)
// contains filtered or unexported fields
}
WireGroupIterator manages a stream of *computepb.WireGroup.
func (*WireGroupIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*WireGroupIterator) Next ¶
func (it *WireGroupIterator) Next() (*computepb.WireGroup, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*WireGroupIterator) PageInfo ¶
func (it *WireGroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type WireGroupsCallOptions ¶
type WireGroupsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
}
WireGroupsCallOptions contains the retry settings for each method of WireGroupsClient.
type WireGroupsClient ¶
type WireGroupsClient struct {
// The call options for this service.
CallOptions *WireGroupsCallOptions
// contains filtered or unexported fields
}
WireGroupsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The WireGroups API.
func NewWireGroupsRESTClient ¶
func NewWireGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*WireGroupsClient, error)
NewWireGroupsRESTClient creates a new wire groups rest client.
The WireGroups API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewWireGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*WireGroupsClient) Close ¶
func (c *WireGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*WireGroupsClient) Connection
deprecated
func (c *WireGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*WireGroupsClient) Delete ¶
func (c *WireGroupsClient) Delete(ctx context.Context, req *computepb.DeleteWireGroupRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes the specified wire group in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewWireGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteWireGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteWireGroupRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*WireGroupsClient) Get ¶
func (c *WireGroupsClient) Get(ctx context.Context, req *computepb.GetWireGroupRequest, opts ...gax.CallOption) (*computepb.WireGroup, error)
Get gets the specified wire group resource in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewWireGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetWireGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetWireGroupRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*WireGroupsClient) Insert ¶
func (c *WireGroupsClient) Insert(ctx context.Context, req *computepb.InsertWireGroupRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a wire group in the specified project in the given scope using the parameters that are included in the request.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewWireGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertWireGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertWireGroupRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*WireGroupsClient) List ¶
func (c *WireGroupsClient) List(ctx context.Context, req *computepb.ListWireGroupsRequest, opts ...gax.CallOption) *WireGroupIterator
List lists the wire groups for a project in the given scope.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewWireGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListWireGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListWireGroupsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.WireGroupList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewWireGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListWireGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListWireGroupsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*WireGroupsClient) Patch ¶
func (c *WireGroupsClient) Patch(ctx context.Context, req *computepb.PatchWireGroupRequest, opts ...gax.CallOption) (*Operation, error)
Patch updates the specified wire group resource with the data included in the request. This method supportsPATCH semantics and usesJSON merge patch format and processing rules.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewWireGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.PatchWireGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#PatchWireGroupRequest.
}
op, err := c.Patch(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type XpnResourceIdIterator ¶
type XpnResourceIdIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.XpnResourceId, nextPageToken string, err error)
// contains filtered or unexported fields
}
XpnResourceIdIterator manages a stream of *computepb.XpnResourceId.
func (*XpnResourceIdIterator) All ¶
func (it *XpnResourceIdIterator) All() iter.Seq2[*computepb.XpnResourceId, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*XpnResourceIdIterator) Next ¶
func (it *XpnResourceIdIterator) Next() (*computepb.XpnResourceId, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*XpnResourceIdIterator) PageInfo ¶
func (it *XpnResourceIdIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ZoneIterator ¶
type ZoneIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.Zone, nextPageToken string, err error)
// contains filtered or unexported fields
}
ZoneIterator manages a stream of *computepb.Zone.
func (*ZoneIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ZoneIterator) Next ¶
func (it *ZoneIterator) Next() (*computepb.Zone, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ZoneIterator) PageInfo ¶
func (it *ZoneIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ZoneOperationsCallOptions ¶
type ZoneOperationsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
List []gax.CallOption
Wait []gax.CallOption
}
ZoneOperationsCallOptions contains the retry settings for each method of ZoneOperationsClient.
type ZoneOperationsClient ¶
type ZoneOperationsClient struct {
// The call options for this service.
CallOptions *ZoneOperationsCallOptions
// contains filtered or unexported fields
}
ZoneOperationsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ZoneOperations API.
func NewZoneOperationsRESTClient ¶
func NewZoneOperationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ZoneOperationsClient, error)
NewZoneOperationsRESTClient creates a new zone operations rest client.
The ZoneOperations API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ZoneOperationsClient) Close ¶
func (c *ZoneOperationsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ZoneOperationsClient) Connection
deprecated
func (c *ZoneOperationsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ZoneOperationsClient) Delete ¶
func (c *ZoneOperationsClient) Delete(ctx context.Context, req *computepb.DeleteZoneOperationRequest, opts ...gax.CallOption) (*computepb.DeleteZoneOperationResponse, error)
Delete deletes the specified zone-specific Operations resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteZoneOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteZoneOperationRequest.
}
resp, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ZoneOperationsClient) Get ¶
func (c *ZoneOperationsClient) Get(ctx context.Context, req *computepb.GetZoneOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error)
Get retrieves the specified zone-specific Operations resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetZoneOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetZoneOperationRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ZoneOperationsClient) List ¶
func (c *ZoneOperationsClient) List(ctx context.Context, req *computepb.ListZoneOperationsRequest, opts ...gax.CallOption) *OperationIterator
List retrieves a list of Operation resources contained within the specified zone.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListZoneOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListZoneOperationsRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.OperationList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListZoneOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListZoneOperationsRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ZoneOperationsClient) Wait ¶
func (c *ZoneOperationsClient) Wait(ctx context.Context, req *computepb.WaitZoneOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error)
Wait waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method waits for no more than the 2 minutes and then returns the current state of the operation, which might be DONE or still in progress.
This method is called on a best-effort basis. Specifically:
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneOperationsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.WaitZoneOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#WaitZoneOperationRequest.
}
resp, err := c.Wait(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ZoneVmExtensionPoliciesCallOptions ¶ added in v1.50.0
type ZoneVmExtensionPoliciesCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Update []gax.CallOption
}
ZoneVmExtensionPoliciesCallOptions contains the retry settings for each method of ZoneVmExtensionPoliciesClient.
type ZoneVmExtensionPoliciesClient ¶ added in v1.50.0
type ZoneVmExtensionPoliciesClient struct {
// The call options for this service.
CallOptions *ZoneVmExtensionPoliciesCallOptions
// contains filtered or unexported fields
}
ZoneVmExtensionPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ZoneVmExtensionPolicies API.
func NewZoneVmExtensionPoliciesRESTClient ¶ added in v1.50.0
func NewZoneVmExtensionPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ZoneVmExtensionPoliciesClient, error)
NewZoneVmExtensionPoliciesRESTClient creates a new zone vm extension policies rest client.
The ZoneVmExtensionPolicies API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ZoneVmExtensionPoliciesClient) Close ¶ added in v1.50.0
func (c *ZoneVmExtensionPoliciesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ZoneVmExtensionPoliciesClient) Connection
deprecated
added in
v1.50.0
func (c *ZoneVmExtensionPoliciesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ZoneVmExtensionPoliciesClient) Delete ¶ added in v1.50.0
func (c *ZoneVmExtensionPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteZoneVmExtensionPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Delete deletes a specified zone VM extension policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.DeleteZoneVmExtensionPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#DeleteZoneVmExtensionPolicyRequest.
}
op, err := c.Delete(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ZoneVmExtensionPoliciesClient) Get ¶ added in v1.50.0
func (c *ZoneVmExtensionPoliciesClient) Get(ctx context.Context, req *computepb.GetZoneVmExtensionPolicyRequest, opts ...gax.CallOption) (*computepb.VmExtensionPolicy, error)
Get retrieves details of a specific zone VM extension policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetZoneVmExtensionPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetZoneVmExtensionPolicyRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ZoneVmExtensionPoliciesClient) Insert ¶ added in v1.50.0
func (c *ZoneVmExtensionPoliciesClient) Insert(ctx context.Context, req *computepb.InsertZoneVmExtensionPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Insert creates a new zone-level VM extension policy within a project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.InsertZoneVmExtensionPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#InsertZoneVmExtensionPolicyRequest.
}
op, err := c.Insert(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ZoneVmExtensionPoliciesClient) List ¶ added in v1.50.0
func (c *ZoneVmExtensionPoliciesClient) List(ctx context.Context, req *computepb.ListZoneVmExtensionPoliciesRequest, opts ...gax.CallOption) *VmExtensionPolicyIterator
List lists all VM extension policies within a specific zone for a project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListZoneVmExtensionPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListZoneVmExtensionPoliciesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.VmExtensionPolicyList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListZoneVmExtensionPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListZoneVmExtensionPoliciesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ZoneVmExtensionPoliciesClient) Update ¶ added in v1.50.0
func (c *ZoneVmExtensionPoliciesClient) Update(ctx context.Context, req *computepb.UpdateZoneVmExtensionPolicyRequest, opts ...gax.CallOption) (*Operation, error)
Update modifies an existing zone VM extension policy.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZoneVmExtensionPoliciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.UpdateZoneVmExtensionPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#UpdateZoneVmExtensionPolicyRequest.
}
op, err := c.Update(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
type ZonesCallOptions ¶
type ZonesCallOptions struct {
Get []gax.CallOption
List []gax.CallOption
}
ZonesCallOptions contains the retry settings for each method of ZonesClient.
type ZonesClient ¶
type ZonesClient struct {
// The call options for this service.
CallOptions *ZonesCallOptions
// contains filtered or unexported fields
}
ZonesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Zones API.
func NewZonesRESTClient ¶
func NewZonesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ZonesClient, error)
NewZonesRESTClient creates a new zones rest client.
The Zones API.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZonesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ZonesClient) Close ¶
func (c *ZonesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ZonesClient) Connection
deprecated
func (c *ZonesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ZonesClient) Get ¶
func (c *ZonesClient) Get(ctx context.Context, req *computepb.GetZoneRequest, opts ...gax.CallOption) (*computepb.Zone, error)
Get returns the specified Zone resource.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZonesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.GetZoneRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#GetZoneRequest.
}
resp, err := c.Get(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ZonesClient) List ¶
func (c *ZonesClient) List(ctx context.Context, req *computepb.ListZonesRequest, opts ...gax.CallOption) *ZoneIterator
List retrieves the list of Zone resources available to the specified project.
Example ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZonesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListZonesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListZonesRequest.
}
it := c.List(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*computepb.ZoneList)
}
}
Example (All) ¶
package main
import (
"context"
compute "cloud.google.com/go/compute/apiv1beta"
computepb "cloud.google.com/go/compute/apiv1beta/computepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := compute.NewZonesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListZonesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/compute/apiv1beta/computepb#ListZonesRequest.
}
for resp, err := range c.List(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Source Files
¶
- accelerator_types_client.go
- addresses_client.go
- advice_client.go
- autoscalers_client.go
- auxiliary.go
- auxiliary_go123.go
- backend_buckets_client.go
- backend_services_client.go
- cross_site_networks_client.go
- disk_settings_client.go
- disk_types_client.go
- disks_client.go
- doc.go
- external_vpn_gateways_client.go
- firewall_policies_client.go
- firewalls_client.go
- forwarding_rules_client.go
- future_reservations_client.go
- global_addresses_client.go
- global_forwarding_rules_client.go
- global_network_endpoint_groups_client.go
- global_operations_client.go
- global_organization_operations_client.go
- global_public_delegated_prefixes_client.go
- global_vm_extension_policies_client.go
- health_checks_client.go
- helpers.go
- image_family_views_client.go
- images_client.go
- instance_group_manager_resize_requests_client.go
- instance_group_managers_client.go
- instance_groups_client.go
- instance_settings_client.go
- instance_templates_client.go
- instances_client.go
- instant_snapshot_groups_client.go
- instant_snapshots_client.go
- interconnect_attachment_groups_client.go
- interconnect_attachments_client.go
- interconnect_groups_client.go
- interconnect_locations_client.go
- interconnect_remote_locations_client.go
- interconnects_client.go
- license_codes_client.go
- licenses_client.go
- machine_images_client.go
- machine_types_client.go
- network_attachments_client.go
- network_edge_security_services_client.go
- network_endpoint_groups_client.go
- network_firewall_policies_client.go
- network_profiles_client.go
- networks_client.go
- node_groups_client.go
- node_templates_client.go
- node_types_client.go
- operations.go
- organization_security_policies_client.go
- packet_mirrorings_client.go
- preview_features_client.go
- projects_client.go
- public_advertised_prefixes_client.go
- public_delegated_prefixes_client.go
- region_autoscalers_client.go
- region_backend_buckets_client.go
- region_backend_services_client.go
- region_commitments_client.go
- region_composite_health_checks_client.go
- region_disk_settings_client.go
- region_disk_types_client.go
- region_disks_client.go
- region_health_aggregation_policies_client.go
- region_health_check_services_client.go
- region_health_checks_client.go
- region_health_sources_client.go
- region_instance_group_manager_resize_requests_client.go
- region_instance_group_managers_client.go
- region_instance_groups_client.go
- region_instance_templates_client.go
- region_instances_client.go
- region_instant_snapshot_groups_client.go
- region_instant_snapshots_client.go
- region_multi_mig_members_client.go
- region_multi_migs_client.go
- region_network_endpoint_groups_client.go
- region_network_firewall_policies_client.go
- region_network_policies_client.go
- region_notification_endpoints_client.go
- region_operations_client.go
- region_security_policies_client.go
- region_snapshot_settings_client.go
- region_snapshots_client.go
- region_ssl_certificates_client.go
- region_ssl_policies_client.go
- region_target_http_proxies_client.go
- region_target_https_proxies_client.go
- region_target_tcp_proxies_client.go
- region_url_maps_client.go
- region_zones_client.go
- regions_client.go
- reservation_blocks_client.go
- reservation_slots_client.go
- reservation_sub_blocks_client.go
- reservations_client.go
- resource_policies_client.go
- rollout_plans_client.go
- rollouts_client.go
- routers_client.go
- routes_client.go
- security_policies_client.go
- service_attachments_client.go
- snapshot_settings_client.go
- snapshots_client.go
- ssl_certificates_client.go
- ssl_policies_client.go
- storage_pool_types_client.go
- storage_pools_client.go
- subnetworks_client.go
- target_grpc_proxies_client.go
- target_http_proxies_client.go
- target_https_proxies_client.go
- target_instances_client.go
- target_pools_client.go
- target_ssl_proxies_client.go
- target_tcp_proxies_client.go
- target_vpn_gateways_client.go
- url_maps_client.go
- version.go
- vpn_gateways_client.go
- vpn_tunnels_client.go
- wire_groups_client.go
- zone_operations_client.go
- zone_vm_extension_policies_client.go
- zones_client.go