azure

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClustersAPI

type ClustersAPI struct {
	Client DBClient
}

ClustersAPI exposes the Clusters API

func (ClustersAPI) Create

Create creates a new Spark cluster

func (ClustersAPI) Delete

func (a ClustersAPI) Delete(clusterID string) error

Delete is an alias of Terminate

func (ClustersAPI) Edit

func (a ClustersAPI) Edit(editReq httpmodels.EditReq) error

Edit edits the configuration of a cluster to match the provided attributes and size

func (ClustersAPI) Events

func (a ClustersAPI) Events(
	clusterID string, startTime, endTime int64, order models.ListOrder,
	eventTypes []models.ClusterEventType, offset, limit int64) (httpmodels.EventsResp, error)

Events retrieves a list of events about the activity of a cluster

func (ClustersAPI) Get

func (a ClustersAPI) Get(clusterID string) (httpmodels.GetResp, error)

Get retrieves the information for a cluster given its identifier

func (ClustersAPI) List

func (a ClustersAPI) List() ([]httpmodels.GetResp, error)

List return information about all pinned clusters, currently active clusters, up to 70 of the most recently terminated interactive clusters in the past 30 days, and up to 30 of the most recently terminated job clusters in the past 30 days

func (ClustersAPI) ListNodeTypes

func (a ClustersAPI) ListNodeTypes() ([]httpmodels.ListNodeTypesRespItem, error)

ListNodeTypes returns a list of supported Spark node types

func (ClustersAPI) PermanentDelete

func (a ClustersAPI) PermanentDelete(clusterID string) error

PermanentDelete permanently delete a cluster

func (ClustersAPI) Pin

func (a ClustersAPI) Pin(clusterID string) error

Pin ensure that an interactive cluster configuration is retained even after a cluster has been terminated for more than 30 days

func (ClustersAPI) Resize

func (a ClustersAPI) Resize(clusterID string, clusterSize models.ClusterSize) error

Resize resizes a cluster to have a desired number of workers. This will fail unless the cluster is in a RUNNING state.

func (ClustersAPI) Restart

func (a ClustersAPI) Restart(clusterID string) error

Restart restart a Spark cluster given its ID. If the cluster is not in a RUNNING state, nothing will happen.

func (ClustersAPI) SparkVersions

func (a ClustersAPI) SparkVersions() ([]httpmodels.SparkVersionsRespItem, error)

SparkVersions return the list of available Spark versions

func (ClustersAPI) Start

func (a ClustersAPI) Start(clusterID string) error

Start starts a terminated Spark cluster given its ID

func (ClustersAPI) Terminate

func (a ClustersAPI) Terminate(clusterID string) error

Terminate terminates a Spark cluster given its ID

func (ClustersAPI) Unpin

func (a ClustersAPI) Unpin(clusterID string) error

Unpin allows the cluster to eventually be removed from the list returned by the List API

type DBClient

type DBClient struct {
	Option databricks.DBClientOption
}

DBClient is the client for Azure implements DBClient

func (DBClient) Clusters

func (c DBClient) Clusters() ClustersAPI

Clusters returns an instance of ClustersAPI

func (DBClient) Dbfs

func (c DBClient) Dbfs() DbfsAPI

Dbfs returns an instance of DbfsAPI

func (DBClient) Groups

func (c DBClient) Groups() GroupsAPI

Groups returns an instance of GroupAPI

func (*DBClient) Init

func (c *DBClient) Init(option databricks.DBClientOption) DBClient

Init initializes the client

func (DBClient) InstancePools

func (c DBClient) InstancePools() InstancePoolsAPI

InstancePools returns an instance of InstancePoolsAPI

func (DBClient) Jobs

func (c DBClient) Jobs() JobsAPI

Jobs returns an instance of JobsAPI

func (DBClient) Libraries

func (c DBClient) Libraries() LibrariesAPI

Libraries returns an instance of LibrariesAPI

func (DBClient) Scim

func (c DBClient) Scim() ScimAPI

Scim returns an instance of ScimAPI

func (DBClient) Secrets

func (c DBClient) Secrets() SecretsAPI

Secrets returns an instance of SecretsAPI

func (DBClient) Token

func (c DBClient) Token() TokenAPI

Token returns an instance of TokensAPI

func (DBClient) Workspace

func (c DBClient) Workspace() WorkspaceAPI

Workspace returns an instance of WorkspaceAPI

type DbfsAPI

type DbfsAPI struct {
	Client DBClient
}

DbfsAPI exposes the DBFS API

func (DbfsAPI) AddBlock

func (a DbfsAPI) AddBlock(handle int64, data []byte) error

AddBlock appends a block of data to the stream specified by the input handle

func (DbfsAPI) Close

func (a DbfsAPI) Close(handle int64) error

Close closes the stream specified by the input handle

func (DbfsAPI) Create

func (a DbfsAPI) Create(path string, overwrite bool) (DbfsCreateResponse, error)

Create opens a stream to write to a file and returns a handle to this stream

func (DbfsAPI) Delete

func (a DbfsAPI) Delete(path string, recursive bool) error

Delete deletes the file or directory (optionally recursively delete all files in the directory)

func (DbfsAPI) GetStatus

func (a DbfsAPI) GetStatus(path string) (models.FileInfo, error)

GetStatus gets the file information of a file or directory

func (DbfsAPI) List

func (a DbfsAPI) List(path string) ([]models.FileInfo, error)

List lists the contents of a directory, or details of the file

func (DbfsAPI) Mkdirs

func (a DbfsAPI) Mkdirs(path string) error

Mkdirs creates the given directory and necessary parent directories if they do not exist

func (DbfsAPI) Move

func (a DbfsAPI) Move(sourcePath, destinationPath string) error

Move moves a file from one location to another location within DBFS

func (DbfsAPI) Put

func (a DbfsAPI) Put(path string, contents []byte, overwrite bool) error

Put uploads a file through the use of multipart form post

func (DbfsAPI) Read

func (a DbfsAPI) Read(path string, offset, length int64) (DbfsReadResponse, error)

Read returns the contents of a file

type DbfsCreateResponse

type DbfsCreateResponse struct {
	Handle int64 `json:"handle,omitempty" url:"handle,omitempty"`
}

DbfsCreateResponse is the response from Create

type DbfsListResponse

type DbfsListResponse struct {
	Files []models.FileInfo `json:"files,omitempty" url:"files,omitempty"`
}

DbfsListResponse is a list of FileInfo as a response of List

type DbfsReadResponse

type DbfsReadResponse struct {
	BytesRead int64  `json:"bytes_read,omitempty" url:"bytes_read,omitempty"`
	Data      []byte `json:"data,omitempty" url:"data,omitempty"`
}

DbfsReadResponse is the response of reading a file

type GroupsAPI

type GroupsAPI struct {
	Client DBClient
}

GroupsAPI exposes the Groups API

func (GroupsAPI) AddMember

func (a GroupsAPI) AddMember(principalName models.PrincipalName, parentName string) error

AddMember adds a user or group to a group

func (GroupsAPI) Create

func (a GroupsAPI) Create(groupName string) (GroupsCreateResponse, error)

Create creates a new group with the given name

func (GroupsAPI) Delete

func (a GroupsAPI) Delete(groupName string) error

Delete removes a group from this organization

func (GroupsAPI) List

func (a GroupsAPI) List() ([]string, error)

List returns all of the groups in an organization

func (GroupsAPI) ListMembers

func (a GroupsAPI) ListMembers(groupName string) ([]models.PrincipalName, error)

ListMembers returns all of the members of a particular group

func (GroupsAPI) ListParents

func (a GroupsAPI) ListParents(principalName models.PrincipalName) ([]string, error)

ListParents retrieves all groups in which a given user or group is a member

func (GroupsAPI) RemoveMember

func (a GroupsAPI) RemoveMember(principalName models.PrincipalName, parentName string) error

RemoveMember removes a user or group from a group

type GroupsCreateResponse

type GroupsCreateResponse struct {
	GroupName string `json:"group_name,omitempty" url:"group_name,omitempty"`
}

GroupsCreateResponse is a response with group name for Create

type InstancePoolsAPI

type InstancePoolsAPI struct {
	Client DBClient
}

InstancePoolsAPI exposes the InstancePools API

type JobsAPI

type JobsAPI struct {
	Client DBClient
}

JobsAPI exposes Jobs API endpoints

func (JobsAPI) Create

func (a JobsAPI) Create(jobSettings models.JobSettings) (models.Job, error)

Create creates a new job

func (JobsAPI) Delete

func (a JobsAPI) Delete(jobID int64) error

Delete deletes a job by ID

func (JobsAPI) Get

func (a JobsAPI) Get(jobID int64) (models.Job, error)

Get gets a job by ID

func (JobsAPI) List

func (a JobsAPI) List() ([]models.Job, error)

List lists all jobs

func (JobsAPI) Reset

func (a JobsAPI) Reset(jobID int64, jobSettings models.JobSettings) error

Reset overwrites job settings

func (JobsAPI) RunNow

func (a JobsAPI) RunNow(jobID int64, runParameters models.RunParameters) (models.Run, error)

RunNow runs a job now and return the run_id of the triggered run

func (JobsAPI) RunsCancel

func (a JobsAPI) RunsCancel(runID int64) error

RunsCancel cancels a run

func (JobsAPI) RunsDelete

func (a JobsAPI) RunsDelete(runID int64) error

RunsDelete deletes a non-active run. Returns an error if the run is active.

func (JobsAPI) RunsExport

func (a JobsAPI) RunsExport(runID int64) ([]models.ViewItem, error)

RunsExport exports and retrieve the job run task

func (JobsAPI) RunsGet

func (a JobsAPI) RunsGet(runID int64) (models.Run, error)

RunsGet retrieve the metadata of a run

func (JobsAPI) RunsGetOutput

func (a JobsAPI) RunsGetOutput(runID int64) (JobsRunsGetOutputResponse, error)

RunsGetOutput retrieves the output of a run

func (JobsAPI) RunsList

func (a JobsAPI) RunsList(activeOnly, completedOnly bool, jobID int64, offset, limit int32) (JobsRunsListResponse, error)

RunsList lists runs from most recently started to least

func (JobsAPI) RunsSubmit

func (a JobsAPI) RunsSubmit(runName string, clusterSpec models.ClusterSpec, jobTask models.JobTask, timeoutSeconds int32) (models.Run, error)

RunsSubmit submit a one-time run

type JobsListResponse

type JobsListResponse = struct {
	Jobs []models.Job `json:"jobs,omitempty" url:"jobs,omitempty"`
}

JobsListResponse is the response type returned by JobsList

type JobsRunsGetOutputResponse

type JobsRunsGetOutputResponse struct {
	NotebookOutput models.NotebookOutput `json:"notebook_output,omitempty" url:"notebook_output,omitempty"`
	Error          string                `json:"error,omitempty" url:"error,omitempty"`
	Metadata       models.Run            `json:"metadata,omitempty" url:"metadata,omitempty"`
}

JobsRunsGetOutputResponse is the output of the run

type JobsRunsListResponse

type JobsRunsListResponse struct {
	Runs    []models.Run `json:"runs,omitempty" url:"runs,omitempty"`
	HasMore bool         `json:"has_more,omitempty" url:"has_more,omitempty"`
}

JobsRunsListResponse is the response type returned by RunsList

type LibrariesAPI

type LibrariesAPI struct {
	Client DBClient
}

LibrariesAPI exposes the Libraries API

func (LibrariesAPI) AllClusterStatuses

func (a LibrariesAPI) AllClusterStatuses() ([]models.ClusterLibraryStatuses, error)

AllClusterStatuses gets the status of all libraries on all clusters

func (LibrariesAPI) ClusterStatus

func (a LibrariesAPI) ClusterStatus(clusterID string) (LibrariesClusterStatusResponse, error)

ClusterStatus get the status of libraries on a cluster

func (LibrariesAPI) Install

func (a LibrariesAPI) Install(clusterID string, libraries []models.Library) error

Install installs libraries on a cluster

func (LibrariesAPI) Uninstall

func (a LibrariesAPI) Uninstall(clusterID string, libraries []models.Library) error

Uninstall sets libraries to be uninstalled on a cluster

type LibrariesClusterStatusResponse

type LibrariesClusterStatusResponse struct {
	ClusterID       string                     `json:"cluster_id,omitempty" url:"cluster_id,omitempty"`
	LibraryStatuses []models.LibraryFullStatus `json:"library_statuses,omitempty" url:"library_statuses,omitempty"`
}

LibrariesClusterStatusResponse is a response from AllClusterStatuses

type ScimAPI

type ScimAPI struct {
	Client DBClient
}

ScimAPI exposes the SCIM API

type SecretsAPI

type SecretsAPI struct {
	Client DBClient
}

SecretsAPI exposes the Secrets API

func (SecretsAPI) Create

func (a SecretsAPI) Create(lifetimeSeconds int64, comment string) (TokenCreateResponse, error)

Create creates and return a token

func (SecretsAPI) CreateSecretScope

func (a SecretsAPI) CreateSecretScope(scope, initialManagePrincipal string) error

CreateSecretScope creates a new secret scope

func (SecretsAPI) DeleteSecret

func (a SecretsAPI) DeleteSecret(scope, key string) error

DeleteSecret deletes a secret depends on the type of scope backend

func (SecretsAPI) DeleteSecretACL

func (a SecretsAPI) DeleteSecretACL(scope, principal string) error

DeleteSecretACL deletes the given ACL on the given scope

func (SecretsAPI) DeleteSecretScope

func (a SecretsAPI) DeleteSecretScope(scope string) error

DeleteSecretScope deletes a secret scope

func (SecretsAPI) GetSecretACL

func (a SecretsAPI) GetSecretACL(scope, principal string) (models.AclItem, error)

GetSecretACL describe the details about the given ACL, such as the group and permission

func (SecretsAPI) List

func (a SecretsAPI) List() ([]models.PublicTokenInfo, error)

List lists all the valid tokens for a user-workspace pair

func (SecretsAPI) ListSecretACLs

func (a SecretsAPI) ListSecretACLs(scope string) ([]models.AclItem, error)

ListSecretACLs lists the ACLs set on the given scope

func (SecretsAPI) ListSecretScopes

func (a SecretsAPI) ListSecretScopes() ([]models.SecretScope, error)

ListSecretScopes lists all secret scopes available in the workspace

func (SecretsAPI) ListSecrets

func (a SecretsAPI) ListSecrets(scope string) ([]models.SecretMetadata, error)

ListSecrets lists the secret keys that are stored at this scope

func (SecretsAPI) PutSecret

func (a SecretsAPI) PutSecret(bytesValue []byte, scope, key string) error

PutSecret creates or modifies a bytes secret depends on the type of scope backend with

func (SecretsAPI) PutSecretACL

func (a SecretsAPI) PutSecretACL(scope, principal string, permission models.AclPermission) error

PutSecretACL creates or overwrites the ACL associated with the given principal (user or group) on the specified scope point

func (SecretsAPI) PutSecretString

func (a SecretsAPI) PutSecretString(stringValue, scope, key string) error

PutSecretString creates or modifies a string secret depends on the type of scope backend

func (SecretsAPI) Revoke

func (a SecretsAPI) Revoke(tokenID string) error

Revoke revokes an access token

type TokenAPI

type TokenAPI struct {
	Client DBClient
}

TokenAPI exposes the Token API

type TokenCreateResponse

type TokenCreateResponse struct {
	TokenValue string                 `json:"token_value,omitempty" url:"token_value,omitempty"`
	TokenInfo  models.PublicTokenInfo `json:"token_info,omitempty" url:"token_info,omitempty"`
}

TokenCreateResponse is the response from Create

type WorkspaceAPI

type WorkspaceAPI struct {
	Client DBClient
}

WorkspaceAPI exposes the Workspace API

func (WorkspaceAPI) Delete

func (a WorkspaceAPI) Delete(path string, recursive bool) error

Delete deletes an object or a directory (and optionally recursively deletes all objects in the directory)

func (WorkspaceAPI) Export

func (a WorkspaceAPI) Export(path string, format models.ExportFormat, directDownload bool) ([]byte, error)

Export exports a notebook or contents of an entire directory

func (WorkspaceAPI) GetStatus

func (a WorkspaceAPI) GetStatus(path string) (models.ObjectInfo, error)

GetStatus gets the status of an object or a directory

func (WorkspaceAPI) Import

func (a WorkspaceAPI) Import(path string, format models.ExportFormat,
	language models.Language, content []byte, overwrite bool) error

Import imports a notebook or the contents of an entire directory

func (WorkspaceAPI) List

func (a WorkspaceAPI) List(path string) ([]models.ObjectInfo, error)

List lists the contents of a directory, or the object if it is not a directory

func (WorkspaceAPI) Mkdirs

func (a WorkspaceAPI) Mkdirs(path string) error

Mkdirs creates the given directory and necessary parent directories if they do not exists

Directories

Path Synopsis
clusters
dbfs
doc
models
+k8s:deepcopy-gen=package
+k8s:deepcopy-gen=package
groups
instance_pools
jobs
libraries
secrets
token
workspace

Jump to

Keyboard shortcuts

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