Documentation ¶
Overview ¶
Package apphub is an auto-generated package for the App Hub API.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
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.
ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(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.
ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.CreateApplicationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#CreateApplicationRequest. } op, err := c.CreateApplication(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context ¶
The ctx passed to NewClient 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 ApplicationIterator
- type CallOptions
- type Client
- func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateApplication(ctx context.Context, req *apphubpb.CreateApplicationRequest, ...) (*CreateApplicationOperation, error)
- func (c *Client) CreateApplicationOperation(name string) *CreateApplicationOperation
- func (c *Client) CreateService(ctx context.Context, req *apphubpb.CreateServiceRequest, ...) (*CreateServiceOperation, error)
- func (c *Client) CreateServiceOperation(name string) *CreateServiceOperation
- func (c *Client) CreateServiceProjectAttachment(ctx context.Context, req *apphubpb.CreateServiceProjectAttachmentRequest, ...) (*CreateServiceProjectAttachmentOperation, error)
- func (c *Client) CreateServiceProjectAttachmentOperation(name string) *CreateServiceProjectAttachmentOperation
- func (c *Client) CreateWorkload(ctx context.Context, req *apphubpb.CreateWorkloadRequest, ...) (*CreateWorkloadOperation, error)
- func (c *Client) CreateWorkloadOperation(name string) *CreateWorkloadOperation
- func (c *Client) DeleteApplication(ctx context.Context, req *apphubpb.DeleteApplicationRequest, ...) (*DeleteApplicationOperation, error)
- func (c *Client) DeleteApplicationOperation(name string) *DeleteApplicationOperation
- func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *Client) DeleteService(ctx context.Context, req *apphubpb.DeleteServiceRequest, ...) (*DeleteServiceOperation, error)
- func (c *Client) DeleteServiceOperation(name string) *DeleteServiceOperation
- func (c *Client) DeleteServiceProjectAttachment(ctx context.Context, req *apphubpb.DeleteServiceProjectAttachmentRequest, ...) (*DeleteServiceProjectAttachmentOperation, error)
- func (c *Client) DeleteServiceProjectAttachmentOperation(name string) *DeleteServiceProjectAttachmentOperation
- func (c *Client) DeleteWorkload(ctx context.Context, req *apphubpb.DeleteWorkloadRequest, ...) (*DeleteWorkloadOperation, error)
- func (c *Client) DeleteWorkloadOperation(name string) *DeleteWorkloadOperation
- func (c *Client) DetachServiceProjectAttachment(ctx context.Context, req *apphubpb.DetachServiceProjectAttachmentRequest, ...) (*apphubpb.DetachServiceProjectAttachmentResponse, error)
- func (c *Client) GetApplication(ctx context.Context, req *apphubpb.GetApplicationRequest, ...) (*apphubpb.Application, error)
- func (c *Client) GetDiscoveredService(ctx context.Context, req *apphubpb.GetDiscoveredServiceRequest, ...) (*apphubpb.DiscoveredService, error)
- func (c *Client) GetDiscoveredWorkload(ctx context.Context, req *apphubpb.GetDiscoveredWorkloadRequest, ...) (*apphubpb.DiscoveredWorkload, error)
- func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *Client) GetService(ctx context.Context, req *apphubpb.GetServiceRequest, opts ...gax.CallOption) (*apphubpb.Service, error)
- func (c *Client) GetServiceProjectAttachment(ctx context.Context, req *apphubpb.GetServiceProjectAttachmentRequest, ...) (*apphubpb.ServiceProjectAttachment, error)
- func (c *Client) GetWorkload(ctx context.Context, req *apphubpb.GetWorkloadRequest, opts ...gax.CallOption) (*apphubpb.Workload, error)
- func (c *Client) ListApplications(ctx context.Context, req *apphubpb.ListApplicationsRequest, ...) *ApplicationIterator
- func (c *Client) ListDiscoveredServices(ctx context.Context, req *apphubpb.ListDiscoveredServicesRequest, ...) *DiscoveredServiceIterator
- func (c *Client) ListDiscoveredWorkloads(ctx context.Context, req *apphubpb.ListDiscoveredWorkloadsRequest, ...) *DiscoveredWorkloadIterator
- func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *Client) ListServiceProjectAttachments(ctx context.Context, req *apphubpb.ListServiceProjectAttachmentsRequest, ...) *ServiceProjectAttachmentIterator
- func (c *Client) ListServices(ctx context.Context, req *apphubpb.ListServicesRequest, opts ...gax.CallOption) *ServiceIterator
- func (c *Client) ListWorkloads(ctx context.Context, req *apphubpb.ListWorkloadsRequest, ...) *WorkloadIterator
- func (c *Client) LookupDiscoveredService(ctx context.Context, req *apphubpb.LookupDiscoveredServiceRequest, ...) (*apphubpb.LookupDiscoveredServiceResponse, error)
- func (c *Client) LookupDiscoveredWorkload(ctx context.Context, req *apphubpb.LookupDiscoveredWorkloadRequest, ...) (*apphubpb.LookupDiscoveredWorkloadResponse, error)
- func (c *Client) LookupServiceProjectAttachment(ctx context.Context, req *apphubpb.LookupServiceProjectAttachmentRequest, ...) (*apphubpb.LookupServiceProjectAttachmentResponse, error)
- func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- func (c *Client) UpdateApplication(ctx context.Context, req *apphubpb.UpdateApplicationRequest, ...) (*UpdateApplicationOperation, error)
- func (c *Client) UpdateApplicationOperation(name string) *UpdateApplicationOperation
- func (c *Client) UpdateService(ctx context.Context, req *apphubpb.UpdateServiceRequest, ...) (*UpdateServiceOperation, error)
- func (c *Client) UpdateServiceOperation(name string) *UpdateServiceOperation
- func (c *Client) UpdateWorkload(ctx context.Context, req *apphubpb.UpdateWorkloadRequest, ...) (*UpdateWorkloadOperation, error)
- func (c *Client) UpdateWorkloadOperation(name string) *UpdateWorkloadOperation
- type CreateApplicationOperation
- func (op *CreateApplicationOperation) Done() bool
- func (op *CreateApplicationOperation) Metadata() (*apphubpb.OperationMetadata, error)
- func (op *CreateApplicationOperation) Name() string
- func (op *CreateApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Application, error)
- func (op *CreateApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Application, error)
- type CreateServiceOperation
- func (op *CreateServiceOperation) Done() bool
- func (op *CreateServiceOperation) Metadata() (*apphubpb.OperationMetadata, error)
- func (op *CreateServiceOperation) Name() string
- func (op *CreateServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Service, error)
- func (op *CreateServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Service, error)
- type CreateServiceProjectAttachmentOperation
- func (op *CreateServiceProjectAttachmentOperation) Done() bool
- func (op *CreateServiceProjectAttachmentOperation) Metadata() (*apphubpb.OperationMetadata, error)
- func (op *CreateServiceProjectAttachmentOperation) Name() string
- func (op *CreateServiceProjectAttachmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.ServiceProjectAttachment, error)
- func (op *CreateServiceProjectAttachmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.ServiceProjectAttachment, error)
- type CreateWorkloadOperation
- func (op *CreateWorkloadOperation) Done() bool
- func (op *CreateWorkloadOperation) Metadata() (*apphubpb.OperationMetadata, error)
- func (op *CreateWorkloadOperation) Name() string
- func (op *CreateWorkloadOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Workload, error)
- func (op *CreateWorkloadOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Workload, error)
- type DeleteApplicationOperation
- func (op *DeleteApplicationOperation) Done() bool
- func (op *DeleteApplicationOperation) Metadata() (*apphubpb.OperationMetadata, error)
- func (op *DeleteApplicationOperation) Name() string
- func (op *DeleteApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteServiceOperation
- func (op *DeleteServiceOperation) Done() bool
- func (op *DeleteServiceOperation) Metadata() (*apphubpb.OperationMetadata, error)
- func (op *DeleteServiceOperation) Name() string
- func (op *DeleteServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteServiceProjectAttachmentOperation
- func (op *DeleteServiceProjectAttachmentOperation) Done() bool
- func (op *DeleteServiceProjectAttachmentOperation) Metadata() (*apphubpb.OperationMetadata, error)
- func (op *DeleteServiceProjectAttachmentOperation) Name() string
- func (op *DeleteServiceProjectAttachmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteServiceProjectAttachmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteWorkloadOperation
- func (op *DeleteWorkloadOperation) Done() bool
- func (op *DeleteWorkloadOperation) Metadata() (*apphubpb.OperationMetadata, error)
- func (op *DeleteWorkloadOperation) Name() string
- func (op *DeleteWorkloadOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteWorkloadOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DiscoveredServiceIterator
- type DiscoveredWorkloadIterator
- type LocationIterator
- type OperationIterator
- type ServiceIterator
- type ServiceProjectAttachmentIterator
- type UpdateApplicationOperation
- func (op *UpdateApplicationOperation) Done() bool
- func (op *UpdateApplicationOperation) Metadata() (*apphubpb.OperationMetadata, error)
- func (op *UpdateApplicationOperation) Name() string
- func (op *UpdateApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Application, error)
- func (op *UpdateApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Application, error)
- type UpdateServiceOperation
- func (op *UpdateServiceOperation) Done() bool
- func (op *UpdateServiceOperation) Metadata() (*apphubpb.OperationMetadata, error)
- func (op *UpdateServiceOperation) Name() string
- func (op *UpdateServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Service, error)
- func (op *UpdateServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Service, error)
- type UpdateWorkloadOperation
- func (op *UpdateWorkloadOperation) Done() bool
- func (op *UpdateWorkloadOperation) Metadata() (*apphubpb.OperationMetadata, error)
- func (op *UpdateWorkloadOperation) Name() string
- func (op *UpdateWorkloadOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Workload, error)
- func (op *UpdateWorkloadOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Workload, error)
- type WorkloadIterator
Examples ¶
- Client.CancelOperation
- Client.CreateApplication
- Client.CreateService
- Client.CreateServiceProjectAttachment
- Client.CreateWorkload
- Client.DeleteApplication
- Client.DeleteOperation
- Client.DeleteService
- Client.DeleteServiceProjectAttachment
- Client.DeleteWorkload
- Client.DetachServiceProjectAttachment
- Client.GetApplication
- Client.GetDiscoveredService
- Client.GetDiscoveredWorkload
- Client.GetIamPolicy
- Client.GetLocation
- Client.GetOperation
- Client.GetService
- Client.GetServiceProjectAttachment
- Client.GetWorkload
- Client.ListApplications
- Client.ListDiscoveredServices
- Client.ListDiscoveredWorkloads
- Client.ListLocations
- Client.ListOperations
- Client.ListServiceProjectAttachments
- Client.ListServices
- Client.ListWorkloads
- Client.LookupDiscoveredService
- Client.LookupDiscoveredWorkload
- Client.LookupServiceProjectAttachment
- Client.SetIamPolicy
- Client.TestIamPermissions
- Client.UpdateApplication
- Client.UpdateService
- Client.UpdateWorkload
- NewClient
- NewRESTClient
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 ApplicationIterator ¶
type ApplicationIterator 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 []*apphubpb.Application, nextPageToken string, err error) // contains filtered or unexported fields }
ApplicationIterator manages a stream of *apphubpb.Application.
func (*ApplicationIterator) Next ¶
func (it *ApplicationIterator) Next() (*apphubpb.Application, 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 (*ApplicationIterator) PageInfo ¶
func (it *ApplicationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CallOptions ¶
type CallOptions struct { LookupServiceProjectAttachment []gax.CallOption ListServiceProjectAttachments []gax.CallOption CreateServiceProjectAttachment []gax.CallOption GetServiceProjectAttachment []gax.CallOption DeleteServiceProjectAttachment []gax.CallOption DetachServiceProjectAttachment []gax.CallOption ListDiscoveredServices []gax.CallOption GetDiscoveredService []gax.CallOption LookupDiscoveredService []gax.CallOption ListServices []gax.CallOption CreateService []gax.CallOption GetService []gax.CallOption UpdateService []gax.CallOption DeleteService []gax.CallOption ListDiscoveredWorkloads []gax.CallOption GetDiscoveredWorkload []gax.CallOption LookupDiscoveredWorkload []gax.CallOption ListWorkloads []gax.CallOption CreateWorkload []gax.CallOption GetWorkload []gax.CallOption UpdateWorkload []gax.CallOption DeleteWorkload []gax.CallOption ListApplications []gax.CallOption CreateApplication []gax.CallOption GetApplication []gax.CallOption UpdateApplication []gax.CallOption DeleteApplication []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
CallOptions contains the retry settings for each method of Client.
type Client ¶
type Client struct { // The call options for this service. CallOptions *CallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
Client is a client for interacting with App Hub API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The App Hub API allows you to manage App Hub resources.
func NewClient ¶
NewClient creates a new app hub client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The App Hub API allows you to manage App Hub resources.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewRESTClient ¶
NewRESTClient creates a new app hub rest client.
The App Hub API allows you to manage App Hub resources.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*Client) CancelOperation ¶
func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.CancelOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. } err = c.CancelOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection
deprecated
func (c *Client) 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 (*Client) CreateApplication ¶
func (c *Client) CreateApplication(ctx context.Context, req *apphubpb.CreateApplicationRequest, opts ...gax.CallOption) (*CreateApplicationOperation, error)
CreateApplication creates an Application in a host project and location.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.CreateApplicationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#CreateApplicationRequest. } op, err := c.CreateApplication(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateApplicationOperation ¶
func (c *Client) CreateApplicationOperation(name string) *CreateApplicationOperation
CreateApplicationOperation returns a new CreateApplicationOperation from a given name. The name must be that of a previously created CreateApplicationOperation, possibly from a different process.
func (*Client) CreateService ¶
func (c *Client) CreateService(ctx context.Context, req *apphubpb.CreateServiceRequest, opts ...gax.CallOption) (*CreateServiceOperation, error)
CreateService creates a Service in an Application.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.CreateServiceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#CreateServiceRequest. } op, err := c.CreateService(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateServiceOperation ¶
func (c *Client) CreateServiceOperation(name string) *CreateServiceOperation
CreateServiceOperation returns a new CreateServiceOperation from a given name. The name must be that of a previously created CreateServiceOperation, possibly from a different process.
func (*Client) CreateServiceProjectAttachment ¶
func (c *Client) CreateServiceProjectAttachment(ctx context.Context, req *apphubpb.CreateServiceProjectAttachmentRequest, opts ...gax.CallOption) (*CreateServiceProjectAttachmentOperation, error)
CreateServiceProjectAttachment attaches a service project to the host project.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.CreateServiceProjectAttachmentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#CreateServiceProjectAttachmentRequest. } op, err := c.CreateServiceProjectAttachment(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateServiceProjectAttachmentOperation ¶
func (c *Client) CreateServiceProjectAttachmentOperation(name string) *CreateServiceProjectAttachmentOperation
CreateServiceProjectAttachmentOperation returns a new CreateServiceProjectAttachmentOperation from a given name. The name must be that of a previously created CreateServiceProjectAttachmentOperation, possibly from a different process.
func (*Client) CreateWorkload ¶
func (c *Client) CreateWorkload(ctx context.Context, req *apphubpb.CreateWorkloadRequest, opts ...gax.CallOption) (*CreateWorkloadOperation, error)
CreateWorkload creates a Workload in an Application.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.CreateWorkloadRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#CreateWorkloadRequest. } op, err := c.CreateWorkload(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateWorkloadOperation ¶
func (c *Client) CreateWorkloadOperation(name string) *CreateWorkloadOperation
CreateWorkloadOperation returns a new CreateWorkloadOperation from a given name. The name must be that of a previously created CreateWorkloadOperation, possibly from a different process.
func (*Client) DeleteApplication ¶
func (c *Client) DeleteApplication(ctx context.Context, req *apphubpb.DeleteApplicationRequest, opts ...gax.CallOption) (*DeleteApplicationOperation, error)
DeleteApplication deletes an Application in a host project and location.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.DeleteApplicationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#DeleteApplicationRequest. } op, err := c.DeleteApplication(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteApplicationOperation ¶
func (c *Client) DeleteApplicationOperation(name string) *DeleteApplicationOperation
DeleteApplicationOperation returns a new DeleteApplicationOperation from a given name. The name must be that of a previously created DeleteApplicationOperation, possibly from a different process.
func (*Client) DeleteOperation ¶
func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.DeleteOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest. } err = c.DeleteOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteService ¶
func (c *Client) DeleteService(ctx context.Context, req *apphubpb.DeleteServiceRequest, opts ...gax.CallOption) (*DeleteServiceOperation, error)
DeleteService deletes a Service from an Application.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.DeleteServiceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#DeleteServiceRequest. } op, err := c.DeleteService(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteServiceOperation ¶
func (c *Client) DeleteServiceOperation(name string) *DeleteServiceOperation
DeleteServiceOperation returns a new DeleteServiceOperation from a given name. The name must be that of a previously created DeleteServiceOperation, possibly from a different process.
func (*Client) DeleteServiceProjectAttachment ¶
func (c *Client) DeleteServiceProjectAttachment(ctx context.Context, req *apphubpb.DeleteServiceProjectAttachmentRequest, opts ...gax.CallOption) (*DeleteServiceProjectAttachmentOperation, error)
DeleteServiceProjectAttachment deletes a service project attachment.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.DeleteServiceProjectAttachmentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#DeleteServiceProjectAttachmentRequest. } op, err := c.DeleteServiceProjectAttachment(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteServiceProjectAttachmentOperation ¶
func (c *Client) DeleteServiceProjectAttachmentOperation(name string) *DeleteServiceProjectAttachmentOperation
DeleteServiceProjectAttachmentOperation returns a new DeleteServiceProjectAttachmentOperation from a given name. The name must be that of a previously created DeleteServiceProjectAttachmentOperation, possibly from a different process.
func (*Client) DeleteWorkload ¶
func (c *Client) DeleteWorkload(ctx context.Context, req *apphubpb.DeleteWorkloadRequest, opts ...gax.CallOption) (*DeleteWorkloadOperation, error)
DeleteWorkload deletes a Workload from an Application.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.DeleteWorkloadRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#DeleteWorkloadRequest. } op, err := c.DeleteWorkload(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteWorkloadOperation ¶
func (c *Client) DeleteWorkloadOperation(name string) *DeleteWorkloadOperation
DeleteWorkloadOperation returns a new DeleteWorkloadOperation from a given name. The name must be that of a previously created DeleteWorkloadOperation, possibly from a different process.
func (*Client) DetachServiceProjectAttachment ¶
func (c *Client) DetachServiceProjectAttachment(ctx context.Context, req *apphubpb.DetachServiceProjectAttachmentRequest, opts ...gax.CallOption) (*apphubpb.DetachServiceProjectAttachmentResponse, error)
DetachServiceProjectAttachment detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.DetachServiceProjectAttachmentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#DetachServiceProjectAttachmentRequest. } resp, err := c.DetachServiceProjectAttachment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetApplication ¶
func (c *Client) GetApplication(ctx context.Context, req *apphubpb.GetApplicationRequest, opts ...gax.CallOption) (*apphubpb.Application, error)
GetApplication gets an Application in a host project and location.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.GetApplicationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#GetApplicationRequest. } resp, err := c.GetApplication(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetDiscoveredService ¶
func (c *Client) GetDiscoveredService(ctx context.Context, req *apphubpb.GetDiscoveredServiceRequest, opts ...gax.CallOption) (*apphubpb.DiscoveredService, error)
GetDiscoveredService gets a Discovered Service in a host project and location.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.GetDiscoveredServiceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#GetDiscoveredServiceRequest. } resp, err := c.GetDiscoveredService(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetDiscoveredWorkload ¶
func (c *Client) GetDiscoveredWorkload(ctx context.Context, req *apphubpb.GetDiscoveredWorkloadRequest, opts ...gax.CallOption) (*apphubpb.DiscoveredWorkload, error)
GetDiscoveredWorkload gets a Discovered Workload in a host project and location.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.GetDiscoveredWorkloadRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#GetDiscoveredWorkloadRequest. } resp, err := c.GetDiscoveredWorkload(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetIamPolicy ¶
func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iampb.GetIamPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest. } resp, err := c.GetIamPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetLocation ¶
func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" locationpb "google.golang.org/genproto/googleapis/cloud/location" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &locationpb.GetLocationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest. } resp, err := c.GetLocation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetOperation ¶
func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.GetOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest. } resp, err := c.GetOperation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetService ¶
func (c *Client) GetService(ctx context.Context, req *apphubpb.GetServiceRequest, opts ...gax.CallOption) (*apphubpb.Service, error)
GetService gets a Service in an Application.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.GetServiceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#GetServiceRequest. } resp, err := c.GetService(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetServiceProjectAttachment ¶
func (c *Client) GetServiceProjectAttachment(ctx context.Context, req *apphubpb.GetServiceProjectAttachmentRequest, opts ...gax.CallOption) (*apphubpb.ServiceProjectAttachment, error)
GetServiceProjectAttachment gets a service project attachment.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.GetServiceProjectAttachmentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#GetServiceProjectAttachmentRequest. } resp, err := c.GetServiceProjectAttachment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetWorkload ¶
func (c *Client) GetWorkload(ctx context.Context, req *apphubpb.GetWorkloadRequest, opts ...gax.CallOption) (*apphubpb.Workload, error)
GetWorkload gets a Workload in an Application.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.GetWorkloadRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#GetWorkloadRequest. } resp, err := c.GetWorkload(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ListApplications ¶
func (c *Client) ListApplications(ctx context.Context, req *apphubpb.ListApplicationsRequest, opts ...gax.CallOption) *ApplicationIterator
ListApplications lists Applications in a host project and location.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" "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 := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.ListApplicationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListApplicationsRequest. } it := c.ListApplications(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.(*apphubpb.ListApplicationsResponse) } }
Output:
func (*Client) ListDiscoveredServices ¶
func (c *Client) ListDiscoveredServices(ctx context.Context, req *apphubpb.ListDiscoveredServicesRequest, opts ...gax.CallOption) *DiscoveredServiceIterator
ListDiscoveredServices lists Discovered Services that can be added to an Application in a host project and location.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" "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 := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.ListDiscoveredServicesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListDiscoveredServicesRequest. } it := c.ListDiscoveredServices(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.(*apphubpb.ListDiscoveredServicesResponse) } }
Output:
func (*Client) ListDiscoveredWorkloads ¶
func (c *Client) ListDiscoveredWorkloads(ctx context.Context, req *apphubpb.ListDiscoveredWorkloadsRequest, opts ...gax.CallOption) *DiscoveredWorkloadIterator
ListDiscoveredWorkloads lists Discovered Workloads that can be added to an Application in a host project and location.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" "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 := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.ListDiscoveredWorkloadsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListDiscoveredWorkloadsRequest. } it := c.ListDiscoveredWorkloads(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.(*apphubpb.ListDiscoveredWorkloadsResponse) } }
Output:
func (*Client) ListLocations ¶
func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" "google.golang.org/api/iterator" locationpb "google.golang.org/genproto/googleapis/cloud/location" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &locationpb.ListLocationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. } it := c.ListLocations(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // 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.(*locationpb.ListLocationsResponse) } }
Output:
func (*Client) ListOperations ¶
func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" "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 := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } it := c.ListOperations(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.(*longrunningpb.ListOperationsResponse) } }
Output:
func (*Client) ListServiceProjectAttachments ¶
func (c *Client) ListServiceProjectAttachments(ctx context.Context, req *apphubpb.ListServiceProjectAttachmentsRequest, opts ...gax.CallOption) *ServiceProjectAttachmentIterator
ListServiceProjectAttachments lists service projects attached to the host project.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" "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 := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.ListServiceProjectAttachmentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListServiceProjectAttachmentsRequest. } it := c.ListServiceProjectAttachments(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.(*apphubpb.ListServiceProjectAttachmentsResponse) } }
Output:
func (*Client) ListServices ¶
func (c *Client) ListServices(ctx context.Context, req *apphubpb.ListServicesRequest, opts ...gax.CallOption) *ServiceIterator
ListServices lists Services in an Application.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" "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 := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.ListServicesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListServicesRequest. } it := c.ListServices(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.(*apphubpb.ListServicesResponse) } }
Output:
func (*Client) ListWorkloads ¶
func (c *Client) ListWorkloads(ctx context.Context, req *apphubpb.ListWorkloadsRequest, opts ...gax.CallOption) *WorkloadIterator
ListWorkloads lists Workloads in an Application.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" "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 := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.ListWorkloadsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListWorkloadsRequest. } it := c.ListWorkloads(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.(*apphubpb.ListWorkloadsResponse) } }
Output:
func (*Client) LookupDiscoveredService ¶
func (c *Client) LookupDiscoveredService(ctx context.Context, req *apphubpb.LookupDiscoveredServiceRequest, opts ...gax.CallOption) (*apphubpb.LookupDiscoveredServiceResponse, error)
LookupDiscoveredService lists a Discovered Service in a host project and location, with a given resource URI.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.LookupDiscoveredServiceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#LookupDiscoveredServiceRequest. } resp, err := c.LookupDiscoveredService(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) LookupDiscoveredWorkload ¶
func (c *Client) LookupDiscoveredWorkload(ctx context.Context, req *apphubpb.LookupDiscoveredWorkloadRequest, opts ...gax.CallOption) (*apphubpb.LookupDiscoveredWorkloadResponse, error)
LookupDiscoveredWorkload lists a Discovered Workload in a host project and location, with a given resource URI.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.LookupDiscoveredWorkloadRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#LookupDiscoveredWorkloadRequest. } resp, err := c.LookupDiscoveredWorkload(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) LookupServiceProjectAttachment ¶
func (c *Client) LookupServiceProjectAttachment(ctx context.Context, req *apphubpb.LookupServiceProjectAttachmentRequest, opts ...gax.CallOption) (*apphubpb.LookupServiceProjectAttachmentResponse, error)
LookupServiceProjectAttachment lists a service project attachment for a given service project. You can call this API from any project to find if it is attached to a host project.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.LookupServiceProjectAttachmentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#LookupServiceProjectAttachmentRequest. } resp, err := c.LookupServiceProjectAttachment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) SetIamPolicy ¶
func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iampb.SetIamPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest. } resp, err := c.SetIamPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) TestIamPermissions ¶
func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iampb.TestIamPermissionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest. } resp, err := c.TestIamPermissions(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateApplication ¶
func (c *Client) UpdateApplication(ctx context.Context, req *apphubpb.UpdateApplicationRequest, opts ...gax.CallOption) (*UpdateApplicationOperation, error)
UpdateApplication updates an Application in a host project and location.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.UpdateApplicationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#UpdateApplicationRequest. } op, err := c.UpdateApplication(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateApplicationOperation ¶
func (c *Client) UpdateApplicationOperation(name string) *UpdateApplicationOperation
UpdateApplicationOperation returns a new UpdateApplicationOperation from a given name. The name must be that of a previously created UpdateApplicationOperation, possibly from a different process.
func (*Client) UpdateService ¶
func (c *Client) UpdateService(ctx context.Context, req *apphubpb.UpdateServiceRequest, opts ...gax.CallOption) (*UpdateServiceOperation, error)
UpdateService updates a Service in an Application.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.UpdateServiceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#UpdateServiceRequest. } op, err := c.UpdateService(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateServiceOperation ¶
func (c *Client) UpdateServiceOperation(name string) *UpdateServiceOperation
UpdateServiceOperation returns a new UpdateServiceOperation from a given name. The name must be that of a previously created UpdateServiceOperation, possibly from a different process.
func (*Client) UpdateWorkload ¶
func (c *Client) UpdateWorkload(ctx context.Context, req *apphubpb.UpdateWorkloadRequest, opts ...gax.CallOption) (*UpdateWorkloadOperation, error)
UpdateWorkload updates a Workload in an Application.
Example ¶
package main import ( "context" apphub "cloud.google.com/go/apphub/apiv1" apphubpb "cloud.google.com/go/apphub/apiv1/apphubpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := apphub.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &apphubpb.UpdateWorkloadRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#UpdateWorkloadRequest. } op, err := c.UpdateWorkload(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateWorkloadOperation ¶
func (c *Client) UpdateWorkloadOperation(name string) *UpdateWorkloadOperation
UpdateWorkloadOperation returns a new UpdateWorkloadOperation from a given name. The name must be that of a previously created UpdateWorkloadOperation, possibly from a different process.
type CreateApplicationOperation ¶
type CreateApplicationOperation struct {
// contains filtered or unexported fields
}
CreateApplicationOperation manages a long-running operation from CreateApplication.
func (*CreateApplicationOperation) Done ¶
func (op *CreateApplicationOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateApplicationOperation) Metadata ¶
func (op *CreateApplicationOperation) Metadata() (*apphubpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateApplicationOperation) Name ¶
func (op *CreateApplicationOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateApplicationOperation) Poll ¶
func (op *CreateApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Application, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateApplicationOperation) Wait ¶
func (op *CreateApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Application, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateServiceOperation ¶
type CreateServiceOperation struct {
// contains filtered or unexported fields
}
CreateServiceOperation manages a long-running operation from CreateService.
func (*CreateServiceOperation) Done ¶
func (op *CreateServiceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateServiceOperation) Metadata ¶
func (op *CreateServiceOperation) Metadata() (*apphubpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateServiceOperation) Name ¶
func (op *CreateServiceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateServiceOperation) Poll ¶
func (op *CreateServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Service, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateServiceOperation) Wait ¶
func (op *CreateServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Service, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateServiceProjectAttachmentOperation ¶
type CreateServiceProjectAttachmentOperation struct {
// contains filtered or unexported fields
}
CreateServiceProjectAttachmentOperation manages a long-running operation from CreateServiceProjectAttachment.
func (*CreateServiceProjectAttachmentOperation) Done ¶
func (op *CreateServiceProjectAttachmentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateServiceProjectAttachmentOperation) Metadata ¶
func (op *CreateServiceProjectAttachmentOperation) Metadata() (*apphubpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateServiceProjectAttachmentOperation) Name ¶
func (op *CreateServiceProjectAttachmentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateServiceProjectAttachmentOperation) Poll ¶
func (op *CreateServiceProjectAttachmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.ServiceProjectAttachment, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateServiceProjectAttachmentOperation) Wait ¶
func (op *CreateServiceProjectAttachmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.ServiceProjectAttachment, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateWorkloadOperation ¶
type CreateWorkloadOperation struct {
// contains filtered or unexported fields
}
CreateWorkloadOperation manages a long-running operation from CreateWorkload.
func (*CreateWorkloadOperation) Done ¶
func (op *CreateWorkloadOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateWorkloadOperation) Metadata ¶
func (op *CreateWorkloadOperation) Metadata() (*apphubpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateWorkloadOperation) Name ¶
func (op *CreateWorkloadOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateWorkloadOperation) Poll ¶
func (op *CreateWorkloadOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Workload, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateWorkloadOperation) Wait ¶
func (op *CreateWorkloadOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Workload, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteApplicationOperation ¶
type DeleteApplicationOperation struct {
// contains filtered or unexported fields
}
DeleteApplicationOperation manages a long-running operation from DeleteApplication.
func (*DeleteApplicationOperation) Done ¶
func (op *DeleteApplicationOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteApplicationOperation) Metadata ¶
func (op *DeleteApplicationOperation) Metadata() (*apphubpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteApplicationOperation) Name ¶
func (op *DeleteApplicationOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteApplicationOperation) Poll ¶
func (op *DeleteApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteApplicationOperation) Wait ¶
func (op *DeleteApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteServiceOperation ¶
type DeleteServiceOperation struct {
// contains filtered or unexported fields
}
DeleteServiceOperation manages a long-running operation from DeleteService.
func (*DeleteServiceOperation) Done ¶
func (op *DeleteServiceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteServiceOperation) Metadata ¶
func (op *DeleteServiceOperation) Metadata() (*apphubpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteServiceOperation) Name ¶
func (op *DeleteServiceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteServiceOperation) Poll ¶
func (op *DeleteServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteServiceOperation) Wait ¶
func (op *DeleteServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteServiceProjectAttachmentOperation ¶
type DeleteServiceProjectAttachmentOperation struct {
// contains filtered or unexported fields
}
DeleteServiceProjectAttachmentOperation manages a long-running operation from DeleteServiceProjectAttachment.
func (*DeleteServiceProjectAttachmentOperation) Done ¶
func (op *DeleteServiceProjectAttachmentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteServiceProjectAttachmentOperation) Metadata ¶
func (op *DeleteServiceProjectAttachmentOperation) Metadata() (*apphubpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteServiceProjectAttachmentOperation) Name ¶
func (op *DeleteServiceProjectAttachmentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteServiceProjectAttachmentOperation) Poll ¶
func (op *DeleteServiceProjectAttachmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteServiceProjectAttachmentOperation) Wait ¶
func (op *DeleteServiceProjectAttachmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteWorkloadOperation ¶
type DeleteWorkloadOperation struct {
// contains filtered or unexported fields
}
DeleteWorkloadOperation manages a long-running operation from DeleteWorkload.
func (*DeleteWorkloadOperation) Done ¶
func (op *DeleteWorkloadOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteWorkloadOperation) Metadata ¶
func (op *DeleteWorkloadOperation) Metadata() (*apphubpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteWorkloadOperation) Name ¶
func (op *DeleteWorkloadOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteWorkloadOperation) Poll ¶
func (op *DeleteWorkloadOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteWorkloadOperation) Wait ¶
func (op *DeleteWorkloadOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DiscoveredServiceIterator ¶
type DiscoveredServiceIterator 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 []*apphubpb.DiscoveredService, nextPageToken string, err error) // contains filtered or unexported fields }
DiscoveredServiceIterator manages a stream of *apphubpb.DiscoveredService.
func (*DiscoveredServiceIterator) Next ¶
func (it *DiscoveredServiceIterator) Next() (*apphubpb.DiscoveredService, 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 (*DiscoveredServiceIterator) PageInfo ¶
func (it *DiscoveredServiceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type DiscoveredWorkloadIterator ¶
type DiscoveredWorkloadIterator 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 []*apphubpb.DiscoveredWorkload, nextPageToken string, err error) // contains filtered or unexported fields }
DiscoveredWorkloadIterator manages a stream of *apphubpb.DiscoveredWorkload.
func (*DiscoveredWorkloadIterator) Next ¶
func (it *DiscoveredWorkloadIterator) Next() (*apphubpb.DiscoveredWorkload, 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 (*DiscoveredWorkloadIterator) PageInfo ¶
func (it *DiscoveredWorkloadIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type LocationIterator ¶
type LocationIterator 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 []*locationpb.Location, nextPageToken string, err error) // contains filtered or unexported fields }
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) Next ¶
func (it *LocationIterator) Next() (*locationpb.Location, 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 (*LocationIterator) PageInfo ¶
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
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 []*longrunningpb.Operation, nextPageToken string, err error) // contains filtered or unexported fields }
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) Next ¶
func (it *OperationIterator) Next() (*longrunningpb.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 ServiceIterator ¶
type ServiceIterator 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 []*apphubpb.Service, nextPageToken string, err error) // contains filtered or unexported fields }
ServiceIterator manages a stream of *apphubpb.Service.
func (*ServiceIterator) Next ¶
func (it *ServiceIterator) Next() (*apphubpb.Service, 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 (*ServiceIterator) PageInfo ¶
func (it *ServiceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ServiceProjectAttachmentIterator ¶
type ServiceProjectAttachmentIterator 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 []*apphubpb.ServiceProjectAttachment, nextPageToken string, err error) // contains filtered or unexported fields }
ServiceProjectAttachmentIterator manages a stream of *apphubpb.ServiceProjectAttachment.
func (*ServiceProjectAttachmentIterator) Next ¶
func (it *ServiceProjectAttachmentIterator) Next() (*apphubpb.ServiceProjectAttachment, 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 (*ServiceProjectAttachmentIterator) PageInfo ¶
func (it *ServiceProjectAttachmentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UpdateApplicationOperation ¶
type UpdateApplicationOperation struct {
// contains filtered or unexported fields
}
UpdateApplicationOperation manages a long-running operation from UpdateApplication.
func (*UpdateApplicationOperation) Done ¶
func (op *UpdateApplicationOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateApplicationOperation) Metadata ¶
func (op *UpdateApplicationOperation) Metadata() (*apphubpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateApplicationOperation) Name ¶
func (op *UpdateApplicationOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateApplicationOperation) Poll ¶
func (op *UpdateApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Application, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateApplicationOperation) Wait ¶
func (op *UpdateApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Application, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type UpdateServiceOperation ¶
type UpdateServiceOperation struct {
// contains filtered or unexported fields
}
UpdateServiceOperation manages a long-running operation from UpdateService.
func (*UpdateServiceOperation) Done ¶
func (op *UpdateServiceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateServiceOperation) Metadata ¶
func (op *UpdateServiceOperation) Metadata() (*apphubpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateServiceOperation) Name ¶
func (op *UpdateServiceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateServiceOperation) Poll ¶
func (op *UpdateServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Service, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateServiceOperation) Wait ¶
func (op *UpdateServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Service, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type UpdateWorkloadOperation ¶
type UpdateWorkloadOperation struct {
// contains filtered or unexported fields
}
UpdateWorkloadOperation manages a long-running operation from UpdateWorkload.
func (*UpdateWorkloadOperation) Done ¶
func (op *UpdateWorkloadOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateWorkloadOperation) Metadata ¶
func (op *UpdateWorkloadOperation) Metadata() (*apphubpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateWorkloadOperation) Name ¶
func (op *UpdateWorkloadOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateWorkloadOperation) Poll ¶
func (op *UpdateWorkloadOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Workload, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateWorkloadOperation) Wait ¶
func (op *UpdateWorkloadOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apphubpb.Workload, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type WorkloadIterator ¶
type WorkloadIterator 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 []*apphubpb.Workload, nextPageToken string, err error) // contains filtered or unexported fields }
WorkloadIterator manages a stream of *apphubpb.Workload.
func (*WorkloadIterator) Next ¶
func (it *WorkloadIterator) Next() (*apphubpb.Workload, 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 (*WorkloadIterator) PageInfo ¶
func (it *WorkloadIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.