Cloud Composer API v1 - Package cloud.google.com/go/orchestration/airflow/service/apiv1 (v1.8.5)

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:

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.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

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.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

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

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

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

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

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

DatabaseFailoverOperation

type DatabaseFailoverOperation struct {
	// contains filtered or unexported fields
}

DatabaseFailoverOperation manages a long-running operation from DatabaseFailover.

func (*DatabaseFailoverOperation) Done

func (op *DatabaseFailoverOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*DatabaseFailoverOperation) Metadata

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

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

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

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

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

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

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

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

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

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) Next

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.

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
	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.

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
}

func NewEnvironmentsRESTClient

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
}

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

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
}

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) DatabaseFailover

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
}

func (*EnvironmentsClient) DatabaseFailoverOperation

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

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.
	}
}

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

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.
	}
}

func (*EnvironmentsClient) ExecuteAirflowCommand

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
}

func (*EnvironmentsClient) FetchDatabaseProperties

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
}

func (*EnvironmentsClient) GetEnvironment

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
}

func (*EnvironmentsClient) GetOperation

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
}

func (*EnvironmentsClient) ListEnvironments

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
	}
}

func (*EnvironmentsClient) ListOperations

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
	}
}

func (*EnvironmentsClient) LoadSnapshot

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
}

func (*EnvironmentsClient) LoadSnapshotOperation

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

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
}

func (*EnvironmentsClient) SaveSnapshot

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
}

func (*EnvironmentsClient) SaveSnapshotOperation

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

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
}

func (*EnvironmentsClient) UpdateEnvironment

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
}

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.

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) Next

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.

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.

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
}

func NewImageVersionsRESTClient

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
}

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

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.
	}
}

func (*ImageVersionsClient) GetOperation

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
}

func (*ImageVersionsClient) ListImageVersions

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
	}
}

func (*ImageVersionsClient) ListOperations

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
	}
}

LoadSnapshotOperation

type LoadSnapshotOperation struct {
	// contains filtered or unexported fields
}

LoadSnapshotOperation manages a long-running operation from LoadSnapshot.

func (*LoadSnapshotOperation) Done

func (op *LoadSnapshotOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*LoadSnapshotOperation) Metadata

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

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

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

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

OperationIterator

type OperationIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
	// contains filtered or unexported fields
}

OperationIterator manages a stream of *longrunningpb.Operation.

func (*OperationIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*OperationIterator) PageInfo

func (it *OperationIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

SaveSnapshotOperation

type SaveSnapshotOperation struct {
	// contains filtered or unexported fields
}

SaveSnapshotOperation manages a long-running operation from SaveSnapshot.

func (*SaveSnapshotOperation) Done

func (op *SaveSnapshotOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*SaveSnapshotOperation) Metadata

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

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

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

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

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

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

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

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

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.