Documentation ¶
Overview ¶
Package service is an auto-generated package for the Cloud Composer API.
Manages Apache Airflow environments on Google Cloud Platform.
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 := service.NewEnvironmentsClient(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 := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.CheckUpgradeRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#CheckUpgradeRequest. } op, err := c.CheckUpgrade(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 NewEnvironmentsClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Index ¶
- func DefaultAuthScopes() []string
- type CheckUpgradeOperation
- func (op *CheckUpgradeOperation) Done() bool
- func (op *CheckUpgradeOperation) Metadata() (*servicepb.OperationMetadata, error)
- func (op *CheckUpgradeOperation) Name() string
- func (op *CheckUpgradeOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.CheckUpgradeResponse, error)
- func (op *CheckUpgradeOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.CheckUpgradeResponse, error)
- type CreateEnvironmentOperation
- func (op *CreateEnvironmentOperation) Done() bool
- func (op *CreateEnvironmentOperation) Metadata() (*servicepb.OperationMetadata, error)
- func (op *CreateEnvironmentOperation) Name() string
- func (op *CreateEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, error)
- func (op *CreateEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, error)
- type DatabaseFailoverOperation
- func (op *DatabaseFailoverOperation) Done() bool
- func (op *DatabaseFailoverOperation) Metadata() (*servicepb.OperationMetadata, error)
- func (op *DatabaseFailoverOperation) Name() string
- func (op *DatabaseFailoverOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.DatabaseFailoverResponse, error)
- func (op *DatabaseFailoverOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.DatabaseFailoverResponse, error)
- type DeleteEnvironmentOperation
- func (op *DeleteEnvironmentOperation) Done() bool
- func (op *DeleteEnvironmentOperation) Metadata() (*servicepb.OperationMetadata, error)
- func (op *DeleteEnvironmentOperation) Name() string
- func (op *DeleteEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type EnvironmentIterator
- type EnvironmentsCallOptions
- type EnvironmentsClient
- func (c *EnvironmentsClient) CheckUpgrade(ctx context.Context, req *servicepb.CheckUpgradeRequest, ...) (*CheckUpgradeOperation, error)
- func (c *EnvironmentsClient) CheckUpgradeOperation(name string) *CheckUpgradeOperation
- func (c *EnvironmentsClient) Close() error
- func (c *EnvironmentsClient) Connection() *grpc.ClientConndeprecated
- func (c *EnvironmentsClient) CreateEnvironment(ctx context.Context, req *servicepb.CreateEnvironmentRequest, ...) (*CreateEnvironmentOperation, error)
- func (c *EnvironmentsClient) CreateEnvironmentOperation(name string) *CreateEnvironmentOperation
- func (c *EnvironmentsClient) CreateUserWorkloadsConfigMap(ctx context.Context, req *servicepb.CreateUserWorkloadsConfigMapRequest, ...) (*servicepb.UserWorkloadsConfigMap, error)
- func (c *EnvironmentsClient) CreateUserWorkloadsSecret(ctx context.Context, req *servicepb.CreateUserWorkloadsSecretRequest, ...) (*servicepb.UserWorkloadsSecret, error)
- func (c *EnvironmentsClient) DatabaseFailover(ctx context.Context, req *servicepb.DatabaseFailoverRequest, ...) (*DatabaseFailoverOperation, error)
- func (c *EnvironmentsClient) DatabaseFailoverOperation(name string) *DatabaseFailoverOperation
- func (c *EnvironmentsClient) DeleteEnvironment(ctx context.Context, req *servicepb.DeleteEnvironmentRequest, ...) (*DeleteEnvironmentOperation, error)
- func (c *EnvironmentsClient) DeleteEnvironmentOperation(name string) *DeleteEnvironmentOperation
- func (c *EnvironmentsClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *EnvironmentsClient) DeleteUserWorkloadsConfigMap(ctx context.Context, req *servicepb.DeleteUserWorkloadsConfigMapRequest, ...) error
- func (c *EnvironmentsClient) DeleteUserWorkloadsSecret(ctx context.Context, req *servicepb.DeleteUserWorkloadsSecretRequest, ...) error
- func (c *EnvironmentsClient) ExecuteAirflowCommand(ctx context.Context, req *servicepb.ExecuteAirflowCommandRequest, ...) (*servicepb.ExecuteAirflowCommandResponse, error)
- func (c *EnvironmentsClient) FetchDatabaseProperties(ctx context.Context, req *servicepb.FetchDatabasePropertiesRequest, ...) (*servicepb.FetchDatabasePropertiesResponse, error)
- func (c *EnvironmentsClient) GetEnvironment(ctx context.Context, req *servicepb.GetEnvironmentRequest, ...) (*servicepb.Environment, error)
- func (c *EnvironmentsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *EnvironmentsClient) GetUserWorkloadsConfigMap(ctx context.Context, req *servicepb.GetUserWorkloadsConfigMapRequest, ...) (*servicepb.UserWorkloadsConfigMap, error)
- func (c *EnvironmentsClient) GetUserWorkloadsSecret(ctx context.Context, req *servicepb.GetUserWorkloadsSecretRequest, ...) (*servicepb.UserWorkloadsSecret, error)
- func (c *EnvironmentsClient) ListEnvironments(ctx context.Context, req *servicepb.ListEnvironmentsRequest, ...) *EnvironmentIterator
- func (c *EnvironmentsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *EnvironmentsClient) ListUserWorkloadsConfigMaps(ctx context.Context, req *servicepb.ListUserWorkloadsConfigMapsRequest, ...) *UserWorkloadsConfigMapIterator
- func (c *EnvironmentsClient) ListUserWorkloadsSecrets(ctx context.Context, req *servicepb.ListUserWorkloadsSecretsRequest, ...) *UserWorkloadsSecretIterator
- func (c *EnvironmentsClient) ListWorkloads(ctx context.Context, req *servicepb.ListWorkloadsRequest, ...) *ListWorkloadsResponse_ComposerWorkloadIterator
- func (c *EnvironmentsClient) LoadSnapshot(ctx context.Context, req *servicepb.LoadSnapshotRequest, ...) (*LoadSnapshotOperation, error)
- func (c *EnvironmentsClient) LoadSnapshotOperation(name string) *LoadSnapshotOperation
- func (c *EnvironmentsClient) PollAirflowCommand(ctx context.Context, req *servicepb.PollAirflowCommandRequest, ...) (*servicepb.PollAirflowCommandResponse, error)
- func (c *EnvironmentsClient) SaveSnapshot(ctx context.Context, req *servicepb.SaveSnapshotRequest, ...) (*SaveSnapshotOperation, error)
- func (c *EnvironmentsClient) SaveSnapshotOperation(name string) *SaveSnapshotOperation
- func (c *EnvironmentsClient) StopAirflowCommand(ctx context.Context, req *servicepb.StopAirflowCommandRequest, ...) (*servicepb.StopAirflowCommandResponse, error)
- func (c *EnvironmentsClient) UpdateEnvironment(ctx context.Context, req *servicepb.UpdateEnvironmentRequest, ...) (*UpdateEnvironmentOperation, error)
- func (c *EnvironmentsClient) UpdateEnvironmentOperation(name string) *UpdateEnvironmentOperation
- func (c *EnvironmentsClient) UpdateUserWorkloadsConfigMap(ctx context.Context, req *servicepb.UpdateUserWorkloadsConfigMapRequest, ...) (*servicepb.UserWorkloadsConfigMap, error)
- func (c *EnvironmentsClient) UpdateUserWorkloadsSecret(ctx context.Context, req *servicepb.UpdateUserWorkloadsSecretRequest, ...) (*servicepb.UserWorkloadsSecret, error)
- type ImageVersionIterator
- type ImageVersionsCallOptions
- type ImageVersionsClient
- func (c *ImageVersionsClient) Close() error
- func (c *ImageVersionsClient) Connection() *grpc.ClientConndeprecated
- func (c *ImageVersionsClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *ImageVersionsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *ImageVersionsClient) ListImageVersions(ctx context.Context, req *servicepb.ListImageVersionsRequest, ...) *ImageVersionIterator
- func (c *ImageVersionsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- type ListWorkloadsResponse_ComposerWorkloadIterator
- func (it *ListWorkloadsResponse_ComposerWorkloadIterator) All() iter.Seq2[*servicepb.ListWorkloadsResponse_ComposerWorkload, error]
- func (it *ListWorkloadsResponse_ComposerWorkloadIterator) Next() (*servicepb.ListWorkloadsResponse_ComposerWorkload, error)
- func (it *ListWorkloadsResponse_ComposerWorkloadIterator) PageInfo() *iterator.PageInfo
- type LoadSnapshotOperation
- func (op *LoadSnapshotOperation) Done() bool
- func (op *LoadSnapshotOperation) Metadata() (*servicepb.OperationMetadata, error)
- func (op *LoadSnapshotOperation) Name() string
- func (op *LoadSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.LoadSnapshotResponse, error)
- func (op *LoadSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.LoadSnapshotResponse, error)
- type OperationIterator
- type SaveSnapshotOperation
- func (op *SaveSnapshotOperation) Done() bool
- func (op *SaveSnapshotOperation) Metadata() (*servicepb.OperationMetadata, error)
- func (op *SaveSnapshotOperation) Name() string
- func (op *SaveSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.SaveSnapshotResponse, error)
- func (op *SaveSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.SaveSnapshotResponse, error)
- type UpdateEnvironmentOperation
- func (op *UpdateEnvironmentOperation) Done() bool
- func (op *UpdateEnvironmentOperation) Metadata() (*servicepb.OperationMetadata, error)
- func (op *UpdateEnvironmentOperation) Name() string
- func (op *UpdateEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, error)
- func (op *UpdateEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, error)
- type UserWorkloadsConfigMapIterator
- type UserWorkloadsSecretIterator
Examples ¶
- EnvironmentsClient.CheckUpgrade
- EnvironmentsClient.CreateEnvironment
- EnvironmentsClient.CreateUserWorkloadsConfigMap
- EnvironmentsClient.CreateUserWorkloadsSecret
- EnvironmentsClient.DatabaseFailover
- EnvironmentsClient.DeleteEnvironment
- EnvironmentsClient.DeleteOperation
- EnvironmentsClient.DeleteUserWorkloadsConfigMap
- EnvironmentsClient.DeleteUserWorkloadsSecret
- EnvironmentsClient.ExecuteAirflowCommand
- EnvironmentsClient.FetchDatabaseProperties
- EnvironmentsClient.GetEnvironment
- EnvironmentsClient.GetOperation
- EnvironmentsClient.GetUserWorkloadsConfigMap
- EnvironmentsClient.GetUserWorkloadsSecret
- EnvironmentsClient.ListEnvironments
- EnvironmentsClient.ListEnvironments (All)
- EnvironmentsClient.ListOperations
- EnvironmentsClient.ListOperations (All)
- EnvironmentsClient.ListUserWorkloadsConfigMaps
- EnvironmentsClient.ListUserWorkloadsConfigMaps (All)
- EnvironmentsClient.ListUserWorkloadsSecrets
- EnvironmentsClient.ListUserWorkloadsSecrets (All)
- EnvironmentsClient.ListWorkloads
- EnvironmentsClient.ListWorkloads (All)
- EnvironmentsClient.LoadSnapshot
- EnvironmentsClient.PollAirflowCommand
- EnvironmentsClient.SaveSnapshot
- EnvironmentsClient.StopAirflowCommand
- EnvironmentsClient.UpdateEnvironment
- EnvironmentsClient.UpdateUserWorkloadsConfigMap
- EnvironmentsClient.UpdateUserWorkloadsSecret
- ImageVersionsClient.DeleteOperation
- ImageVersionsClient.GetOperation
- ImageVersionsClient.ListImageVersions
- ImageVersionsClient.ListImageVersions (All)
- ImageVersionsClient.ListOperations
- ImageVersionsClient.ListOperations (All)
- NewEnvironmentsClient
- NewEnvironmentsRESTClient
- NewImageVersionsClient
- NewImageVersionsRESTClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type CheckUpgradeOperation ¶ added in v1.11.0
type CheckUpgradeOperation struct {
// contains filtered or unexported fields
}
CheckUpgradeOperation manages a long-running operation from CheckUpgrade.
func (*CheckUpgradeOperation) Done ¶ added in v1.11.0
func (op *CheckUpgradeOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CheckUpgradeOperation) Metadata ¶ added in v1.11.0
func (op *CheckUpgradeOperation) Metadata() (*servicepb.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 (*CheckUpgradeOperation) Name ¶ added in v1.11.0
func (op *CheckUpgradeOperation) 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 (*CheckUpgradeOperation) Poll ¶ added in v1.11.0
func (op *CheckUpgradeOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.CheckUpgradeResponse, 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 (*CheckUpgradeOperation) Wait ¶ added in v1.11.0
func (op *CheckUpgradeOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.CheckUpgradeResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateEnvironmentOperation ¶
type CreateEnvironmentOperation struct {
// contains filtered or unexported fields
}
CreateEnvironmentOperation manages a long-running operation from CreateEnvironment.
func (*CreateEnvironmentOperation) Done ¶
func (op *CreateEnvironmentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateEnvironmentOperation) Metadata ¶
func (op *CreateEnvironmentOperation) Metadata() (*servicepb.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 (*CreateEnvironmentOperation) Name ¶
func (op *CreateEnvironmentOperation) 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 (*CreateEnvironmentOperation) Poll ¶
func (op *CreateEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, 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 (*CreateEnvironmentOperation) Wait ¶
func (op *CreateEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DatabaseFailoverOperation ¶ added in v1.8.0
type DatabaseFailoverOperation struct {
// contains filtered or unexported fields
}
DatabaseFailoverOperation manages a long-running operation from DatabaseFailover.
func (*DatabaseFailoverOperation) Done ¶ added in v1.8.0
func (op *DatabaseFailoverOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DatabaseFailoverOperation) Metadata ¶ added in v1.8.0
func (op *DatabaseFailoverOperation) Metadata() (*servicepb.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 (*DatabaseFailoverOperation) Name ¶ added in v1.8.0
func (op *DatabaseFailoverOperation) 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 (*DatabaseFailoverOperation) Poll ¶ added in v1.8.0
func (op *DatabaseFailoverOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.DatabaseFailoverResponse, 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 (*DatabaseFailoverOperation) Wait ¶ added in v1.8.0
func (op *DatabaseFailoverOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.DatabaseFailoverResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteEnvironmentOperation ¶
type DeleteEnvironmentOperation struct {
// contains filtered or unexported fields
}
DeleteEnvironmentOperation manages a long-running operation from DeleteEnvironment.
func (*DeleteEnvironmentOperation) Done ¶
func (op *DeleteEnvironmentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteEnvironmentOperation) Metadata ¶
func (op *DeleteEnvironmentOperation) Metadata() (*servicepb.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 (*DeleteEnvironmentOperation) Name ¶
func (op *DeleteEnvironmentOperation) 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 (*DeleteEnvironmentOperation) Poll ¶
func (op *DeleteEnvironmentOperation) 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 (*DeleteEnvironmentOperation) Wait ¶
func (op *DeleteEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type EnvironmentIterator ¶
type EnvironmentIterator 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 []*servicepb.Environment, nextPageToken string, err error) // contains filtered or unexported fields }
EnvironmentIterator manages a stream of *servicepb.Environment.
func (*EnvironmentIterator) All ¶ added in v1.10.1
func (it *EnvironmentIterator) All() iter.Seq2[*servicepb.Environment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EnvironmentIterator) Next ¶
func (it *EnvironmentIterator) Next() (*servicepb.Environment, 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 (*EnvironmentIterator) PageInfo ¶
func (it *EnvironmentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type EnvironmentsCallOptions ¶
type EnvironmentsCallOptions struct { CreateEnvironment []gax.CallOption GetEnvironment []gax.CallOption ListEnvironments []gax.CallOption UpdateEnvironment []gax.CallOption DeleteEnvironment []gax.CallOption ExecuteAirflowCommand []gax.CallOption StopAirflowCommand []gax.CallOption PollAirflowCommand []gax.CallOption ListWorkloads []gax.CallOption CheckUpgrade []gax.CallOption CreateUserWorkloadsSecret []gax.CallOption GetUserWorkloadsSecret []gax.CallOption ListUserWorkloadsSecrets []gax.CallOption UpdateUserWorkloadsSecret []gax.CallOption DeleteUserWorkloadsSecret []gax.CallOption CreateUserWorkloadsConfigMap []gax.CallOption GetUserWorkloadsConfigMap []gax.CallOption ListUserWorkloadsConfigMaps []gax.CallOption UpdateUserWorkloadsConfigMap []gax.CallOption DeleteUserWorkloadsConfigMap []gax.CallOption SaveSnapshot []gax.CallOption LoadSnapshot []gax.CallOption DatabaseFailover []gax.CallOption FetchDatabaseProperties []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
EnvironmentsCallOptions contains the retry settings for each method of EnvironmentsClient.
type EnvironmentsClient ¶
type EnvironmentsClient struct { // The call options for this service. CallOptions *EnvironmentsCallOptions // 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 }
EnvironmentsClient is a client for interacting with Cloud Composer API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Managed Apache Airflow Environments.
func NewEnvironmentsClient ¶
func NewEnvironmentsClient(ctx context.Context, opts ...option.ClientOption) (*EnvironmentsClient, error)
NewEnvironmentsClient creates a new environments client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Managed Apache Airflow Environments.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/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 := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewEnvironmentsRESTClient ¶ added in v1.6.0
func NewEnvironmentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*EnvironmentsClient, error)
NewEnvironmentsRESTClient creates a new environments rest client.
Managed Apache Airflow Environments.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/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 := service.NewEnvironmentsRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*EnvironmentsClient) CheckUpgrade ¶ added in v1.11.0
func (c *EnvironmentsClient) CheckUpgrade(ctx context.Context, req *servicepb.CheckUpgradeRequest, opts ...gax.CallOption) (*CheckUpgradeOperation, error)
CheckUpgrade check if an upgrade operation on the environment will succeed.
In case of problems detailed info can be found in the returned Operation.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.CheckUpgradeRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#CheckUpgradeRequest. } op, err := c.CheckUpgrade(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) CheckUpgradeOperation ¶ added in v1.11.0
func (c *EnvironmentsClient) CheckUpgradeOperation(name string) *CheckUpgradeOperation
CheckUpgradeOperation returns a new CheckUpgradeOperation from a given name. The name must be that of a previously created CheckUpgradeOperation, possibly from a different process.
func (*EnvironmentsClient) Close ¶
func (c *EnvironmentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*EnvironmentsClient) Connection
deprecated
func (c *EnvironmentsClient) 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 (*EnvironmentsClient) CreateEnvironment ¶
func (c *EnvironmentsClient) CreateEnvironment(ctx context.Context, req *servicepb.CreateEnvironmentRequest, opts ...gax.CallOption) (*CreateEnvironmentOperation, error)
CreateEnvironment create a new environment.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.CreateEnvironmentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#CreateEnvironmentRequest. } op, err := c.CreateEnvironment(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) CreateEnvironmentOperation ¶
func (c *EnvironmentsClient) CreateEnvironmentOperation(name string) *CreateEnvironmentOperation
CreateEnvironmentOperation returns a new CreateEnvironmentOperation from a given name. The name must be that of a previously created CreateEnvironmentOperation, possibly from a different process.
func (*EnvironmentsClient) CreateUserWorkloadsConfigMap ¶ added in v1.9.0
func (c *EnvironmentsClient) CreateUserWorkloadsConfigMap(ctx context.Context, req *servicepb.CreateUserWorkloadsConfigMapRequest, opts ...gax.CallOption) (*servicepb.UserWorkloadsConfigMap, error)
CreateUserWorkloadsConfigMap creates a user workloads ConfigMap.
This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.CreateUserWorkloadsConfigMapRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#CreateUserWorkloadsConfigMapRequest. } resp, err := c.CreateUserWorkloadsConfigMap(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) CreateUserWorkloadsSecret ¶ added in v1.9.0
func (c *EnvironmentsClient) CreateUserWorkloadsSecret(ctx context.Context, req *servicepb.CreateUserWorkloadsSecretRequest, opts ...gax.CallOption) (*servicepb.UserWorkloadsSecret, error)
CreateUserWorkloadsSecret creates a user workloads Secret.
This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.CreateUserWorkloadsSecretRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#CreateUserWorkloadsSecretRequest. } resp, err := c.CreateUserWorkloadsSecret(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) DatabaseFailover ¶ added in v1.8.0
func (c *EnvironmentsClient) DatabaseFailover(ctx context.Context, req *servicepb.DatabaseFailoverRequest, opts ...gax.CallOption) (*DatabaseFailoverOperation, error)
DatabaseFailover triggers database failover (only for highly resilient environments).
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.DatabaseFailoverRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#DatabaseFailoverRequest. } op, err := c.DatabaseFailover(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) DatabaseFailoverOperation ¶ added in v1.8.0
func (c *EnvironmentsClient) DatabaseFailoverOperation(name string) *DatabaseFailoverOperation
DatabaseFailoverOperation returns a new DatabaseFailoverOperation from a given name. The name must be that of a previously created DatabaseFailoverOperation, possibly from a different process.
func (*EnvironmentsClient) DeleteEnvironment ¶
func (c *EnvironmentsClient) DeleteEnvironment(ctx context.Context, req *servicepb.DeleteEnvironmentRequest, opts ...gax.CallOption) (*DeleteEnvironmentOperation, error)
DeleteEnvironment delete an environment.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.DeleteEnvironmentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#DeleteEnvironmentRequest. } op, err := c.DeleteEnvironment(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*EnvironmentsClient) DeleteEnvironmentOperation ¶
func (c *EnvironmentsClient) DeleteEnvironmentOperation(name string) *DeleteEnvironmentOperation
DeleteEnvironmentOperation returns a new DeleteEnvironmentOperation from a given name. The name must be that of a previously created DeleteEnvironmentOperation, possibly from a different process.
func (*EnvironmentsClient) DeleteOperation ¶ added in v1.5.0
func (c *EnvironmentsClient) 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" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" service "cloud.google.com/go/orchestration/airflow/service/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 := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.DeleteOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest. } err = c.DeleteOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*EnvironmentsClient) DeleteUserWorkloadsConfigMap ¶ added in v1.9.0
func (c *EnvironmentsClient) DeleteUserWorkloadsConfigMap(ctx context.Context, req *servicepb.DeleteUserWorkloadsConfigMapRequest, opts ...gax.CallOption) error
DeleteUserWorkloadsConfigMap deletes a user workloads ConfigMap.
This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.DeleteUserWorkloadsConfigMapRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#DeleteUserWorkloadsConfigMapRequest. } err = c.DeleteUserWorkloadsConfigMap(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*EnvironmentsClient) DeleteUserWorkloadsSecret ¶ added in v1.9.0
func (c *EnvironmentsClient) DeleteUserWorkloadsSecret(ctx context.Context, req *servicepb.DeleteUserWorkloadsSecretRequest, opts ...gax.CallOption) error
DeleteUserWorkloadsSecret deletes a user workloads Secret.
This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.DeleteUserWorkloadsSecretRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#DeleteUserWorkloadsSecretRequest. } err = c.DeleteUserWorkloadsSecret(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*EnvironmentsClient) ExecuteAirflowCommand ¶ added in v1.8.0
func (c *EnvironmentsClient) ExecuteAirflowCommand(ctx context.Context, req *servicepb.ExecuteAirflowCommandRequest, opts ...gax.CallOption) (*servicepb.ExecuteAirflowCommandResponse, error)
ExecuteAirflowCommand executes Airflow CLI command.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.ExecuteAirflowCommandRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#ExecuteAirflowCommandRequest. } resp, err := c.ExecuteAirflowCommand(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) FetchDatabaseProperties ¶ added in v1.8.0
func (c *EnvironmentsClient) FetchDatabaseProperties(ctx context.Context, req *servicepb.FetchDatabasePropertiesRequest, opts ...gax.CallOption) (*servicepb.FetchDatabasePropertiesResponse, error)
FetchDatabaseProperties fetches database properties.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.FetchDatabasePropertiesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#FetchDatabasePropertiesRequest. } resp, err := c.FetchDatabaseProperties(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) GetEnvironment ¶
func (c *EnvironmentsClient) GetEnvironment(ctx context.Context, req *servicepb.GetEnvironmentRequest, opts ...gax.CallOption) (*servicepb.Environment, error)
GetEnvironment get an existing environment.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.GetEnvironmentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#GetEnvironmentRequest. } resp, err := c.GetEnvironment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) GetOperation ¶ added in v1.5.0
func (c *EnvironmentsClient) 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" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" service "cloud.google.com/go/orchestration/airflow/service/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 := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.GetOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest. } resp, err := c.GetOperation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) GetUserWorkloadsConfigMap ¶ added in v1.9.0
func (c *EnvironmentsClient) GetUserWorkloadsConfigMap(ctx context.Context, req *servicepb.GetUserWorkloadsConfigMapRequest, opts ...gax.CallOption) (*servicepb.UserWorkloadsConfigMap, error)
GetUserWorkloadsConfigMap gets an existing user workloads ConfigMap.
This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.GetUserWorkloadsConfigMapRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#GetUserWorkloadsConfigMapRequest. } resp, err := c.GetUserWorkloadsConfigMap(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) GetUserWorkloadsSecret ¶ added in v1.9.0
func (c *EnvironmentsClient) GetUserWorkloadsSecret(ctx context.Context, req *servicepb.GetUserWorkloadsSecretRequest, opts ...gax.CallOption) (*servicepb.UserWorkloadsSecret, error)
GetUserWorkloadsSecret gets an existing user workloads Secret. Values of the “data” field in the response are cleared.
This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.GetUserWorkloadsSecretRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#GetUserWorkloadsSecretRequest. } resp, err := c.GetUserWorkloadsSecret(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) ListEnvironments ¶
func (c *EnvironmentsClient) ListEnvironments(ctx context.Context, req *servicepb.ListEnvironmentsRequest, opts ...gax.CallOption) *EnvironmentIterator
ListEnvironments list environments.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" "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 := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.ListEnvironmentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#ListEnvironmentsRequest. } it := c.ListEnvironments(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.(*servicepb.ListEnvironmentsResponse) } }
Output:
Example (All) ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.ListEnvironmentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#ListEnvironmentsRequest. } for resp, err := range c.ListEnvironments(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*EnvironmentsClient) ListOperations ¶ added in v1.5.0
func (c *EnvironmentsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" service "cloud.google.com/go/orchestration/airflow/service/apiv1" "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 := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } it := c.ListOperations(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*longrunningpb.ListOperationsResponse) } }
Output:
Example (All) ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" service "cloud.google.com/go/orchestration/airflow/service/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 := service.NewEnvironmentsClient(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 } }
Output:
func (*EnvironmentsClient) ListUserWorkloadsConfigMaps ¶ added in v1.9.0
func (c *EnvironmentsClient) ListUserWorkloadsConfigMaps(ctx context.Context, req *servicepb.ListUserWorkloadsConfigMapsRequest, opts ...gax.CallOption) *UserWorkloadsConfigMapIterator
ListUserWorkloadsConfigMaps lists user workloads ConfigMaps.
This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" "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 := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.ListUserWorkloadsConfigMapsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#ListUserWorkloadsConfigMapsRequest. } it := c.ListUserWorkloadsConfigMaps(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.(*servicepb.ListUserWorkloadsConfigMapsResponse) } }
Output:
Example (All) ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.ListUserWorkloadsConfigMapsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#ListUserWorkloadsConfigMapsRequest. } for resp, err := range c.ListUserWorkloadsConfigMaps(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*EnvironmentsClient) ListUserWorkloadsSecrets ¶ added in v1.9.0
func (c *EnvironmentsClient) ListUserWorkloadsSecrets(ctx context.Context, req *servicepb.ListUserWorkloadsSecretsRequest, opts ...gax.CallOption) *UserWorkloadsSecretIterator
ListUserWorkloadsSecrets lists user workloads Secrets.
This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" "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 := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.ListUserWorkloadsSecretsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#ListUserWorkloadsSecretsRequest. } it := c.ListUserWorkloadsSecrets(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.(*servicepb.ListUserWorkloadsSecretsResponse) } }
Output:
Example (All) ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.ListUserWorkloadsSecretsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#ListUserWorkloadsSecretsRequest. } for resp, err := range c.ListUserWorkloadsSecrets(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*EnvironmentsClient) ListWorkloads ¶ added in v1.9.0
func (c *EnvironmentsClient) ListWorkloads(ctx context.Context, req *servicepb.ListWorkloadsRequest, opts ...gax.CallOption) *ListWorkloadsResponse_ComposerWorkloadIterator
ListWorkloads lists workloads in a Cloud Composer environment. Workload is a unit that runs a single Composer component.
This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" "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 := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.ListWorkloadsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#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.(*servicepb.ListWorkloadsResponse) } }
Output:
Example (All) ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.ListWorkloadsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#ListWorkloadsRequest. } for resp, err := range c.ListWorkloads(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*EnvironmentsClient) LoadSnapshot ¶ added in v1.5.0
func (c *EnvironmentsClient) LoadSnapshot(ctx context.Context, req *servicepb.LoadSnapshotRequest, opts ...gax.CallOption) (*LoadSnapshotOperation, error)
LoadSnapshot loads a snapshot of a Cloud Composer environment.
As a result of this operation, a snapshot of environment’s specified in LoadSnapshotRequest is loaded into the environment.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.LoadSnapshotRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#LoadSnapshotRequest. } op, err := c.LoadSnapshot(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) LoadSnapshotOperation ¶ added in v1.5.0
func (c *EnvironmentsClient) LoadSnapshotOperation(name string) *LoadSnapshotOperation
LoadSnapshotOperation returns a new LoadSnapshotOperation from a given name. The name must be that of a previously created LoadSnapshotOperation, possibly from a different process.
func (*EnvironmentsClient) PollAirflowCommand ¶ added in v1.8.0
func (c *EnvironmentsClient) PollAirflowCommand(ctx context.Context, req *servicepb.PollAirflowCommandRequest, opts ...gax.CallOption) (*servicepb.PollAirflowCommandResponse, error)
PollAirflowCommand polls Airflow CLI command execution and fetches logs.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.PollAirflowCommandRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#PollAirflowCommandRequest. } resp, err := c.PollAirflowCommand(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) SaveSnapshot ¶ added in v1.5.0
func (c *EnvironmentsClient) SaveSnapshot(ctx context.Context, req *servicepb.SaveSnapshotRequest, opts ...gax.CallOption) (*SaveSnapshotOperation, error)
SaveSnapshot creates a snapshots of a Cloud Composer environment.
As a result of this operation, snapshot of environment’s state is stored in a location specified in the SaveSnapshotRequest.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.SaveSnapshotRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#SaveSnapshotRequest. } op, err := c.SaveSnapshot(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) SaveSnapshotOperation ¶ added in v1.5.0
func (c *EnvironmentsClient) SaveSnapshotOperation(name string) *SaveSnapshotOperation
SaveSnapshotOperation returns a new SaveSnapshotOperation from a given name. The name must be that of a previously created SaveSnapshotOperation, possibly from a different process.
func (*EnvironmentsClient) StopAirflowCommand ¶ added in v1.8.0
func (c *EnvironmentsClient) StopAirflowCommand(ctx context.Context, req *servicepb.StopAirflowCommandRequest, opts ...gax.CallOption) (*servicepb.StopAirflowCommandResponse, error)
StopAirflowCommand stops Airflow CLI command execution.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.StopAirflowCommandRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#StopAirflowCommandRequest. } resp, err := c.StopAirflowCommand(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) UpdateEnvironment ¶
func (c *EnvironmentsClient) UpdateEnvironment(ctx context.Context, req *servicepb.UpdateEnvironmentRequest, opts ...gax.CallOption) (*UpdateEnvironmentOperation, error)
UpdateEnvironment update an environment.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.UpdateEnvironmentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#UpdateEnvironmentRequest. } op, err := c.UpdateEnvironment(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) UpdateEnvironmentOperation ¶
func (c *EnvironmentsClient) UpdateEnvironmentOperation(name string) *UpdateEnvironmentOperation
UpdateEnvironmentOperation returns a new UpdateEnvironmentOperation from a given name. The name must be that of a previously created UpdateEnvironmentOperation, possibly from a different process.
func (*EnvironmentsClient) UpdateUserWorkloadsConfigMap ¶ added in v1.9.0
func (c *EnvironmentsClient) UpdateUserWorkloadsConfigMap(ctx context.Context, req *servicepb.UpdateUserWorkloadsConfigMapRequest, opts ...gax.CallOption) (*servicepb.UserWorkloadsConfigMap, error)
UpdateUserWorkloadsConfigMap updates a user workloads ConfigMap.
This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.UpdateUserWorkloadsConfigMapRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#UpdateUserWorkloadsConfigMapRequest. } resp, err := c.UpdateUserWorkloadsConfigMap(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) UpdateUserWorkloadsSecret ¶ added in v1.9.0
func (c *EnvironmentsClient) UpdateUserWorkloadsSecret(ctx context.Context, req *servicepb.UpdateUserWorkloadsSecretRequest, opts ...gax.CallOption) (*servicepb.UserWorkloadsSecret, error)
UpdateUserWorkloadsSecret updates a user workloads Secret.
This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.UpdateUserWorkloadsSecretRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#UpdateUserWorkloadsSecretRequest. } resp, err := c.UpdateUserWorkloadsSecret(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type ImageVersionIterator ¶
type ImageVersionIterator 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 []*servicepb.ImageVersion, nextPageToken string, err error) // contains filtered or unexported fields }
ImageVersionIterator manages a stream of *servicepb.ImageVersion.
func (*ImageVersionIterator) All ¶ added in v1.10.1
func (it *ImageVersionIterator) All() iter.Seq2[*servicepb.ImageVersion, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ImageVersionIterator) Next ¶
func (it *ImageVersionIterator) Next() (*servicepb.ImageVersion, 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 (*ImageVersionIterator) PageInfo ¶
func (it *ImageVersionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ImageVersionsCallOptions ¶
type ImageVersionsCallOptions struct { ListImageVersions []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
ImageVersionsCallOptions contains the retry settings for each method of ImageVersionsClient.
type ImageVersionsClient ¶
type ImageVersionsClient struct { // The call options for this service. CallOptions *ImageVersionsCallOptions // contains filtered or unexported fields }
ImageVersionsClient is a client for interacting with Cloud Composer API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Readonly service to query available ImageVersions.
func NewImageVersionsClient ¶
func NewImageVersionsClient(ctx context.Context, opts ...option.ClientOption) (*ImageVersionsClient, error)
NewImageVersionsClient creates a new image versions client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Readonly service to query available ImageVersions.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/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 := service.NewImageVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewImageVersionsRESTClient ¶ added in v1.6.0
func NewImageVersionsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ImageVersionsClient, error)
NewImageVersionsRESTClient creates a new image versions rest client.
Readonly service to query available ImageVersions.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/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 := service.NewImageVersionsRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*ImageVersionsClient) Close ¶
func (c *ImageVersionsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ImageVersionsClient) Connection
deprecated
func (c *ImageVersionsClient) 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 (*ImageVersionsClient) DeleteOperation ¶ added in v1.5.0
func (c *ImageVersionsClient) 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" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" service "cloud.google.com/go/orchestration/airflow/service/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 := service.NewImageVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.DeleteOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest. } err = c.DeleteOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*ImageVersionsClient) GetOperation ¶ added in v1.5.0
func (c *ImageVersionsClient) 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" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" service "cloud.google.com/go/orchestration/airflow/service/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 := service.NewImageVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.GetOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest. } resp, err := c.GetOperation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ImageVersionsClient) ListImageVersions ¶
func (c *ImageVersionsClient) ListImageVersions(ctx context.Context, req *servicepb.ListImageVersionsRequest, opts ...gax.CallOption) *ImageVersionIterator
ListImageVersions list ImageVersions for provided location.
Example ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" "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 := service.NewImageVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.ListImageVersionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#ListImageVersionsRequest. } it := c.ListImageVersions(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.(*servicepb.ListImageVersionsResponse) } }
Output:
Example (All) ¶
package main import ( "context" service "cloud.google.com/go/orchestration/airflow/service/apiv1" servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := service.NewImageVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicepb.ListImageVersionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb#ListImageVersionsRequest. } for resp, err := range c.ListImageVersions(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*ImageVersionsClient) ListOperations ¶ added in v1.5.0
func (c *ImageVersionsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" service "cloud.google.com/go/orchestration/airflow/service/apiv1" "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 := service.NewImageVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } it := c.ListOperations(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*longrunningpb.ListOperationsResponse) } }
Output:
Example (All) ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" service "cloud.google.com/go/orchestration/airflow/service/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 := service.NewImageVersionsClient(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 } }
Output:
type ListWorkloadsResponse_ComposerWorkloadIterator ¶ added in v1.9.0
type ListWorkloadsResponse_ComposerWorkloadIterator 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 []*servicepb.ListWorkloadsResponse_ComposerWorkload, nextPageToken string, err error) // contains filtered or unexported fields }
ListWorkloadsResponse_ComposerWorkloadIterator manages a stream of *servicepb.ListWorkloadsResponse_ComposerWorkload.
func (*ListWorkloadsResponse_ComposerWorkloadIterator) All ¶ added in v1.10.1
func (it *ListWorkloadsResponse_ComposerWorkloadIterator) All() iter.Seq2[*servicepb.ListWorkloadsResponse_ComposerWorkload, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ListWorkloadsResponse_ComposerWorkloadIterator) Next ¶ added in v1.9.0
func (it *ListWorkloadsResponse_ComposerWorkloadIterator) Next() (*servicepb.ListWorkloadsResponse_ComposerWorkload, 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 (*ListWorkloadsResponse_ComposerWorkloadIterator) PageInfo ¶ added in v1.9.0
func (it *ListWorkloadsResponse_ComposerWorkloadIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type LoadSnapshotOperation ¶ added in v1.5.0
type LoadSnapshotOperation struct {
// contains filtered or unexported fields
}
LoadSnapshotOperation manages a long-running operation from LoadSnapshot.
func (*LoadSnapshotOperation) Done ¶ added in v1.5.0
func (op *LoadSnapshotOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*LoadSnapshotOperation) Metadata ¶ added in v1.5.0
func (op *LoadSnapshotOperation) Metadata() (*servicepb.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 (*LoadSnapshotOperation) Name ¶ added in v1.5.0
func (op *LoadSnapshotOperation) 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 (*LoadSnapshotOperation) Poll ¶ added in v1.5.0
func (op *LoadSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.LoadSnapshotResponse, 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 (*LoadSnapshotOperation) Wait ¶ added in v1.5.0
func (op *LoadSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.LoadSnapshotResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type OperationIterator ¶ added in v1.5.0
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 ¶ added in v1.10.1
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 ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SaveSnapshotOperation ¶ added in v1.5.0
type SaveSnapshotOperation struct {
// contains filtered or unexported fields
}
SaveSnapshotOperation manages a long-running operation from SaveSnapshot.
func (*SaveSnapshotOperation) Done ¶ added in v1.5.0
func (op *SaveSnapshotOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*SaveSnapshotOperation) Metadata ¶ added in v1.5.0
func (op *SaveSnapshotOperation) Metadata() (*servicepb.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 (*SaveSnapshotOperation) Name ¶ added in v1.5.0
func (op *SaveSnapshotOperation) 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 (*SaveSnapshotOperation) Poll ¶ added in v1.5.0
func (op *SaveSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.SaveSnapshotResponse, 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 (*SaveSnapshotOperation) Wait ¶ added in v1.5.0
func (op *SaveSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.SaveSnapshotResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type UpdateEnvironmentOperation ¶
type UpdateEnvironmentOperation struct {
// contains filtered or unexported fields
}
UpdateEnvironmentOperation manages a long-running operation from UpdateEnvironment.
func (*UpdateEnvironmentOperation) Done ¶
func (op *UpdateEnvironmentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateEnvironmentOperation) Metadata ¶
func (op *UpdateEnvironmentOperation) Metadata() (*servicepb.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 (*UpdateEnvironmentOperation) Name ¶
func (op *UpdateEnvironmentOperation) 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 (*UpdateEnvironmentOperation) Poll ¶
func (op *UpdateEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, 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 (*UpdateEnvironmentOperation) Wait ¶
func (op *UpdateEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type UserWorkloadsConfigMapIterator ¶ added in v1.9.0
type UserWorkloadsConfigMapIterator 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 []*servicepb.UserWorkloadsConfigMap, nextPageToken string, err error) // contains filtered or unexported fields }
UserWorkloadsConfigMapIterator manages a stream of *servicepb.UserWorkloadsConfigMap.
func (*UserWorkloadsConfigMapIterator) All ¶ added in v1.10.1
func (it *UserWorkloadsConfigMapIterator) All() iter.Seq2[*servicepb.UserWorkloadsConfigMap, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*UserWorkloadsConfigMapIterator) Next ¶ added in v1.9.0
func (it *UserWorkloadsConfigMapIterator) Next() (*servicepb.UserWorkloadsConfigMap, 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 (*UserWorkloadsConfigMapIterator) PageInfo ¶ added in v1.9.0
func (it *UserWorkloadsConfigMapIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UserWorkloadsSecretIterator ¶ added in v1.9.0
type UserWorkloadsSecretIterator 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 []*servicepb.UserWorkloadsSecret, nextPageToken string, err error) // contains filtered or unexported fields }
UserWorkloadsSecretIterator manages a stream of *servicepb.UserWorkloadsSecret.
func (*UserWorkloadsSecretIterator) All ¶ added in v1.10.1
func (it *UserWorkloadsSecretIterator) All() iter.Seq2[*servicepb.UserWorkloadsSecret, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*UserWorkloadsSecretIterator) Next ¶ added in v1.9.0
func (it *UserWorkloadsSecretIterator) Next() (*servicepb.UserWorkloadsSecret, 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 (*UserWorkloadsSecretIterator) PageInfo ¶ added in v1.9.0
func (it *UserWorkloadsSecretIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.