workspaces

package
v0.0.1-dev.7 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureWorkspaceInfo

type AzureWorkspaceInfo struct {
	// Azure Resource Group name
	ResourceGroup *string `fieldmask:"resource_group"`
	// Azure Subscription ID
	SubscriptionId *string `fieldmask:"subscription_id"`
}

type Client

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

func NewClient

func NewClient(ctx context.Context, opts ...client.Option) (*Client, error)

func (*Client) CreateWorkspacePublic

func (c *Client) CreateWorkspacePublic(ctx context.Context, req CreateWorkspaceRequest, opts ...call.Option) (*CreateWorkspacePublicWaiter, error)

Creates a new workspace using a credential configuration and a storage configuration, an optional network configuration (if using a customer-managed VPC), an optional managed services key configuration (if using customer-managed keys for managed services), and an optional storage key configuration (if using customer-managed keys for storage). The key configurations used for managed services and storage encryption can be the same or different.

Important: This operation is asynchronous. A response with HTTP status code 200 means the request has been accepted and is in progress, but does not mean that the workspace deployed successfully and is running. The initial workspace status is typically PROVISIONING. Use the workspace ID (workspace_id) field in the response to identify the new workspace and make repeated GET requests with the workspace ID and check its status. The workspace becomes available when the status changes to RUNNING.

You can share one customer-managed VPC with multiple workspaces in a single account. It is not required to create a new VPC for each workspace. However, you cannot reuse subnets or Security Groups between workspaces. If you plan to share one VPC with multiple workspaces, make sure you size your VPC and subnets accordingly. Because a Databricks Account API network configuration encapsulates this information, you cannot reuse a Databricks Account API network configuration across workspaces.

For information about how to create a new workspace with this API including error handling, see Create a new workspace using the Account API.

Important: Customer-managed VPCs, PrivateLink, and customer-managed keys are supported on a limited set of deployment and subscription types. If you have questions about availability, contact your <Databricks> representative.

This operation is available only if your account is on the E2 version of the platform or on a select custom plan that allows multiple workspaces per account.

func (*Client) DeleteWorkspacePublic

func (c *Client) DeleteWorkspacePublic(ctx context.Context, req DeleteWorkspaceRequest, opts ...call.Option) (*Workspace, error)

Deletes a <Databricks> workspace, both specified by ID. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) GetWorkspacePublic

func (c *Client) GetWorkspacePublic(ctx context.Context, req GetWorkspaceRequest, opts ...call.Option) (*Workspace, error)

Gets information including status for a <Databricks> workspace, specified by ID. In the response, the `workspace_status` field indicates the current status. After initial workspace creation (which is asynchronous), make repeated `GET` requests with the workspace ID and check its status. The workspace becomes available when the status changes to `RUNNING`. For information about how to create a new workspace with this API **including error handling**, see [Create a new workspace using the Account API].

[Create a new workspace using the Account API]: http://docs.databricks.com/administration-guide/account-api/new-workspace.html Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) ListWorkspacesPublic

func (c *Client) ListWorkspacesPublic(ctx context.Context, req ListWorkspacesRequest, opts ...call.Option) (*ListWorkspacesResponse, error)

Lists <Databricks> workspaces for an account. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) UpdateWorkspacePublic

func (c *Client) UpdateWorkspacePublic(ctx context.Context, req UpdateWorkspaceRequest, opts ...call.Option) (*UpdateWorkspacePublicWaiter, error)

Updates a workspace.

type CloudResourceContainer

type CloudResourceContainer struct {
	CloudResourceContainer isCloudResourceContainer_CloudResourceContainer
	// contains filtered or unexported fields
}

type CloudResourceContainer_CloudResourceContainer_Gcp

type CloudResourceContainer_CloudResourceContainer_Gcp struct {
	Gcp GcpCloudResourceContainer `fieldmask:"gcp"`
}

CloudResourceContainer_CloudResourceContainer_Gcp selects Gcp for CloudResourceContainer.CloudResourceContainer.

type ComputeMode

type ComputeMode string

Corresponds to compute mode defined here: https://src.dev.databricks.com/databricks/universe@9076536b18479afd639d1c1f9dd5a59f72215e69/-/blob/central/api/common.proto?L872

const (
	ComputeMode_Unspecified ComputeMode = ""
	// Classic + Serverless
	ComputeMode_Hybrid ComputeMode = "HYBRID"
	// Serverless-only.
	ComputeMode_Serverless ComputeMode = "SERVERLESS"
)

type CreateWorkspacePublicWaiter

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

CreateWorkspacePublicWaiter tracks the state of the operation started by CreateWorkspacePublic.

func (*CreateWorkspacePublicWaiter) Done

func (w *CreateWorkspacePublicWaiter) Done(ctx context.Context, opts ...call.Option) (bool, error)

Done polls once and reports whether the operation has reached a terminal state.

func (*CreateWorkspacePublicWaiter) GetWorkspaceId

func (w *CreateWorkspacePublicWaiter) GetWorkspaceId() int64

GetWorkspaceId returns the WorkspaceId value used to identify the operation.

func (*CreateWorkspacePublicWaiter) Wait

Wait polls until the operation reaches a terminal state.

type CreateWorkspaceRequest

type CreateWorkspaceRequest struct {
	AccountId *string
	// The human-readable name of the workspace.
	WorkspaceName *string
	// The deployment name defines part of the subdomain for the workspace. The
	// workspace URL for the web application and REST APIs is
	// <workspace-deployment-name>.cloud.databricks.com. For example, if the
	// deployment name is abcsales, your workspace URL will be
	// https://abcsales.cloud.databricks.com. Hyphens are allowed. This property
	// supports only the set of characters that are allowed in a subdomain. To set
	// this value, you must have a deployment name prefix. Contact your <Databricks>
	// account team to add an account deployment name prefix to your account.
	// Workspace deployment names follow the account prefix and a hyphen. For
	// example, if your account's deployment prefix is acme and the workspace
	// deployment name is workspace-1, the JSON response for the deployment_name
	// field becomes acme-workspace-1. The workspace URL would be
	// acme-workspace-1.cloud.databricks.com. You can also set the deployment_name
	// to the reserved keyword EMPTY if you want the deployment name to only include
	// the deployment prefix. For example, if your account's deployment prefix is
	// acme and the workspace deployment name is EMPTY, the deployment_name becomes
	// acme only and the workspace URL is acme.cloud.databricks.com. This value must
	// be unique across all non-deleted deployments across all AWS regions. If a new
	// workspace omits this property, the server generates a unique deployment name
	// for you with the pattern dbc-xxxxxxxx-xxxx.
	DeploymentName *string
	AwsRegion      *string
	// The Google Cloud region of the workspace data plane in your Google account
	// (for example, `us-east4`).
	Location *string
	// DEPRECATED: This field is being ignored by the server and will be removed in
	// the future. The cloud name. This field always has the value `gcp`.
	Cloud                  *string
	PricingTier            PricingTier
	CloudResourceContainer *CloudResourceContainer
	// ID of the workspace's credential configuration object.
	CredentialsId *string
	// ID of the workspace's storage configuration object.
	StorageConfigurationId *string
	// The ID of the workspace's network configuration object. To use AWS
	// PrivateLink, this field is required.
	NetworkId               *string
	GcpManagedNetworkConfig *GcpManagedNetworkConfig
	GkeConfig               *GkeConfig
	// ID of the workspace's private access settings object. Only used for
	// PrivateLink. You must specify this ID if you are using [AWS PrivateLink] for
	// either front-end (user-to-workspace connection), back-end (data plane to
	// control plane connection), or both connection types. Before configuring
	// PrivateLink, read the [<Databricks> article about PrivateLink].",
	//
	// [<Databricks> article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html
	// [AWS PrivateLink]: https://aws.amazon.com/privatelink/
	PrivateAccessSettingsId *string
	// The ID of the workspace's managed services encryption key configuration
	// object. This is used to help protect and control access to the workspace's
	// notebooks, secrets, Databricks SQL queries, and query history. The provided
	// key configuration object property use_cases must contain MANAGED_SERVICES.
	ManagedServicesCustomerManagedKeyId *string
	// The ID of the workspace's storage encryption key configuration object. This
	// is used to encrypt the workspace's root S3 bucket (root DBFS and system data)
	// and, optionally, cluster EBS volumes. The provided key configuration object
	// property use_cases must contain STORAGE.
	StorageCustomerManagedKeyId *string
	// The custom tags key-value pairing that is attached to this workspace. The
	// key-value pair is a string of utf-8 characters. The value can be an empty
	// string, with maximum length of 255 characters. The key can be of maximum
	// length of 127 characters, and cannot be empty.
	CustomTags map[string]string
	// If the compute mode is `SERVERLESS`, a serverless workspace is created that
	// comes pre-configured with serverless compute and default storage, providing a
	// fully-managed, enterprise-ready SaaS experience. This means you don't need to
	// provide any resources managed by you, such as credentials, storage, or
	// network. If the compute mode is `HYBRID` (which is the default option), a
	// classic workspace is created that uses customer-managed resources.
	ComputeMode ComputeMode
	// The object ID of network connectivity config. Once assigned, the workspace
	// serverless compute resources use the same set of stable IP CIDR blocks and
	// optional private link to access your resources.
	NetworkConnectivityConfigId *string
}

type DeleteWorkspaceRequest

type DeleteWorkspaceRequest struct {
	WorkspaceId *int64
	AccountId   *string
}

type GcpCloudResourceContainer

type GcpCloudResourceContainer struct {
	ProjectId *string `fieldmask:"project_id"`
}

type GcpCommonNetworkConfig

type GcpCommonNetworkConfig struct {
	// The type of network connectivity of the GKE cluster.
	GkeConnectivityType GkeConnectivityType `fieldmask:"gke_connectivity_type"`
	// The IP range that will be used to allocate GKE cluster master resources from.
	// This field must not be set if gke_cluster_type=PUBLIC_NODE_PUBLIC_MASTER.
	GkeClusterMasterIpRange *string `fieldmask:"gke_cluster_master_ip_range"`
}

The shared network config for GCP workspace. This object has common network configurations that are network attributions of a workspace. DEPRECATED. Use GkeConfig instead..

type GcpManagedNetworkConfig

type GcpManagedNetworkConfig struct {
	// The IP range which will be used to allocate GKE cluster nodes from. Note:
	// Pods, services and master IP range must be mutually exclusive.
	SubnetCidr *string `fieldmask:"subnet_cidr"`
	// The IP range that will be used to allocate GKE cluster Pods from.
	GkeClusterPodIpRange *string `fieldmask:"gke_cluster_pod_ip_range"`
	// The IP range that will be used to allocate GKE cluster Services from.
	GkeClusterServiceIpRange *string `fieldmask:"gke_cluster_service_ip_range"`
}

The network configuration for the workspace..

type GetWorkspaceRequest

type GetWorkspaceRequest struct {
	WorkspaceId *int64
	AccountId   *string
}

type GkeConfig

type GkeConfig struct {
	// The type of network connectivity of the GKE cluster.
	ConnectivityType GkeConnectivityType `fieldmask:"connectivity_type"`
	// The IP range that will be used to allocate GKE cluster master resources from.
	// This field must not be set if gke_cluster_type=PUBLIC_NODE_PUBLIC_MASTER.
	MasterIpRange *string `fieldmask:"master_ip_range"`
}

The configurations of the GKE cluster used by the GCP workspace..

type GkeConnectivityType

type GkeConnectivityType string

Specifies the network connectivity types for the GKE nodes and the GKE master network.

Set to `PRIVATE_NODE_PUBLIC_MASTER` for a private GKE cluster for the workspace. The GKE nodes will not have public IPs.

Set to `PUBLIC_NODE_PUBLIC_MASTER` for a public GKE cluster. The nodes of a public GKE cluster have public IP addresses.

const (
	GkeConnectivityType_Unspecified GkeConnectivityType = ""
	// The nodes of the GKE cluster will have private IP only. GKE master will still
	// have a public IP.
	GkeConnectivityType_PrivateNodePublicMaster GkeConnectivityType = "PRIVATE_NODE_PUBLIC_MASTER"
	// The GKE cluster will have public IPs for both its nodes and GKE master.
	GkeConnectivityType_PublicNodePublicMaster GkeConnectivityType = "PUBLIC_NODE_PUBLIC_MASTER"
)

type ListWorkspacesRequest

type ListWorkspacesRequest struct {
	AccountId *string
}

type ListWorkspacesResponse

type ListWorkspacesResponse struct {
	Workspaces []Workspace
}

type PricingTier

type PricingTier string
const (
	PricingTier_Unspecified PricingTier = ""
	// Tier for CE workspaces
	PricingTier_CommunityEdition PricingTier = "COMMUNITY_EDITION"
	// Standard pricing tier that maps to STANDARD_TIER feature tier
	PricingTier_Standard PricingTier = "STANDARD"
	// Premium pricing tier that maps to STANDARD_W_SEC_TIER feature tier
	PricingTier_Premium PricingTier = "PREMIUM"
	// Enterprise pricing tier that maps to ENTERPRISE_TIER_V2 feature tier
	PricingTier_Enterprise PricingTier = "ENTERPRISE"
	// Dedicated pricing tier that maps to the DEDICATED feature tier
	PricingTier_Dedicated PricingTier = "DEDICATED"
)

type StorageMode

type StorageMode string
const (
	StorageMode_Unspecified StorageMode = ""
	// The storage resources of the workspace are hosted by customers.
	StorageMode_CustomerHosted StorageMode = "CUSTOMER_HOSTED"
	// The storage resources of the workspace are hosted by Databricks.
	StorageMode_DefaultStorage StorageMode = "DEFAULT_STORAGE"
)

type UpdateWorkspacePublicWaiter

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

UpdateWorkspacePublicWaiter tracks the state of the operation started by UpdateWorkspacePublic.

func (*UpdateWorkspacePublicWaiter) Done

func (w *UpdateWorkspacePublicWaiter) Done(ctx context.Context, opts ...call.Option) (bool, error)

Done polls once and reports whether the operation has reached a terminal state.

func (*UpdateWorkspacePublicWaiter) GetWorkspaceId

func (w *UpdateWorkspacePublicWaiter) GetWorkspaceId() int64

GetWorkspaceId returns the WorkspaceId value used to identify the operation.

func (*UpdateWorkspacePublicWaiter) Wait

Wait polls until the operation reaches a terminal state.

type UpdateWorkspaceRequest

type UpdateWorkspaceRequest struct {
	CustomerFacingWorkspace *Workspace
	UpdateMask              *types.FieldMask[Workspace]
}

type Workspace

type Workspace struct {
	// A unique integer ID for the workspace
	WorkspaceId *int64 `fieldmask:"workspace_id"`
	// The human-readable name of the workspace.
	WorkspaceName *string `fieldmask:"workspace_name"`
	AwsRegion     *string `fieldmask:"aws_region"`
	// Time in epoch milliseconds when the workspace was created.
	CreationTime   *int64  `fieldmask:"creation_time"`
	DeploymentName *string `fieldmask:"deployment_name"`
	// The status of a workspace
	WorkspaceStatus WorkspaceStatus `fieldmask:"workspace_status"`
	// <Databricks> account ID.
	AccountId *string `fieldmask:"account_id"`
	// ID of the workspace's credential configuration object.
	CredentialsId *string `fieldmask:"credentials_id"`
	// ID of the workspace's storage configuration object.
	StorageConfigurationId *string `fieldmask:"storage_configuration_id"`
	// Message describing the current workspace status.
	WorkspaceStatusMessage *string `fieldmask:"workspace_status_message"`
	NetworkConfig          isWorkspace_NetworkConfig
	PricingTier            PricingTier `fieldmask:"pricing_tier"`
	// ID of the workspace's private access settings object. Only used for
	// PrivateLink. You must specify this ID if you are using [AWS PrivateLink] for
	// either front-end (user-to-workspace connection), back-end (data plane to
	// control plane connection), or both connection types.
	//
	// Before configuring PrivateLink, read the [<Databricks> article about
	// PrivateLink].",
	//
	// [<Databricks> article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html
	// [AWS PrivateLink]: https://aws.amazon.com/privatelink/
	PrivateAccessSettingsId *string `fieldmask:"private_access_settings_id"`
	// ID of the key configuration for encrypting managed services.
	ManagedServicesCustomerManagedKeyId *string `fieldmask:"managed_services_customer_managed_key_id"`
	// ID of the key configuration for encrypting workspace storage.
	StorageCustomerManagedKeyId *string `fieldmask:"storage_customer_managed_key_id"`
	// The Google Cloud region of the workspace data plane in your Google account
	// (for example, `us-east4`).
	Location *string `fieldmask:"location"`
	// The cloud name. This field can have values like `azure`, `gcp`.
	Cloud *string `fieldmask:"cloud"`
	// The network configuration for the workspace. DEPRECATED. Use `network_id`
	// instead.
	Network                *WorkspaceNetwork       `fieldmask:"network"`
	AzureWorkspaceInfo     *AzureWorkspaceInfo     `fieldmask:"azure_workspace_info"`
	GkeConfig              *GkeConfig              `fieldmask:"gke_config"`
	CloudResourceContainer *CloudResourceContainer `fieldmask:"cloud_resource_container"`
	// The custom tags key-value pairing that is attached to this workspace. The
	// key-value pair is a string of utf-8 characters. The value can be an empty
	// string, with maximum length of 255 characters. The key can be of maximum
	// length of 127 characters, and cannot be empty.
	CustomTags map[string]string `fieldmask:"custom_tags"`
	// The object ID of network connectivity config.
	NetworkConnectivityConfigId *string `fieldmask:"network_connectivity_config_id"`
	// The storage mode of the workspace.
	StorageMode StorageMode `fieldmask:"storage_mode"`
	// The compute mode of the workspace.
	ComputeMode ComputeMode `fieldmask:"compute_mode"`
	// A client owned field used to indicate the workspace status that the client
	// expects to be in. For now this is only used to unblock Temporal workflow for
	// GCP least privileged workspace.
	ExpectedWorkspaceStatus WorkspaceStatus `fieldmask:"expected_workspace_status"`
	// contains filtered or unexported fields
}

type WorkspaceNetwork

type WorkspaceNetwork struct {
	Network isWorkspaceNetwork_Network
	// The shared network config for GCP workspace. This object has common network
	// configurations that are network attributions of a workspace. This object is
	// input-only.
	GcpCommonNetworkConfig *GcpCommonNetworkConfig `fieldmask:"gcp_common_network_config"`
	// contains filtered or unexported fields
}

The network configuration for workspaces..

type WorkspaceNetwork_Network_GcpManagedNetworkConfig

type WorkspaceNetwork_Network_GcpManagedNetworkConfig struct {
	GcpManagedNetworkConfig GcpManagedNetworkConfig `fieldmask:"gcp_managed_network_config"`
}

WorkspaceNetwork_Network_GcpManagedNetworkConfig selects GcpManagedNetworkConfig for WorkspaceNetwork.Network. The mutually exclusive network deployment modes. The option decides which network mode the workspace will use. The network config for GCP workspace with <Databricks> managed network. This object is input-only and will not be provided when listing workspaces.

type WorkspaceNetwork_Network_NetworkId

type WorkspaceNetwork_Network_NetworkId struct {
	NetworkId string `fieldmask:"network_id"`
}

WorkspaceNetwork_Network_NetworkId selects NetworkId for WorkspaceNetwork.Network. The ID of the network object, if the workspace is a BYOVPC workspace. This should apply to workspaces on all clouds in internal services. In accounts-rest-api, user will use workspace.network_id for input and output instead. Currently (2021-06-19) the network ID is only used by GCP.

type WorkspaceStatus

type WorkspaceStatus string

The different statuses of a workspace. The following represents the current set of valid transitions from status to status: NOT_PROVISIONED -> PROVISIONING -> CANCELLED PROVISIONING -> RUNNING -> FAILED -> CANCELLED (note that this transition is disallowed in the MultiWorkspace Project) RUNNING -> PROVISIONING -> BANNED -> CANCELLED FAILED -> PROVISIONING -> CANCELLED BANNED -> RUNNING -> CANCELLED Note that a transition from any state to itself is also valid.

const (
	WorkspaceStatus_Unspecified WorkspaceStatus = ""
	// Status for workspaces being provisioned.
	WorkspaceStatus_Provisioning WorkspaceStatus = "PROVISIONING"
	// Status for running workspaces.
	WorkspaceStatus_Running WorkspaceStatus = "RUNNING"
	// Status for workspaces that have failed to be provisioned. This is currently
	// an AWS-only state since an Azure customer can easily retry to launch a
	// workspace that failed to launch, whereas this process is different in AWS.
	WorkspaceStatus_Failed WorkspaceStatus = "FAILED"
	// Status for banned workspaces. This is intended for use with CE workspaces,
	// although there is no code to enforce this restriction. These workspaces can
	// be unbanned at a later time.
	WorkspaceStatus_Banned WorkspaceStatus = "BANNED"
	// Status for cancelling workspaces. This state always comes before the
	// CANCELLED status.
	WorkspaceStatus_Cancelling WorkspaceStatus = "CANCELLING"
)

type Workspace_NetworkConfig_GcpManagedNetworkConfig

type Workspace_NetworkConfig_GcpManagedNetworkConfig struct {
	GcpManagedNetworkConfig GcpManagedNetworkConfig `fieldmask:"gcp_managed_network_config"`
}

Workspace_NetworkConfig_GcpManagedNetworkConfig selects GcpManagedNetworkConfig for Workspace.NetworkConfig.

type Workspace_NetworkConfig_NetworkId

type Workspace_NetworkConfig_NetworkId struct {
	NetworkId string `fieldmask:"network_id"`
}

Workspace_NetworkConfig_NetworkId selects NetworkId for Workspace.NetworkConfig. If this workspace is BYO VPC, then the network_id will be populated. If this workspace is not BYO VPC, then the network_id will be empty.

Jump to

Keyboard shortcuts

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