Documentation
¶
Index ¶
- Variables
- func DataSourceWarehouse() *schema.Resource
- func DataSourceWarehouses() *schema.Resource
- func NewSqlGlobalConfigAPI(ctx context.Context, m any) globalConfigAPI
- func ResourceSqlAlert() *schema.Resource
- func ResourceSqlDashboard() *schema.Resource
- func ResourceSqlEndpoint() *schema.Resource
- func ResourceSqlGlobalConfig() *schema.Resource
- func ResourceSqlQuery() *schema.Resource
- func ResourceSqlVisualization() *schema.Resource
- func ResourceSqlWidget() *schema.Resource
- type AlertEntity
- type AlertOptions
- type DashboardAPI
- type DashboardEntity
- type DataSource
- type EndpointList
- type GlobalConfig
- type GlobalConfigForRead
- type OdbcParams
- type QueryAPI
- type QueryEntity
- type QueryParameter
- type QueryParameterAllowMultiple
- type QueryParameterDateLike
- type QueryParameterDateRangeLike
- type QueryParameterEnum
- type QueryParameterNumber
- type QueryParameterQuery
- type QueryParameterText
- type QuerySchedule
- type QueryScheduleContinuous
- type QueryScheduleDaily
- type QueryScheduleWeekly
- type ReleaseChannel
- type SQLEndpoint
- type SQLEndpointsAPI
- func (a SQLEndpointsAPI) Create(se *SQLEndpoint, timeout time.Duration) error
- func (a SQLEndpointsAPI) Delete(endpointID string) error
- func (a SQLEndpointsAPI) Edit(se SQLEndpoint) error
- func (a SQLEndpointsAPI) Get(endpointID string) (se SQLEndpoint, err error)
- func (a SQLEndpointsAPI) List() (lst EndpointList, err error)
- func (a SQLEndpointsAPI) ResolveDataSourceID(endpointID string) (dataSourceID string, err error)
- func (a SQLEndpointsAPI) Start(endpointID string, timeout time.Duration) error
- func (a SQLEndpointsAPI) Stop(endpointID string) error
- type Tag
- type Tags
- type VisualizationAPI
- func (a VisualizationAPI) Create(v *api.Visualization) error
- func (a VisualizationAPI) Delete(visualizationID string) error
- func (a VisualizationAPI) Read(queryID, visualizationID string) (*api.Visualization, error)
- func (a VisualizationAPI) Update(visualizationID string, v *api.Visualization) error
- type VisualizationEntity
- type WidgetAPI
- type WidgetEntity
- type WidgetParameter
- type WidgetPosition
Constants ¶
This section is empty.
Variables ¶
var ( ClusterSizes = []string{"2X-Small", "X-Small", "Small", "Medium", "Large", "X-Large", "2X-Large", "3X-Large", "4X-Large"} MaxNumClusters = 30 )
ClusterSizes for SQL endpoints
var (
GlobalSqlConfigResourceID = "global"
)
Functions ¶
func DataSourceWarehouse ¶ added in v1.1.0
func DataSourceWarehouses ¶ added in v1.1.0
func NewSqlGlobalConfigAPI ¶
func ResourceSqlAlert ¶ added in v1.13.0
func ResourceSqlDashboard ¶
func ResourceSqlEndpoint ¶
func ResourceSqlGlobalConfig ¶
func ResourceSqlQuery ¶
func ResourceSqlWidget ¶
Types ¶
type AlertEntity ¶ added in v1.13.0
type AlertEntity struct {
Name string `json:"name"`
QueryId string `json:"query_id"`
Rearm int `json:"rearm,omitempty"`
Options *AlertOptions `json:"options"`
Parent string `json:"parent,omitempty" tf:"suppress_diff,force_new"`
CreatedAt string `json:"created_at,omitempty" tf:"computed"`
UpdatedAt string `json:"updated_at,omitempty" tf:"computed"`
}
type AlertOptions ¶ added in v1.13.0
type AlertOptions struct {
Column string `json:"column"`
Op string `json:"op"`
Value string `json:"value"`
Muted bool `json:"muted,omitempty"`
CustomBody string `json:"custom_body,omitempty"`
CustomSubject string `json:"custom_subject,omitempty"`
EmptyResultState string `json:"empty_result_state,omitempty"`
}
type DashboardAPI ¶
type DashboardAPI struct {
// contains filtered or unexported fields
}
DashboardAPI ...
func NewDashboardAPI ¶
func NewDashboardAPI(ctx context.Context, m any) DashboardAPI
NewDashboardAPI ...
type DashboardEntity ¶
type DashboardEntity struct {
Name string `json:"name"`
Tags []string `json:"tags,omitempty"`
Parent string `json:"parent,omitempty" tf:"suppress_diff,force_new"`
CreatedAt string `json:"created_at,omitempty" tf:"computed"`
UpdatedAt string `json:"updated_at,omitempty" tf:"computed"`
RunAsRole string `json:"run_as_role,omitempty" tf:"suppress_diff"`
DashboardFiltersEnabled bool `json:"dashboard_filters_enabled,omitempty"`
}
DashboardEntity defines the parameters that can be set in the resource.
type DataSource ¶
type DataSource struct {
ID string `json:"id"`
EndpointID string `json:"endpoint_id"`
Name string `json:"name"`
}
DataSource
Note: this object returns more fields than contained in this struct, but we only list the ones that are in use here.
type EndpointList ¶
type EndpointList struct {
Endpoints []SQLEndpoint `json:"warehouses"`
}
endpointList ...
type GlobalConfig ¶
type GlobalConfig struct {
SecurityPolicy string `json:"security_policy,omitempty" tf:"default:DATA_ACCESS_CONTROL"`
DataAccessConfig map[string]string `json:"data_access_config,omitempty"`
InstanceProfileARN string `json:"instance_profile_arn,omitempty"`
GoogleServiceAccount string `json:"google_service_account,omitempty"`
EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty" tf:"default:false"`
SqlConfigParams map[string]string `json:"sql_config_params,omitempty"`
}
GlobalConfig used to generate Terraform resource schema and bind to resource data
type GlobalConfigForRead ¶
type GlobalConfigForRead struct {
SecurityPolicy string `json:"security_policy"`
DataAccessConfig []confPair `json:"data_access_config"`
InstanceProfileARN string `json:"instance_profile_arn,omitempty"`
GoogleServiceAccount string `json:"google_service_account,omitempty"`
EnableServerlessCompute bool `json:"enable_serverless_compute"`
SqlConfigurationParameters *repeatedEndpointConfPairs `json:"sql_configuration_parameters,omitempty"`
}
GlobalConfigForRead used to talk to REST API
type OdbcParams ¶
type OdbcParams struct {
Hostname string `json:"hostname,omitempty"`
Path string `json:"path"`
Protocol string `json:"protocol"`
Port int32 `json:"port"`
// TODO: eventually remove this column,
// as it doesn't seem to be populated
Host string `json:"host,omitempty"`
}
OdbcParams hold information required to submit SQL commands to the SQL endpoint using ODBC.
type QueryEntity ¶
type QueryEntity struct {
DataSourceID string `json:"data_source_id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Query string `json:"query"`
// Deprecated: Use databricks_job resource to schedule a Query
Schedule *QuerySchedule `json:"schedule,omitempty"`
Tags []string `json:"tags,omitempty"`
Parameter []QueryParameter `json:"parameter,omitempty"`
RunAsRole string `json:"run_as_role,omitempty" tf:"suppress_diff"`
Parent string `json:"parent,omitempty" tf:"suppress_diff,force_new"`
CreatedAt string `json:"created_at,omitempty" tf:"computed"`
UpdatedAt string `json:"updated_at,omitempty" tf:"computed"`
}
QueryEntity defines the parameters that can be set in the resource.
type QueryParameter ¶
type QueryParameter struct {
Name string `json:"name"`
Title string `json:"title,omitempty"`
// Type specific structs.
// Only one of them may be set.
Text *QueryParameterText `json:"text,omitempty"`
Number *QueryParameterNumber `json:"number,omitempty"`
Enum *QueryParameterEnum `json:"enum,omitempty"`
Query *QueryParameterQuery `json:"query,omitempty"`
Date *QueryParameterDateLike `json:"date,omitempty"`
DateTime *QueryParameterDateLike `json:"datetime,omitempty"`
DateTimeSec *QueryParameterDateLike `json:"datetimesec,omitempty"`
DateRange *QueryParameterDateRangeLike `json:"date_range,omitempty"`
DateTimeRange *QueryParameterDateRangeLike `json:"datetime_range,omitempty"`
DateTimeSecRange *QueryParameterDateRangeLike `json:"datetimesec_range,omitempty"`
}
QueryParameter ...
type QueryParameterAllowMultiple ¶
type QueryParameterAllowMultiple struct {
Prefix string `json:"prefix,omitempty"`
Suffix string `json:"suffix,omitempty"`
Separator string `json:"separator"`
}
QueryParameterAllowMultiple ...
type QueryParameterDateLike ¶
type QueryParameterDateLike struct {
Value string `json:"value"`
}
QueryParameterDateLike ...
type QueryParameterDateRangeLike ¶
type QueryParameterDateRangeLike struct {
Value string `json:"value,omitempty"`
Range *api.DateTimeRange `json:"range,omitempty"`
}
QueryParameterDateRangeLike ...
type QueryParameterEnum ¶
type QueryParameterEnum struct {
// Value iff `multiple == nil`
Value string `json:"value,omitempty"`
// Values iff `multiple != nil`
Values []string `json:"values,omitempty"`
Options []string `json:"options"`
Multiple *QueryParameterAllowMultiple `json:"multiple,omitempty"`
}
QueryParameterEnum ...
type QueryParameterNumber ¶
type QueryParameterNumber struct {
Value float64 `json:"value"`
}
QueryParameterNumber ...
type QueryParameterQuery ¶
type QueryParameterQuery struct {
// Value iff `multiple == nil`
Value string `json:"value,omitempty"`
// Values iff `multiple != nil`
Values []string `json:"values,omitempty"`
QueryID string `json:"query_id"`
Multiple *QueryParameterAllowMultiple `json:"multiple,omitempty"`
}
QueryParameterQuery ...
type QueryParameterText ¶
type QueryParameterText struct {
Value string `json:"value"`
}
QueryParameterText ...
type QuerySchedule ¶
type QuerySchedule struct {
Continuous *QueryScheduleContinuous `json:"continuous,omitempty"`
Daily *QueryScheduleDaily `json:"daily,omitempty"`
Weekly *QueryScheduleWeekly `json:"weekly,omitempty"`
}
QuerySchedule ... Deprecated: Use databricks_job resource to schedule a Query
type QueryScheduleContinuous ¶
type QueryScheduleContinuous struct {
IntervalSeconds int `json:"interval_seconds"`
UntilDate string `json:"until_date,omitempty"`
}
QueryScheduleContinuous ... Deprecated: Use databricks_job resource to schedule a Query
type QueryScheduleDaily ¶
type QueryScheduleDaily struct {
IntervalDays int `json:"interval_days"`
TimeOfDay string `json:"time_of_day"`
UntilDate string `json:"until_date,omitempty"`
}
QueryScheduleDaily ... Deprecated: Use databricks_job resource to schedule a Query
type QueryScheduleWeekly ¶
type QueryScheduleWeekly struct {
IntervalWeeks int `json:"interval_weeks"`
DayOfWeek string `json:"day_of_week"`
TimeOfDay string `json:"time_of_day"`
UntilDate string `json:"until_date,omitempty"`
}
QueryScheduleWeekly ... Deprecated: Use databricks_job resource to schedule a Query
type ReleaseChannel ¶
type ReleaseChannel struct {
Name string `json:"name,omitempty" tf:"default:CHANNEL_NAME_CURRENT"`
}
ReleaseChannel holds information about DBSQL Release Channel
type SQLEndpoint ¶
type SQLEndpoint struct {
ID string `json:"id,omitempty" tf:"computed"`
Name string `json:"name"`
ClusterSize string `json:"cluster_size"`
AutoStopMinutes int `json:"auto_stop_mins" tf:"optional,default:120"`
MinNumClusters int `json:"min_num_clusters,omitempty" tf:"suppress_diff"`
MaxNumClusters int `json:"max_num_clusters,omitempty" tf:"default:1"`
NumClusters int `json:"num_clusters,omitempty" tf:"suppress_diff"`
EnablePhoton bool `json:"enable_photon" tf:"optional,default:true"`
EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty" tf:"suppress_diff"`
InstanceProfileARN string `json:"instance_profile_arn,omitempty"`
State string `json:"state,omitempty" tf:"computed"`
JdbcURL string `json:"jdbc_url,omitempty" tf:"computed"`
OdbcParams *OdbcParams `json:"odbc_params,omitempty" tf:"computed"`
Tags *Tags `json:"tags,omitempty" tf:"suppress_diff"`
SpotInstancePolicy string `json:"spot_instance_policy,omitempty" tf:"default:COST_OPTIMIZED"`
Channel *ReleaseChannel `json:"channel,omitempty" tf:"suppress_diff"`
WarehouseType string `json:"warehouse_type,omitempty" tf:"suppress_diff"`
// The data source ID is not part of the endpoint API response.
// We manually resolve it by retrieving the list of data sources
// and matching this entity's endpoint ID.
DataSourceID string `json:"data_source_id,omitempty" tf:"computed"`
}
SQLEndpoint ...
type SQLEndpointsAPI ¶
type SQLEndpointsAPI struct {
// contains filtered or unexported fields
}
SQLEndpointsAPI ...
func NewSQLEndpointsAPI ¶
func NewSQLEndpointsAPI(ctx context.Context, m any) SQLEndpointsAPI
NewSQLEndpointsAPI ...
func (SQLEndpointsAPI) Create ¶
func (a SQLEndpointsAPI) Create(se *SQLEndpoint, timeout time.Duration) error
Create ...
func (SQLEndpointsAPI) Get ¶
func (a SQLEndpointsAPI) Get(endpointID string) (se SQLEndpoint, err error)
Get ...
func (SQLEndpointsAPI) List ¶
func (a SQLEndpointsAPI) List() (lst EndpointList, err error)
List all SQL endpoints
func (SQLEndpointsAPI) ResolveDataSourceID ¶
func (a SQLEndpointsAPI) ResolveDataSourceID(endpointID string) (dataSourceID string, err error)
ResolveDataSourceID ...
type VisualizationAPI ¶
type VisualizationAPI struct {
// contains filtered or unexported fields
}
VisualizationAPI ...
func NewVisualizationAPI ¶
func NewVisualizationAPI(ctx context.Context, m any) VisualizationAPI
NewVisualizationAPI ...
func (VisualizationAPI) Create ¶
func (a VisualizationAPI) Create(v *api.Visualization) error
Create ...
func (VisualizationAPI) Delete ¶
func (a VisualizationAPI) Delete(visualizationID string) error
Delete ...
func (VisualizationAPI) Read ¶
func (a VisualizationAPI) Read(queryID, visualizationID string) (*api.Visualization, error)
Read ...
func (VisualizationAPI) Update ¶
func (a VisualizationAPI) Update(visualizationID string, v *api.Visualization) error
Update ...
type VisualizationEntity ¶
type VisualizationEntity struct {
QueryID string `json:"query_id" tf:"force_new"`
VisualizationID string `json:"visualization_id,omitempty" tf:"computed,force_new"`
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Options string `json:"options"`
QueryPlan string `json:"query_plan,omitempty"`
}
VisualizationEntity defines the parameters that can be set in the resource.
type WidgetAPI ¶
type WidgetAPI struct {
// contains filtered or unexported fields
}
WidgetAPI ...
type WidgetEntity ¶
type WidgetEntity struct {
DashboardID string `json:"dashboard_id" tf:"force_new"`
WidgetID string `json:"widget_id,omitempty" tf:"computed,force_new"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Text string `json:"text,omitempty"`
VisualizationID string `json:"visualization_id,omitempty" tf:"force_new"`
Position *WidgetPosition `json:"position,omitempty"`
Parameter []WidgetParameter `json:"parameter,omitempty" tf:"slice_set"`
}
WidgetEntity defines the parameters that can be set in the resource.
type WidgetParameter ¶
type WidgetParameter struct {
Name string `json:"name"`
Type string `json:"type"`
MapTo string `json:"map_to,omitempty"`
Title string `json:"title,omitempty"`
// Mutually exclusive.
Value string `json:"value,omitempty"`
Values []string `json:"values,omitempty"`
}
WidgetParameter ...