Documentation
¶
Overview ¶
Test service for Long Running Operations
Index ¶
- type CancelOperationRequest
- type CreateTestResourceOperationInterface
- type CreateTestResourceRequest
- type DatabricksServiceExceptionWithDetailsProto
- type DeleteTestResourceOperationInterface
- type DeleteTestResourceRequest
- type ErrorCode
- type GetOperationRequest
- type GetTestResourceRequest
- type LroTestingAPI
- func (a *LroTestingAPI) CancelOperation(ctx context.Context, request CancelOperationRequest) error
- func (a *LroTestingAPI) CreateTestResource(ctx context.Context, request CreateTestResourceRequest) (CreateTestResourceOperationInterface, error)
- func (a *LroTestingAPI) DeleteTestResource(ctx context.Context, request DeleteTestResourceRequest) (DeleteTestResourceOperationInterface, error)
- func (a *LroTestingAPI) GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error)
- func (a *LroTestingAPI) GetTestResource(ctx context.Context, request GetTestResourceRequest) (*TestResource, error)
- type LroTestingInterface
- type Operation
- type TestResource
- type TestResourceOperationMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelOperationRequest ¶
type CancelOperationRequest struct {
// The name of the operation resource to be cancelled.
Name string `json:"-" url:"-"`
}
type CreateTestResourceOperationInterface ¶ added in v0.87.0
type CreateTestResourceOperationInterface interface {
// Wait blocks until the long-running operation is completed. If no timeout is
// specified, this will poll indefinitely. If a timeout is provided and the operation
// didn't finish within the timeout, this function will return an error, otherwise
// returns successful response and any errors encountered.
Wait(ctx context.Context, opts ...api.Option) (*TestResource, error)
// Starts asynchronous cancellation on a long-running operation. The server
// makes a best effort to cancel the operation, but success is not guaranteed.
Cancel(ctx context.Context) error
// Name returns the name of the long-running operation. The name is assigned
// by the server and is unique within the service from which the operation is created.
Name() string
// Metadata returns metadata associated with the long-running operation.
// If the metadata is not available, the returned metadata and error are both nil.
Metadata() (*TestResourceOperationMetadata, error)
// Done reports whether the long-running operation has completed.
Done() (bool, error)
}
type CreateTestResourceRequest ¶
type CreateTestResourceRequest struct {
// The resource to create
Resource TestResource `json:"resource"`
}
type DatabricksServiceExceptionWithDetailsProto ¶ added in v0.86.0
type DatabricksServiceExceptionWithDetailsProto struct {
// @pbjson-skip
Details []json.RawMessage `json:"details,omitempty"`
ErrorCode ErrorCode `json:"error_code,omitempty"`
Message string `json:"message,omitempty"`
StackTrace string `json:"stack_trace,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Databricks Error that is returned by all Databricks APIs.
func (DatabricksServiceExceptionWithDetailsProto) MarshalJSON ¶ added in v0.86.0
func (s DatabricksServiceExceptionWithDetailsProto) MarshalJSON() ([]byte, error)
func (*DatabricksServiceExceptionWithDetailsProto) UnmarshalJSON ¶ added in v0.86.0
func (s *DatabricksServiceExceptionWithDetailsProto) UnmarshalJSON(b []byte) error
type DeleteTestResourceOperationInterface ¶ added in v0.88.0
type DeleteTestResourceOperationInterface interface {
// Wait blocks until the long-running operation is completed. If no timeout is
// specified, this will poll indefinitely. If a timeout is provided and the operation
// didn't finish within the timeout, this function will return an error, otherwise
// returns successful response and any errors encountered.
Wait(ctx context.Context, opts ...api.Option) error
// Starts asynchronous cancellation on a long-running operation. The server
// makes a best effort to cancel the operation, but success is not guaranteed.
Cancel(ctx context.Context) error
// Name returns the name of the long-running operation. The name is assigned
// by the server and is unique within the service from which the operation is created.
Name() string
// Metadata returns metadata associated with the long-running operation.
// If the metadata is not available, the returned metadata and error are both nil.
Metadata() (*TestResourceOperationMetadata, error)
// Done reports whether the long-running operation has completed.
Done() (bool, error)
}
type DeleteTestResourceRequest ¶ added in v0.88.0
type DeleteTestResourceRequest struct {
// Resource ID to delete
ResourceId string `json:"-" url:"-"`
}
type ErrorCode ¶ added in v0.86.0
type ErrorCode string
Legacy definition of the ErrorCode enum. Please keep in sync with api-base/proto/error_code.proto (except status code mapping annotations as this file doesn't have them). Will be removed eventually, pending the ScalaPB 0.4 cleanup.
const ErrorCodeAborted ErrorCode = `ABORTED`
const ErrorCodeAlreadyExists ErrorCode = `ALREADY_EXISTS`
const ErrorCodeBadRequest ErrorCode = `BAD_REQUEST`
const ErrorCodeCancelled ErrorCode = `CANCELLED`
const ErrorCodeCatalogAlreadyExists ErrorCode = `CATALOG_ALREADY_EXISTS`
const ErrorCodeCatalogDoesNotExist ErrorCode = `CATALOG_DOES_NOT_EXIST`
const ErrorCodeCatalogNotEmpty ErrorCode = `CATALOG_NOT_EMPTY`
const ErrorCodeCouldNotAcquireLock ErrorCode = `COULD_NOT_ACQUIRE_LOCK`
const ErrorCodeDacAlreadyExists ErrorCode = `DAC_ALREADY_EXISTS`
const ErrorCodeDacDoesNotExist ErrorCode = `DAC_DOES_NOT_EXIST`
const ErrorCodeDataLoss ErrorCode = `DATA_LOSS`
const ErrorCodeDeadlineExceeded ErrorCode = `DEADLINE_EXCEEDED`
const ErrorCodeDeploymentTimeout ErrorCode = `DEPLOYMENT_TIMEOUT`
const ErrorCodeDirectoryNotEmpty ErrorCode = `DIRECTORY_NOT_EMPTY`
const ErrorCodeDirectoryProtected ErrorCode = `DIRECTORY_PROTECTED`
const ErrorCodeDryRunFailed ErrorCode = `DRY_RUN_FAILED`
const ErrorCodeEndpointNotFound ErrorCode = `ENDPOINT_NOT_FOUND`
const ErrorCodeExternalLocationAlreadyExists ErrorCode = `EXTERNAL_LOCATION_ALREADY_EXISTS`
const ErrorCodeExternalLocationDoesNotExist ErrorCode = `EXTERNAL_LOCATION_DOES_NOT_EXIST`
const ErrorCodeFeatureDisabled ErrorCode = `FEATURE_DISABLED`
const ErrorCodeGitConflict ErrorCode = `GIT_CONFLICT`
const ErrorCodeGitRemoteError ErrorCode = `GIT_REMOTE_ERROR`
const ErrorCodeGitSensitiveTokenDetected ErrorCode = `GIT_SENSITIVE_TOKEN_DETECTED`
const ErrorCodeGitUnknownRef ErrorCode = `GIT_UNKNOWN_REF`
const ErrorCodeGitUrlNotOnAllowList ErrorCode = `GIT_URL_NOT_ON_ALLOW_LIST`
const ErrorCodeInsecurePartnerResponse ErrorCode = `INSECURE_PARTNER_RESPONSE`
const ErrorCodeInternalError ErrorCode = `INTERNAL_ERROR`
const ErrorCodeInvalidParameterValue ErrorCode = `INVALID_PARAMETER_VALUE`
const ErrorCodeInvalidState ErrorCode = `INVALID_STATE`
const ErrorCodeInvalidStateTransition ErrorCode = `INVALID_STATE_TRANSITION`
const ErrorCodeIoError ErrorCode = `IO_ERROR`
const ErrorCodeIpynbFileInRepo ErrorCode = `IPYNB_FILE_IN_REPO`
const ErrorCodeMalformedPartnerResponse ErrorCode = `MALFORMED_PARTNER_RESPONSE`
const ErrorCodeMalformedRequest ErrorCode = `MALFORMED_REQUEST`
const ErrorCodeManagedResourceGroupDoesNotExist ErrorCode = `MANAGED_RESOURCE_GROUP_DOES_NOT_EXIST`
const ErrorCodeMaxBlockSizeExceeded ErrorCode = `MAX_BLOCK_SIZE_EXCEEDED`
const ErrorCodeMaxChildNodeSizeExceeded ErrorCode = `MAX_CHILD_NODE_SIZE_EXCEEDED`
const ErrorCodeMaxListSizeExceeded ErrorCode = `MAX_LIST_SIZE_EXCEEDED`
const ErrorCodeMaxNotebookSizeExceeded ErrorCode = `MAX_NOTEBOOK_SIZE_EXCEEDED`
const ErrorCodeMaxReadSizeExceeded ErrorCode = `MAX_READ_SIZE_EXCEEDED`
const ErrorCodeMetastoreAlreadyExists ErrorCode = `METASTORE_ALREADY_EXISTS`
const ErrorCodeMetastoreDoesNotExist ErrorCode = `METASTORE_DOES_NOT_EXIST`
const ErrorCodeMetastoreNotEmpty ErrorCode = `METASTORE_NOT_EMPTY`
const ErrorCodeNotFound ErrorCode = `NOT_FOUND`
const ErrorCodeNotImplemented ErrorCode = `NOT_IMPLEMENTED`
const ErrorCodePartialDelete ErrorCode = `PARTIAL_DELETE`
const ErrorCodePermissionDenied ErrorCode = `PERMISSION_DENIED`
const ErrorCodePermissionNotPropagated ErrorCode = `PERMISSION_NOT_PROPAGATED`
const ErrorCodePrincipalDoesNotExist ErrorCode = `PRINCIPAL_DOES_NOT_EXIST`
const ErrorCodeProjectsOperationTimeout ErrorCode = `PROJECTS_OPERATION_TIMEOUT`
const ErrorCodeProviderAlreadyExists ErrorCode = `PROVIDER_ALREADY_EXISTS`
const ErrorCodeProviderDoesNotExist ErrorCode = `PROVIDER_DOES_NOT_EXIST`
const ErrorCodeQuotaExceeded ErrorCode = `QUOTA_EXCEEDED`
const ErrorCodeRecipientAlreadyExists ErrorCode = `RECIPIENT_ALREADY_EXISTS`
const ErrorCodeRecipientDoesNotExist ErrorCode = `RECIPIENT_DOES_NOT_EXIST`
const ErrorCodeRequestLimitExceeded ErrorCode = `REQUEST_LIMIT_EXCEEDED`
const ErrorCodeResourceAlreadyExists ErrorCode = `RESOURCE_ALREADY_EXISTS`
const ErrorCodeResourceConflict ErrorCode = `RESOURCE_CONFLICT`
const ErrorCodeResourceDoesNotExist ErrorCode = `RESOURCE_DOES_NOT_EXIST`
const ErrorCodeResourceExhausted ErrorCode = `RESOURCE_EXHAUSTED`
const ErrorCodeResourceLimitExceeded ErrorCode = `RESOURCE_LIMIT_EXCEEDED`
const ErrorCodeSchemaAlreadyExists ErrorCode = `SCHEMA_ALREADY_EXISTS`
const ErrorCodeSchemaDoesNotExist ErrorCode = `SCHEMA_DOES_NOT_EXIST`
const ErrorCodeSchemaNotEmpty ErrorCode = `SCHEMA_NOT_EMPTY`
const ErrorCodeSearchQueryTooLong ErrorCode = `SEARCH_QUERY_TOO_LONG`
const ErrorCodeSearchQueryTooShort ErrorCode = `SEARCH_QUERY_TOO_SHORT`
const ErrorCodeServiceUnderMaintenance ErrorCode = `SERVICE_UNDER_MAINTENANCE`
const ErrorCodeStorageCredentialAlreadyExists ErrorCode = `STORAGE_CREDENTIAL_ALREADY_EXISTS`
const ErrorCodeStorageCredentialDoesNotExist ErrorCode = `STORAGE_CREDENTIAL_DOES_NOT_EXIST`
const ErrorCodeTableAlreadyExists ErrorCode = `TABLE_ALREADY_EXISTS`
const ErrorCodeTableDoesNotExist ErrorCode = `TABLE_DOES_NOT_EXIST`
const ErrorCodeUnauthenticated ErrorCode = `UNAUTHENTICATED`
const ErrorCodeUnknown ErrorCode = `UNKNOWN`
const ErrorCodeUnparseableHttpError ErrorCode = `UNPARSEABLE_HTTP_ERROR`
func (*ErrorCode) Set ¶ added in v0.86.0
Set raw string value and validate it against allowed values
type GetOperationRequest ¶
type GetOperationRequest struct {
// The name of the operation resource.
Name string `json:"-" url:"-"`
}
type GetTestResourceRequest ¶
type GetTestResourceRequest struct {
// Resource ID to get
ResourceId string `json:"-" url:"-"`
}
type LroTestingAPI ¶
type LroTestingAPI struct {
// contains filtered or unexported fields
}
Test service for Long Running Operations
func NewLroTesting ¶
func NewLroTesting(client *client.DatabricksClient) *LroTestingAPI
func (*LroTestingAPI) CancelOperation ¶
func (a *LroTestingAPI) CancelOperation(ctx context.Context, request CancelOperationRequest) error
func (*LroTestingAPI) CreateTestResource ¶
func (a *LroTestingAPI) CreateTestResource(ctx context.Context, request CreateTestResourceRequest) (CreateTestResourceOperationInterface, error)
func (*LroTestingAPI) DeleteTestResource ¶ added in v0.88.0
func (a *LroTestingAPI) DeleteTestResource(ctx context.Context, request DeleteTestResourceRequest) (DeleteTestResourceOperationInterface, error)
func (*LroTestingAPI) GetOperation ¶
func (a *LroTestingAPI) GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error)
func (*LroTestingAPI) GetTestResource ¶
func (a *LroTestingAPI) GetTestResource(ctx context.Context, request GetTestResourceRequest) (*TestResource, error)
type LroTestingInterface ¶
type LroTestingInterface interface {
CancelOperation(ctx context.Context, request CancelOperationRequest) error
CreateTestResource(ctx context.Context, request CreateTestResourceRequest) (CreateTestResourceOperationInterface, error)
DeleteTestResource(ctx context.Context, request DeleteTestResourceRequest) (DeleteTestResourceOperationInterface, error)
GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error)
// Simple method to get test resource
GetTestResource(ctx context.Context, request GetTestResourceRequest) (*TestResource, error)
}
type Operation ¶ added in v0.86.0
type Operation struct {
// If the value is `false`, it means the operation is still in progress. If
// `true`, the operation is completed, and either `error` or `response` is
// available.
Done bool `json:"done,omitempty"`
// The error result of the operation in case of failure or cancellation.
Error *DatabricksServiceExceptionWithDetailsProto `json:"error,omitempty"`
// Service-specific metadata associated with the operation. It typically
// contains progress information and common metadata such as create time.
// Some services might not provide such metadata.
Metadata json.RawMessage `json:"metadata,omitempty"`
// The server-assigned name, which is only unique within the same service
// that originally returns it. If you use the default HTTP mapping, the
// `name` should be a resource name ending with `operations/{unique_id}`.
Name string `json:"name,omitempty"`
// The normal, successful response of the operation.
Response json.RawMessage `json:"response,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
This resource represents a long-running operation that is the result of a network API call.
func (Operation) MarshalJSON ¶ added in v0.86.0
func (*Operation) UnmarshalJSON ¶ added in v0.86.0
type TestResource ¶
type TestResource struct {
// Unique identifier for the resource
Id string `json:"id,omitempty"`
// Name of the resource
Name string `json:"name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Test resource for LRO operations
func (TestResource) MarshalJSON ¶
func (s TestResource) MarshalJSON() ([]byte, error)
func (*TestResource) UnmarshalJSON ¶
func (s *TestResource) UnmarshalJSON(b []byte) error
type TestResourceOperationMetadata ¶
type TestResourceOperationMetadata struct {
// Progress percentage (0-100)
ProgressPercent int `json:"progress_percent,omitempty"`
// ID of the resource being operated on
ResourceId string `json:"resource_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Metadata for test resource operations
func (TestResourceOperationMetadata) MarshalJSON ¶
func (s TestResourceOperationMetadata) MarshalJSON() ([]byte, error)
func (*TestResourceOperationMetadata) UnmarshalJSON ¶
func (s *TestResourceOperationMetadata) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.