bundle

package
v0.135.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Service for managing bundle deployment metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleAPI

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

Service for managing bundle deployment metadata.

func NewBundle

func NewBundle(client *client.DatabricksClient) *BundleAPI

func (*BundleAPI) CompleteVersion

func (a *BundleAPI) CompleteVersion(ctx context.Context, request CompleteVersionRequest) (*Version, error)

func (*BundleAPI) CreateDeployment

func (a *BundleAPI) CreateDeployment(ctx context.Context, request CreateDeploymentRequest) (*Deployment, error)

func (*BundleAPI) CreateOperation

func (a *BundleAPI) CreateOperation(ctx context.Context, request CreateOperationRequest) (*Operation, error)

func (*BundleAPI) CreateVersion

func (a *BundleAPI) CreateVersion(ctx context.Context, request CreateVersionRequest) (*Version, error)

func (*BundleAPI) DeleteDeployment

func (a *BundleAPI) DeleteDeployment(ctx context.Context, request DeleteDeploymentRequest) error

func (*BundleAPI) GetDeployment

func (a *BundleAPI) GetDeployment(ctx context.Context, request GetDeploymentRequest) (*Deployment, error)

func (*BundleAPI) GetOperation

func (a *BundleAPI) GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error)

func (*BundleAPI) GetResource

func (a *BundleAPI) GetResource(ctx context.Context, request GetResourceRequest) (*Resource, error)

func (*BundleAPI) GetVersion

func (a *BundleAPI) GetVersion(ctx context.Context, request GetVersionRequest) (*Version, error)

func (*BundleAPI) Heartbeat

func (a *BundleAPI) Heartbeat(ctx context.Context, request HeartbeatRequest) (*HeartbeatResponse, error)

func (*BundleAPI) ListDeployments

func (a *BundleAPI) ListDeployments(ctx context.Context, request ListDeploymentsRequest) listing.Iterator[Deployment]

Lists deployments in the workspace.

func (*BundleAPI) ListDeploymentsAll

func (a *BundleAPI) ListDeploymentsAll(ctx context.Context, request ListDeploymentsRequest) ([]Deployment, error)

Lists deployments in the workspace.

func (*BundleAPI) ListOperations

func (a *BundleAPI) ListOperations(ctx context.Context, request ListOperationsRequest) listing.Iterator[Operation]

Lists resource operations under a version.

func (*BundleAPI) ListOperationsAll

func (a *BundleAPI) ListOperationsAll(ctx context.Context, request ListOperationsRequest) ([]Operation, error)

Lists resource operations under a version.

func (*BundleAPI) ListResources

func (a *BundleAPI) ListResources(ctx context.Context, request ListResourcesRequest) listing.Iterator[Resource]

Lists resources under a deployment.

func (*BundleAPI) ListResourcesAll

func (a *BundleAPI) ListResourcesAll(ctx context.Context, request ListResourcesRequest) ([]Resource, error)

Lists resources under a deployment.

func (*BundleAPI) ListVersions

func (a *BundleAPI) ListVersions(ctx context.Context, request ListVersionsRequest) listing.Iterator[Version]

Lists versions under a deployment, ordered by version_id descending (most recent first).

func (*BundleAPI) ListVersionsAll

func (a *BundleAPI) ListVersionsAll(ctx context.Context, request ListVersionsRequest) ([]Version, error)

Lists versions under a deployment, ordered by version_id descending (most recent first).

type BundleInterface

type BundleInterface interface {

	// Marks a version as complete and releases the deployment lock.
	//
	// The server atomically: 1. Sets the version status to the provided terminal
	// status. 2. Sets `complete_time` to the current server timestamp. 3. Releases
	// the lock on the parent deployment. 4. Updates the parent deployment's
	// `status` and `last_version_id`.
	CompleteVersion(ctx context.Context, request CompleteVersionRequest) (*Version, error)

	// Creates a new deployment in the workspace.
	//
	// The caller must provide a `deployment_id` which becomes the final component
	// of the deployment's resource name. If a deployment with the same ID already
	// exists, the server returns `ALREADY_EXISTS`.
	CreateDeployment(ctx context.Context, request CreateDeploymentRequest) (*Deployment, error)

	// Creates a resource operation under a version.
	//
	// The caller must provide a `resource_key` which becomes the final component of
	// the operation's name. If an operation with the same key already exists under
	// the version, the server returns `ALREADY_EXISTS`.
	//
	// On success the server also updates the corresponding deployment-level
	// Resource (creating it if this is the first operation for that resource_key,
	// or removing it if action_type is DELETE).
	CreateOperation(ctx context.Context, request CreateOperationRequest) (*Operation, error)

	// Creates a new version under a deployment.
	//
	// Creating a version acquires an exclusive lock on the deployment, preventing
	// concurrent deploys. The caller provides a `version_id` which the server
	// validates equals `last_version_id + 1` on the deployment.
	CreateVersion(ctx context.Context, request CreateVersionRequest) (*Version, error)

	// Deletes a deployment.
	//
	// The deployment is marked as deleted. It and all its children (versions and
	// their operations) will be permanently deleted after the retention policy
	// expires. If the deployment has an in-progress version, the server returns
	// `RESOURCE_CONFLICT`.
	DeleteDeployment(ctx context.Context, request DeleteDeploymentRequest) error

	// Retrieves a deployment by its resource name.
	GetDeployment(ctx context.Context, request GetDeploymentRequest) (*Deployment, error)

	// Retrieves a resource operation by its resource name.
	GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error)

	// Retrieves a deployment resource by its resource name.
	GetResource(ctx context.Context, request GetResourceRequest) (*Resource, error)

	// Retrieves a version by its resource name.
	GetVersion(ctx context.Context, request GetVersionRequest) (*Version, error)

	// Sends a heartbeat to renew the lock held by a version.
	//
	// The server validates that the version is the active (non-terminal) version on
	// the parent deployment and resets the lock expiry. If the lock has already
	// expired or the version is no longer active, the server returns `ABORTED`.
	Heartbeat(ctx context.Context, request HeartbeatRequest) (*HeartbeatResponse, error)

	// Lists deployments in the workspace.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListDeployments(ctx context.Context, request ListDeploymentsRequest) listing.Iterator[Deployment]

	// Lists deployments in the workspace.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListDeploymentsAll(ctx context.Context, request ListDeploymentsRequest) ([]Deployment, error)

	// Lists resource operations under a version.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListOperations(ctx context.Context, request ListOperationsRequest) listing.Iterator[Operation]

	// Lists resource operations under a version.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListOperationsAll(ctx context.Context, request ListOperationsRequest) ([]Operation, error)

	// Lists resources under a deployment.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListResources(ctx context.Context, request ListResourcesRequest) listing.Iterator[Resource]

	// Lists resources under a deployment.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListResourcesAll(ctx context.Context, request ListResourcesRequest) ([]Resource, error)

	// Lists versions under a deployment, ordered by version_id descending (most
	// recent first).
	//
	// This method is generated by Databricks SDK Code Generator.
	ListVersions(ctx context.Context, request ListVersionsRequest) listing.Iterator[Version]

	// Lists versions under a deployment, ordered by version_id descending (most
	// recent first).
	//
	// This method is generated by Databricks SDK Code Generator.
	ListVersionsAll(ctx context.Context, request ListVersionsRequest) ([]Version, error)
}

type BundleService deprecated

type BundleService interface {

	// Marks a version as complete and releases the deployment lock.
	//
	// The server atomically: 1. Sets the version status to the provided
	// terminal status. 2. Sets `complete_time` to the current server timestamp.
	// 3. Releases the lock on the parent deployment. 4. Updates the parent
	// deployment's `status` and `last_version_id`.
	CompleteVersion(ctx context.Context, request CompleteVersionRequest) (*Version, error)

	// Creates a new deployment in the workspace.
	//
	// The caller must provide a `deployment_id` which becomes the final
	// component of the deployment's resource name. If a deployment with the
	// same ID already exists, the server returns `ALREADY_EXISTS`.
	CreateDeployment(ctx context.Context, request CreateDeploymentRequest) (*Deployment, error)

	// Creates a resource operation under a version.
	//
	// The caller must provide a `resource_key` which becomes the final
	// component of the operation's name. If an operation with the same key
	// already exists under the version, the server returns `ALREADY_EXISTS`.
	//
	// On success the server also updates the corresponding deployment-level
	// Resource (creating it if this is the first operation for that
	// resource_key, or removing it if action_type is DELETE).
	CreateOperation(ctx context.Context, request CreateOperationRequest) (*Operation, error)

	// Creates a new version under a deployment.
	//
	// Creating a version acquires an exclusive lock on the deployment,
	// preventing concurrent deploys. The caller provides a `version_id` which
	// the server validates equals `last_version_id + 1` on the deployment.
	CreateVersion(ctx context.Context, request CreateVersionRequest) (*Version, error)

	// Deletes a deployment.
	//
	// The deployment is marked as deleted. It and all its children (versions
	// and their operations) will be permanently deleted after the retention
	// policy expires. If the deployment has an in-progress version, the server
	// returns `RESOURCE_CONFLICT`.
	DeleteDeployment(ctx context.Context, request DeleteDeploymentRequest) error

	// Retrieves a deployment by its resource name.
	GetDeployment(ctx context.Context, request GetDeploymentRequest) (*Deployment, error)

	// Retrieves a resource operation by its resource name.
	GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error)

	// Retrieves a deployment resource by its resource name.
	GetResource(ctx context.Context, request GetResourceRequest) (*Resource, error)

	// Retrieves a version by its resource name.
	GetVersion(ctx context.Context, request GetVersionRequest) (*Version, error)

	// Sends a heartbeat to renew the lock held by a version.
	//
	// The server validates that the version is the active (non-terminal)
	// version on the parent deployment and resets the lock expiry. If the lock
	// has already expired or the version is no longer active, the server
	// returns `ABORTED`.
	Heartbeat(ctx context.Context, request HeartbeatRequest) (*HeartbeatResponse, error)

	// Lists deployments in the workspace.
	ListDeployments(ctx context.Context, request ListDeploymentsRequest) (*ListDeploymentsResponse, error)

	// Lists resource operations under a version.
	ListOperations(ctx context.Context, request ListOperationsRequest) (*ListOperationsResponse, error)

	// Lists resources under a deployment.
	ListResources(ctx context.Context, request ListResourcesRequest) (*ListResourcesResponse, error)

	// Lists versions under a deployment, ordered by version_id descending (most
	// recent first).
	ListVersions(ctx context.Context, request ListVersionsRequest) (*ListVersionsResponse, error)
}

Service for managing bundle deployment metadata.

Deprecated: Do not use this interface, it will be removed in a future version of the SDK.

type CompleteVersionRequest

type CompleteVersionRequest struct {
	// The reason for completing the version. Must be a terminal reason:
	// VERSION_COMPLETE_SUCCESS, VERSION_COMPLETE_FAILURE, or
	// VERSION_COMPLETE_FORCE_ABORT.
	CompletionReason VersionComplete `json:"completion_reason"`
	// If true, force-completes the version even if the caller is not the
	// original creator. The completion_reason must be
	// VERSION_COMPLETE_FORCE_ABORT when force is true.
	Force bool `json:"force,omitempty"`
	// The name of the version to complete. Format:
	// deployments/{deployment_id}/versions/{version_id}
	Name string `json:"-" url:"-"`

	ForceSendFields []string `json:"-" url:"-"`
}

A request to complete a Version.

func (CompleteVersionRequest) MarshalJSON

func (s CompleteVersionRequest) MarshalJSON() ([]byte, error)

func (*CompleteVersionRequest) UnmarshalJSON

func (s *CompleteVersionRequest) UnmarshalJSON(b []byte) error

type CreateDeploymentRequest

type CreateDeploymentRequest struct {
	// The deployment to create.
	Deployment Deployment `json:"deployment"`
	// The ID to use for the deployment, which will become the final component
	// of the deployment's resource name (i.e. `deployments/{deployment_id}`).
	DeploymentId string `json:"-" url:"deployment_id"`
}

type CreateOperationRequest

type CreateOperationRequest struct {
	// The resource operation to create.
	Operation Operation `json:"operation"`
	// The parent version where this operation will be recorded. Format:
	// deployments/{deployment_id}/versions/{version_id}
	Parent string `json:"-" url:"-"`
	// The key identifying the resource this operation applies to. Becomes the
	// final component of the operation's name.
	ResourceKey string `json:"-" url:"resource_key"`
}

type CreateVersionRequest

type CreateVersionRequest struct {
	// The parent deployment where this version will be created. Format:
	// deployments/{deployment_id}
	Parent string `json:"-" url:"-"`
	// The version to create.
	Version Version `json:"version"`
	// The version ID the caller expects to create. The server validates this
	// equals `last_version_id + 1` on the deployment. If it doesn't match, the
	// server returns `ABORTED`.
	VersionId string `json:"-" url:"version_id"`
}

type DeleteDeploymentRequest

type DeleteDeploymentRequest struct {
	// Resource name of the deployment to delete. Format:
	// deployments/{deployment_id}
	Name string `json:"-" url:"-"`
}

type Deployment

type Deployment struct {
	// When the deployment was created.
	CreateTime *time.Time `json:"create_time,omitempty"`
	// The user who created the deployment (email or principal name).
	CreatedBy string `json:"created_by,omitempty"`
	// When the deployment was destroyed (i.e. `bundle destroy` completed).
	// Unset if the deployment has not been destroyed. Named destroy_time (not
	// delete_time) because this tracks the `databricks bundle destroy` command,
	// not the API-level deletion.
	DestroyTime *time.Time `json:"destroy_time,omitempty"`
	// The user who destroyed the deployment (email or principal name). Unset if
	// the deployment has not been destroyed.
	DestroyedBy string `json:"destroyed_by,omitempty"`
	// Human-readable name for the deployment.
	DisplayName string `json:"display_name,omitempty"`
	// The version_id of the most recent deployment version.
	LastVersionId string `json:"last_version_id,omitempty"`
	// Resource name of the deployment. Format: deployments/{deployment_id}
	Name string `json:"name,omitempty"`
	// Current status of the deployment.
	Status DeploymentStatus `json:"status,omitempty"`
	// The bundle target name associated with this deployment.
	TargetName string `json:"target_name,omitempty"`
	// When the deployment was last updated.
	UpdateTime *time.Time `json:"update_time,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

A bundle deployment registered with the control plane.

func (Deployment) MarshalJSON

func (s Deployment) MarshalJSON() ([]byte, error)

func (*Deployment) UnmarshalJSON

func (s *Deployment) UnmarshalJSON(b []byte) error

type DeploymentResourceType

type DeploymentResourceType string

Type of a deployment resource.

const DeploymentResourceTypeDeploymentResourceTypeAlert DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_ALERT`
const DeploymentResourceTypeDeploymentResourceTypeApp DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_APP`
const DeploymentResourceTypeDeploymentResourceTypeCatalog DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_CATALOG`
const DeploymentResourceTypeDeploymentResourceTypeCluster DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_CLUSTER`
const DeploymentResourceTypeDeploymentResourceTypeDashboard DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_DASHBOARD`
const DeploymentResourceTypeDeploymentResourceTypeDatabaseCatalog DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_DATABASE_CATALOG`
const DeploymentResourceTypeDeploymentResourceTypeDatabaseInstance DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_DATABASE_INSTANCE`
const DeploymentResourceTypeDeploymentResourceTypeExperiment DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_EXPERIMENT`
const DeploymentResourceTypeDeploymentResourceTypeExternalLocation DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_EXTERNAL_LOCATION`
const DeploymentResourceTypeDeploymentResourceTypeJob DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_JOB`
const DeploymentResourceTypeDeploymentResourceTypeModel DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_MODEL`
const DeploymentResourceTypeDeploymentResourceTypeModelServingEndpoint DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_MODEL_SERVING_ENDPOINT`
const DeploymentResourceTypeDeploymentResourceTypePipeline DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_PIPELINE`
const DeploymentResourceTypeDeploymentResourceTypePostgresBranch DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_POSTGRES_BRANCH`
const DeploymentResourceTypeDeploymentResourceTypePostgresEndpoint DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_POSTGRES_ENDPOINT`
const DeploymentResourceTypeDeploymentResourceTypePostgresProject DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_POSTGRES_PROJECT`
const DeploymentResourceTypeDeploymentResourceTypeQualityMonitor DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_QUALITY_MONITOR`
const DeploymentResourceTypeDeploymentResourceTypeRegisteredModel DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_REGISTERED_MODEL`
const DeploymentResourceTypeDeploymentResourceTypeSchema DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_SCHEMA`
const DeploymentResourceTypeDeploymentResourceTypeSecretScope DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_SECRET_SCOPE`
const DeploymentResourceTypeDeploymentResourceTypeSqlWarehouse DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_SQL_WAREHOUSE`
const DeploymentResourceTypeDeploymentResourceTypeSyncedDatabaseTable DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_SYNCED_DATABASE_TABLE`
const DeploymentResourceTypeDeploymentResourceTypeVolume DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_VOLUME`

func (*DeploymentResourceType) Set

Set raw string value and validate it against allowed values

func (*DeploymentResourceType) String

func (f *DeploymentResourceType) String() string

String representation for fmt.Print

func (*DeploymentResourceType) Type

func (f *DeploymentResourceType) Type() string

Type always returns DeploymentResourceType to satisfy [pflag.Value] interface

func (*DeploymentResourceType) Values

Values returns all possible values for DeploymentResourceType.

There is no guarantee on the order of the values in the slice.

type DeploymentStatus

type DeploymentStatus string

Status of a deployment.

const DeploymentStatusDeploymentStatusActive DeploymentStatus = `DEPLOYMENT_STATUS_ACTIVE`
const DeploymentStatusDeploymentStatusDeleted DeploymentStatus = `DEPLOYMENT_STATUS_DELETED`
const DeploymentStatusDeploymentStatusFailed DeploymentStatus = `DEPLOYMENT_STATUS_FAILED`
const DeploymentStatusDeploymentStatusInProgress DeploymentStatus = `DEPLOYMENT_STATUS_IN_PROGRESS`

func (*DeploymentStatus) Set

func (f *DeploymentStatus) Set(v string) error

Set raw string value and validate it against allowed values

func (*DeploymentStatus) String

func (f *DeploymentStatus) String() string

String representation for fmt.Print

func (*DeploymentStatus) Type

func (f *DeploymentStatus) Type() string

Type always returns DeploymentStatus to satisfy [pflag.Value] interface

func (*DeploymentStatus) Values

func (f *DeploymentStatus) Values() []DeploymentStatus

Values returns all possible values for DeploymentStatus.

There is no guarantee on the order of the values in the slice.

type GetDeploymentRequest

type GetDeploymentRequest struct {
	// Resource name of the deployment to retrieve. Format:
	// deployments/{deployment_id}
	Name string `json:"-" url:"-"`
}

type GetOperationRequest

type GetOperationRequest struct {
	// The name of the resource operation to retrieve. Format:
	// deployments/{deployment_id}/versions/{version_id}/operations/{resource_key}
	Name string `json:"-" url:"-"`
}

type GetResourceRequest

type GetResourceRequest struct {
	// The name of the resource to retrieve. Format:
	// deployments/{deployment_id}/resources/{resource_key}
	Name string `json:"-" url:"-"`
}

type GetVersionRequest

type GetVersionRequest struct {
	// The name of the version to retrieve. Format:
	// deployments/{deployment_id}/versions/{version_id}
	Name string `json:"-" url:"-"`
}

type HeartbeatRequest

type HeartbeatRequest struct {
	// The version whose lock to renew. Format:
	// deployments/{deployment_id}/versions/{version_id}
	Name string `json:"-" url:"-"`
}

A request to send a heartbeat for a Version.

type HeartbeatResponse

type HeartbeatResponse struct {
	// The new lock expiry time after renewal.
	ExpireTime *time.Time `json:"expire_time,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

Response for Heartbeat.

func (HeartbeatResponse) MarshalJSON

func (s HeartbeatResponse) MarshalJSON() ([]byte, error)

func (*HeartbeatResponse) UnmarshalJSON

func (s *HeartbeatResponse) UnmarshalJSON(b []byte) error

type ListDeploymentsRequest

type ListDeploymentsRequest struct {
	// The maximum number of deployments to return. The service may return fewer
	// than this value. If unspecified, at most 50 deployments will be returned.
	// The maximum value is 1000; values above 1000 will be coerced to 1000.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// A page token, received from a previous `ListDeployments` call. Provide
	// this to retrieve the subsequent page.
	PageToken string `json:"-" url:"page_token,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListDeploymentsRequest) MarshalJSON

func (s ListDeploymentsRequest) MarshalJSON() ([]byte, error)

func (*ListDeploymentsRequest) UnmarshalJSON

func (s *ListDeploymentsRequest) UnmarshalJSON(b []byte) error

type ListDeploymentsResponse

type ListDeploymentsResponse struct {
	// The deployments from the queried workspace.
	Deployments []Deployment `json:"deployments,omitempty"`
	// A token, which can be sent as `page_token` to retrieve the next page. If
	// this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"next_page_token,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

Response for ListDeployments.

func (ListDeploymentsResponse) MarshalJSON

func (s ListDeploymentsResponse) MarshalJSON() ([]byte, error)

func (*ListDeploymentsResponse) UnmarshalJSON

func (s *ListDeploymentsResponse) UnmarshalJSON(b []byte) error

type ListOperationsRequest

type ListOperationsRequest struct {
	// The maximum number of operations to return. The service may return fewer
	// than this value. If unspecified, at most 50 operations will be returned.
	// The maximum value is 1000; values above 1000 will be coerced to 1000.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// A page token, received from a previous `ListOperations` call. Provide
	// this to retrieve the subsequent page.
	PageToken string `json:"-" url:"page_token,omitempty"`
	// The parent version. Format:
	// deployments/{deployment_id}/versions/{version_id}
	Parent string `json:"-" url:"-"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListOperationsRequest) MarshalJSON

func (s ListOperationsRequest) MarshalJSON() ([]byte, error)

func (*ListOperationsRequest) UnmarshalJSON

func (s *ListOperationsRequest) UnmarshalJSON(b []byte) error

type ListOperationsResponse

type ListOperationsResponse struct {
	// A token, which can be sent as `page_token` to retrieve the next page. If
	// this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"next_page_token,omitempty"`
	// The resource operations under the specified version.
	Operations []Operation `json:"operations,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

Response for ListOperations.

func (ListOperationsResponse) MarshalJSON

func (s ListOperationsResponse) MarshalJSON() ([]byte, error)

func (*ListOperationsResponse) UnmarshalJSON

func (s *ListOperationsResponse) UnmarshalJSON(b []byte) error

type ListResourcesRequest

type ListResourcesRequest struct {
	// The maximum number of resources to return. The service may return fewer
	// than this value. If unspecified, at most 50 resources will be returned.
	// The maximum value is 1000; values above 1000 will be coerced to 1000.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// A page token, received from a previous `ListResources` call. Provide this
	// to retrieve the subsequent page.
	PageToken string `json:"-" url:"page_token,omitempty"`
	// The parent deployment. Format: deployments/{deployment_id}
	Parent string `json:"-" url:"-"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListResourcesRequest) MarshalJSON

func (s ListResourcesRequest) MarshalJSON() ([]byte, error)

func (*ListResourcesRequest) UnmarshalJSON

func (s *ListResourcesRequest) UnmarshalJSON(b []byte) error

type ListResourcesResponse

type ListResourcesResponse struct {
	// A token, which can be sent as `page_token` to retrieve the next page. If
	// this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"next_page_token,omitempty"`
	// The resources under the specified deployment.
	Resources []Resource `json:"resources,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

Response for ListResources.

func (ListResourcesResponse) MarshalJSON

func (s ListResourcesResponse) MarshalJSON() ([]byte, error)

func (*ListResourcesResponse) UnmarshalJSON

func (s *ListResourcesResponse) UnmarshalJSON(b []byte) error

type ListVersionsRequest

type ListVersionsRequest struct {
	// The maximum number of versions to return. The service may return fewer
	// than this value. If unspecified, at most 50 versions will be returned.
	// The maximum value is 1000; values above 1000 will be coerced to 1000.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// A page token, received from a previous `ListVersions` call. Provide this
	// to retrieve the subsequent page.
	PageToken string `json:"-" url:"page_token,omitempty"`
	// The parent deployment. Format: deployments/{deployment_id}
	Parent string `json:"-" url:"-"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListVersionsRequest) MarshalJSON

func (s ListVersionsRequest) MarshalJSON() ([]byte, error)

func (*ListVersionsRequest) UnmarshalJSON

func (s *ListVersionsRequest) UnmarshalJSON(b []byte) error

type ListVersionsResponse

type ListVersionsResponse struct {
	// A token, which can be sent as `page_token` to retrieve the next page. If
	// this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"next_page_token,omitempty"`
	// The versions under the specified deployment.
	Versions []Version `json:"versions,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

Response for ListVersions.

func (ListVersionsResponse) MarshalJSON

func (s ListVersionsResponse) MarshalJSON() ([]byte, error)

func (*ListVersionsResponse) UnmarshalJSON

func (s *ListVersionsResponse) UnmarshalJSON(b []byte) error

type Operation

type Operation struct {
	// The type of operation performed on this resource.
	ActionType OperationActionType `json:"action_type,omitempty"`
	// When the operation was recorded.
	CreateTime *time.Time `json:"create_time,omitempty"`
	// Error message if the operation failed. Set when status is
	// OPERATION_STATUS_FAILED. Captures the error encountered while applying
	// the resource to the workspace.
	ErrorMessage string `json:"error_message,omitempty"`
	// Resource name of the operation. Format:
	// deployments/{deployment_id}/versions/{version_id}/operations/{resource_key}
	Name string `json:"name,omitempty"`
	// ID reference for the actual resource in the workspace (e.g. the job ID,
	// pipeline ID). Should be unset for delete operations.
	ResourceId string `json:"resource_id,omitempty"`
	// Resource identifier within the bundle (e.g. "jobs.foo", "pipelines.bar",
	// "jobs.foo.permissions", "files.<rel-path>"). Can be an arbitrary UTF-8
	// encoded string key. This key links the operation to the corresponding
	// deployment-level Resource.
	ResourceKey string `json:"resource_key,omitempty"`
	// Serialized local config state after the operation. Should be unset for
	// delete operations.
	State *json.RawMessage `json:"state,omitempty"`
	// Whether the operation succeeded or failed.
	Status OperationStatus `json:"status"`

	ForceSendFields []string `json:"-" url:"-"`
}

An operation on a single resource performed during a version. Operations are append-only and record the result of applying a resource change to the workspace.

func (Operation) MarshalJSON

func (s Operation) MarshalJSON() ([]byte, error)

func (*Operation) UnmarshalJSON

func (s *Operation) UnmarshalJSON(b []byte) error

type OperationActionType

type OperationActionType string

Type of action performed on a resource during a deployment.

const OperationActionTypeOperationActionTypeBind OperationActionType = `OPERATION_ACTION_TYPE_BIND`
const OperationActionTypeOperationActionTypeBindAndUpdate OperationActionType = `OPERATION_ACTION_TYPE_BIND_AND_UPDATE`
const OperationActionTypeOperationActionTypeCreate OperationActionType = `OPERATION_ACTION_TYPE_CREATE`
const OperationActionTypeOperationActionTypeDelete OperationActionType = `OPERATION_ACTION_TYPE_DELETE`
const OperationActionTypeOperationActionTypeInitialRegister OperationActionType = `OPERATION_ACTION_TYPE_INITIAL_REGISTER`
const OperationActionTypeOperationActionTypeRecreate OperationActionType = `OPERATION_ACTION_TYPE_RECREATE`
const OperationActionTypeOperationActionTypeResize OperationActionType = `OPERATION_ACTION_TYPE_RESIZE`
const OperationActionTypeOperationActionTypeUpdate OperationActionType = `OPERATION_ACTION_TYPE_UPDATE`
const OperationActionTypeOperationActionTypeUpdateWithId OperationActionType = `OPERATION_ACTION_TYPE_UPDATE_WITH_ID`

func (*OperationActionType) Set

func (f *OperationActionType) Set(v string) error

Set raw string value and validate it against allowed values

func (*OperationActionType) String

func (f *OperationActionType) String() string

String representation for fmt.Print

func (*OperationActionType) Type

func (f *OperationActionType) Type() string

Type always returns OperationActionType to satisfy [pflag.Value] interface

func (*OperationActionType) Values

Values returns all possible values for OperationActionType.

There is no guarantee on the order of the values in the slice.

type OperationStatus

type OperationStatus string

Status of a resource operation.

const OperationStatusOperationStatusFailed OperationStatus = `OPERATION_STATUS_FAILED`
const OperationStatusOperationStatusSucceeded OperationStatus = `OPERATION_STATUS_SUCCEEDED`

func (*OperationStatus) Set

func (f *OperationStatus) Set(v string) error

Set raw string value and validate it against allowed values

func (*OperationStatus) String

func (f *OperationStatus) String() string

String representation for fmt.Print

func (*OperationStatus) Type

func (f *OperationStatus) Type() string

Type always returns OperationStatus to satisfy [pflag.Value] interface

func (*OperationStatus) Values

func (f *OperationStatus) Values() []OperationStatus

Values returns all possible values for OperationStatus.

There is no guarantee on the order of the values in the slice.

type Resource

type Resource struct {
	// The action performed on this resource during the last version.
	LastActionType OperationActionType `json:"last_action_type,omitempty"`
	// The version_id of the last version where this resource was updated.
	LastVersionId string `json:"last_version_id,omitempty"`
	// Resource name. Format:
	// deployments/{deployment_id}/resources/{resource_key}
	Name string `json:"name,omitempty"`
	// ID that references the actual resource in the workspace (e.g. the job ID,
	// pipeline ID).
	ResourceId string `json:"resource_id,omitempty"`
	// Resource identifier within the bundle (e.g. "jobs.foo", "pipelines.bar",
	// "jobs.foo.permissions").
	ResourceKey string `json:"resource_key,omitempty"`
	// The type of the deployment resource.
	ResourceType DeploymentResourceType `json:"resource_type"`
	// Serialized local config state (what the CLI deployed).
	State *json.RawMessage `json:"state,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

A resource managed by a deployment. Resources are implicitly created, updated, or deleted when operations are recorded on a version.

func (Resource) MarshalJSON

func (s Resource) MarshalJSON() ([]byte, error)

func (*Resource) UnmarshalJSON

func (s *Resource) UnmarshalJSON(b []byte) error

type Version

type Version struct {
	// CLI version used to initiate the version.
	CliVersion string `json:"cli_version,omitempty"`
	// When the version completed. Unset while the version is in progress.
	CompleteTime *time.Time `json:"complete_time,omitempty"`
	// The user who completed the version (email or principal name). May differ
	// from `created_by` when another user force-completes the version.
	CompletedBy string `json:"completed_by,omitempty"`
	// Why the version was completed. Unset while in progress. Set when status
	// transitions to COMPLETED.
	CompletionReason VersionComplete `json:"completion_reason,omitempty"`
	// When the version was created.
	CreateTime *time.Time `json:"create_time,omitempty"`
	// The user who created the version (email or principal name).
	CreatedBy string `json:"created_by,omitempty"`
	// Display name for the deployment, captured at the time of this version.
	DisplayName string `json:"display_name,omitempty"`
	// Resource name of the version. Format:
	// deployments/{deployment_id}/versions/{version_id}
	Name string `json:"name,omitempty"`
	// Status of the version: IN_PROGRESS or COMPLETED.
	Status VersionStatus `json:"status,omitempty"`
	// Target name of the deployment, captured at the time of this version.
	TargetName string `json:"target_name,omitempty"`
	// Monotonically increasing version identifier within the parent deployment.
	// Assigned by the client on creation.
	VersionId string `json:"version_id,omitempty"`
	// Type of version (deploy or destroy).
	VersionType VersionType `json:"version_type"`

	ForceSendFields []string `json:"-" url:"-"`
}

A single invocation of a deploy or destroy command against a deployment. Creating a version acquires an exclusive lock on the parent deployment.

func (Version) MarshalJSON

func (s Version) MarshalJSON() ([]byte, error)

func (*Version) UnmarshalJSON

func (s *Version) UnmarshalJSON(b []byte) error

type VersionComplete

type VersionComplete string

Reason why a version was completed.

const VersionCompleteVersionCompleteFailure VersionComplete = `VERSION_COMPLETE_FAILURE`
const VersionCompleteVersionCompleteForceAbort VersionComplete = `VERSION_COMPLETE_FORCE_ABORT`
const VersionCompleteVersionCompleteLeaseExpired VersionComplete = `VERSION_COMPLETE_LEASE_EXPIRED`
const VersionCompleteVersionCompleteSuccess VersionComplete = `VERSION_COMPLETE_SUCCESS`

func (*VersionComplete) Set

func (f *VersionComplete) Set(v string) error

Set raw string value and validate it against allowed values

func (*VersionComplete) String

func (f *VersionComplete) String() string

String representation for fmt.Print

func (*VersionComplete) Type

func (f *VersionComplete) Type() string

Type always returns VersionComplete to satisfy [pflag.Value] interface

func (*VersionComplete) Values

func (f *VersionComplete) Values() []VersionComplete

Values returns all possible values for VersionComplete.

There is no guarantee on the order of the values in the slice.

type VersionStatus

type VersionStatus string

Status of a version.

const VersionStatusVersionStatusCompleted VersionStatus = `VERSION_STATUS_COMPLETED`
const VersionStatusVersionStatusInProgress VersionStatus = `VERSION_STATUS_IN_PROGRESS`

func (*VersionStatus) Set

func (f *VersionStatus) Set(v string) error

Set raw string value and validate it against allowed values

func (*VersionStatus) String

func (f *VersionStatus) String() string

String representation for fmt.Print

func (*VersionStatus) Type

func (f *VersionStatus) Type() string

Type always returns VersionStatus to satisfy [pflag.Value] interface

func (*VersionStatus) Values

func (f *VersionStatus) Values() []VersionStatus

Values returns all possible values for VersionStatus.

There is no guarantee on the order of the values in the slice.

type VersionType

type VersionType string

Type of version.

const VersionTypeVersionTypeDeploy VersionType = `VERSION_TYPE_DEPLOY`
const VersionTypeVersionTypeDestroy VersionType = `VERSION_TYPE_DESTROY`

func (*VersionType) Set

func (f *VersionType) Set(v string) error

Set raw string value and validate it against allowed values

func (*VersionType) String

func (f *VersionType) String() string

String representation for fmt.Print

func (*VersionType) Type

func (f *VersionType) Type() string

Type always returns VersionType to satisfy [pflag.Value] interface

func (*VersionType) Values

func (f *VersionType) Values() []VersionType

Values returns all possible values for VersionType.

There is no guarantee on the order of the values in the slice.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL