postgres

package
v0.95.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

The Postgres API provides access to a Postgres database via REST API or direct SQL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	// A timestamp indicating when the branch was created.
	CreateTime *time.Time `json:"create_time,omitempty"`
	// The branch's state, indicating if it is initializing, ready for use, or
	// archived.
	CurrentState BranchState `json:"current_state,omitempty"`
	// Whether the branch is the project's default branch. This field is only
	// returned on create/update responses. See effective_default for the value
	// that is actually applied to the branch.
	Default bool `json:"default,omitempty"`
	// Whether the branch is the project's default branch.
	EffectiveDefault bool `json:"effective_default,omitempty"`
	// Whether the branch is protected.
	EffectiveIsProtected bool `json:"effective_is_protected,omitempty"`
	// The name of the source branch from which this branch was created. Format:
	// projects/{project_id}/branches/{branch_id}
	EffectiveSourceBranch string `json:"effective_source_branch,omitempty"`
	// The Log Sequence Number (LSN) on the source branch from which this branch
	// was created.
	EffectiveSourceBranchLsn string `json:"effective_source_branch_lsn,omitempty"`
	// The point in time on the source branch from which this branch was
	// created.
	EffectiveSourceBranchTime *time.Time `json:"effective_source_branch_time,omitempty"`
	// Whether the branch is protected.
	IsProtected bool `json:"is_protected,omitempty"`
	// The logical size of the branch.
	LogicalSizeBytes int64 `json:"logical_size_bytes,omitempty"`
	// The resource name of the branch. Format:
	// projects/{project_id}/branches/{branch_id}
	Name string `json:"name,omitempty"`
	// The project containing this branch. Format: projects/{project_id}
	Parent string `json:"parent,omitempty"`
	// The pending state of the branch, if a state transition is in progress.
	PendingState BranchState `json:"pending_state,omitempty"`
	// The name of the source branch from which this branch was created. Format:
	// projects/{project_id}/branches/{branch_id}
	SourceBranch string `json:"source_branch,omitempty"`
	// The Log Sequence Number (LSN) on the source branch from which this branch
	// was created.
	SourceBranchLsn string `json:"source_branch_lsn,omitempty"`
	// The point in time on the source branch from which this branch was
	// created.
	SourceBranchTime *time.Time `json:"source_branch_time,omitempty"`
	// A timestamp indicating when the `current_state` began.
	StateChangeTime *time.Time `json:"state_change_time,omitempty"`
	// System generated unique ID for the branch.
	Uid string `json:"uid,omitempty"`
	// A timestamp indicating when the branch was last updated.
	UpdateTime *time.Time `json:"update_time,omitempty"`

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

func (Branch) MarshalJSON

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

func (*Branch) UnmarshalJSON

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

type BranchOperationMetadata

type BranchOperationMetadata struct {
}

type BranchState

type BranchState string

The state of the database branch.

const BranchStateArchived BranchState = `ARCHIVED`
const BranchStateImporting BranchState = `IMPORTING`
const BranchStateInit BranchState = `INIT`
const BranchStateReady BranchState = `READY`
const BranchStateResetting BranchState = `RESETTING`

func (*BranchState) Set

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

Set raw string value and validate it against allowed values

func (*BranchState) String

func (f *BranchState) String() string

String representation for fmt.Print

func (*BranchState) Type

func (f *BranchState) Type() string

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

func (*BranchState) Values

func (f *BranchState) Values() []BranchState

Values returns all possible values for BranchState.

There is no guarantee on the order of the values in the slice.

type CreateBranchOperationInterface

type CreateBranchOperationInterface 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) (*Branch, 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() (*BranchOperationMetadata, error)

	// Done reports whether the long-running operation has completed.
	Done() (bool, error)
}

type CreateBranchRequest

type CreateBranchRequest struct {
	// The Branch to create.
	Branch Branch `json:"branch"`
	// The ID to use for the Branch, which will become the final component of
	// the branch's resource name.
	//
	// This value should be 4-63 characters, and valid characters are
	// /[a-z][0-9]-/.
	BranchId string `json:"-" url:"branch_id,omitempty"`
	// The Project where this Branch will be created. Format:
	// projects/{project_id}
	Parent string `json:"-" url:"-"`

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

func (CreateBranchRequest) MarshalJSON

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

func (*CreateBranchRequest) UnmarshalJSON

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

type CreateEndpointOperationInterface

type CreateEndpointOperationInterface 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) (*Endpoint, 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() (*EndpointOperationMetadata, error)

	// Done reports whether the long-running operation has completed.
	Done() (bool, error)
}

type CreateEndpointRequest

type CreateEndpointRequest struct {
	// The Endpoint to create.
	Endpoint Endpoint `json:"endpoint"`
	// The ID to use for the Endpoint, which will become the final component of
	// the endpoint's resource name.
	//
	// This value should be 4-63 characters, and valid characters are
	// /[a-z][0-9]-/.
	EndpointId string `json:"-" url:"endpoint_id,omitempty"`
	// The Branch where this Endpoint will be created. Format:
	// projects/{project_id}/branches/{branch_id}
	Parent string `json:"-" url:"-"`

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

func (CreateEndpointRequest) MarshalJSON

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

func (*CreateEndpointRequest) UnmarshalJSON

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

type CreateProjectOperationInterface

type CreateProjectOperationInterface 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) (*Project, 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() (*ProjectOperationMetadata, error)

	// Done reports whether the long-running operation has completed.
	Done() (bool, error)
}

type CreateProjectRequest

type CreateProjectRequest struct {
	// The Project to create.
	Project Project `json:"project"`
	// The ID to use for the Project, which will become the final component of
	// the project's resource name.
	//
	// This value should be 4-63 characters, and valid characters are
	// /[a-z][0-9]-/.
	ProjectId string `json:"-" url:"project_id,omitempty"`

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

func (CreateProjectRequest) MarshalJSON

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

func (*CreateProjectRequest) UnmarshalJSON

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

type DatabricksServiceExceptionWithDetailsProto

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

func (*DatabricksServiceExceptionWithDetailsProto) UnmarshalJSON

type DeleteBranchRequest

type DeleteBranchRequest struct {
	// The name of the Branch to delete. Format:
	// projects/{project_id}/branches/{branch_id}
	Name string `json:"-" url:"-"`
}

type DeleteEndpointRequest

type DeleteEndpointRequest struct {
	// The name of the Endpoint to delete. Format:
	// projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
	Name string `json:"-" url:"-"`
}

type DeleteProjectRequest

type DeleteProjectRequest struct {
	// The name of the Project to delete. Format: projects/{project_id}
	Name string `json:"-" url:"-"`
}

type Endpoint

type Endpoint struct {
	// The maximum number of Compute Units.
	AutoscalingLimitMaxCu float64 `json:"autoscaling_limit_max_cu,omitempty"`
	// The minimum number of Compute Units.
	AutoscalingLimitMinCu float64 `json:"autoscaling_limit_min_cu,omitempty"`
	// A timestamp indicating when the compute endpoint was created.
	CreateTime *time.Time `json:"create_time,omitempty"`

	CurrentState EndpointState `json:"current_state,omitempty"`
	// Whether to restrict connections to the compute endpoint. Enabling this
	// option schedules a suspend compute operation. A disabled compute endpoint
	// cannot be enabled by a connection or console action.
	Disabled bool `json:"disabled,omitempty"`
	// The maximum number of Compute Units.
	EffectiveAutoscalingLimitMaxCu float64 `json:"effective_autoscaling_limit_max_cu,omitempty"`
	// The minimum number of Compute Units.
	EffectiveAutoscalingLimitMinCu float64 `json:"effective_autoscaling_limit_min_cu,omitempty"`
	// Whether to restrict connections to the compute endpoint. Enabling this
	// option schedules a suspend compute operation. A disabled compute endpoint
	// cannot be enabled by a connection or console action.
	EffectiveDisabled bool `json:"effective_disabled,omitempty"`

	EffectivePoolerMode EndpointPoolerMode `json:"effective_pooler_mode,omitempty"`

	EffectiveSettings *EndpointSettings `json:"effective_settings,omitempty"`
	// Duration of inactivity after which the compute endpoint is automatically
	// suspended.
	EffectiveSuspendTimeoutDuration *duration.Duration `json:"effective_suspend_timeout_duration,omitempty"`
	// The endpoint type. There could be only one READ_WRITE endpoint per
	// branch.
	EndpointType EndpointType `json:"endpoint_type"`
	// The hostname of the compute endpoint. This is the hostname specified when
	// connecting to a database.
	Host string `json:"host,omitempty"`
	// A timestamp indicating when the compute endpoint was last active.
	LastActiveTime *time.Time `json:"last_active_time,omitempty"`
	// The resource name of the endpoint. Format:
	// projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
	Name string `json:"name,omitempty"`
	// The branch containing this endpoint. Format:
	// projects/{project_id}/branches/{branch_id}
	Parent string `json:"parent,omitempty"`

	PendingState EndpointState `json:"pending_state,omitempty"`

	PoolerMode EndpointPoolerMode `json:"pooler_mode,omitempty"`

	Settings *EndpointSettings `json:"settings,omitempty"`
	// A timestamp indicating when the compute endpoint was last started.
	StartTime *time.Time `json:"start_time,omitempty"`
	// A timestamp indicating when the compute endpoint was last suspended.
	SuspendTime *time.Time `json:"suspend_time,omitempty"`
	// Duration of inactivity after which the compute endpoint is automatically
	// suspended.
	SuspendTimeoutDuration *duration.Duration `json:"suspend_timeout_duration,omitempty"`
	// System generated unique ID for the endpoint.
	Uid string `json:"uid,omitempty"`
	// A timestamp indicating when the compute endpoint was last updated.
	UpdateTime *time.Time `json:"update_time,omitempty"`

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

func (Endpoint) MarshalJSON

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

func (*Endpoint) UnmarshalJSON

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

type EndpointOperationMetadata

type EndpointOperationMetadata struct {
}

type EndpointPoolerMode

type EndpointPoolerMode string

The connection pooler mode. Lakebase supports PgBouncer in `transaction` mode only.

const EndpointPoolerModeTransaction EndpointPoolerMode = `TRANSACTION`

func (*EndpointPoolerMode) Set

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

Set raw string value and validate it against allowed values

func (*EndpointPoolerMode) String

func (f *EndpointPoolerMode) String() string

String representation for fmt.Print

func (*EndpointPoolerMode) Type

func (f *EndpointPoolerMode) Type() string

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

func (*EndpointPoolerMode) Values

func (f *EndpointPoolerMode) Values() []EndpointPoolerMode

Values returns all possible values for EndpointPoolerMode.

There is no guarantee on the order of the values in the slice.

type EndpointSettings

type EndpointSettings struct {
	// A raw representation of Postgres settings.
	PgSettings map[string]string `json:"pg_settings,omitempty"`
	// A raw representation of PgBouncer settings.
	PgbouncerSettings map[string]string `json:"pgbouncer_settings,omitempty"`
}

A collection of settings for a compute endpoint.

type EndpointState

type EndpointState string

The state of the compute endpoint.

const EndpointStateActive EndpointState = `ACTIVE`
const EndpointStateIdle EndpointState = `IDLE`
const EndpointStateInit EndpointState = `INIT`

func (*EndpointState) Set

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

Set raw string value and validate it against allowed values

func (*EndpointState) String

func (f *EndpointState) String() string

String representation for fmt.Print

func (*EndpointState) Type

func (f *EndpointState) Type() string

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

func (*EndpointState) Values

func (f *EndpointState) Values() []EndpointState

Values returns all possible values for EndpointState.

There is no guarantee on the order of the values in the slice.

type EndpointType

type EndpointType string

The compute endpoint type. Either `read_write` or `read_only`.

const EndpointTypeReadOnly EndpointType = `READ_ONLY`
const EndpointTypeReadWrite EndpointType = `READ_WRITE`

func (*EndpointType) Set

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

Set raw string value and validate it against allowed values

func (*EndpointType) String

func (f *EndpointType) String() string

String representation for fmt.Print

func (*EndpointType) Type

func (f *EndpointType) Type() string

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

func (*EndpointType) Values

func (f *EndpointType) Values() []EndpointType

Values returns all possible values for EndpointType.

There is no guarantee on the order of the values in the slice.

type ErrorCode

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 ErrorCodeCustomerUnauthorized ErrorCode = `CUSTOMER_UNAUTHORIZED`
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 ErrorCodeProviderShareNotAccessible ErrorCode = `PROVIDER_SHARE_NOT_ACCESSIBLE`
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 ErrorCodeShareAlreadyExists ErrorCode = `SHARE_ALREADY_EXISTS`
const ErrorCodeShareDoesNotExist ErrorCode = `SHARE_DOES_NOT_EXIST`
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 ErrorCodeTemporarilyUnavailable ErrorCode = `TEMPORARILY_UNAVAILABLE`
const ErrorCodeUnauthenticated ErrorCode = `UNAUTHENTICATED`
const ErrorCodeUnavailable ErrorCode = `UNAVAILABLE`
const ErrorCodeUnknown ErrorCode = `UNKNOWN`
const ErrorCodeUnparseableHttpError ErrorCode = `UNPARSEABLE_HTTP_ERROR`
const ErrorCodeWorkspaceTemporarilyUnavailable ErrorCode = `WORKSPACE_TEMPORARILY_UNAVAILABLE`

func (*ErrorCode) Set

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

Set raw string value and validate it against allowed values

func (*ErrorCode) String

func (f *ErrorCode) String() string

String representation for fmt.Print

func (*ErrorCode) Type

func (f *ErrorCode) Type() string

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

func (*ErrorCode) Values

func (f *ErrorCode) Values() []ErrorCode

Values returns all possible values for ErrorCode.

There is no guarantee on the order of the values in the slice.

type GetBranchRequest

type GetBranchRequest struct {
	// The name of the Branch to retrieve. Format:
	// projects/{project_id}/branches/{branch_id}
	Name string `json:"-" url:"-"`
}

type GetEndpointRequest

type GetEndpointRequest struct {
	// The name of the Endpoint to retrieve. Format:
	// projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
	Name string `json:"-" url:"-"`
}

type GetOperationRequest

type GetOperationRequest struct {
	// The name of the operation resource.
	Name string `json:"-" url:"-"`
}

type GetProjectRequest

type GetProjectRequest struct {
	// The name of the Project to retrieve. Format: projects/{project_id}
	Name string `json:"-" url:"-"`
}

type ListBranchesRequest

type ListBranchesRequest struct {
	// Upper bound for items returned.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// Pagination token to go to the next page of Branches. Requests first page
	// if absent.
	PageToken string `json:"-" url:"page_token,omitempty"`
	// The Project that owns this collection of branches. Format:
	// projects/{project_id}
	Parent string `json:"-" url:"-"`

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

func (ListBranchesRequest) MarshalJSON

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

func (*ListBranchesRequest) UnmarshalJSON

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

type ListBranchesResponse

type ListBranchesResponse struct {
	// List of branches.
	Branches []Branch `json:"branches,omitempty"`
	// Pagination token to request the next page of branches.
	NextPageToken string `json:"next_page_token,omitempty"`

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

func (ListBranchesResponse) MarshalJSON

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

func (*ListBranchesResponse) UnmarshalJSON

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

type ListEndpointsRequest

type ListEndpointsRequest struct {
	// Upper bound for items returned.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// Pagination token to go to the next page of Endpoints. Requests first page
	// if absent.
	PageToken string `json:"-" url:"page_token,omitempty"`
	// The Branch that owns this collection of endpoints. Format:
	// projects/{project_id}/branches/{branch_id}
	Parent string `json:"-" url:"-"`

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

func (ListEndpointsRequest) MarshalJSON

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

func (*ListEndpointsRequest) UnmarshalJSON

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

type ListEndpointsResponse

type ListEndpointsResponse struct {
	// List of endpoints.
	Endpoints []Endpoint `json:"endpoints,omitempty"`
	// Pagination token to request the next page of endpoints.
	NextPageToken string `json:"next_page_token,omitempty"`

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

func (ListEndpointsResponse) MarshalJSON

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

func (*ListEndpointsResponse) UnmarshalJSON

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

type ListProjectsRequest

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

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

func (ListProjectsRequest) MarshalJSON

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

func (*ListProjectsRequest) UnmarshalJSON

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

type ListProjectsResponse

type ListProjectsResponse struct {
	// Pagination token to request the next page of projects.
	NextPageToken string `json:"next_page_token,omitempty"`
	// List of projects.
	Projects []Project `json:"projects,omitempty"`

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

func (ListProjectsResponse) MarshalJSON

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

func (*ListProjectsResponse) UnmarshalJSON

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

type Operation

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

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

func (*Operation) UnmarshalJSON

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

type PostgresAPI

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

The Postgres API provides access to a Postgres database via REST API or direct SQL.

func NewPostgres

func NewPostgres(client *client.DatabricksClient) *PostgresAPI

func (*PostgresAPI) CreateBranch

func (*PostgresAPI) CreateEndpoint

func (*PostgresAPI) CreateProject

func (*PostgresAPI) DeleteBranch

func (a *PostgresAPI) DeleteBranch(ctx context.Context, request DeleteBranchRequest) error

func (*PostgresAPI) DeleteEndpoint

func (a *PostgresAPI) DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error

func (*PostgresAPI) DeleteProject

func (a *PostgresAPI) DeleteProject(ctx context.Context, request DeleteProjectRequest) error

func (*PostgresAPI) GetBranch

func (a *PostgresAPI) GetBranch(ctx context.Context, request GetBranchRequest) (*Branch, error)

func (*PostgresAPI) GetEndpoint

func (a *PostgresAPI) GetEndpoint(ctx context.Context, request GetEndpointRequest) (*Endpoint, error)

func (*PostgresAPI) GetOperation

func (a *PostgresAPI) GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error)

func (*PostgresAPI) GetProject

func (a *PostgresAPI) GetProject(ctx context.Context, request GetProjectRequest) (*Project, error)

func (*PostgresAPI) ListBranches

func (a *PostgresAPI) ListBranches(ctx context.Context, request ListBranchesRequest) listing.Iterator[Branch]

List Branches.

func (*PostgresAPI) ListBranchesAll

func (a *PostgresAPI) ListBranchesAll(ctx context.Context, request ListBranchesRequest) ([]Branch, error)

List Branches.

func (*PostgresAPI) ListEndpoints

func (a *PostgresAPI) ListEndpoints(ctx context.Context, request ListEndpointsRequest) listing.Iterator[Endpoint]

List Endpoints.

func (*PostgresAPI) ListEndpointsAll

func (a *PostgresAPI) ListEndpointsAll(ctx context.Context, request ListEndpointsRequest) ([]Endpoint, error)

List Endpoints.

func (*PostgresAPI) ListProjects

func (a *PostgresAPI) ListProjects(ctx context.Context, request ListProjectsRequest) listing.Iterator[Project]

List Projects.

func (*PostgresAPI) ListProjectsAll

func (a *PostgresAPI) ListProjectsAll(ctx context.Context, request ListProjectsRequest) ([]Project, error)

List Projects.

func (*PostgresAPI) UpdateBranch

func (*PostgresAPI) UpdateEndpoint

func (*PostgresAPI) UpdateProject

type PostgresInterface

type PostgresInterface interface {
	CreateBranch(ctx context.Context, request CreateBranchRequest) (CreateBranchOperationInterface, error)

	CreateEndpoint(ctx context.Context, request CreateEndpointRequest) (CreateEndpointOperationInterface, error)

	CreateProject(ctx context.Context, request CreateProjectRequest) (CreateProjectOperationInterface, error)

	// Delete a Branch.
	DeleteBranch(ctx context.Context, request DeleteBranchRequest) error

	// Delete an Endpoint.
	DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error

	// Delete a Project.
	DeleteProject(ctx context.Context, request DeleteProjectRequest) error

	// Get a Branch.
	GetBranch(ctx context.Context, request GetBranchRequest) (*Branch, error)

	// Get an Endpoint.
	GetEndpoint(ctx context.Context, request GetEndpointRequest) (*Endpoint, error)

	// Get an Operation.
	GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error)

	// Get a Project.
	GetProject(ctx context.Context, request GetProjectRequest) (*Project, error)

	// List Branches.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListBranches(ctx context.Context, request ListBranchesRequest) listing.Iterator[Branch]

	// List Branches.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListBranchesAll(ctx context.Context, request ListBranchesRequest) ([]Branch, error)

	// List Endpoints.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListEndpoints(ctx context.Context, request ListEndpointsRequest) listing.Iterator[Endpoint]

	// List Endpoints.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListEndpointsAll(ctx context.Context, request ListEndpointsRequest) ([]Endpoint, error)

	// List Projects.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListProjects(ctx context.Context, request ListProjectsRequest) listing.Iterator[Project]

	// List Projects.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListProjectsAll(ctx context.Context, request ListProjectsRequest) ([]Project, error)

	UpdateBranch(ctx context.Context, request UpdateBranchRequest) (UpdateBranchOperationInterface, error)

	UpdateEndpoint(ctx context.Context, request UpdateEndpointRequest) (UpdateEndpointOperationInterface, error)

	UpdateProject(ctx context.Context, request UpdateProjectRequest) (UpdateProjectOperationInterface, error)
}

type PostgresService deprecated

type PostgresService interface {

	// Create a Branch.
	CreateBranch(ctx context.Context, request CreateBranchRequest) (*Operation, error)

	// Create an Endpoint.
	CreateEndpoint(ctx context.Context, request CreateEndpointRequest) (*Operation, error)

	// Create a Project.
	CreateProject(ctx context.Context, request CreateProjectRequest) (*Operation, error)

	// Delete a Branch.
	DeleteBranch(ctx context.Context, request DeleteBranchRequest) error

	// Delete an Endpoint.
	DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error

	// Delete a Project.
	DeleteProject(ctx context.Context, request DeleteProjectRequest) error

	// Get a Branch.
	GetBranch(ctx context.Context, request GetBranchRequest) (*Branch, error)

	// Get an Endpoint.
	GetEndpoint(ctx context.Context, request GetEndpointRequest) (*Endpoint, error)

	// Get an Operation.
	GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error)

	// Get a Project.
	GetProject(ctx context.Context, request GetProjectRequest) (*Project, error)

	// List Branches.
	ListBranches(ctx context.Context, request ListBranchesRequest) (*ListBranchesResponse, error)

	// List Endpoints.
	ListEndpoints(ctx context.Context, request ListEndpointsRequest) (*ListEndpointsResponse, error)

	// List Projects.
	ListProjects(ctx context.Context, request ListProjectsRequest) (*ListProjectsResponse, error)

	// Update a Branch.
	UpdateBranch(ctx context.Context, request UpdateBranchRequest) (*Operation, error)

	// Update an Endpoint.
	UpdateEndpoint(ctx context.Context, request UpdateEndpointRequest) (*Operation, error)

	// Update a Project.
	UpdateProject(ctx context.Context, request UpdateProjectRequest) (*Operation, error)
}

The Postgres API provides access to a Postgres database via REST API or direct SQL.

Deprecated: Do not use this interface, it will be removed in a future version of the SDK.

type Project

type Project struct {
	// The logical size limit for a branch.
	BranchLogicalSizeLimitBytes int64 `json:"branch_logical_size_limit_bytes,omitempty"`
	// The most recent time when any endpoint of this project was active.
	ComputeLastActiveTime *time.Time `json:"compute_last_active_time,omitempty"`
	// A timestamp indicating when the project was created.
	CreateTime *time.Time `json:"create_time,omitempty"`

	DefaultEndpointSettings *ProjectDefaultEndpointSettings `json:"default_endpoint_settings,omitempty"`
	// Human-readable project name.
	DisplayName string `json:"display_name,omitempty"`

	EffectiveDefaultEndpointSettings *ProjectDefaultEndpointSettings `json:"effective_default_endpoint_settings,omitempty"`

	EffectiveDisplayName string `json:"effective_display_name,omitempty"`

	EffectiveHistoryRetentionDuration *duration.Duration `json:"effective_history_retention_duration,omitempty"`

	EffectivePgVersion int `json:"effective_pg_version,omitempty"`

	EffectiveSettings *ProjectSettings `json:"effective_settings,omitempty"`
	// The number of seconds to retain the shared history for point in time
	// recovery for all branches in this project.
	HistoryRetentionDuration *duration.Duration `json:"history_retention_duration,omitempty"`
	// The resource name of the project. Format: projects/{project_id}
	Name string `json:"name,omitempty"`
	// The major Postgres version number.
	PgVersion int `json:"pg_version,omitempty"`

	Settings *ProjectSettings `json:"settings,omitempty"`
	// The current space occupied by the project in storage. Synthetic storage
	// size combines the logical data size and Write-Ahead Log (WAL) size for
	// all branches in a project.
	SyntheticStorageSizeBytes int64 `json:"synthetic_storage_size_bytes,omitempty"`
	// System generated unique ID for the project.
	Uid string `json:"uid,omitempty"`
	// A timestamp indicating when the project was last updated.
	UpdateTime *time.Time `json:"update_time,omitempty"`

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

func (Project) MarshalJSON

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

func (*Project) UnmarshalJSON

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

type ProjectDefaultEndpointSettings

type ProjectDefaultEndpointSettings struct {
	// The maximum number of Compute Units.
	AutoscalingLimitMaxCu float64 `json:"autoscaling_limit_max_cu,omitempty"`
	// The minimum number of Compute Units.
	AutoscalingLimitMinCu float64 `json:"autoscaling_limit_min_cu,omitempty"`
	// A raw representation of Postgres settings.
	PgSettings map[string]string `json:"pg_settings,omitempty"`
	// A raw representation of PgBouncer settings.
	PgbouncerSettings map[string]string `json:"pgbouncer_settings,omitempty"`
	// Duration of inactivity after which the compute endpoint is automatically
	// suspended.
	SuspendTimeoutDuration *duration.Duration `json:"suspend_timeout_duration,omitempty"`

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

A collection of settings for a compute endpoint.

func (ProjectDefaultEndpointSettings) MarshalJSON

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

func (*ProjectDefaultEndpointSettings) UnmarshalJSON

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

type ProjectOperationMetadata

type ProjectOperationMetadata struct {
}

type ProjectSettings

type ProjectSettings struct {
	// Sets wal_level=logical for all compute endpoints in this project. All
	// active endpoints will be suspended. Once enabled, logical replication
	// cannot be disabled.
	EnableLogicalReplication bool `json:"enable_logical_replication,omitempty"`

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

func (ProjectSettings) MarshalJSON

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

func (*ProjectSettings) UnmarshalJSON

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

type UpdateBranchOperationInterface

type UpdateBranchOperationInterface 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) (*Branch, 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() (*BranchOperationMetadata, error)

	// Done reports whether the long-running operation has completed.
	Done() (bool, error)
}

type UpdateBranchRequest

type UpdateBranchRequest struct {
	// The Branch to update.
	//
	// The branch's `name` field is used to identify the branch to update.
	// Format: projects/{project_id}/branches/{branch_id}
	Branch Branch `json:"branch"`
	// The resource name of the branch. Format:
	// projects/{project_id}/branches/{branch_id}
	Name string `json:"-" url:"-"`
	// The list of fields to update. If unspecified, all fields will be updated
	// when possible.
	UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"`
}

type UpdateEndpointOperationInterface

type UpdateEndpointOperationInterface 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) (*Endpoint, 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() (*EndpointOperationMetadata, error)

	// Done reports whether the long-running operation has completed.
	Done() (bool, error)
}

type UpdateEndpointRequest

type UpdateEndpointRequest struct {
	// The Endpoint to update.
	//
	// The endpoint's `name` field is used to identify the endpoint to update.
	// Format:
	// projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
	Endpoint Endpoint `json:"endpoint"`
	// The resource name of the endpoint. Format:
	// projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
	Name string `json:"-" url:"-"`
	// The list of fields to update. If unspecified, all fields will be updated
	// when possible.
	UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"`
}

type UpdateProjectOperationInterface

type UpdateProjectOperationInterface 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) (*Project, 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() (*ProjectOperationMetadata, error)

	// Done reports whether the long-running operation has completed.
	Done() (bool, error)
}

type UpdateProjectRequest

type UpdateProjectRequest struct {
	// The resource name of the project. Format: projects/{project_id}
	Name string `json:"-" url:"-"`
	// The Project to update.
	//
	// The project's `name` field is used to identify the project to update.
	// Format: projects/{project_id}
	Project Project `json:"project"`
	// The list of fields to update. If unspecified, all fields will be updated
	// when possible.
	UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"`
}

Jump to

Keyboard shortcuts

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