Documentation
¶
Overview ¶
These APIs allow you to manage Clusters, Instance Profiles, etc.
Index ¶
- type AddInstanceProfile
- type AutoScale
- type AwsAttributes
- type AwsAvailability
- type AzureAttributes
- type AzureAvailability
- type BaseClusterInfo
- type ChangeClusterOwner
- type ClientsTypes
- type CloudProviderNodeInfo
- type CloudProviderNodeStatus
- type ClusterAttributes
- type ClusterEvent
- type ClusterInfo
- type ClusterLogConf
- type ClusterSize
- type ClusterSource
- type ClustersAPI
- func (a *ClustersAPI) ChangeOwner(ctx context.Context, request ChangeClusterOwner) error
- func (a *ClustersAPI) ClusterInfoClusterNameToClusterIdMap(ctx context.Context, request List) (map[string]string, error)
- func (a *ClustersAPI) Create(ctx context.Context, request CreateCluster) (*CreateClusterResponse, error)
- func (a *ClustersAPI) CreateAndWait(ctx context.Context, createCluster CreateCluster, ...) (*ClusterInfo, error)
- func (a *ClustersAPI) Delete(ctx context.Context, request DeleteCluster) error
- func (a *ClustersAPI) DeleteAndWait(ctx context.Context, deleteCluster DeleteCluster, ...) (*ClusterInfo, error)
- func (a *ClustersAPI) DeleteByClusterId(ctx context.Context, clusterId string) error
- func (a *ClustersAPI) DeleteByClusterIdAndWait(ctx context.Context, clusterId string, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
- func (a *ClustersAPI) Edit(ctx context.Context, request EditCluster) error
- func (a *ClustersAPI) EditAndWait(ctx context.Context, editCluster EditCluster, ...) (*ClusterInfo, error)
- func (a *ClustersAPI) EventsAll(ctx context.Context, request GetEvents) ([]ClusterEvent, error)
- func (a *ClustersAPI) Get(ctx context.Context, request Get) (*ClusterInfo, error)
- func (a *ClustersAPI) GetAndWait(ctx context.Context, get Get, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
- func (a *ClustersAPI) GetByClusterId(ctx context.Context, clusterId string) (*ClusterInfo, error)
- func (a *ClustersAPI) GetByClusterIdAndWait(ctx context.Context, clusterId string, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
- func (a *ClustersAPI) GetByClusterName(ctx context.Context, name string) (*ClusterInfo, error)
- func (a *ClustersAPI) GetOrCreateRunningCluster(ctx context.Context, name string, custom ...CreateCluster) (c *ClusterInfo, err error)
- func (a *ClustersAPI) Impl() ClustersService
- func (a *ClustersAPI) ListAll(ctx context.Context, request List) ([]ClusterInfo, error)
- func (a *ClustersAPI) ListByCanUseClient(ctx context.Context, canUseClient string) (*ListClustersResponse, error)
- func (a *ClustersAPI) ListNodeTypes(ctx context.Context) (*ListNodeTypesResponse, error)
- func (a *ClustersAPI) ListZones(ctx context.Context) (*ListAvailableZonesResponse, error)
- func (a *ClustersAPI) PermanentDelete(ctx context.Context, request PermanentDeleteCluster) error
- func (a *ClustersAPI) PermanentDeleteByClusterId(ctx context.Context, clusterId string) error
- func (a *ClustersAPI) Pin(ctx context.Context, request PinCluster) error
- func (a *ClustersAPI) PinByClusterId(ctx context.Context, clusterId string) error
- func (a *ClustersAPI) Resize(ctx context.Context, request ResizeCluster) error
- func (a *ClustersAPI) ResizeAndWait(ctx context.Context, resizeCluster ResizeCluster, ...) (*ClusterInfo, error)
- func (a *ClustersAPI) Restart(ctx context.Context, request RestartCluster) error
- func (a *ClustersAPI) RestartAndWait(ctx context.Context, restartCluster RestartCluster, ...) (*ClusterInfo, error)
- func (a *ClustersAPI) SparkVersions(ctx context.Context) (*GetSparkVersionsResponse, error)
- func (a *ClustersAPI) Start(ctx context.Context, request StartCluster) error
- func (a *ClustersAPI) StartAndWait(ctx context.Context, startCluster StartCluster, ...) (*ClusterInfo, error)
- func (a *ClustersAPI) StartByClusterId(ctx context.Context, clusterId string) error
- func (a *ClustersAPI) StartByClusterIdAndWait(ctx context.Context, clusterId string, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
- func (a *ClustersAPI) Unpin(ctx context.Context, request UnpinCluster) error
- func (a *ClustersAPI) UnpinByClusterId(ctx context.Context, clusterId string) error
- func (a *ClustersAPI) WithImpl(impl ClustersService) *ClustersAPI
- type ClustersService
- type CreateCluster
- type CreateClusterResponse
- type DataPlaneEventDetails
- type DataPlaneEventDetailsEventType
- type DataSecurityMode
- type DbfsStorageInfo
- type DeleteCluster
- type EbsVolumeType
- type EditCluster
- type EventDetails
- type EventDetailsCause
- type EventType
- type GcpAttributes
- type GcpAvailability
- type Get
- type GetEvents
- type GetEventsOrder
- type GetEventsResponse
- type GetSparkVersionsResponse
- type InstanceProfile
- type InstanceProfilesAPI
- func (a *InstanceProfilesAPI) Add(ctx context.Context, request AddInstanceProfile) error
- func (a *InstanceProfilesAPI) Edit(ctx context.Context, request InstanceProfile) error
- func (a *InstanceProfilesAPI) Impl() InstanceProfilesService
- func (a *InstanceProfilesAPI) ListAll(ctx context.Context) ([]InstanceProfile, error)
- func (a *InstanceProfilesAPI) Remove(ctx context.Context, request RemoveInstanceProfile) error
- func (a *InstanceProfilesAPI) RemoveByInstanceProfileArn(ctx context.Context, instanceProfileArn string) error
- func (a *InstanceProfilesAPI) WithImpl(impl InstanceProfilesService) *InstanceProfilesAPI
- type InstanceProfilesService
- type List
- type ListAvailableZonesResponse
- type ListClustersResponse
- type ListInstanceProfilesResponse
- type ListNodeTypesResponse
- type LogAnalyticsInfo
- type LogSyncStatus
- type NodeInstanceType
- type NodeType
- type NodeTypeRequest
- type PermanentDeleteCluster
- type PinCluster
- type RemoveInstanceProfile
- type ResizeCluster
- type RestartCluster
- type RuntimeEngine
- type S3StorageInfo
- type SparkNode
- type SparkNodeAwsAttributes
- type SparkVersion
- type SparkVersionRequest
- type StartCluster
- type State
- type TerminationReason
- type TerminationReasonCode
- type TerminationReasonType
- type UnpinCluster
- type WorkloadType
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddInstanceProfile ¶
type AddInstanceProfile struct { // The AWS IAM role ARN of the role associated with the instance profile. // This field is required if your role name and instance profile name do not // match and you want to use the instance profile with [Databricks SQL // Serverless]. // // Otherwise, this field is optional. // // [Databricks SQL Serverless]: https://docs.databricks.com/sql/admin/serverless.html IamRoleArn string `json:"iam_role_arn,omitempty"` // The AWS ARN of the instance profile to register with Databricks. This // field is required. InstanceProfileArn string `json:"instance_profile_arn"` // By default, Databricks validates that it has sufficient permissions to // launch instances with the instance profile. This validation uses AWS // dry-run mode for the RunInstances API. If validation fails with an error // message that does not indicate an IAM related permission issue, (e.g. // `Your requested instance type is not supported in your requested // availability zone`), you can pass this flag to skip the validation and // forcibly add the instance profile. IsMetaInstanceProfile bool `json:"is_meta_instance_profile,omitempty"` // By default, Databricks validates that it has sufficient permissions to // launch instances with the instance profile. This validation uses AWS // dry-run mode for the RunInstances API. If validation fails with an error // message that does not indicate an IAM related permission issue, (e.g. // “Your requested instance type is not supported in your requested // availability zone”), you can pass this flag to skip the validation and // forcibly add the instance profile. SkipValidation bool `json:"skip_validation,omitempty"` }
type AutoScale ¶
type AutoScale struct { // The maximum number of workers to which the cluster can scale up when // overloaded. Note that `max_workers` must be strictly greater than // `min_workers`. MaxWorkers int `json:"max_workers"` // The minimum number of workers to which the cluster can scale down when // underutilized. It is also the initial number of workers the cluster will // have after creation. MinWorkers int `json:"min_workers"` }
type AwsAttributes ¶
type AwsAttributes struct { // Availability type used for all subsequent nodes past the // `first_on_demand` ones. // // Note: If `first_on_demand` is zero, this availability type will be used // for the entire cluster. Availability AwsAvailability `json:"availability,omitempty"` // The number of volumes launched for each instance. Users can choose up to // 10 volumes. This feature is only enabled for supported node types. Legacy // node types cannot specify custom EBS volumes. For node types with no // instance store, at least one EBS volume needs to be specified; otherwise, // cluster creation will fail. // // These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. Instance // store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc. // // If EBS volumes are attached, Databricks will configure Spark to use only // the EBS volumes for scratch storage because heterogenously sized scratch // devices can lead to inefficient disk utilization. If no EBS volumes are // attached, Databricks will configure Spark to use instance store volumes. // // Please note that if EBS volumes are specified, then the Spark // configuration `spark.local.dir` will be overridden. EbsVolumeCount int `json:"ebs_volume_count,omitempty"` // <needs content added> EbsVolumeIops int `json:"ebs_volume_iops,omitempty"` // The size of each EBS volume (in GiB) launched for each instance. For // general purpose SSD, this value must be within the range 100 - 4096. For // throughput optimized HDD, this value must be within the range 500 - 4096. EbsVolumeSize int `json:"ebs_volume_size,omitempty"` // <needs content added> EbsVolumeThroughput int `json:"ebs_volume_throughput,omitempty"` // The type of EBS volumes that will be launched with this cluster. EbsVolumeType EbsVolumeType `json:"ebs_volume_type,omitempty"` // The first `first_on_demand` nodes of the cluster will be placed on // on-demand instances. If this value is greater than 0, the cluster driver // node in particular will be placed on an on-demand instance. If this value // is greater than or equal to the current cluster size, all nodes will be // placed on on-demand instances. If this value is less than the current // cluster size, `first_on_demand` nodes will be placed on on-demand // instances and the remainder will be placed on `availability` instances. // Note that this value does not affect cluster size and cannot currently be // mutated over the lifetime of a cluster. FirstOnDemand int `json:"first_on_demand,omitempty"` // Nodes for this cluster will only be placed on AWS instances with this // instance profile. If ommitted, nodes will be placed on instances without // an IAM instance profile. The instance profile must have previously been // added to the Databricks environment by an account administrator. // // This feature may only be available to certain customer plans. // // If this field is ommitted, we will pull in the default from the conf if // it exists. InstanceProfileArn string `json:"instance_profile_arn,omitempty"` // The bid price for AWS spot instances, as a percentage of the // corresponding instance type's on-demand price. For example, if this field // is set to 50, and the cluster needs a new `r3.xlarge` spot instance, then // the bid price is half of the price of on-demand `r3.xlarge` instances. // Similarly, if this field is set to 200, the bid price is twice the price // of on-demand `r3.xlarge` instances. If not specified, the default value // is 100. When spot instances are requested for this cluster, only spot // instances whose bid price percentage matches this field will be // considered. Note that, for safety, we enforce this field to be no more // than 10000. // // The default value and documentation here should be kept consistent with // CommonConf.defaultSpotBidPricePercent and // CommonConf.maxSpotBidPricePercent. SpotBidPricePercent int `json:"spot_bid_price_percent,omitempty"` // Identifier for the availability zone/datacenter in which the cluster // resides. This string will be of a form like "us-west-2a". The provided // availability zone must be in the same region as the Databricks // deployment. For example, "us-west-2a" is not a valid zone id if the // Databricks deployment resides in the "us-east-1" region. This is an // optional field at cluster creation, and if not specified, a default zone // will be used. If the zone specified is "auto", will try to place cluster // in a zone with high availability, and will retry placement in a different // AZ if there is not enough capacity. See [[AutoAZHelper.scala]] for more // details. The list of available zones as well as the default value can be // found by using the `List Zones`_ method. ZoneId string `json:"zone_id,omitempty"` }
type AwsAvailability ¶
type AwsAvailability string
Availability type used for all subsequent nodes past the `first_on_demand` ones.
Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.
const AwsAvailabilityOnDemand AwsAvailability = `ON_DEMAND`
const AwsAvailabilitySpot AwsAvailability = `SPOT`
const AwsAvailabilitySpotWithFallback AwsAvailability = `SPOT_WITH_FALLBACK`
func (*AwsAvailability) Set ¶ added in v0.2.0
func (aa *AwsAvailability) Set(v string) error
Set raw string value and validate it against allowed values
func (*AwsAvailability) String ¶ added in v0.2.0
func (aa *AwsAvailability) String() string
String representation for fmt.Print
func (*AwsAvailability) Type ¶ added in v0.2.0
func (aa *AwsAvailability) Type() string
Type always returns AwsAvailability to satisfy [pflag.Value] interface
type AzureAttributes ¶
type AzureAttributes struct { // Availability type used for all subsequent nodes past the // `first_on_demand` ones. Note: If `first_on_demand` is zero (which only // happens on pool clusters), this availability type will be used for the // entire cluster. Availability AzureAvailability `json:"availability,omitempty"` // The first `first_on_demand` nodes of the cluster will be placed on // on-demand instances. This value should be greater than 0, to make sure // the cluster driver node is placed on an on-demand instance. If this value // is greater than or equal to the current cluster size, all nodes will be // placed on on-demand instances. If this value is less than the current // cluster size, `first_on_demand` nodes will be placed on on-demand // instances and the remainder will be placed on `availability` instances. // Note that this value does not affect cluster size and cannot currently be // mutated over the lifetime of a cluster. FirstOnDemand int `json:"first_on_demand,omitempty"` // Defines values necessary to configure and run Azure Log Analytics agent LogAnalyticsInfo *LogAnalyticsInfo `json:"log_analytics_info,omitempty"` // The max bid price to be used for Azure spot instances. The Max price for // the bid cannot be higher than the on-demand price of the instance. If not // specified, the default value is -1, which specifies that the instance // cannot be evicted on the basis of price, and only on the basis of // availability. Further, the value should > 0 or -1. SpotBidMaxPrice float64 `json:"spot_bid_max_price,omitempty"` }
type AzureAvailability ¶
type AzureAvailability string
Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If `first_on_demand` is zero (which only happens on pool clusters), this availability type will be used for the entire cluster.
const AzureAvailabilityOnDemandAzure AzureAvailability = `ON_DEMAND_AZURE`
const AzureAvailabilitySpotAzure AzureAvailability = `SPOT_AZURE`
const AzureAvailabilitySpotWithFallbackAzure AzureAvailability = `SPOT_WITH_FALLBACK_AZURE`
func (*AzureAvailability) Set ¶ added in v0.2.0
func (aa *AzureAvailability) Set(v string) error
Set raw string value and validate it against allowed values
func (*AzureAvailability) String ¶ added in v0.2.0
func (aa *AzureAvailability) String() string
String representation for fmt.Print
func (*AzureAvailability) Type ¶ added in v0.2.0
func (aa *AzureAvailability) Type() string
Type always returns AzureAvailability to satisfy [pflag.Value] interface
type BaseClusterInfo ¶ added in v0.3.0
type BaseClusterInfo struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. Autoscale *AutoScale `json:"autoscale,omitempty"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. ClusterName string `json:"cluster_name,omitempty"` // Determines whether the cluster was created by a user through the UI, // created by the Databricks Jobs Scheduler, or through an API request. This // is the same as cluster_creator, but read only. ClusterSource ClusterSource `json:"cluster_source,omitempty"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags CustomTags map[string]string `json:"custom_tags,omitempty"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` // Whether to enable LUKS on cluster VMs' local disks EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` // The optional ID of the instance pool to which the cluster belongs. InstancePoolId string `json:"instance_pool_id,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. NodeTypeId string `json:"node_type_id,omitempty"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. // // Note: When reading the properties of a cluster, this field reflects the // desired number of workers rather than the actual current number of // workers. For instance, if a cluster is resized from 5 to 10 workers, this // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. NumWorkers int `json:"num_workers,omitempty"` // The ID of the cluster policy used to create the cluster if applicable. PolicyId string `json:"policy_id,omitempty"` // Decides which runtime engine to be use, e.g. Standard vs. Photon. If // unspecified, the runtime engine is inferred from spark_version. RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. SparkConf map[string]string `json:"spark_conf,omitempty"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the // driver and workers. // // In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we // recommend appending them to `$SPARK_DAEMON_JAVA_OPTS` as shown in the // example below. This ensures that all default databricks managed // environmental variables are included as well. // // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. SparkVersion string `json:"spark_version,omitempty"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. SshPublicKeys []string `json:"ssh_public_keys,omitempty"` WorkloadType *WorkloadType `json:"workload_type,omitempty"` }
type ChangeClusterOwner ¶
type ClientsTypes ¶
type CloudProviderNodeInfo ¶
type CloudProviderNodeInfo struct {
Status []CloudProviderNodeStatus `json:"status,omitempty"`
}
type CloudProviderNodeStatus ¶
type CloudProviderNodeStatus string
const CloudProviderNodeStatusNotavailableinregion CloudProviderNodeStatus = `NotAvailableInRegion`
const CloudProviderNodeStatusNotenabledonsubscription CloudProviderNodeStatus = `NotEnabledOnSubscription`
func (*CloudProviderNodeStatus) Set ¶ added in v0.2.0
func (cpns *CloudProviderNodeStatus) Set(v string) error
Set raw string value and validate it against allowed values
func (*CloudProviderNodeStatus) String ¶ added in v0.2.0
func (cpns *CloudProviderNodeStatus) String() string
String representation for fmt.Print
func (*CloudProviderNodeStatus) Type ¶ added in v0.2.0
func (cpns *CloudProviderNodeStatus) Type() string
Type always returns CloudProviderNodeStatus to satisfy [pflag.Value] interface
type ClusterAttributes ¶
type ClusterAttributes struct { // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. ClusterName string `json:"cluster_name,omitempty"` // Determines whether the cluster was created by a user through the UI, // created by the Databricks Jobs Scheduler, or through an API request. This // is the same as cluster_creator, but read only. ClusterSource ClusterSource `json:"cluster_source,omitempty"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags CustomTags map[string]string `json:"custom_tags,omitempty"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` // Whether to enable LUKS on cluster VMs' local disks EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` // The optional ID of the instance pool to which the cluster belongs. InstancePoolId string `json:"instance_pool_id,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. NodeTypeId string `json:"node_type_id,omitempty"` // The ID of the cluster policy used to create the cluster if applicable. PolicyId string `json:"policy_id,omitempty"` // Decides which runtime engine to be use, e.g. Standard vs. Photon. If // unspecified, the runtime engine is inferred from spark_version. RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. SparkConf map[string]string `json:"spark_conf,omitempty"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the // driver and workers. // // In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we // recommend appending them to `$SPARK_DAEMON_JAVA_OPTS` as shown in the // example below. This ensures that all default databricks managed // environmental variables are included as well. // // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. SparkVersion string `json:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. SshPublicKeys []string `json:"ssh_public_keys,omitempty"` WorkloadType *WorkloadType `json:"workload_type,omitempty"` }
type ClusterEvent ¶
type ClusterEvent struct { // <needs content added> ClusterId string `json:"cluster_id"` // <needs content added> DataPlaneEventDetails *DataPlaneEventDetails `json:"data_plane_event_details,omitempty"` // <needs content added> Details *EventDetails `json:"details,omitempty"` // The timestamp when the event occurred, stored as the number of // milliseconds since the Unix epoch. If not provided, this will be assigned // by the Timeline service. Timestamp int64 `json:"timestamp,omitempty"` Type EventType `json:"type,omitempty"` }
type ClusterInfo ¶
type ClusterInfo struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. Autoscale *AutoScale `json:"autoscale,omitempty"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` // Number of CPU cores available for this cluster. Note that this can be // fractional, e.g. 7.5 cores, since certain node types are configured to // share cores between Spark nodes on the same instance. ClusterCores float64 `json:"cluster_cores,omitempty"` // Canonical identifier for the cluster. This id is retained during cluster // restarts and resizes, while each new cluster has a globally unique id. ClusterId string `json:"cluster_id,omitempty"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` // Cluster log delivery status. ClusterLogStatus *LogSyncStatus `json:"cluster_log_status,omitempty"` // Total amount of cluster memory, in megabytes ClusterMemoryMb int64 `json:"cluster_memory_mb,omitempty"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. ClusterName string `json:"cluster_name,omitempty"` // Determines whether the cluster was created by a user through the UI, // created by the Databricks Jobs Scheduler, or through an API request. This // is the same as cluster_creator, but read only. ClusterSource ClusterSource `json:"cluster_source,omitempty"` // Creator user name. The field won't be included in the response if the // user has already been deleted. CreatorUserName string `json:"creator_user_name,omitempty"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags CustomTags map[string]string `json:"custom_tags,omitempty"` // This describes an enum DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` // Tags that are added by Databricks regardless of any `custom_tags`, // including: // // - Vendor: Databricks // // - Creator: <username_of_creator> // // - ClusterName: <name_of_cluster> // // - ClusterId: <id_of_cluster> // // - Name: <Databricks internal use> DefaultTags map[string]string `json:"default_tags,omitempty"` // Node on which the Spark driver resides. The driver node contains the // Spark master and the Databricks application that manages the per-notebook // Spark REPLs. Driver *SparkNode `json:"driver,omitempty"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` // Whether to enable LUKS on cluster VMs' local disks EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` // Nodes on which the Spark executors reside. Executors []SparkNode `json:"executors,omitempty"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` // The optional ID of the instance pool to which the cluster belongs. InstancePoolId string `json:"instance_pool_id,omitempty"` // Port on which Spark JDBC server is listening, in the driver nod. No // service will be listeningon on this port in executor nodes. JdbcPort int `json:"jdbc_port,omitempty"` // the timestamp that the cluster was started/restarted LastRestartedTime int64 `json:"last_restarted_time,omitempty"` // Time when the cluster driver last lost its state (due to a restart or // driver failure). LastStateLossTime int64 `json:"last_state_loss_time,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. NodeTypeId string `json:"node_type_id,omitempty"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. // // Note: When reading the properties of a cluster, this field reflects the // desired number of workers rather than the actual current number of // workers. For instance, if a cluster is resized from 5 to 10 workers, this // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. NumWorkers int `json:"num_workers,omitempty"` // The ID of the cluster policy used to create the cluster if applicable. PolicyId string `json:"policy_id,omitempty"` // Decides which runtime engine to be use, e.g. Standard vs. Photon. If // unspecified, the runtime engine is inferred from spark_version. RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` // Single user name if data_security_mode is `SINGLE_USER` SingleUserName string `json:"single_user_name,omitempty"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. SparkConf map[string]string `json:"spark_conf,omitempty"` // A canonical SparkContext identifier. This value *does* change when the // Spark driver restarts. The pair `(cluster_id, spark_context_id)` is a // globally unique identifier over all Spark contexts. SparkContextId int64 `json:"spark_context_id,omitempty"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the // driver and workers. // // In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we // recommend appending them to `$SPARK_DAEMON_JAVA_OPTS` as shown in the // example below. This ensures that all default databricks managed // environmental variables are included as well. // // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. SparkVersion string `json:"spark_version,omitempty"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. SshPublicKeys []string `json:"ssh_public_keys,omitempty"` // Time (in epoch milliseconds) when the cluster creation request was // received (when the cluster entered a `PENDING` state). StartTime int64 `json:"start_time,omitempty"` // Current state of the cluster. State State `json:"state,omitempty"` // A message associated with the most recent state transition (e.g., the // reason why the cluster entered a `TERMINATED` state). StateMessage string `json:"state_message,omitempty"` // Time (in epoch milliseconds) when the cluster was terminated, if // applicable. TerminatedTime int64 `json:"terminated_time,omitempty"` // Information about why the cluster was terminated. This field only appears // when the cluster is in a `TERMINATING` or `TERMINATED` state. TerminationReason *TerminationReason `json:"termination_reason,omitempty"` WorkloadType *WorkloadType `json:"workload_type,omitempty"` }
func (*ClusterInfo) IsRunningOrResizing ¶
func (ci *ClusterInfo) IsRunningOrResizing() bool
type ClusterLogConf ¶
type ClusterLogConf struct { // destination needs to be provided. e.g. `{ "dbfs" : { "destination" : // "dbfs:/home/cluster_log" } }` Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` // destination and either region or endpoint should also be provided. e.g. // `{ "s3": { "destination" : "s3://cluster_log_bucket/prefix", "region" : // "us-west-2" } }` Cluster iam role is used to access s3, please make sure // the cluster iam role in `instance_profile_arn` has permission to write // data to the s3 destination. S3 *S3StorageInfo `json:"s3,omitempty"` }
type ClusterSize ¶
type ClusterSize struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. Autoscale *AutoScale `json:"autoscale,omitempty"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. // // Note: When reading the properties of a cluster, this field reflects the // desired number of workers rather than the actual current number of // workers. For instance, if a cluster is resized from 5 to 10 workers, this // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. NumWorkers int `json:"num_workers,omitempty"` }
type ClusterSource ¶
type ClusterSource string
Determines whether the cluster was created by a user through the UI, created by the Databricks Jobs Scheduler, or through an API request. This is the same as cluster_creator, but read only.
const ClusterSourceApi ClusterSource = `API`
const ClusterSourceJob ClusterSource = `JOB`
const ClusterSourceModels ClusterSource = `MODELS`
const ClusterSourcePipeline ClusterSource = `PIPELINE`
const ClusterSourcePipelineMaintenance ClusterSource = `PIPELINE_MAINTENANCE`
const ClusterSourceSql ClusterSource = `SQL`
const ClusterSourceUi ClusterSource = `UI`
func (*ClusterSource) Set ¶ added in v0.2.0
func (cs *ClusterSource) Set(v string) error
Set raw string value and validate it against allowed values
func (*ClusterSource) String ¶ added in v0.2.0
func (cs *ClusterSource) String() string
String representation for fmt.Print
func (*ClusterSource) Type ¶ added in v0.2.0
func (cs *ClusterSource) Type() string
Type always returns ClusterSource to satisfy [pflag.Value] interface
type ClustersAPI ¶
type ClustersAPI struct {
// contains filtered or unexported fields
}
The Clusters API allows you to create, start, edit, list, terminate, and delete clusters.
Databricks maps cluster node instance types to compute units known as DBUs. See the instance type pricing page for a list of the supported instance types and their corresponding DBUs.
A Databricks cluster is a set of computation resources and configurations on which you run data engineering, data science, and data analytics workloads, such as production ETL pipelines, streaming analytics, ad-hoc analytics, and machine learning.
You run these workloads as a set of commands in a notebook or as an automated job. Databricks makes a distinction between all-purpose clusters and job clusters. You use all-purpose clusters to analyze data collaboratively using interactive notebooks. You use job clusters to run fast and robust automated jobs.
You can create an all-purpose cluster using the UI, CLI, or REST API. You can manually terminate and restart an all-purpose cluster. Multiple users can share such clusters to do collaborative interactive analysis.
IMPORTANT: Databricks retains cluster configuration information for up to 200 all-purpose clusters terminated in the last 30 days and up to 30 job clusters recently terminated by the job scheduler. To keep an all-purpose cluster configuration even after it has been terminated for more than 30 days, an administrator can pin a cluster to the cluster list.
Example ¶
w := databricks.Must(databricks.NewWorkspaceClient()) ctx := context.Background() // Fetch list of spark runtime versions sparkVersions, err := w.Clusters.SparkVersions(ctx) if err != nil { panic(err) } // Select the latest LTS version latestLTS, err := sparkVersions.Select(clusters.SparkVersionRequest{ Latest: true, LongTermSupport: true, }) if err != nil { panic(err) } // Fetch list of available node types nodeTypes, err := w.Clusters.ListNodeTypes(ctx) if err != nil { panic(err) } // Select the smallest node type id smallestWithDisk, err := nodeTypes.Smallest(clusters.NodeTypeRequest{ LocalDisk: true, }) if err != nil { panic(err) } // Create cluster and wait until it's ready to use runningCluster, err := w.Clusters.CreateAndWait(ctx, clusters.CreateCluster{ ClusterName: "Test cluster from SDK", SparkVersion: latestLTS, NodeTypeId: smallestWithDisk, AutoterminationMinutes: 15, NumWorkers: 1, }) if err != nil { panic(err) } fmt.Printf("Cluster is ready: %s#setting/clusters/%s/configuration\n", w.Config.Host, runningCluster.ClusterId)
Output:
func NewClusters ¶
func NewClusters(client *client.DatabricksClient) *ClustersAPI
func (*ClustersAPI) ChangeOwner ¶
func (a *ClustersAPI) ChangeOwner(ctx context.Context, request ChangeClusterOwner) error
Change cluster owner.
Change the owner of the cluster. You must be an admin to perform this operation.
func (*ClustersAPI) ClusterInfoClusterNameToClusterIdMap ¶
func (a *ClustersAPI) ClusterInfoClusterNameToClusterIdMap(ctx context.Context, request List) (map[string]string, error)
ClusterInfoClusterNameToClusterIdMap calls ClustersAPI.ListAll and creates a map of results with ClusterInfo.ClusterName as key and ClusterInfo.ClusterId as value.
Returns an error if there's more than one ClusterInfo with the same .ClusterName.
Note: All ClusterInfo instances are loaded into memory before creating a map.
This method is generated by Databricks SDK Code Generator.
func (*ClustersAPI) Create ¶
func (a *ClustersAPI) Create(ctx context.Context, request CreateCluster) (*CreateClusterResponse, error)
Create new cluster.
Creates a new Spark cluster. This method will acquire new instances from the cloud provider if necessary. This method is asynchronous; the returned `cluster_id` can be used to poll the cluster status. When this method returns, the cluster will be in a `PENDING` state. The cluster will be usable once it enters a `RUNNING` state.
Note: Databricks may not be able to acquire some of the requested nodes, due to cloud provider limitations (account limits, spot price, etc.) or transient network issues.
If Databricks acquires at least 85% of the requested on-demand nodes, cluster creation will succeed. Otherwise the cluster will terminate with an informative error message.
func (*ClustersAPI) CreateAndWait ¶
func (a *ClustersAPI) CreateAndWait(ctx context.Context, createCluster CreateCluster, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
Calls ClustersAPI.Create and waits to reach RUNNING state
You can override the default timeout of 20 minutes by calling adding retries.Timeout[ClusterInfo](60*time.Minute) functional option.
func (*ClustersAPI) Delete ¶
func (a *ClustersAPI) Delete(ctx context.Context, request DeleteCluster) error
Terminate cluster.
Terminates the Spark cluster with the specified ID. The cluster is removed asynchronously. Once the termination has completed, the cluster will be in a `TERMINATED` state. If the cluster is already in a `TERMINATING` or `TERMINATED` state, nothing will happen.
func (*ClustersAPI) DeleteAndWait ¶
func (a *ClustersAPI) DeleteAndWait(ctx context.Context, deleteCluster DeleteCluster, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
Calls ClustersAPI.Delete and waits to reach TERMINATED state
You can override the default timeout of 20 minutes by calling adding retries.Timeout[ClusterInfo](60*time.Minute) functional option.
func (*ClustersAPI) DeleteByClusterId ¶
func (a *ClustersAPI) DeleteByClusterId(ctx context.Context, clusterId string) error
Terminate cluster.
Terminates the Spark cluster with the specified ID. The cluster is removed asynchronously. Once the termination has completed, the cluster will be in a `TERMINATED` state. If the cluster is already in a `TERMINATING` or `TERMINATED` state, nothing will happen.
func (*ClustersAPI) DeleteByClusterIdAndWait ¶
func (a *ClustersAPI) DeleteByClusterIdAndWait(ctx context.Context, clusterId string, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
func (*ClustersAPI) Edit ¶
func (a *ClustersAPI) Edit(ctx context.Context, request EditCluster) error
Update cluster configuration.
Updates the configuration of a cluster to match the provided attributes and size. A cluster can be updated if it is in a `RUNNING` or `TERMINATED` state.
If a cluster is updated while in a `RUNNING` state, it will be restarted so that the new attributes can take effect.
If a cluster is updated while in a `TERMINATED` state, it will remain `TERMINATED`. The next time it is started using the `clusters/start` API, the new attributes will take effect. Any attempt to update a cluster in any other state will be rejected with an `INVALID_STATE` error code.
Clusters created by the Databricks Jobs service cannot be edited.
func (*ClustersAPI) EditAndWait ¶
func (a *ClustersAPI) EditAndWait(ctx context.Context, editCluster EditCluster, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
Calls ClustersAPI.Edit and waits to reach RUNNING state
You can override the default timeout of 20 minutes by calling adding retries.Timeout[ClusterInfo](60*time.Minute) functional option.
func (*ClustersAPI) EventsAll ¶
func (a *ClustersAPI) EventsAll(ctx context.Context, request GetEvents) ([]ClusterEvent, error)
List cluster activity events.
Retrieves a list of events about the activity of a cluster. This API is paginated. If there are more events to read, the response includes all the nparameters necessary to request the next page of events.
This method is generated by Databricks SDK Code Generator.
func (*ClustersAPI) Get ¶
func (a *ClustersAPI) Get(ctx context.Context, request Get) (*ClusterInfo, error)
Get cluster info.
"Retrieves the information for a cluster given its identifier. Clusters can be described while they are running, or up to 60 days after they are terminated.
func (*ClustersAPI) GetAndWait ¶
func (a *ClustersAPI) GetAndWait(ctx context.Context, get Get, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
Calls ClustersAPI.Get and waits to reach RUNNING state
You can override the default timeout of 20 minutes by calling adding retries.Timeout[ClusterInfo](60*time.Minute) functional option.
func (*ClustersAPI) GetByClusterId ¶
func (a *ClustersAPI) GetByClusterId(ctx context.Context, clusterId string) (*ClusterInfo, error)
Get cluster info.
"Retrieves the information for a cluster given its identifier. Clusters can be described while they are running, or up to 60 days after they are terminated.
func (*ClustersAPI) GetByClusterIdAndWait ¶
func (a *ClustersAPI) GetByClusterIdAndWait(ctx context.Context, clusterId string, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
func (*ClustersAPI) GetByClusterName ¶
func (a *ClustersAPI) GetByClusterName(ctx context.Context, name string) (*ClusterInfo, error)
GetByClusterName calls ClustersAPI.ClusterInfoClusterNameToClusterIdMap and returns a single ClusterInfo.
Returns an error if there's more than one ClusterInfo with the same .ClusterName.
Note: All ClusterInfo instances are loaded into memory before returning matching by name.
This method is generated by Databricks SDK Code Generator.
func (*ClustersAPI) GetOrCreateRunningCluster ¶
func (a *ClustersAPI) GetOrCreateRunningCluster(ctx context.Context, name string, custom ...CreateCluster) (c *ClusterInfo, err error)
GetOrCreateRunningCluster creates an autoterminating cluster if it doesn't exist
func (*ClustersAPI) Impl ¶
func (a *ClustersAPI) Impl() ClustersService
Impl returns low-level Clusters API implementation
func (*ClustersAPI) ListAll ¶
func (a *ClustersAPI) ListAll(ctx context.Context, request List) ([]ClusterInfo, error)
List all clusters.
Return information about all pinned clusters, active clusters, up to 200 of the most recently terminated all-purpose clusters in the past 30 days, and up to 30 of the most recently terminated job clusters in the past 30 days.
For example, if there is 1 pinned cluster, 4 active clusters, 45 terminated all-purpose clusters in the past 30 days, and 50 terminated job clusters in the past 30 days, then this API returns the 1 pinned cluster, 4 active clusters, all 45 terminated all-purpose clusters, and the 30 most recently terminated job clusters.
This method is generated by Databricks SDK Code Generator.
func (*ClustersAPI) ListByCanUseClient ¶
func (a *ClustersAPI) ListByCanUseClient(ctx context.Context, canUseClient string) (*ListClustersResponse, error)
List all clusters.
Return information about all pinned clusters, active clusters, up to 200 of the most recently terminated all-purpose clusters in the past 30 days, and up to 30 of the most recently terminated job clusters in the past 30 days.
For example, if there is 1 pinned cluster, 4 active clusters, 45 terminated all-purpose clusters in the past 30 days, and 50 terminated job clusters in the past 30 days, then this API returns the 1 pinned cluster, 4 active clusters, all 45 terminated all-purpose clusters, and the 30 most recently terminated job clusters.
func (*ClustersAPI) ListNodeTypes ¶
func (a *ClustersAPI) ListNodeTypes(ctx context.Context) (*ListNodeTypesResponse, error)
List node types.
Returns a list of supported Spark node types. These node types can be used to launch a cluster.
func (*ClustersAPI) ListZones ¶
func (a *ClustersAPI) ListZones(ctx context.Context) (*ListAvailableZonesResponse, error)
List availability zones.
Returns a list of availability zones where clusters can be created in (For example, us-west-2a). These zones can be used to launch a cluster.
func (*ClustersAPI) PermanentDelete ¶
func (a *ClustersAPI) PermanentDelete(ctx context.Context, request PermanentDeleteCluster) error
Permanently delete cluster.
Permanently deletes a Spark cluster. This cluster is terminated and resources are asynchronously removed.
In addition, users will no longer see permanently deleted clusters in the cluster list, and API users can no longer perform any action on permanently deleted clusters.
func (*ClustersAPI) PermanentDeleteByClusterId ¶
func (a *ClustersAPI) PermanentDeleteByClusterId(ctx context.Context, clusterId string) error
Permanently delete cluster.
Permanently deletes a Spark cluster. This cluster is terminated and resources are asynchronously removed.
In addition, users will no longer see permanently deleted clusters in the cluster list, and API users can no longer perform any action on permanently deleted clusters.
func (*ClustersAPI) Pin ¶
func (a *ClustersAPI) Pin(ctx context.Context, request PinCluster) error
Pin cluster.
Pinning a cluster ensures that the cluster will always be returned by the ListClusters API. Pinning a cluster that is already pinned will have no effect. This API can only be called by workspace admins.
func (*ClustersAPI) PinByClusterId ¶
func (a *ClustersAPI) PinByClusterId(ctx context.Context, clusterId string) error
Pin cluster.
Pinning a cluster ensures that the cluster will always be returned by the ListClusters API. Pinning a cluster that is already pinned will have no effect. This API can only be called by workspace admins.
func (*ClustersAPI) Resize ¶
func (a *ClustersAPI) Resize(ctx context.Context, request ResizeCluster) error
Resize cluster.
Resizes a cluster to have a desired number of workers. This will fail unless the cluster is in a `RUNNING` state.
func (*ClustersAPI) ResizeAndWait ¶
func (a *ClustersAPI) ResizeAndWait(ctx context.Context, resizeCluster ResizeCluster, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
Calls ClustersAPI.Resize and waits to reach RUNNING state
You can override the default timeout of 20 minutes by calling adding retries.Timeout[ClusterInfo](60*time.Minute) functional option.
func (*ClustersAPI) Restart ¶
func (a *ClustersAPI) Restart(ctx context.Context, request RestartCluster) error
Restart cluster.
Restarts a Spark cluster with the supplied ID. If the cluster is not currently in a `RUNNING` state, nothing will happen.
func (*ClustersAPI) RestartAndWait ¶
func (a *ClustersAPI) RestartAndWait(ctx context.Context, restartCluster RestartCluster, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
Calls ClustersAPI.Restart and waits to reach RUNNING state
You can override the default timeout of 20 minutes by calling adding retries.Timeout[ClusterInfo](60*time.Minute) functional option.
func (*ClustersAPI) SparkVersions ¶
func (a *ClustersAPI) SparkVersions(ctx context.Context) (*GetSparkVersionsResponse, error)
List available Spark versions.
Returns the list of available Spark versions. These versions can be used to launch a cluster.
func (*ClustersAPI) Start ¶
func (a *ClustersAPI) Start(ctx context.Context, request StartCluster) error
Start terminated cluster.
Starts a terminated Spark cluster with the supplied ID. This works similar to `createCluster` except:
* The previous cluster id and attributes are preserved. * The cluster starts with the last specified cluster size. * If the previous cluster was an autoscaling cluster, the current cluster starts with the minimum number of nodes. * If the cluster is not currently in a `TERMINATED` state, nothing will happen. * Clusters launched to run a job cannot be started.
func (*ClustersAPI) StartAndWait ¶
func (a *ClustersAPI) StartAndWait(ctx context.Context, startCluster StartCluster, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
Calls ClustersAPI.Start and waits to reach RUNNING state
You can override the default timeout of 20 minutes by calling adding retries.Timeout[ClusterInfo](60*time.Minute) functional option.
func (*ClustersAPI) StartByClusterId ¶
func (a *ClustersAPI) StartByClusterId(ctx context.Context, clusterId string) error
Start terminated cluster.
Starts a terminated Spark cluster with the supplied ID. This works similar to `createCluster` except:
* The previous cluster id and attributes are preserved. * The cluster starts with the last specified cluster size. * If the previous cluster was an autoscaling cluster, the current cluster starts with the minimum number of nodes. * If the cluster is not currently in a `TERMINATED` state, nothing will happen. * Clusters launched to run a job cannot be started.
func (*ClustersAPI) StartByClusterIdAndWait ¶
func (a *ClustersAPI) StartByClusterIdAndWait(ctx context.Context, clusterId string, options ...retries.Option[ClusterInfo]) (*ClusterInfo, error)
func (*ClustersAPI) Unpin ¶
func (a *ClustersAPI) Unpin(ctx context.Context, request UnpinCluster) error
Unpin cluster.
Unpinning a cluster will allow the cluster to eventually be removed from the ListClusters API. Unpinning a cluster that is not pinned will have no effect. This API can only be called by workspace admins.
func (*ClustersAPI) UnpinByClusterId ¶
func (a *ClustersAPI) UnpinByClusterId(ctx context.Context, clusterId string) error
Unpin cluster.
Unpinning a cluster will allow the cluster to eventually be removed from the ListClusters API. Unpinning a cluster that is not pinned will have no effect. This API can only be called by workspace admins.
func (*ClustersAPI) WithImpl ¶
func (a *ClustersAPI) WithImpl(impl ClustersService) *ClustersAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
type ClustersService ¶
type ClustersService interface { // Change cluster owner. // // Change the owner of the cluster. You must be an admin to perform this // operation. ChangeOwner(ctx context.Context, request ChangeClusterOwner) error // Create new cluster. // // Creates a new Spark cluster. This method will acquire new instances from // the cloud provider if necessary. This method is asynchronous; the // returned `cluster_id` can be used to poll the cluster status. When this // method returns, the cluster will be in a `PENDING` state. The cluster // will be usable once it enters a `RUNNING` state. // // Note: Databricks may not be able to acquire some of the requested nodes, // due to cloud provider limitations (account limits, spot price, etc.) or // transient network issues. // // If Databricks acquires at least 85% of the requested on-demand nodes, // cluster creation will succeed. Otherwise the cluster will terminate with // an informative error message. Create(ctx context.Context, request CreateCluster) (*CreateClusterResponse, error) // Terminate cluster. // // Terminates the Spark cluster with the specified ID. The cluster is // removed asynchronously. Once the termination has completed, the cluster // will be in a `TERMINATED` state. If the cluster is already in a // `TERMINATING` or `TERMINATED` state, nothing will happen. Delete(ctx context.Context, request DeleteCluster) error // Update cluster configuration. // // Updates the configuration of a cluster to match the provided attributes // and size. A cluster can be updated if it is in a `RUNNING` or // `TERMINATED` state. // // If a cluster is updated while in a `RUNNING` state, it will be restarted // so that the new attributes can take effect. // // If a cluster is updated while in a `TERMINATED` state, it will remain // `TERMINATED`. The next time it is started using the `clusters/start` API, // the new attributes will take effect. Any attempt to update a cluster in // any other state will be rejected with an `INVALID_STATE` error code. // // Clusters created by the Databricks Jobs service cannot be edited. Edit(ctx context.Context, request EditCluster) error // List cluster activity events. // // Retrieves a list of events about the activity of a cluster. This API is // paginated. If there are more events to read, the response includes all // the nparameters necessary to request the next page of events. // // Use EventsAll() to get all ClusterEvent instances, which will iterate over every result page. Events(ctx context.Context, request GetEvents) (*GetEventsResponse, error) // Get cluster info. // // "Retrieves the information for a cluster given its identifier. Clusters // can be described while they are running, or up to 60 days after they are // terminated. Get(ctx context.Context, request Get) (*ClusterInfo, error) // List all clusters. // // Return information about all pinned clusters, active clusters, up to 200 // of the most recently terminated all-purpose clusters in the past 30 days, // and up to 30 of the most recently terminated job clusters in the past 30 // days. // // For example, if there is 1 pinned cluster, 4 active clusters, 45 // terminated all-purpose clusters in the past 30 days, and 50 terminated // job clusters in the past 30 days, then this API returns the 1 pinned // cluster, 4 active clusters, all 45 terminated all-purpose clusters, and // the 30 most recently terminated job clusters. // // Use ListAll() to get all ClusterInfo instances List(ctx context.Context, request List) (*ListClustersResponse, error) // List node types. // // Returns a list of supported Spark node types. These node types can be // used to launch a cluster. ListNodeTypes(ctx context.Context) (*ListNodeTypesResponse, error) // List availability zones. // // Returns a list of availability zones where clusters can be created in // (For example, us-west-2a). These zones can be used to launch a cluster. ListZones(ctx context.Context) (*ListAvailableZonesResponse, error) // Permanently delete cluster. // // Permanently deletes a Spark cluster. This cluster is terminated and // resources are asynchronously removed. // // In addition, users will no longer see permanently deleted clusters in the // cluster list, and API users can no longer perform any action on // permanently deleted clusters. PermanentDelete(ctx context.Context, request PermanentDeleteCluster) error // Pin cluster. // // Pinning a cluster ensures that the cluster will always be returned by the // ListClusters API. Pinning a cluster that is already pinned will have no // effect. This API can only be called by workspace admins. Pin(ctx context.Context, request PinCluster) error // Resize cluster. // // Resizes a cluster to have a desired number of workers. This will fail // unless the cluster is in a `RUNNING` state. Resize(ctx context.Context, request ResizeCluster) error // Restart cluster. // // Restarts a Spark cluster with the supplied ID. If the cluster is not // currently in a `RUNNING` state, nothing will happen. Restart(ctx context.Context, request RestartCluster) error // List available Spark versions. // // Returns the list of available Spark versions. These versions can be used // to launch a cluster. SparkVersions(ctx context.Context) (*GetSparkVersionsResponse, error) // Start terminated cluster. // // Starts a terminated Spark cluster with the supplied ID. This works // similar to `createCluster` except: // // * The previous cluster id and attributes are preserved. * The cluster // starts with the last specified cluster size. * If the previous cluster // was an autoscaling cluster, the current cluster starts with the minimum // number of nodes. * If the cluster is not currently in a `TERMINATED` // state, nothing will happen. * Clusters launched to run a job cannot be // started. Start(ctx context.Context, request StartCluster) error // Unpin cluster. // // Unpinning a cluster will allow the cluster to eventually be removed from // the ListClusters API. Unpinning a cluster that is not pinned will have no // effect. This API can only be called by workspace admins. Unpin(ctx context.Context, request UnpinCluster) error }
The Clusters API allows you to create, start, edit, list, terminate, and delete clusters.
Databricks maps cluster node instance types to compute units known as DBUs. See the instance type pricing page for a list of the supported instance types and their corresponding DBUs.
A Databricks cluster is a set of computation resources and configurations on which you run data engineering, data science, and data analytics workloads, such as production ETL pipelines, streaming analytics, ad-hoc analytics, and machine learning.
You run these workloads as a set of commands in a notebook or as an automated job. Databricks makes a distinction between all-purpose clusters and job clusters. You use all-purpose clusters to analyze data collaboratively using interactive notebooks. You use job clusters to run fast and robust automated jobs.
You can create an all-purpose cluster using the UI, CLI, or REST API. You can manually terminate and restart an all-purpose cluster. Multiple users can share such clusters to do collaborative interactive analysis.
IMPORTANT: Databricks retains cluster configuration information for up to 200 all-purpose clusters terminated in the last 30 days and up to 30 job clusters recently terminated by the job scheduler. To keep an all-purpose cluster configuration even after it has been terminated for more than 30 days, an administrator can pin a cluster to the cluster list.
type CreateCluster ¶
type CreateCluster struct { // Note: This field won't be true for webapp requests. Only API users will // check this field. ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. Autoscale *AutoScale `json:"autoscale,omitempty"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. ClusterName string `json:"cluster_name,omitempty"` // Determines whether the cluster was created by a user through the UI, // created by the Databricks Jobs Scheduler, or through an API request. This // is the same as cluster_creator, but read only. ClusterSource ClusterSource `json:"cluster_source,omitempty"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags CustomTags map[string]string `json:"custom_tags,omitempty"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` // Whether to enable LUKS on cluster VMs' local disks EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` // The optional ID of the instance pool to which the cluster belongs. InstancePoolId string `json:"instance_pool_id,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. NodeTypeId string `json:"node_type_id,omitempty"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. // // Note: When reading the properties of a cluster, this field reflects the // desired number of workers rather than the actual current number of // workers. For instance, if a cluster is resized from 5 to 10 workers, this // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. NumWorkers int `json:"num_workers,omitempty"` // The ID of the cluster policy used to create the cluster if applicable. PolicyId string `json:"policy_id,omitempty"` // Decides which runtime engine to be use, e.g. Standard vs. Photon. If // unspecified, the runtime engine is inferred from spark_version. RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. SparkConf map[string]string `json:"spark_conf,omitempty"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the // driver and workers. // // In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we // recommend appending them to `$SPARK_DAEMON_JAVA_OPTS` as shown in the // example below. This ensures that all default databricks managed // environmental variables are included as well. // // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. SparkVersion string `json:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. SshPublicKeys []string `json:"ssh_public_keys,omitempty"` WorkloadType *WorkloadType `json:"workload_type,omitempty"` }
type CreateClusterResponse ¶
type CreateClusterResponse struct {
ClusterId string `json:"cluster_id,omitempty"`
}
type DataPlaneEventDetails ¶
type DataPlaneEventDetails struct { // <needs content added> EventType DataPlaneEventDetailsEventType `json:"event_type,omitempty"` // <needs content added> ExecutorFailures int `json:"executor_failures,omitempty"` // <needs content added> HostId string `json:"host_id,omitempty"` // <needs content added> Timestamp int64 `json:"timestamp,omitempty"` }
type DataPlaneEventDetailsEventType ¶
type DataPlaneEventDetailsEventType string
<needs content added>
const DataPlaneEventDetailsEventTypeNodeBlacklisted DataPlaneEventDetailsEventType = `NODE_BLACKLISTED`
const DataPlaneEventDetailsEventTypeNodeExcludedDecommissioned DataPlaneEventDetailsEventType = `NODE_EXCLUDED_DECOMMISSIONED`
func (*DataPlaneEventDetailsEventType) Set ¶ added in v0.2.0
func (dpedet *DataPlaneEventDetailsEventType) Set(v string) error
Set raw string value and validate it against allowed values
func (*DataPlaneEventDetailsEventType) String ¶ added in v0.2.0
func (dpedet *DataPlaneEventDetailsEventType) String() string
String representation for fmt.Print
func (*DataPlaneEventDetailsEventType) Type ¶ added in v0.2.0
func (dpedet *DataPlaneEventDetailsEventType) Type() string
Type always returns DataPlaneEventDetailsEventType to satisfy [pflag.Value] interface
type DataSecurityMode ¶
type DataSecurityMode string
This describes an enum
const DataSecurityModeLegacyPassthrough DataSecurityMode = `LEGACY_PASSTHROUGH`
This mode is for users migrating from legacy Passthrough on high concurrency clusters.
const DataSecurityModeLegacySingleUser DataSecurityMode = `LEGACY_SINGLE_USER`
This mode is for users migrating from legacy Passthrough on standard clusters.
const DataSecurityModeLegacyTableAcl DataSecurityMode = `LEGACY_TABLE_ACL`
This mode is for users migrating from legacy Table ACL clusters.
const DataSecurityModeNone DataSecurityMode = `NONE`
No security isolation for multiple users sharing the cluster. Data governance features are not available in this mode.
const DataSecurityModeSingleUser DataSecurityMode = `SINGLE_USER`
A secure cluster that can only be exclusively used by a single user specified in `single_user_name`. Most programming languages, cluster features and data governance features are available in this mode.
const DataSecurityModeUserIsolation DataSecurityMode = `USER_ISOLATION`
A secure cluster that can be shared by multiple users. Cluster users are fully isolated so that they cannot see each other's data and credentials. Most data governance features are supported in this mode. But programming languages and cluster features might be limited.
func (*DataSecurityMode) Set ¶ added in v0.2.0
func (dsm *DataSecurityMode) Set(v string) error
Set raw string value and validate it against allowed values
func (*DataSecurityMode) String ¶ added in v0.2.0
func (dsm *DataSecurityMode) String() string
String representation for fmt.Print
func (*DataSecurityMode) Type ¶ added in v0.2.0
func (dsm *DataSecurityMode) Type() string
Type always returns DataSecurityMode to satisfy [pflag.Value] interface
type DbfsStorageInfo ¶
type DbfsStorageInfo struct { // dbfs destination, e.g. `dbfs:/my/path` Destination string `json:"destination,omitempty"` }
type DeleteCluster ¶
type DeleteCluster struct { // The cluster to be terminated. ClusterId string `json:"cluster_id"` }
type EbsVolumeType ¶
type EbsVolumeType string
The type of EBS volumes that will be launched with this cluster.
const EbsVolumeTypeGeneralPurposeSsd EbsVolumeType = `GENERAL_PURPOSE_SSD`
const EbsVolumeTypeThroughputOptimizedHdd EbsVolumeType = `THROUGHPUT_OPTIMIZED_HDD`
func (*EbsVolumeType) Set ¶ added in v0.2.0
func (evt *EbsVolumeType) Set(v string) error
Set raw string value and validate it against allowed values
func (*EbsVolumeType) String ¶ added in v0.2.0
func (evt *EbsVolumeType) String() string
String representation for fmt.Print
func (*EbsVolumeType) Type ¶ added in v0.2.0
func (evt *EbsVolumeType) Type() string
Type always returns EbsVolumeType to satisfy [pflag.Value] interface
type EditCluster ¶
type EditCluster struct { // Note: This field won't be true for webapp requests. Only API users will // check this field. ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. Autoscale *AutoScale `json:"autoscale,omitempty"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` // ID of the cluser ClusterId string `json:"cluster_id"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. ClusterName string `json:"cluster_name,omitempty"` // Determines whether the cluster was created by a user through the UI, // created by the Databricks Jobs Scheduler, or through an API request. This // is the same as cluster_creator, but read only. ClusterSource ClusterSource `json:"cluster_source,omitempty"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags CustomTags map[string]string `json:"custom_tags,omitempty"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` // Whether to enable LUKS on cluster VMs' local disks EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` // The optional ID of the instance pool to which the cluster belongs. InstancePoolId string `json:"instance_pool_id,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. NodeTypeId string `json:"node_type_id,omitempty"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. // // Note: When reading the properties of a cluster, this field reflects the // desired number of workers rather than the actual current number of // workers. For instance, if a cluster is resized from 5 to 10 workers, this // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. NumWorkers int `json:"num_workers,omitempty"` // The ID of the cluster policy used to create the cluster if applicable. PolicyId string `json:"policy_id,omitempty"` // Decides which runtime engine to be use, e.g. Standard vs. Photon. If // unspecified, the runtime engine is inferred from spark_version. RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. SparkConf map[string]string `json:"spark_conf,omitempty"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the // driver and workers. // // In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we // recommend appending them to `$SPARK_DAEMON_JAVA_OPTS` as shown in the // example below. This ensures that all default databricks managed // environmental variables are included as well. // // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. SparkVersion string `json:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. SshPublicKeys []string `json:"ssh_public_keys,omitempty"` WorkloadType *WorkloadType `json:"workload_type,omitempty"` }
type EventDetails ¶
type EventDetails struct { // * For created clusters, the attributes of the cluster. * For edited // clusters, the new attributes of the cluster. Attributes *ClusterAttributes `json:"attributes,omitempty"` // The cause of a change in target size. Cause EventDetailsCause `json:"cause,omitempty"` // The actual cluster size that was set in the cluster creation or edit. ClusterSize *ClusterSize `json:"cluster_size,omitempty"` // The current number of vCPUs in the cluster. CurrentNumVcpus int `json:"current_num_vcpus,omitempty"` // The current number of nodes in the cluster. CurrentNumWorkers int `json:"current_num_workers,omitempty"` // <needs content added> DidNotExpandReason string `json:"did_not_expand_reason,omitempty"` // Current disk size in bytes DiskSize int64 `json:"disk_size,omitempty"` // More details about the change in driver's state DriverStateMessage string `json:"driver_state_message,omitempty"` // Whether or not a blocklisted node should be terminated. For // ClusterEventType NODE_BLACKLISTED. EnableTerminationForNodeBlocklisted bool `json:"enable_termination_for_node_blocklisted,omitempty"` // <needs content added> FreeSpace int64 `json:"free_space,omitempty"` // Instance Id where the event originated from InstanceId string `json:"instance_id,omitempty"` // Unique identifier of the specific job run associated with this cluster // event * For clusters created for jobs, this will be the same as the // cluster name JobRunName string `json:"job_run_name,omitempty"` // The cluster attributes before a cluster was edited. PreviousAttributes *ClusterAttributes `json:"previous_attributes,omitempty"` // The size of the cluster before an edit or resize. PreviousClusterSize *ClusterSize `json:"previous_cluster_size,omitempty"` // Previous disk size in bytes PreviousDiskSize int64 `json:"previous_disk_size,omitempty"` // A termination reason: * On a TERMINATED event, this is the reason of the // termination. * On a RESIZE_COMPLETE event, this indicates the reason that // we failed to acquire some nodes. Reason *TerminationReason `json:"reason,omitempty"` // The targeted number of vCPUs in the cluster. TargetNumVcpus int `json:"target_num_vcpus,omitempty"` // The targeted number of nodes in the cluster. TargetNumWorkers int `json:"target_num_workers,omitempty"` // The user that caused the event to occur. (Empty if it was done by the // control plane.) User string `json:"user,omitempty"` }
type EventDetailsCause ¶
type EventDetailsCause string
The cause of a change in target size.
const EventDetailsCauseAutorecovery EventDetailsCause = `AUTORECOVERY`
const EventDetailsCauseAutoscale EventDetailsCause = `AUTOSCALE`
const EventDetailsCauseReplaceBadNodes EventDetailsCause = `REPLACE_BAD_NODES`
const EventDetailsCauseUserRequest EventDetailsCause = `USER_REQUEST`
func (*EventDetailsCause) Set ¶ added in v0.2.0
func (edc *EventDetailsCause) Set(v string) error
Set raw string value and validate it against allowed values
func (*EventDetailsCause) String ¶ added in v0.2.0
func (edc *EventDetailsCause) String() string
String representation for fmt.Print
func (*EventDetailsCause) Type ¶ added in v0.2.0
func (edc *EventDetailsCause) Type() string
Type always returns EventDetailsCause to satisfy [pflag.Value] interface
type EventType ¶
type EventType string
const EventTypeAutoscalingStatsReport EventType = `AUTOSCALING_STATS_REPORT`
const EventTypeCreating EventType = `CREATING`
const EventTypeDbfsDown EventType = `DBFS_DOWN`
const EventTypeDidNotExpandDisk EventType = `DID_NOT_EXPAND_DISK`
const EventTypeDriverHealthy EventType = `DRIVER_HEALTHY`
const EventTypeDriverNotResponding EventType = `DRIVER_NOT_RESPONDING`
const EventTypeEdited EventType = `EDITED`
const EventTypeExpandedDisk EventType = `EXPANDED_DISK`
const EventTypeFailedToExpandDisk EventType = `FAILED_TO_EXPAND_DISK`
const EventTypeInitScriptsFinished EventType = `INIT_SCRIPTS_FINISHED`
const EventTypeInitScriptsStarted EventType = `INIT_SCRIPTS_STARTED`
const EventTypeMetastoreDown EventType = `METASTORE_DOWN`
const EventTypeNodeBlacklisted EventType = `NODE_BLACKLISTED`
const EventTypeNodeExcludedDecommissioned EventType = `NODE_EXCLUDED_DECOMMISSIONED`
const EventTypeNodesLost EventType = `NODES_LOST`
const EventTypePinned EventType = `PINNED`
const EventTypeResizing EventType = `RESIZING`
const EventTypeRestarting EventType = `RESTARTING`
const EventTypeRunning EventType = `RUNNING`
const EventTypeSparkException EventType = `SPARK_EXCEPTION`
const EventTypeStarting EventType = `STARTING`
const EventTypeTerminating EventType = `TERMINATING`
const EventTypeUnpinned EventType = `UNPINNED`
const EventTypeUpsizeCompleted EventType = `UPSIZE_COMPLETED`
type GcpAttributes ¶
type GcpAttributes struct { // This field determines whether the spark executors will be scheduled to // run on preemptible VMs, on-demand VMs, or preemptible VMs with a fallback // to on-demand VMs if the former is unavailable. Availability GcpAvailability `json:"availability,omitempty"` // boot disk size in GB BootDiskSize int `json:"boot_disk_size,omitempty"` // If provided, the cluster will impersonate the google service account when // accessing gcloud services (like GCS). The google service account must // have previously been added to the Databricks environment by an account // administrator. GoogleServiceAccount string `json:"google_service_account,omitempty"` }
type GcpAvailability ¶
type GcpAvailability string
This field determines whether the spark executors will be scheduled to run on preemptible VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable.
const GcpAvailabilityOnDemandGcp GcpAvailability = `ON_DEMAND_GCP`
const GcpAvailabilityPreemptibleGcp GcpAvailability = `PREEMPTIBLE_GCP`
const GcpAvailabilityPreemptibleWithFallbackGcp GcpAvailability = `PREEMPTIBLE_WITH_FALLBACK_GCP`
func (*GcpAvailability) Set ¶ added in v0.2.0
func (ga *GcpAvailability) Set(v string) error
Set raw string value and validate it against allowed values
func (*GcpAvailability) String ¶ added in v0.2.0
func (ga *GcpAvailability) String() string
String representation for fmt.Print
func (*GcpAvailability) Type ¶ added in v0.2.0
func (ga *GcpAvailability) Type() string
Type always returns GcpAvailability to satisfy [pflag.Value] interface
type Get ¶
type Get struct { // The cluster about which to retrieve information. ClusterId string `json:"-" url:"cluster_id"` }
Get cluster info
type GetEvents ¶
type GetEvents struct { // The ID of the cluster to retrieve events about. ClusterId string `json:"cluster_id"` // The end time in epoch milliseconds. If empty, returns events up to the // current time. EndTime int64 `json:"end_time,omitempty"` // An optional set of event types to filter on. If empty, all event types // are returned. EventTypes []EventType `json:"event_types,omitempty"` // The maximum number of events to include in a page of events. Defaults to // 50, and maximum allowed value is 500. Limit int64 `json:"limit,omitempty"` // The offset in the result set. Defaults to 0 (no offset). When an offset // is specified and the results are requested in descending order, the // end_time field is required. Offset int64 `json:"offset,omitempty"` // The order to list events in; either "ASC" or "DESC". Defaults to "DESC". Order GetEventsOrder `json:"order,omitempty"` // The start time in epoch milliseconds. If empty, returns events starting // from the beginning of time. StartTime int64 `json:"start_time,omitempty"` }
type GetEventsOrder ¶
type GetEventsOrder string
The order to list events in; either "ASC" or "DESC". Defaults to "DESC".
const GetEventsOrderAsc GetEventsOrder = `ASC`
const GetEventsOrderDesc GetEventsOrder = `DESC`
func (*GetEventsOrder) Set ¶ added in v0.2.0
func (geo *GetEventsOrder) Set(v string) error
Set raw string value and validate it against allowed values
func (*GetEventsOrder) String ¶ added in v0.2.0
func (geo *GetEventsOrder) String() string
String representation for fmt.Print
func (*GetEventsOrder) Type ¶ added in v0.2.0
func (geo *GetEventsOrder) Type() string
Type always returns GetEventsOrder to satisfy [pflag.Value] interface
type GetEventsResponse ¶
type GetEventsResponse struct { // <content needs to be added> Events []ClusterEvent `json:"events,omitempty"` // The parameters required to retrieve the next page of events. Omitted if // there are no more events to read. NextPage *GetEvents `json:"next_page,omitempty"` // The total number of events filtered by the start_time, end_time, and // event_types. TotalCount int64 `json:"total_count,omitempty"` }
type GetSparkVersionsResponse ¶
type GetSparkVersionsResponse struct { // All the available Spark versions. Versions []SparkVersion `json:"versions,omitempty"` }
func (GetSparkVersionsResponse) Select ¶
func (sv GetSparkVersionsResponse) Select(req SparkVersionRequest) (string, error)
LatestSparkVersion returns latest version matching the request parameters
type InstanceProfile ¶
type InstanceProfile struct { // The AWS IAM role ARN of the role associated with the instance profile. // This field is required if your role name and instance profile name do not // match and you want to use the instance profile with [Databricks SQL // Serverless]. // // Otherwise, this field is optional. // // [Databricks SQL Serverless]: https://docs.databricks.com/sql/admin/serverless.html IamRoleArn string `json:"iam_role_arn,omitempty"` // The AWS ARN of the instance profile to register with Databricks. This // field is required. InstanceProfileArn string `json:"instance_profile_arn"` // By default, Databricks validates that it has sufficient permissions to // launch instances with the instance profile. This validation uses AWS // dry-run mode for the RunInstances API. If validation fails with an error // message that does not indicate an IAM related permission issue, (e.g. // `Your requested instance type is not supported in your requested // availability zone`), you can pass this flag to skip the validation and // forcibly add the instance profile. IsMetaInstanceProfile bool `json:"is_meta_instance_profile,omitempty"` }
type InstanceProfilesAPI ¶
type InstanceProfilesAPI struct {
// contains filtered or unexported fields
}
The Instance Profiles API allows admins to add, list, and remove instance profiles that users can launch clusters with. Regular users can list the instance profiles available to them. See Secure access to S3 buckets using instance profiles for more information.
func NewInstanceProfiles ¶
func NewInstanceProfiles(client *client.DatabricksClient) *InstanceProfilesAPI
func (*InstanceProfilesAPI) Add ¶
func (a *InstanceProfilesAPI) Add(ctx context.Context, request AddInstanceProfile) error
Register an instance profile.
In the UI, you can select the instance profile when launching clusters. This API is only available to admin users.
func (*InstanceProfilesAPI) Edit ¶
func (a *InstanceProfilesAPI) Edit(ctx context.Context, request InstanceProfile) error
Edit an instance profile.
The only supported field to change is the optional IAM role ARN associated with the instance profile. It is required to specify the IAM role ARN if both of the following are true:
* Your role name and instance profile name do not match. The name is the part after the last slash in each ARN. * You want to use the instance profile with Databricks SQL Serverless.
To understand where these fields are in the AWS console, see Enable serverless SQL warehouses.
This API is only available to admin users.
func (*InstanceProfilesAPI) Impl ¶
func (a *InstanceProfilesAPI) Impl() InstanceProfilesService
Impl returns low-level InstanceProfiles API implementation
func (*InstanceProfilesAPI) ListAll ¶
func (a *InstanceProfilesAPI) ListAll(ctx context.Context) ([]InstanceProfile, error)
List available instance profiles.
List the instance profiles that the calling user can use to launch a cluster.
This API is available to all users.
This method is generated by Databricks SDK Code Generator.
func (*InstanceProfilesAPI) Remove ¶
func (a *InstanceProfilesAPI) Remove(ctx context.Context, request RemoveInstanceProfile) error
Remove the instance profile.
Remove the instance profile with the provided ARN. Existing clusters with this instance profile will continue to function.
This API is only accessible to admin users.
func (*InstanceProfilesAPI) RemoveByInstanceProfileArn ¶
func (a *InstanceProfilesAPI) RemoveByInstanceProfileArn(ctx context.Context, instanceProfileArn string) error
Remove the instance profile.
Remove the instance profile with the provided ARN. Existing clusters with this instance profile will continue to function.
This API is only accessible to admin users.
func (*InstanceProfilesAPI) WithImpl ¶
func (a *InstanceProfilesAPI) WithImpl(impl InstanceProfilesService) *InstanceProfilesAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
type InstanceProfilesService ¶
type InstanceProfilesService interface { // Register an instance profile. // // In the UI, you can select the instance profile when launching clusters. // This API is only available to admin users. Add(ctx context.Context, request AddInstanceProfile) error // Edit an instance profile. // // The only supported field to change is the optional IAM role ARN // associated with the instance profile. It is required to specify the IAM // role ARN if both of the following are true: // // * Your role name and instance profile name do not match. The name is the // part after the last slash in each ARN. * You want to use the instance // profile with [Databricks SQL Serverless]. // // To understand where these fields are in the AWS console, see [Enable // serverless SQL warehouses]. // // This API is only available to admin users. // // [Databricks SQL Serverless]: https://docs.databricks.com/sql/admin/serverless.html // [Enable serverless SQL warehouses]: https://docs.databricks.com/sql/admin/serverless.html Edit(ctx context.Context, request InstanceProfile) error // List available instance profiles. // // List the instance profiles that the calling user can use to launch a // cluster. // // This API is available to all users. // // Use ListAll() to get all InstanceProfile instances List(ctx context.Context) (*ListInstanceProfilesResponse, error) // Remove the instance profile. // // Remove the instance profile with the provided ARN. Existing clusters with // this instance profile will continue to function. // // This API is only accessible to admin users. Remove(ctx context.Context, request RemoveInstanceProfile) error }
The Instance Profiles API allows admins to add, list, and remove instance profiles that users can launch clusters with. Regular users can list the instance profiles available to them. See Secure access to S3 buckets using instance profiles for more information.
type List ¶
type List struct { // Filter clusters based on what type of client it can be used for. Could be // either NOTEBOOKS or JOBS. No input for this field will get all clusters // in the workspace without filtering on its supported client CanUseClient string `json:"-" url:"can_use_client,omitempty"` }
List all clusters
type ListClustersResponse ¶
type ListClustersResponse struct { // <needs content added> Clusters []ClusterInfo `json:"clusters,omitempty"` }
type ListInstanceProfilesResponse ¶
type ListInstanceProfilesResponse struct { // A list of instance profiles that the user can access. InstanceProfiles []InstanceProfile `json:"instance_profiles,omitempty"` }
type ListNodeTypesResponse ¶
type ListNodeTypesResponse struct { // The list of available Spark node types. NodeTypes []NodeType `json:"node_types,omitempty"` }
func (*ListNodeTypesResponse) Smallest ¶
func (ntl *ListNodeTypesResponse) Smallest(r NodeTypeRequest) (string, error)
type LogAnalyticsInfo ¶
type LogSyncStatus ¶
type LogSyncStatus struct { // The timestamp of last attempt. If the last attempt fails, // `last_exception` will contain the exception in the last attempt. LastAttempted int64 `json:"last_attempted,omitempty"` // The exception thrown in the last attempt, it would be null (omitted in // the response) if there is no exception in last attempted. LastException string `json:"last_exception,omitempty"` }
type NodeInstanceType ¶
type NodeInstanceType struct { InstanceTypeId string `json:"instance_type_id,omitempty"` LocalDiskSizeGb int `json:"local_disk_size_gb,omitempty"` LocalDisks int `json:"local_disks,omitempty"` LocalNvmeDiskSizeGb int `json:"local_nvme_disk_size_gb,omitempty"` LocalNvmeDisks int `json:"local_nvme_disks,omitempty"` }
type NodeType ¶
type NodeType struct { Category string `json:"category,omitempty"` // A string description associated with this node type, e.g., "r3.xlarge". Description string `json:"description"` DisplayOrder int `json:"display_order,omitempty"` // An identifier for the type of hardware that this node runs on, e.g., // "r3.2xlarge" in AWS. InstanceTypeId string `json:"instance_type_id"` // Whether the node type is deprecated. Non-deprecated node types offer // greater performance. IsDeprecated bool `json:"is_deprecated,omitempty"` // AWS specific, whether this instance supports encryption in transit, used // for hipaa and pci workloads. IsEncryptedInTransit bool `json:"is_encrypted_in_transit,omitempty"` IsGraviton bool `json:"is_graviton,omitempty"` IsHidden bool `json:"is_hidden,omitempty"` IsIoCacheEnabled bool `json:"is_io_cache_enabled,omitempty"` // Memory (in MB) available for this node type. MemoryMb int `json:"memory_mb"` NodeInfo *CloudProviderNodeInfo `json:"node_info,omitempty"` NodeInstanceType *NodeInstanceType `json:"node_instance_type,omitempty"` // Unique identifier for this node type. NodeTypeId string `json:"node_type_id"` // Number of CPU cores available for this node type. Note that this can be // fractional, e.g., 2.5 cores, if the the number of cores on a machine // instance is not divisible by the number of Spark nodes on that machine. NumCores float64 `json:"num_cores"` NumGpus int `json:"num_gpus,omitempty"` PhotonDriverCapable bool `json:"photon_driver_capable,omitempty"` PhotonWorkerCapable bool `json:"photon_worker_capable,omitempty"` SupportClusterTags bool `json:"support_cluster_tags,omitempty"` SupportEbsVolumes bool `json:"support_ebs_volumes,omitempty"` SupportPortForwarding bool `json:"support_port_forwarding,omitempty"` }
type NodeTypeRequest ¶
type NodeTypeRequest struct { Id string `json:"id,omitempty"` MinMemoryGB int32 `json:"min_memory_gb,omitempty"` GBPerCore int32 `json:"gb_per_core,omitempty"` MinCores int32 `json:"min_cores,omitempty"` MinGPUs int32 `json:"min_gpus,omitempty"` LocalDisk bool `json:"local_disk,omitempty"` LocalDiskMinSize int32 `json:"local_disk_min_size,omitempty"` Category string `json:"category,omitempty"` PhotonWorkerCapable bool `json:"photon_worker_capable,omitempty"` PhotonDriverCapable bool `json:"photon_driver_capable,omitempty"` Graviton bool `json:"graviton,omitempty"` IsIOCacheEnabled bool `json:"is_io_cache_enabled,omitempty"` SupportPortForwarding bool `json:"support_port_forwarding,omitempty"` Fleet bool `json:"fleet,omitempty"` }
NodeTypeRequest is a wrapper for local filtering of node types
type PermanentDeleteCluster ¶
type PermanentDeleteCluster struct { // The cluster to be deleted. ClusterId string `json:"cluster_id"` }
type PinCluster ¶
type PinCluster struct { // <needs content added> ClusterId string `json:"cluster_id"` }
type RemoveInstanceProfile ¶
type RemoveInstanceProfile struct { // The ARN of the instance profile to remove. This field is required. InstanceProfileArn string `json:"instance_profile_arn"` }
type ResizeCluster ¶
type ResizeCluster struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. Autoscale *AutoScale `json:"autoscale,omitempty"` // The cluster to be resized. ClusterId string `json:"cluster_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. // // Note: When reading the properties of a cluster, this field reflects the // desired number of workers rather than the actual current number of // workers. For instance, if a cluster is resized from 5 to 10 workers, this // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. NumWorkers int `json:"num_workers,omitempty"` }
type RestartCluster ¶
type RuntimeEngine ¶
type RuntimeEngine string
Decides which runtime engine to be use, e.g. Standard vs. Photon. If unspecified, the runtime engine is inferred from spark_version.
const RuntimeEngineNull RuntimeEngine = `NULL`
const RuntimeEnginePhoton RuntimeEngine = `PHOTON`
const RuntimeEngineStandard RuntimeEngine = `STANDARD`
func (*RuntimeEngine) Set ¶ added in v0.2.0
func (re *RuntimeEngine) Set(v string) error
Set raw string value and validate it against allowed values
func (*RuntimeEngine) String ¶ added in v0.2.0
func (re *RuntimeEngine) String() string
String representation for fmt.Print
func (*RuntimeEngine) Type ¶ added in v0.2.0
func (re *RuntimeEngine) Type() string
Type always returns RuntimeEngine to satisfy [pflag.Value] interface
type S3StorageInfo ¶
type S3StorageInfo struct { // (Optional) Set canned access control list for the logs, e.g. // `bucket-owner-full-control`. If `canned_cal` is set, please make sure the // cluster iam role has `s3:PutObjectAcl` permission on the destination // bucket and prefix. The full list of possible canned acl can be found at // http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. // Please also note that by default only the object owner gets full // controls. If you are using cross account role for writing data, you may // want to set `bucket-owner-full-control` to make bucket owner able to read // the logs. CannedAcl string `json:"canned_acl,omitempty"` // S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be // delivered using cluster iam role, please make sure you set cluster iam // role and the role has write access to the destination. Please also note // that you cannot use AWS keys to deliver logs. Destination string `json:"destination,omitempty"` // (Optional) Flag to enable server side encryption, `false` by default. EnableEncryption bool `json:"enable_encryption,omitempty"` // (Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It // will be used only when encryption is enabled and the default type is // `sse-s3`. EncryptionType string `json:"encryption_type,omitempty"` // S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or // endpoint needs to be set. If both are set, endpoint will be used. Endpoint string `json:"endpoint,omitempty"` // (Optional) Kms key which will be used if encryption is enabled and // encryption type is set to `sse-kms`. KmsKey string `json:"kms_key,omitempty"` // S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. // If both are set, endpoint will be used. Region string `json:"region,omitempty"` }
type SparkNode ¶
type SparkNode struct { // The private IP address of the host instance. HostPrivateIp string `json:"host_private_ip,omitempty"` // Globally unique identifier for the host instance from the cloud provider. InstanceId string `json:"instance_id,omitempty"` // Attributes specific to AWS for a Spark node. NodeAwsAttributes *SparkNodeAwsAttributes `json:"node_aws_attributes,omitempty"` // Globally unique identifier for this node. NodeId string `json:"node_id,omitempty"` // Private IP address (typically a 10.x.x.x address) of the Spark node. Note // that this is different from the private IP address of the host instance. PrivateIp string `json:"private_ip,omitempty"` // Public DNS address of this node. This address can be used to access the // Spark JDBC server on the driver node. To communicate with the JDBC // server, traffic must be manually authorized by adding security group // rules to the "worker-unmanaged" security group via the AWS console. // // Actually it's the public DNS address of the host instance. PublicDns string `json:"public_dns,omitempty"` // The timestamp (in millisecond) when the Spark node is launched. // // The start_timestamp is set right before the container is being launched. // The timestamp when the container is placed on the ResourceManager, before // its launch and setup by the NodeDaemon. This timestamp is the same as the // creation timestamp in the database. StartTimestamp int64 `json:"start_timestamp,omitempty"` }
type SparkNodeAwsAttributes ¶
type SparkNodeAwsAttributes struct { // Whether this node is on an Amazon spot instance. IsSpot bool `json:"is_spot,omitempty"` }
type SparkVersion ¶
type SparkVersion struct { // Spark version key, for example "2.1.x-scala2.11". This is the value which // should be provided as the "spark_version" when creating a new cluster. // Note that the exact Spark version may change over time for a "wildcard" // version (i.e., "2.1.x-scala2.11" is a "wildcard" version) with minor bug // fixes. Key string `json:"key,omitempty"` // A descriptive name for this Spark version, for example "Spark 2.1". Name string `json:"name,omitempty"` }
type SparkVersionRequest ¶
type SparkVersionRequest struct { Id string `json:"id,omitempty"` LongTermSupport bool `json:"long_term_support,omitempty" tf:"optional,default:false"` Beta bool `json:"beta,omitempty" tf:"optional,default:false,conflicts:long_term_support"` Latest bool `json:"latest,omitempty" tf:"optional,default:true"` ML bool `json:"ml,omitempty" tf:"optional,default:false"` Genomics bool `json:"genomics,omitempty" tf:"optional,default:false"` GPU bool `json:"gpu,omitempty" tf:"optional,default:false"` Scala string `json:"scala,omitempty" tf:"optional,default:2.12"` SparkVersion string `json:"spark_version,omitempty" tf:"optional,default:"` Photon bool `json:"photon,omitempty" tf:"optional,default:false"` Graviton bool `json:"graviton,omitempty"` }
SparkVersionRequest - filtering request
type StartCluster ¶
type StartCluster struct { // The cluster to be started. ClusterId string `json:"cluster_id"` }
type State ¶
type State string
Current state of the cluster.
const StateError State = `ERROR`
const StatePending State = `PENDING`
const StateResizing State = `RESIZING`
const StateRestarting State = `RESTARTING`
const StateRunning State = `RUNNING`
const StateTerminated State = `TERMINATED`
const StateTerminating State = `TERMINATING`
const StateUnknown State = `UNKNOWN`
type TerminationReason ¶
type TerminationReason struct { // status code indicating why the cluster was terminated Code TerminationReasonCode `json:"code,omitempty"` // list of parameters that provide additional information about why the // cluster was terminated Parameters map[string]string `json:"parameters,omitempty"` // type of the termination Type TerminationReasonType `json:"type,omitempty"` }
type TerminationReasonCode ¶
type TerminationReasonCode string
status code indicating why the cluster was terminated
const TerminationReasonCodeAbuseDetected TerminationReasonCode = `ABUSE_DETECTED`
const TerminationReasonCodeAttachProjectFailure TerminationReasonCode = `ATTACH_PROJECT_FAILURE`
const TerminationReasonCodeAwsAuthorizationFailure TerminationReasonCode = `AWS_AUTHORIZATION_FAILURE`
const TerminationReasonCodeAwsInsufficientFreeAddressesInSubnetFailure TerminationReasonCode = `AWS_INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET_FAILURE`
const TerminationReasonCodeAwsInsufficientInstanceCapacityFailure TerminationReasonCode = `AWS_INSUFFICIENT_INSTANCE_CAPACITY_FAILURE`
const TerminationReasonCodeAwsMaxSpotInstanceCountExceededFailure TerminationReasonCode = `AWS_MAX_SPOT_INSTANCE_COUNT_EXCEEDED_FAILURE`
const TerminationReasonCodeAwsRequestLimitExceeded TerminationReasonCode = `AWS_REQUEST_LIMIT_EXCEEDED`
const TerminationReasonCodeAwsUnsupportedFailure TerminationReasonCode = `AWS_UNSUPPORTED_FAILURE`
const TerminationReasonCodeAzureByokKeyPermissionFailure TerminationReasonCode = `AZURE_BYOK_KEY_PERMISSION_FAILURE`
const TerminationReasonCodeAzureEphemeralDiskFailure TerminationReasonCode = `AZURE_EPHEMERAL_DISK_FAILURE`
const TerminationReasonCodeAzureInvalidDeploymentTemplate TerminationReasonCode = `AZURE_INVALID_DEPLOYMENT_TEMPLATE`
const TerminationReasonCodeAzureOperationNotAllowedException TerminationReasonCode = `AZURE_OPERATION_NOT_ALLOWED_EXCEPTION`
const TerminationReasonCodeAzureQuotaExceededException TerminationReasonCode = `AZURE_QUOTA_EXCEEDED_EXCEPTION`
const TerminationReasonCodeAzureResourceManagerThrottling TerminationReasonCode = `AZURE_RESOURCE_MANAGER_THROTTLING`
const TerminationReasonCodeAzureResourceProviderThrottling TerminationReasonCode = `AZURE_RESOURCE_PROVIDER_THROTTLING`
const TerminationReasonCodeAzureUnexpectedDeploymentTemplateFailure TerminationReasonCode = `AZURE_UNEXPECTED_DEPLOYMENT_TEMPLATE_FAILURE`
const TerminationReasonCodeAzureVmExtensionFailure TerminationReasonCode = `AZURE_VM_EXTENSION_FAILURE`
const TerminationReasonCodeAzureVnetConfigurationFailure TerminationReasonCode = `AZURE_VNET_CONFIGURATION_FAILURE`
const TerminationReasonCodeBootstrapTimeout TerminationReasonCode = `BOOTSTRAP_TIMEOUT`
const TerminationReasonCodeBootstrapTimeoutCloudProviderException TerminationReasonCode = `BOOTSTRAP_TIMEOUT_CLOUD_PROVIDER_EXCEPTION`
const TerminationReasonCodeCloudProviderDiskSetupFailure TerminationReasonCode = `CLOUD_PROVIDER_DISK_SETUP_FAILURE`
const TerminationReasonCodeCloudProviderLaunchFailure TerminationReasonCode = `CLOUD_PROVIDER_LAUNCH_FAILURE`
const TerminationReasonCodeCloudProviderResourceStockout TerminationReasonCode = `CLOUD_PROVIDER_RESOURCE_STOCKOUT`
const TerminationReasonCodeCloudProviderShutdown TerminationReasonCode = `CLOUD_PROVIDER_SHUTDOWN`
const TerminationReasonCodeCommunicationLost TerminationReasonCode = `COMMUNICATION_LOST`
const TerminationReasonCodeContainerLaunchFailure TerminationReasonCode = `CONTAINER_LAUNCH_FAILURE`
const TerminationReasonCodeControlPlaneRequestFailure TerminationReasonCode = `CONTROL_PLANE_REQUEST_FAILURE`
const TerminationReasonCodeDatabaseConnectionFailure TerminationReasonCode = `DATABASE_CONNECTION_FAILURE`
const TerminationReasonCodeDbfsComponentUnhealthy TerminationReasonCode = `DBFS_COMPONENT_UNHEALTHY`
const TerminationReasonCodeDockerImagePullFailure TerminationReasonCode = `DOCKER_IMAGE_PULL_FAILURE`
const TerminationReasonCodeDriverUnreachable TerminationReasonCode = `DRIVER_UNREACHABLE`
const TerminationReasonCodeDriverUnresponsive TerminationReasonCode = `DRIVER_UNRESPONSIVE`
const TerminationReasonCodeExecutionComponentUnhealthy TerminationReasonCode = `EXECUTION_COMPONENT_UNHEALTHY`
const TerminationReasonCodeGcpQuotaExceeded TerminationReasonCode = `GCP_QUOTA_EXCEEDED`
const TerminationReasonCodeGcpServiceAccountDeleted TerminationReasonCode = `GCP_SERVICE_ACCOUNT_DELETED`
const TerminationReasonCodeGlobalInitScriptFailure TerminationReasonCode = `GLOBAL_INIT_SCRIPT_FAILURE`
const TerminationReasonCodeHiveMetastoreProvisioningFailure TerminationReasonCode = `HIVE_METASTORE_PROVISIONING_FAILURE`
const TerminationReasonCodeImagePullPermissionDenied TerminationReasonCode = `IMAGE_PULL_PERMISSION_DENIED`
const TerminationReasonCodeInactivity TerminationReasonCode = `INACTIVITY`
const TerminationReasonCodeInitScriptFailure TerminationReasonCode = `INIT_SCRIPT_FAILURE`
const TerminationReasonCodeInstancePoolClusterFailure TerminationReasonCode = `INSTANCE_POOL_CLUSTER_FAILURE`
const TerminationReasonCodeInstanceUnreachable TerminationReasonCode = `INSTANCE_UNREACHABLE`
const TerminationReasonCodeInternalError TerminationReasonCode = `INTERNAL_ERROR`
const TerminationReasonCodeInvalidArgument TerminationReasonCode = `INVALID_ARGUMENT`
const TerminationReasonCodeInvalidSparkImage TerminationReasonCode = `INVALID_SPARK_IMAGE`
const TerminationReasonCodeIpExhaustionFailure TerminationReasonCode = `IP_EXHAUSTION_FAILURE`
const TerminationReasonCodeJobFinished TerminationReasonCode = `JOB_FINISHED`
const TerminationReasonCodeKsAutoscalingFailure TerminationReasonCode = `K8S_AUTOSCALING_FAILURE`
const TerminationReasonCodeKsDbrClusterLaunchTimeout TerminationReasonCode = `K8S_DBR_CLUSTER_LAUNCH_TIMEOUT`
const TerminationReasonCodeMetastoreComponentUnhealthy TerminationReasonCode = `METASTORE_COMPONENT_UNHEALTHY`
const TerminationReasonCodeNephosResourceManagement TerminationReasonCode = `NEPHOS_RESOURCE_MANAGEMENT`
const TerminationReasonCodeNetworkConfigurationFailure TerminationReasonCode = `NETWORK_CONFIGURATION_FAILURE`
const TerminationReasonCodeNfsMountFailure TerminationReasonCode = `NFS_MOUNT_FAILURE`
const TerminationReasonCodeNpipTunnelSetupFailure TerminationReasonCode = `NPIP_TUNNEL_SETUP_FAILURE`
const TerminationReasonCodeNpipTunnelTokenFailure TerminationReasonCode = `NPIP_TUNNEL_TOKEN_FAILURE`
const TerminationReasonCodeRequestRejected TerminationReasonCode = `REQUEST_REJECTED`
const TerminationReasonCodeRequestThrottled TerminationReasonCode = `REQUEST_THROTTLED`
const TerminationReasonCodeSecretResolutionError TerminationReasonCode = `SECRET_RESOLUTION_ERROR`
const TerminationReasonCodeSecurityDaemonRegistrationException TerminationReasonCode = `SECURITY_DAEMON_REGISTRATION_EXCEPTION`
const TerminationReasonCodeSelfBootstrapFailure TerminationReasonCode = `SELF_BOOTSTRAP_FAILURE`
const TerminationReasonCodeSkippedSlowNodes TerminationReasonCode = `SKIPPED_SLOW_NODES`
const TerminationReasonCodeSlowImageDownload TerminationReasonCode = `SLOW_IMAGE_DOWNLOAD`
const TerminationReasonCodeSparkError TerminationReasonCode = `SPARK_ERROR`
const TerminationReasonCodeSparkImageDownloadFailure TerminationReasonCode = `SPARK_IMAGE_DOWNLOAD_FAILURE`
const TerminationReasonCodeSparkStartupFailure TerminationReasonCode = `SPARK_STARTUP_FAILURE`
const TerminationReasonCodeSpotInstanceTermination TerminationReasonCode = `SPOT_INSTANCE_TERMINATION`
const TerminationReasonCodeStorageDownloadFailure TerminationReasonCode = `STORAGE_DOWNLOAD_FAILURE`
const TerminationReasonCodeStsClientSetupFailure TerminationReasonCode = `STS_CLIENT_SETUP_FAILURE`
const TerminationReasonCodeSubnetExhaustedFailure TerminationReasonCode = `SUBNET_EXHAUSTED_FAILURE`
const TerminationReasonCodeTrialExpired TerminationReasonCode = `TRIAL_EXPIRED`
const TerminationReasonCodeUnexpectedLaunchFailure TerminationReasonCode = `UNEXPECTED_LAUNCH_FAILURE`
const TerminationReasonCodeUnknown TerminationReasonCode = `UNKNOWN`
const TerminationReasonCodeUnsupportedInstanceType TerminationReasonCode = `UNSUPPORTED_INSTANCE_TYPE`
const TerminationReasonCodeUpdateInstanceProfileFailure TerminationReasonCode = `UPDATE_INSTANCE_PROFILE_FAILURE`
const TerminationReasonCodeUserRequest TerminationReasonCode = `USER_REQUEST`
const TerminationReasonCodeWorkerSetupFailure TerminationReasonCode = `WORKER_SETUP_FAILURE`
const TerminationReasonCodeWorkspaceCancelledError TerminationReasonCode = `WORKSPACE_CANCELLED_ERROR`
const TerminationReasonCodeWorkspaceConfigurationError TerminationReasonCode = `WORKSPACE_CONFIGURATION_ERROR`
func (*TerminationReasonCode) Set ¶ added in v0.2.0
func (trc *TerminationReasonCode) Set(v string) error
Set raw string value and validate it against allowed values
func (*TerminationReasonCode) String ¶ added in v0.2.0
func (trc *TerminationReasonCode) String() string
String representation for fmt.Print
func (*TerminationReasonCode) Type ¶ added in v0.2.0
func (trc *TerminationReasonCode) Type() string
Type always returns TerminationReasonCode to satisfy [pflag.Value] interface
type TerminationReasonType ¶
type TerminationReasonType string
type of the termination
const TerminationReasonTypeClientError TerminationReasonType = `CLIENT_ERROR`
const TerminationReasonTypeCloudFailure TerminationReasonType = `CLOUD_FAILURE`
const TerminationReasonTypeServiceFault TerminationReasonType = `SERVICE_FAULT`
const TerminationReasonTypeSuccess TerminationReasonType = `SUCCESS`
func (*TerminationReasonType) Set ¶ added in v0.2.0
func (trt *TerminationReasonType) Set(v string) error
Set raw string value and validate it against allowed values
func (*TerminationReasonType) String ¶ added in v0.2.0
func (trt *TerminationReasonType) String() string
String representation for fmt.Print
func (*TerminationReasonType) Type ¶ added in v0.2.0
func (trt *TerminationReasonType) Type() string
Type always returns TerminationReasonType to satisfy [pflag.Value] interface
type UnpinCluster ¶
type UnpinCluster struct { // <needs content added> ClusterId string `json:"cluster_id"` }
type WorkloadType ¶
type WorkloadType struct { // defined what type of clients can use the cluster. E.g. Notebooks, Jobs Clients *ClientsTypes `json:"clients,omitempty"` }