apps

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 7

Documentation

Overview

Apps run directly on a customer’s Databricks instance, integrate with their data, use and extend Databricks services, and enable users to interact through single sign-on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// The active deployment of the app.
	ActiveDeployment *AppDeployment `json:"active_deployment,omitempty"`

	AppStatus *ApplicationStatus `json:"app_status,omitempty"`

	ComputeStatus *ComputeStatus `json:"compute_status,omitempty"`
	// The creation time of the app. Formatted timestamp in ISO 6801.
	CreateTime string `json:"create_time,omitempty"`
	// The email of the user that created the app.
	Creator string `json:"creator,omitempty"`
	// The default workspace file system path of the source code from which app
	// deployment are created. This field tracks the workspace source code path
	// of the last active deployment.
	DefaultSourceCodePath string `json:"default_source_code_path,omitempty"`
	// The description of the app.
	Description string `json:"description,omitempty"`
	// The name of the app. The name must contain only lowercase alphanumeric
	// characters and hyphens. It must be unique within the workspace.
	Name string `json:"name"`
	// The pending deployment of the app.
	PendingDeployment *AppDeployment `json:"pending_deployment,omitempty"`
	// Resources for the app.
	Resources []AppResource `json:"resources,omitempty"`

	ServicePrincipalId int64 `json:"service_principal_id,omitempty"`

	ServicePrincipalName string `json:"service_principal_name,omitempty"`
	// The update time of the app. Formatted timestamp in ISO 6801.
	UpdateTime string `json:"update_time,omitempty"`
	// The email of the user that last updated the app.
	Updater string `json:"updater,omitempty"`
	// The URL of the app once it is deployed.
	Url string `json:"url,omitempty"`

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

func (App) MarshalJSON

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

func (*App) UnmarshalJSON

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

type AppAccessControlRequest

type AppAccessControlRequest struct {
	// name of the group
	GroupName string `json:"group_name,omitempty"`
	// Permission level
	PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"`
	// application ID of a service principal
	ServicePrincipalName string `json:"service_principal_name,omitempty"`
	// name of the user
	UserName string `json:"user_name,omitempty"`

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

func (AppAccessControlRequest) MarshalJSON

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

func (*AppAccessControlRequest) UnmarshalJSON

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

type AppAccessControlResponse

type AppAccessControlResponse struct {
	// All permissions.
	AllPermissions []AppPermission `json:"all_permissions,omitempty"`
	// Display name of the user or service principal.
	DisplayName string `json:"display_name,omitempty"`
	// name of the group
	GroupName string `json:"group_name,omitempty"`
	// Name of the service principal.
	ServicePrincipalName string `json:"service_principal_name,omitempty"`
	// name of the user
	UserName string `json:"user_name,omitempty"`

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

func (AppAccessControlResponse) MarshalJSON

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

func (*AppAccessControlResponse) UnmarshalJSON

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

type AppDeployment

type AppDeployment struct {
	// The creation time of the deployment. Formatted timestamp in ISO 6801.
	CreateTime string `json:"create_time,omitempty"`
	// The email of the user creates the deployment.
	Creator string `json:"creator,omitempty"`
	// The deployment artifacts for an app.
	DeploymentArtifacts *AppDeploymentArtifacts `json:"deployment_artifacts,omitempty"`
	// The unique id of the deployment.
	DeploymentId string `json:"deployment_id,omitempty"`
	// The mode of which the deployment will manage the source code.
	Mode AppDeploymentMode `json:"mode,omitempty"`
	// The workspace file system path of the source code used to create the app
	// deployment. This is different from
	// `deployment_artifacts.source_code_path`, which is the path used by the
	// deployed app. The former refers to the original source code location of
	// the app in the workspace during deployment creation, whereas the latter
	// provides a system generated stable snapshotted source code path used by
	// the deployment.
	SourceCodePath string `json:"source_code_path,omitempty"`
	// Status and status message of the deployment
	Status *AppDeploymentStatus `json:"status,omitempty"`
	// The update time of the deployment. Formatted timestamp in ISO 6801.
	UpdateTime string `json:"update_time,omitempty"`

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

func (AppDeployment) MarshalJSON

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

func (*AppDeployment) UnmarshalJSON

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

type AppDeploymentArtifacts

type AppDeploymentArtifacts struct {
	// The snapshotted workspace file system path of the source code loaded by
	// the deployed app.
	SourceCodePath string `json:"source_code_path,omitempty"`

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

func (AppDeploymentArtifacts) MarshalJSON

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

func (*AppDeploymentArtifacts) UnmarshalJSON

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

type AppDeploymentMode

type AppDeploymentMode string
const AppDeploymentModeAutoSync AppDeploymentMode = `AUTO_SYNC`
const AppDeploymentModeSnapshot AppDeploymentMode = `SNAPSHOT`

func (*AppDeploymentMode) Set

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

Set raw string value and validate it against allowed values

func (*AppDeploymentMode) String

func (f *AppDeploymentMode) String() string

String representation for fmt.Print

func (*AppDeploymentMode) Type

func (f *AppDeploymentMode) Type() string

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

type AppDeploymentState

type AppDeploymentState string
const AppDeploymentStateCancelled AppDeploymentState = `CANCELLED`
const AppDeploymentStateFailed AppDeploymentState = `FAILED`
const AppDeploymentStateInProgress AppDeploymentState = `IN_PROGRESS`
const AppDeploymentStateSucceeded AppDeploymentState = `SUCCEEDED`

func (*AppDeploymentState) Set

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

Set raw string value and validate it against allowed values

func (*AppDeploymentState) String

func (f *AppDeploymentState) String() string

String representation for fmt.Print

func (*AppDeploymentState) Type

func (f *AppDeploymentState) Type() string

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

type AppDeploymentStatus

type AppDeploymentStatus struct {
	// Message corresponding with the deployment state.
	Message string `json:"message,omitempty"`
	// State of the deployment.
	State AppDeploymentState `json:"state,omitempty"`

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

func (AppDeploymentStatus) MarshalJSON

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

func (*AppDeploymentStatus) UnmarshalJSON

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

type AppPermission

type AppPermission struct {
	Inherited bool `json:"inherited,omitempty"`

	InheritedFromObject []string `json:"inherited_from_object,omitempty"`
	// Permission level
	PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"`

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

func (AppPermission) MarshalJSON

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

func (*AppPermission) UnmarshalJSON

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

type AppPermissionLevel

type AppPermissionLevel string

Permission level

const AppPermissionLevelCanManage AppPermissionLevel = `CAN_MANAGE`
const AppPermissionLevelCanUse AppPermissionLevel = `CAN_USE`

func (*AppPermissionLevel) Set

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

Set raw string value and validate it against allowed values

func (*AppPermissionLevel) String

func (f *AppPermissionLevel) String() string

String representation for fmt.Print

func (*AppPermissionLevel) Type

func (f *AppPermissionLevel) Type() string

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

type AppPermissions

type AppPermissions struct {
	AccessControlList []AppAccessControlResponse `json:"access_control_list,omitempty"`

	ObjectId string `json:"object_id,omitempty"`

	ObjectType string `json:"object_type,omitempty"`

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

func (AppPermissions) MarshalJSON

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

func (*AppPermissions) UnmarshalJSON

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

type AppPermissionsDescription

type AppPermissionsDescription struct {
	Description string `json:"description,omitempty"`
	// Permission level
	PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"`

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

func (AppPermissionsDescription) MarshalJSON

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

func (*AppPermissionsDescription) UnmarshalJSON

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

type AppPermissionsRequest

type AppPermissionsRequest struct {
	AccessControlList []AppAccessControlRequest `json:"access_control_list,omitempty"`
	// The app for which to get or manage permissions.
	AppName string `json:"-" url:"-"`
}

type AppResource added in v0.48.0

type AppResource struct {
	// Description of the App Resource.
	Description string `json:"description,omitempty"`

	Job *AppResourceJob `json:"job,omitempty"`
	// Name of the App Resource.
	Name string `json:"name"`

	Secret *AppResourceSecret `json:"secret,omitempty"`

	ServingEndpoint *AppResourceServingEndpoint `json:"serving_endpoint,omitempty"`

	SqlWarehouse *AppResourceSqlWarehouse `json:"sql_warehouse,omitempty"`

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

func (AppResource) MarshalJSON added in v0.48.0

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

func (*AppResource) UnmarshalJSON added in v0.48.0

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

type AppResourceJob added in v0.48.0

type AppResourceJob struct {
	// Id of the job to grant permission on.
	Id string `json:"id"`
	// Permissions to grant on the Job. Supported permissions are: "CAN_MANAGE",
	// "IS_OWNER", "CAN_MANAGE_RUN", "CAN_VIEW".
	Permission AppResourceJobJobPermission `json:"permission"`
}

type AppResourceJobJobPermission added in v0.48.0

type AppResourceJobJobPermission string
const AppResourceJobJobPermissionCanManage AppResourceJobJobPermission = `CAN_MANAGE`
const AppResourceJobJobPermissionCanManageRun AppResourceJobJobPermission = `CAN_MANAGE_RUN`
const AppResourceJobJobPermissionCanView AppResourceJobJobPermission = `CAN_VIEW`
const AppResourceJobJobPermissionIsOwner AppResourceJobJobPermission = `IS_OWNER`

func (*AppResourceJobJobPermission) Set added in v0.48.0

Set raw string value and validate it against allowed values

func (*AppResourceJobJobPermission) String added in v0.48.0

func (f *AppResourceJobJobPermission) String() string

String representation for fmt.Print

func (*AppResourceJobJobPermission) Type added in v0.48.0

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

type AppResourceSecret added in v0.48.0

type AppResourceSecret struct {
	// Key of the secret to grant permission on.
	Key string `json:"key"`
	// Permission to grant on the secret scope. For secrets, only one permission
	// is allowed. Permission must be one of: "READ", "WRITE", "MANAGE".
	Permission AppResourceSecretSecretPermission `json:"permission"`
	// Scope of the secret to grant permission on.
	Scope string `json:"scope"`
}

type AppResourceSecretSecretPermission added in v0.48.0

type AppResourceSecretSecretPermission string

Permission to grant on the secret scope. Supported permissions are: "READ", "WRITE", "MANAGE".

const AppResourceSecretSecretPermissionManage AppResourceSecretSecretPermission = `MANAGE`
const AppResourceSecretSecretPermissionRead AppResourceSecretSecretPermission = `READ`
const AppResourceSecretSecretPermissionWrite AppResourceSecretSecretPermission = `WRITE`

func (*AppResourceSecretSecretPermission) Set added in v0.48.0

Set raw string value and validate it against allowed values

func (*AppResourceSecretSecretPermission) String added in v0.48.0

String representation for fmt.Print

func (*AppResourceSecretSecretPermission) Type added in v0.48.0

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

type AppResourceServingEndpoint added in v0.48.0

type AppResourceServingEndpoint struct {
	// Name of the serving endpoint to grant permission on.
	Name string `json:"name"`
	// Permission to grant on the serving endpoint. Supported permissions are:
	// "CAN_MANAGE", "CAN_QUERY", "CAN_VIEW".
	Permission AppResourceServingEndpointServingEndpointPermission `json:"permission"`
}

type AppResourceServingEndpointServingEndpointPermission added in v0.48.0

type AppResourceServingEndpointServingEndpointPermission string
const AppResourceServingEndpointServingEndpointPermissionCanManage AppResourceServingEndpointServingEndpointPermission = `CAN_MANAGE`
const AppResourceServingEndpointServingEndpointPermissionCanQuery AppResourceServingEndpointServingEndpointPermission = `CAN_QUERY`
const AppResourceServingEndpointServingEndpointPermissionCanView AppResourceServingEndpointServingEndpointPermission = `CAN_VIEW`

func (*AppResourceServingEndpointServingEndpointPermission) Set added in v0.48.0

Set raw string value and validate it against allowed values

func (*AppResourceServingEndpointServingEndpointPermission) String added in v0.48.0

String representation for fmt.Print

func (*AppResourceServingEndpointServingEndpointPermission) Type added in v0.48.0

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

type AppResourceSqlWarehouse added in v0.48.0

type AppResourceSqlWarehouse struct {
	// Id of the SQL warehouse to grant permission on.
	Id string `json:"id"`
	// Permission to grant on the SQL warehouse. Supported permissions are:
	// "CAN_MANAGE", "CAN_USE", "IS_OWNER".
	Permission AppResourceSqlWarehouseSqlWarehousePermission `json:"permission"`
}

type AppResourceSqlWarehouseSqlWarehousePermission added in v0.48.0

type AppResourceSqlWarehouseSqlWarehousePermission string
const AppResourceSqlWarehouseSqlWarehousePermissionCanManage AppResourceSqlWarehouseSqlWarehousePermission = `CAN_MANAGE`
const AppResourceSqlWarehouseSqlWarehousePermissionCanUse AppResourceSqlWarehouseSqlWarehousePermission = `CAN_USE`
const AppResourceSqlWarehouseSqlWarehousePermissionIsOwner AppResourceSqlWarehouseSqlWarehousePermission = `IS_OWNER`

func (*AppResourceSqlWarehouseSqlWarehousePermission) Set added in v0.48.0

Set raw string value and validate it against allowed values

func (*AppResourceSqlWarehouseSqlWarehousePermission) String added in v0.48.0

String representation for fmt.Print

func (*AppResourceSqlWarehouseSqlWarehousePermission) Type added in v0.48.0

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

type ApplicationState added in v0.47.0

type ApplicationState string
const ApplicationStateCrashed ApplicationState = `CRASHED`
const ApplicationStateDeploying ApplicationState = `DEPLOYING`
const ApplicationStateRunning ApplicationState = `RUNNING`
const ApplicationStateUnavailable ApplicationState = `UNAVAILABLE`

func (*ApplicationState) Set added in v0.47.0

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

Set raw string value and validate it against allowed values

func (*ApplicationState) String added in v0.47.0

func (f *ApplicationState) String() string

String representation for fmt.Print

func (*ApplicationState) Type added in v0.47.0

func (f *ApplicationState) Type() string

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

type ApplicationStatus added in v0.47.0

type ApplicationStatus struct {
	// Application status message
	Message string `json:"message,omitempty"`
	// State of the application.
	State ApplicationState `json:"state,omitempty"`

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

func (ApplicationStatus) MarshalJSON added in v0.47.0

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

func (*ApplicationStatus) UnmarshalJSON added in v0.47.0

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

type AppsAPI

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

Apps run directly on a customer’s Databricks instance, integrate with their data, use and extend Databricks services, and enable users to interact through single sign-on.

func NewApps

func NewApps(client *client.DatabricksClient) *AppsAPI

func (*AppsAPI) Create

func (a *AppsAPI) Create(ctx context.Context, createAppRequest CreateAppRequest) (*WaitGetAppActive[App], error)

Create an app.

Creates a new app.

func (*AppsAPI) CreateAndWait deprecated

func (a *AppsAPI) CreateAndWait(ctx context.Context, createAppRequest CreateAppRequest, options ...retries.Option[App]) (*App, error)

Calls AppsAPI.Create and waits to reach ACTIVE state

You can override the default timeout of 20 minutes by calling adding retries.Timeout[App](60*time.Minute) functional option.

Deprecated: use AppsAPI.Create.Get() or AppsAPI.WaitGetAppActive

func (*AppsAPI) Delete

func (a *AppsAPI) Delete(ctx context.Context, request DeleteAppRequest) (*App, error)

func (*AppsAPI) DeleteByName

func (a *AppsAPI) DeleteByName(ctx context.Context, name string) (*App, error)

Delete an app.

Deletes an app.

func (*AppsAPI) Deploy

func (a *AppsAPI) Deploy(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest) (*WaitGetDeploymentAppSucceeded[AppDeployment], error)

Create an app deployment.

Creates an app deployment for the app with the supplied name.

func (*AppsAPI) DeployAndWait deprecated

func (a *AppsAPI) DeployAndWait(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest, options ...retries.Option[AppDeployment]) (*AppDeployment, error)

Calls AppsAPI.Deploy and waits to reach SUCCEEDED state

You can override the default timeout of 20 minutes by calling adding retries.Timeout[AppDeployment](60*time.Minute) functional option.

Deprecated: use AppsAPI.Deploy.Get() or AppsAPI.WaitGetDeploymentAppSucceeded

func (*AppsAPI) Get

func (a *AppsAPI) Get(ctx context.Context, request GetAppRequest) (*App, error)

func (*AppsAPI) GetByName

func (a *AppsAPI) GetByName(ctx context.Context, name string) (*App, error)

Get an app.

Retrieves information for the app with the supplied name.

func (*AppsAPI) GetDeployment

func (a *AppsAPI) GetDeployment(ctx context.Context, request GetAppDeploymentRequest) (*AppDeployment, error)

func (*AppsAPI) GetDeploymentByAppNameAndDeploymentId

func (a *AppsAPI) GetDeploymentByAppNameAndDeploymentId(ctx context.Context, appName string, deploymentId string) (*AppDeployment, error)

Get an app deployment.

Retrieves information for the app deployment with the supplied name and deployment id.

func (*AppsAPI) GetPermissionLevels

func (a *AppsAPI) GetPermissionLevels(ctx context.Context, request GetAppPermissionLevelsRequest) (*GetAppPermissionLevelsResponse, error)

func (*AppsAPI) GetPermissionLevelsByAppName

func (a *AppsAPI) GetPermissionLevelsByAppName(ctx context.Context, appName string) (*GetAppPermissionLevelsResponse, error)

Get app permission levels.

Gets the permission levels that a user can have on an object.

func (*AppsAPI) GetPermissions

func (a *AppsAPI) GetPermissions(ctx context.Context, request GetAppPermissionsRequest) (*AppPermissions, error)

func (*AppsAPI) GetPermissionsByAppName

func (a *AppsAPI) GetPermissionsByAppName(ctx context.Context, appName string) (*AppPermissions, error)

Get app permissions.

Gets the permissions of an app. Apps can inherit permissions from their root object.

func (*AppsAPI) List

func (a *AppsAPI) List(ctx context.Context, request ListAppsRequest) listing.Iterator[App]

List apps.

Lists all apps in the workspace.

This method is generated by Databricks SDK Code Generator.

func (*AppsAPI) ListAll

func (a *AppsAPI) ListAll(ctx context.Context, request ListAppsRequest) ([]App, error)

List apps.

Lists all apps in the workspace.

This method is generated by Databricks SDK Code Generator.

func (*AppsAPI) ListDeployments

List app deployments.

Lists all app deployments for the app with the supplied name.

This method is generated by Databricks SDK Code Generator.

func (*AppsAPI) ListDeploymentsAll

func (a *AppsAPI) ListDeploymentsAll(ctx context.Context, request ListAppDeploymentsRequest) ([]AppDeployment, error)

List app deployments.

Lists all app deployments for the app with the supplied name.

This method is generated by Databricks SDK Code Generator.

func (*AppsAPI) ListDeploymentsByAppName

func (a *AppsAPI) ListDeploymentsByAppName(ctx context.Context, appName string) (*ListAppDeploymentsResponse, error)

List app deployments.

Lists all app deployments for the app with the supplied name.

func (*AppsAPI) SetPermissions

func (a *AppsAPI) SetPermissions(ctx context.Context, request AppPermissionsRequest) (*AppPermissions, error)

func (*AppsAPI) Start

func (a *AppsAPI) Start(ctx context.Context, startAppRequest StartAppRequest) (*WaitGetAppActive[App], error)

Start an app.

Start the last active deployment of the app in the workspace.

func (*AppsAPI) StartAndWait deprecated

func (a *AppsAPI) StartAndWait(ctx context.Context, startAppRequest StartAppRequest, options ...retries.Option[App]) (*App, error)

Calls AppsAPI.Start and waits to reach ACTIVE state

You can override the default timeout of 20 minutes by calling adding retries.Timeout[App](60*time.Minute) functional option.

Deprecated: use AppsAPI.Start.Get() or AppsAPI.WaitGetAppActive

func (*AppsAPI) Stop

func (a *AppsAPI) Stop(ctx context.Context, stopAppRequest StopAppRequest) (*WaitGetAppStopped[App], error)

Stop an app.

Stops the active deployment of the app in the workspace.

func (*AppsAPI) StopAndWait deprecated added in v0.47.0

func (a *AppsAPI) StopAndWait(ctx context.Context, stopAppRequest StopAppRequest, options ...retries.Option[App]) (*App, error)

Calls AppsAPI.Stop and waits to reach STOPPED state

You can override the default timeout of 20 minutes by calling adding retries.Timeout[App](60*time.Minute) functional option.

Deprecated: use AppsAPI.Stop.Get() or AppsAPI.WaitGetAppStopped

func (*AppsAPI) Update

func (a *AppsAPI) Update(ctx context.Context, request UpdateAppRequest) (*App, error)

func (*AppsAPI) UpdatePermissions

func (a *AppsAPI) UpdatePermissions(ctx context.Context, request AppPermissionsRequest) (*AppPermissions, error)

func (*AppsAPI) WaitGetAppActive added in v0.47.0

func (a *AppsAPI) WaitGetAppActive(ctx context.Context, name string,
	timeout time.Duration, callback func(*App)) (*App, error)

WaitGetAppActive repeatedly calls AppsAPI.Get and waits to reach ACTIVE state

func (*AppsAPI) WaitGetAppStopped added in v0.47.0

func (a *AppsAPI) WaitGetAppStopped(ctx context.Context, name string,
	timeout time.Duration, callback func(*App)) (*App, error)

WaitGetAppStopped repeatedly calls AppsAPI.Get and waits to reach STOPPED state

func (*AppsAPI) WaitGetDeploymentAppSucceeded

func (a *AppsAPI) WaitGetDeploymentAppSucceeded(ctx context.Context, appName string, deploymentId string,
	timeout time.Duration, callback func(*AppDeployment)) (*AppDeployment, error)

WaitGetDeploymentAppSucceeded repeatedly calls AppsAPI.GetDeployment and waits to reach SUCCEEDED state

type AppsInterface

type AppsInterface interface {

	// WaitGetAppActive repeatedly calls [AppsAPI.Get] and waits to reach ACTIVE state
	WaitGetAppActive(ctx context.Context, name string,
		timeout time.Duration, callback func(*App)) (*App, error)

	// WaitGetAppStopped repeatedly calls [AppsAPI.Get] and waits to reach STOPPED state
	WaitGetAppStopped(ctx context.Context, name string,
		timeout time.Duration, callback func(*App)) (*App, error)

	// WaitGetDeploymentAppSucceeded repeatedly calls [AppsAPI.GetDeployment] and waits to reach SUCCEEDED state
	WaitGetDeploymentAppSucceeded(ctx context.Context, appName string, deploymentId string,
		timeout time.Duration, callback func(*AppDeployment)) (*AppDeployment, error)

	// Create an app.
	//
	// Creates a new app.
	Create(ctx context.Context, createAppRequest CreateAppRequest) (*WaitGetAppActive[App], error)

	// Calls [AppsAPIInterface.Create] and waits to reach ACTIVE state
	//
	// You can override the default timeout of 20 minutes by calling adding
	// retries.Timeout[App](60*time.Minute) functional option.
	//
	// Deprecated: use [AppsAPIInterface.Create].Get() or [AppsAPIInterface.WaitGetAppActive]
	CreateAndWait(ctx context.Context, createAppRequest CreateAppRequest, options ...retries.Option[App]) (*App, error)

	// Delete an app.
	//
	// Deletes an app.
	Delete(ctx context.Context, request DeleteAppRequest) (*App, error)

	// Delete an app.
	//
	// Deletes an app.
	DeleteByName(ctx context.Context, name string) (*App, error)

	// Create an app deployment.
	//
	// Creates an app deployment for the app with the supplied name.
	Deploy(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest) (*WaitGetDeploymentAppSucceeded[AppDeployment], error)

	// Calls [AppsAPIInterface.Deploy] and waits to reach SUCCEEDED state
	//
	// You can override the default timeout of 20 minutes by calling adding
	// retries.Timeout[AppDeployment](60*time.Minute) functional option.
	//
	// Deprecated: use [AppsAPIInterface.Deploy].Get() or [AppsAPIInterface.WaitGetDeploymentAppSucceeded]
	DeployAndWait(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest, options ...retries.Option[AppDeployment]) (*AppDeployment, error)

	// Get an app.
	//
	// Retrieves information for the app with the supplied name.
	Get(ctx context.Context, request GetAppRequest) (*App, error)

	// Get an app.
	//
	// Retrieves information for the app with the supplied name.
	GetByName(ctx context.Context, name string) (*App, error)

	// Get an app deployment.
	//
	// Retrieves information for the app deployment with the supplied name and
	// deployment id.
	GetDeployment(ctx context.Context, request GetAppDeploymentRequest) (*AppDeployment, error)

	// Get an app deployment.
	//
	// Retrieves information for the app deployment with the supplied name and
	// deployment id.
	GetDeploymentByAppNameAndDeploymentId(ctx context.Context, appName string, deploymentId string) (*AppDeployment, error)

	// Get app permission levels.
	//
	// Gets the permission levels that a user can have on an object.
	GetPermissionLevels(ctx context.Context, request GetAppPermissionLevelsRequest) (*GetAppPermissionLevelsResponse, error)

	// Get app permission levels.
	//
	// Gets the permission levels that a user can have on an object.
	GetPermissionLevelsByAppName(ctx context.Context, appName string) (*GetAppPermissionLevelsResponse, error)

	// Get app permissions.
	//
	// Gets the permissions of an app. Apps can inherit permissions from their root
	// object.
	GetPermissions(ctx context.Context, request GetAppPermissionsRequest) (*AppPermissions, error)

	// Get app permissions.
	//
	// Gets the permissions of an app. Apps can inherit permissions from their root
	// object.
	GetPermissionsByAppName(ctx context.Context, appName string) (*AppPermissions, error)

	// List apps.
	//
	// Lists all apps in the workspace.
	//
	// This method is generated by Databricks SDK Code Generator.
	List(ctx context.Context, request ListAppsRequest) listing.Iterator[App]

	// List apps.
	//
	// Lists all apps in the workspace.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListAll(ctx context.Context, request ListAppsRequest) ([]App, error)

	// List app deployments.
	//
	// Lists all app deployments for the app with the supplied name.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListDeployments(ctx context.Context, request ListAppDeploymentsRequest) listing.Iterator[AppDeployment]

	// List app deployments.
	//
	// Lists all app deployments for the app with the supplied name.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListDeploymentsAll(ctx context.Context, request ListAppDeploymentsRequest) ([]AppDeployment, error)

	// List app deployments.
	//
	// Lists all app deployments for the app with the supplied name.
	ListDeploymentsByAppName(ctx context.Context, appName string) (*ListAppDeploymentsResponse, error)

	// Set app permissions.
	//
	// Sets permissions on an app. Apps can inherit permissions from their root
	// object.
	SetPermissions(ctx context.Context, request AppPermissionsRequest) (*AppPermissions, error)

	// Start an app.
	//
	// Start the last active deployment of the app in the workspace.
	Start(ctx context.Context, startAppRequest StartAppRequest) (*WaitGetAppActive[App], error)

	// Calls [AppsAPIInterface.Start] and waits to reach ACTIVE state
	//
	// You can override the default timeout of 20 minutes by calling adding
	// retries.Timeout[App](60*time.Minute) functional option.
	//
	// Deprecated: use [AppsAPIInterface.Start].Get() or [AppsAPIInterface.WaitGetAppActive]
	StartAndWait(ctx context.Context, startAppRequest StartAppRequest, options ...retries.Option[App]) (*App, error)

	// Stop an app.
	//
	// Stops the active deployment of the app in the workspace.
	Stop(ctx context.Context, stopAppRequest StopAppRequest) (*WaitGetAppStopped[App], error)

	// Calls [AppsAPIInterface.Stop] and waits to reach STOPPED state
	//
	// You can override the default timeout of 20 minutes by calling adding
	// retries.Timeout[App](60*time.Minute) functional option.
	//
	// Deprecated: use [AppsAPIInterface.Stop].Get() or [AppsAPIInterface.WaitGetAppStopped]
	StopAndWait(ctx context.Context, stopAppRequest StopAppRequest, options ...retries.Option[App]) (*App, error)

	// Update an app.
	//
	// Updates the app with the supplied name.
	Update(ctx context.Context, request UpdateAppRequest) (*App, error)

	// Update app permissions.
	//
	// Updates the permissions on an app. Apps can inherit permissions from their
	// root object.
	UpdatePermissions(ctx context.Context, request AppPermissionsRequest) (*AppPermissions, error)
}

type AppsService

type AppsService interface {

	// Create an app.
	//
	// Creates a new app.
	Create(ctx context.Context, request CreateAppRequest) (*App, error)

	// Delete an app.
	//
	// Deletes an app.
	Delete(ctx context.Context, request DeleteAppRequest) (*App, error)

	// Create an app deployment.
	//
	// Creates an app deployment for the app with the supplied name.
	Deploy(ctx context.Context, request CreateAppDeploymentRequest) (*AppDeployment, error)

	// Get an app.
	//
	// Retrieves information for the app with the supplied name.
	Get(ctx context.Context, request GetAppRequest) (*App, error)

	// Get an app deployment.
	//
	// Retrieves information for the app deployment with the supplied name and
	// deployment id.
	GetDeployment(ctx context.Context, request GetAppDeploymentRequest) (*AppDeployment, error)

	// Get app permission levels.
	//
	// Gets the permission levels that a user can have on an object.
	GetPermissionLevels(ctx context.Context, request GetAppPermissionLevelsRequest) (*GetAppPermissionLevelsResponse, error)

	// Get app permissions.
	//
	// Gets the permissions of an app. Apps can inherit permissions from their
	// root object.
	GetPermissions(ctx context.Context, request GetAppPermissionsRequest) (*AppPermissions, error)

	// List apps.
	//
	// Lists all apps in the workspace.
	//
	// Use ListAll() to get all App instances, which will iterate over every result page.
	List(ctx context.Context, request ListAppsRequest) (*ListAppsResponse, error)

	// List app deployments.
	//
	// Lists all app deployments for the app with the supplied name.
	//
	// Use ListDeploymentsAll() to get all AppDeployment instances, which will iterate over every result page.
	ListDeployments(ctx context.Context, request ListAppDeploymentsRequest) (*ListAppDeploymentsResponse, error)

	// Set app permissions.
	//
	// Sets permissions on an app. Apps can inherit permissions from their root
	// object.
	SetPermissions(ctx context.Context, request AppPermissionsRequest) (*AppPermissions, error)

	// Start an app.
	//
	// Start the last active deployment of the app in the workspace.
	Start(ctx context.Context, request StartAppRequest) (*App, error)

	// Stop an app.
	//
	// Stops the active deployment of the app in the workspace.
	Stop(ctx context.Context, request StopAppRequest) (*App, error)

	// Update an app.
	//
	// Updates the app with the supplied name.
	Update(ctx context.Context, request UpdateAppRequest) (*App, error)

	// Update app permissions.
	//
	// Updates the permissions on an app. Apps can inherit permissions from
	// their root object.
	UpdatePermissions(ctx context.Context, request AppPermissionsRequest) (*AppPermissions, error)
}

Apps run directly on a customer’s Databricks instance, integrate with their data, use and extend Databricks services, and enable users to interact through single sign-on.

type ComputeState added in v0.47.0

type ComputeState string
const ComputeStateActive ComputeState = `ACTIVE`
const ComputeStateDeleting ComputeState = `DELETING`
const ComputeStateError ComputeState = `ERROR`
const ComputeStateStarting ComputeState = `STARTING`
const ComputeStateStopped ComputeState = `STOPPED`
const ComputeStateStopping ComputeState = `STOPPING`
const ComputeStateUpdating ComputeState = `UPDATING`

func (*ComputeState) Set added in v0.47.0

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

Set raw string value and validate it against allowed values

func (*ComputeState) String added in v0.47.0

func (f *ComputeState) String() string

String representation for fmt.Print

func (*ComputeState) Type added in v0.47.0

func (f *ComputeState) Type() string

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

type ComputeStatus added in v0.47.0

type ComputeStatus struct {
	// Compute status message
	Message string `json:"message,omitempty"`
	// State of the app compute.
	State ComputeState `json:"state,omitempty"`

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

func (ComputeStatus) MarshalJSON added in v0.47.0

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

func (*ComputeStatus) UnmarshalJSON added in v0.47.0

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

type CreateAppDeploymentRequest

type CreateAppDeploymentRequest struct {
	// The name of the app.
	AppName string `json:"-" url:"-"`
	// The unique id of the deployment.
	DeploymentId string `json:"deployment_id,omitempty"`
	// The mode of which the deployment will manage the source code.
	Mode AppDeploymentMode `json:"mode,omitempty"`
	// The workspace file system path of the source code used to create the app
	// deployment. This is different from
	// `deployment_artifacts.source_code_path`, which is the path used by the
	// deployed app. The former refers to the original source code location of
	// the app in the workspace during deployment creation, whereas the latter
	// provides a system generated stable snapshotted source code path used by
	// the deployment.
	SourceCodePath string `json:"source_code_path,omitempty"`

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

func (CreateAppDeploymentRequest) MarshalJSON added in v0.47.0

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

func (*CreateAppDeploymentRequest) UnmarshalJSON added in v0.47.0

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

type CreateAppRequest

type CreateAppRequest struct {
	// The description of the app.
	Description string `json:"description,omitempty"`
	// The name of the app. The name must contain only lowercase alphanumeric
	// characters and hyphens. It must be unique within the workspace.
	Name string `json:"name"`
	// Resources for the app.
	Resources []AppResource `json:"resources,omitempty"`

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

func (CreateAppRequest) MarshalJSON

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

func (*CreateAppRequest) UnmarshalJSON

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

type DeleteAppRequest

type DeleteAppRequest struct {
	// The name of the app.
	Name string `json:"-" url:"-"`
}

Delete an app

type GetAppDeploymentRequest

type GetAppDeploymentRequest struct {
	// The name of the app.
	AppName string `json:"-" url:"-"`
	// The unique id of the deployment.
	DeploymentId string `json:"-" url:"-"`
}

Get an app deployment

type GetAppPermissionLevelsRequest

type GetAppPermissionLevelsRequest struct {
	// The app for which to get or manage permissions.
	AppName string `json:"-" url:"-"`
}

Get app permission levels

type GetAppPermissionLevelsResponse

type GetAppPermissionLevelsResponse struct {
	// Specific permission levels
	PermissionLevels []AppPermissionsDescription `json:"permission_levels,omitempty"`
}

type GetAppPermissionsRequest

type GetAppPermissionsRequest struct {
	// The app for which to get or manage permissions.
	AppName string `json:"-" url:"-"`
}

Get app permissions

type GetAppRequest

type GetAppRequest struct {
	// The name of the app.
	Name string `json:"-" url:"-"`
}

Get an app

type ListAppDeploymentsRequest

type ListAppDeploymentsRequest struct {
	// The name of the app.
	AppName string `json:"-" url:"-"`
	// Upper bound for items returned.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// Pagination token to go to the next page of apps. Requests first page if
	// absent.
	PageToken string `json:"-" url:"page_token,omitempty"`

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

List app deployments

func (ListAppDeploymentsRequest) MarshalJSON

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

func (*ListAppDeploymentsRequest) UnmarshalJSON

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

type ListAppDeploymentsResponse

type ListAppDeploymentsResponse struct {
	// Deployment history of the app.
	AppDeployments []AppDeployment `json:"app_deployments,omitempty"`
	// Pagination token to request the next page of apps.
	NextPageToken string `json:"next_page_token,omitempty"`

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

func (ListAppDeploymentsResponse) MarshalJSON

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

func (*ListAppDeploymentsResponse) UnmarshalJSON

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

type ListAppsRequest

type ListAppsRequest struct {
	// Upper bound for items returned.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// Pagination token to go to the next page of apps. Requests first page if
	// absent.
	PageToken string `json:"-" url:"page_token,omitempty"`

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

List apps

func (ListAppsRequest) MarshalJSON

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

func (*ListAppsRequest) UnmarshalJSON

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

type ListAppsResponse

type ListAppsResponse struct {
	Apps []App `json:"apps,omitempty"`
	// Pagination token to request the next page of apps.
	NextPageToken string `json:"next_page_token,omitempty"`

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

func (ListAppsResponse) MarshalJSON

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

func (*ListAppsResponse) UnmarshalJSON

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

type StartAppRequest

type StartAppRequest struct {
	// The name of the app.
	Name string `json:"-" url:"-"`
}

type StopAppRequest

type StopAppRequest struct {
	// The name of the app.
	Name string `json:"-" url:"-"`
}

type UpdateAppRequest

type UpdateAppRequest struct {
	// The description of the app.
	Description string `json:"description,omitempty"`
	// The name of the app. The name must contain only lowercase alphanumeric
	// characters and hyphens. It must be unique within the workspace.
	Name string `json:"name" url:"-"`
	// Resources for the app.
	Resources []AppResource `json:"resources,omitempty"`

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

func (UpdateAppRequest) MarshalJSON

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

func (*UpdateAppRequest) UnmarshalJSON

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

type WaitGetAppActive added in v0.47.0

type WaitGetAppActive[R any] struct {
	Response *R
	Name     string `json:"name"`
	Poll     func(time.Duration, func(*App)) (*App, error)
	// contains filtered or unexported fields
}

WaitGetAppActive is a wrapper that calls AppsAPI.WaitGetAppActive and waits to reach ACTIVE state.

func (*WaitGetAppActive[R]) Get added in v0.47.0

func (w *WaitGetAppActive[R]) Get() (*App, error)

Get the App with the default timeout of 20 minutes.

func (*WaitGetAppActive[R]) GetWithTimeout added in v0.47.0

func (w *WaitGetAppActive[R]) GetWithTimeout(timeout time.Duration) (*App, error)

Get the App with custom timeout.

func (*WaitGetAppActive[R]) OnProgress added in v0.47.0

func (w *WaitGetAppActive[R]) OnProgress(callback func(*App)) *WaitGetAppActive[R]

OnProgress invokes a callback every time it polls for the status update.

type WaitGetAppStopped added in v0.47.0

type WaitGetAppStopped[R any] struct {
	Response *R
	Name     string `json:"name"`
	Poll     func(time.Duration, func(*App)) (*App, error)
	// contains filtered or unexported fields
}

WaitGetAppStopped is a wrapper that calls AppsAPI.WaitGetAppStopped and waits to reach STOPPED state.

func (*WaitGetAppStopped[R]) Get added in v0.47.0

func (w *WaitGetAppStopped[R]) Get() (*App, error)

Get the App with the default timeout of 20 minutes.

func (*WaitGetAppStopped[R]) GetWithTimeout added in v0.47.0

func (w *WaitGetAppStopped[R]) GetWithTimeout(timeout time.Duration) (*App, error)

Get the App with custom timeout.

func (*WaitGetAppStopped[R]) OnProgress added in v0.47.0

func (w *WaitGetAppStopped[R]) OnProgress(callback func(*App)) *WaitGetAppStopped[R]

OnProgress invokes a callback every time it polls for the status update.

type WaitGetDeploymentAppSucceeded

type WaitGetDeploymentAppSucceeded[R any] struct {
	Response     *R
	AppName      string `json:"app_name"`
	DeploymentId string `json:"deployment_id"`
	Poll         func(time.Duration, func(*AppDeployment)) (*AppDeployment, error)
	// contains filtered or unexported fields
}

WaitGetDeploymentAppSucceeded is a wrapper that calls AppsAPI.WaitGetDeploymentAppSucceeded and waits to reach SUCCEEDED state.

func (*WaitGetDeploymentAppSucceeded[R]) Get

Get the AppDeployment with the default timeout of 20 minutes.

func (*WaitGetDeploymentAppSucceeded[R]) GetWithTimeout

func (w *WaitGetDeploymentAppSucceeded[R]) GetWithTimeout(timeout time.Duration) (*AppDeployment, error)

Get the AppDeployment with custom timeout.

func (*WaitGetDeploymentAppSucceeded[R]) OnProgress

func (w *WaitGetDeploymentAppSucceeded[R]) OnProgress(callback func(*AppDeployment)) *WaitGetDeploymentAppSucceeded[R]

OnProgress invokes a callback every time it polls for the status update.

Jump to

Keyboard shortcuts

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