sql

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClusterSizes   = []string{"2X-Small", "X-Small", "Small", "Medium", "Large", "X-Large", "2X-Large", "3X-Large", "4X-Large"}
	MaxNumClusters = 30
)

ClusterSizes for SQL endpoints

View Source
var (
	GlobalSqlConfigResourceID = "global"
)

Functions

func DataSourceWarehouse added in v1.1.0

func DataSourceWarehouse() common.Resource

func DataSourceWarehouses added in v1.1.0

func DataSourceWarehouses() common.Resource

func NewSqlGlobalConfigAPI

func NewSqlGlobalConfigAPI(ctx context.Context, m any) globalConfigAPI

func ResourceSqlAlert added in v1.13.0

func ResourceSqlAlert() common.Resource

func ResourceSqlDashboard

func ResourceSqlDashboard() common.Resource

func ResourceSqlEndpoint

func ResourceSqlEndpoint() common.Resource

func ResourceSqlGlobalConfig

func ResourceSqlGlobalConfig() common.Resource

func ResourceSqlQuery

func ResourceSqlQuery() common.Resource

func ResourceSqlVisualization

func ResourceSqlVisualization() common.Resource

func ResourceSqlWidget

func ResourceSqlWidget() common.Resource

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

func (DashboardAPI) Create

func (a DashboardAPI) Create(d *api.Dashboard) error

Create ...

func (DashboardAPI) Delete

func (a DashboardAPI) Delete(dashboardID string) error

Delete ...

func (DashboardAPI) Read

func (a DashboardAPI) Read(dashboardID string) (*api.Dashboard, error)

Read ...

func (DashboardAPI) Update

func (a DashboardAPI) Update(dashboardID string, d *api.Dashboard) error

Update ...

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 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:"computed"`
	SqlConfigParams         map[string]string `json:"sql_config_params,omitempty"`
	ForceSendFields         []string          `json:"-"`
}

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,omitempty"`
	SqlConfigurationParameters *repeatedEndpointConfPairs `json:"sql_configuration_parameters,omitempty"`
	ForceSendFields            []string                   `json:"-"`
}

GlobalConfigForRead used to talk to REST API

func (GlobalConfigForRead) MarshalJSON added in v1.38.0

func (g GlobalConfigForRead) MarshalJSON() ([]byte, error)

func (*GlobalConfigForRead) UnmarshalJSON added in v1.38.0

func (g *GlobalConfigForRead) UnmarshalJSON(bs []byte) error

type QueryAPI

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

QueryAPI ...

func NewQueryAPI

func NewQueryAPI(ctx context.Context, m any) QueryAPI

NewQueryAPI ...

func (QueryAPI) Create

func (a QueryAPI) Create(q *api.Query) error

Create ...

func (QueryAPI) Delete

func (a QueryAPI) Delete(queryID string) error

Delete ...

func (QueryAPI) Read

func (a QueryAPI) Read(queryID string) (*api.Query, error)

Read ...

func (QueryAPI) Update

func (a QueryAPI) Update(queryID string, q *api.Query) error

Update ...

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 SqlWarehouse added in v1.34.0

type SqlWarehouse struct {
	sql.GetWarehouseResponse

	// 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"`
}

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

func NewWidgetAPI

func NewWidgetAPI(ctx context.Context, m any) WidgetAPI

NewWidgetAPI ...

func (WidgetAPI) Create

func (a WidgetAPI) Create(w *api.Widget) error

Create ...

func (WidgetAPI) Delete

func (a WidgetAPI) Delete(widgetID string) error

Delete ...

func (WidgetAPI) Read

func (a WidgetAPI) Read(dashboardID, widgetID string) (*api.Widget, error)

Read ...

func (WidgetAPI) Update

func (a WidgetAPI) Update(widgetID string, w *api.Widget) error

Update ...

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

type WidgetPosition

type WidgetPosition struct {
	SizeX      int  `json:"size_x"`
	SizeY      int  `json:"size_y"`
	PosX       int  `json:"pos_x" tf:"optional,default:0"`
	PosY       int  `json:"pos_y" tf:"optional,default:0"`
	AutoHeight bool `json:"auto_height,omitempty"`
}

WidgetPosition ...

Directories

Path Synopsis
Package api contains API structures for use with the Databricks SQL API.
Package api contains API structures for use with the Databricks SQL API.

Jump to

Keyboard shortcuts

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