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.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
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) All
func (it *ApplicationIterator) All() iter.Seq2[*apphubpb.Application, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
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.
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.
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
}
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
}
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.
}
}
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
}
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
}
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
}
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
}
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.
}
}
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.
}
}
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.
}
}
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.
}
}
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.
}
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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.
Examples
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)
}
}
all
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.ListApplicationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListApplicationsRequest.
}
for resp, err := range c.ListApplications(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
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.
Examples
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)
}
}
all
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.ListDiscoveredServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListDiscoveredServicesRequest.
}
for resp, err := range c.ListDiscoveredServices(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
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.
Examples
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)
}
}
all
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.ListDiscoveredWorkloadsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListDiscoveredWorkloadsRequest.
}
for resp, err := range c.ListDiscoveredWorkloads(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
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.
Examples
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)
}
}
all
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.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
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.
Examples
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)
}
}
all
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.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
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.
Examples
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)
}
}
all
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.ListServiceProjectAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListServiceProjectAttachmentsRequest.
}
for resp, err := range c.ListServiceProjectAttachments(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListServices
func (c *Client) ListServices(ctx context.Context, req *apphubpb.ListServicesRequest, opts ...gax.CallOption) *ServiceIterator
ListServices lists Services in an Application.
Examples
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)
}
}
all
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.ListServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListServicesRequest.
}
for resp, err := range c.ListServices(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListWorkloads
func (c *Client) ListWorkloads(ctx context.Context, req *apphubpb.ListWorkloadsRequest, opts ...gax.CallOption) *WorkloadIterator
ListWorkloads lists Workloads in an Application.
Examples
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)
}
}
all
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.ListWorkloadsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apphub/apiv1/apphubpb#ListWorkloadsRequest.
}
for resp, err := range c.ListWorkloads(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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.
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.
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.
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.
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.
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.
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.
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.
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.
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) All
func (it *DiscoveredServiceIterator) All() iter.Seq2[*apphubpb.DiscoveredService, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
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.
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) All
func (it *DiscoveredWorkloadIterator) All() iter.Seq2[*apphubpb.DiscoveredWorkload, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
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.
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) All
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
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.
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) All
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next
func (it *OperationIterator) Next() (*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.
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) All
func (it *ServiceIterator) All() iter.Seq2[*apphubpb.Service, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
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.
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) All
func (it *ServiceProjectAttachmentIterator) All() iter.Seq2[*apphubpb.ServiceProjectAttachment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
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.
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.
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.
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.
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) All
func (it *WorkloadIterator) All() iter.Seq2[*apphubpb.Workload, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
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.