Documentation
¶
Overview ¶
The Postgres API provides access to a Postgres database via REST API or direct SQL.
Index ¶
- type Branch
- type BranchOperationMetadata
- type BranchSpec
- type BranchStatus
- type BranchStatusState
- type CreateBranchOperationInterface
- type CreateBranchRequest
- type CreateEndpointOperationInterface
- type CreateEndpointRequest
- type CreateProjectOperationInterface
- type CreateProjectRequest
- type CreateRoleOperationInterface
- type CreateRoleRequest
- type DatabricksServiceExceptionWithDetailsProto
- type DeleteBranchOperationInterface
- type DeleteBranchRequest
- type DeleteEndpointOperationInterface
- type DeleteEndpointRequest
- type DeleteProjectOperationInterface
- type DeleteProjectRequest
- type DeleteRoleOperationInterface
- type DeleteRoleRequest
- type Endpoint
- type EndpointOperationMetadata
- type EndpointSettings
- type EndpointSpec
- type EndpointStatus
- type EndpointStatusState
- type EndpointType
- type ErrorCode
- type GetBranchRequest
- type GetEndpointRequest
- type GetOperationRequest
- type GetProjectRequest
- type GetRoleRequest
- type ListBranchesRequest
- type ListBranchesResponse
- type ListEndpointsRequest
- type ListEndpointsResponse
- type ListProjectsRequest
- type ListProjectsResponse
- type ListRolesRequest
- type ListRolesResponse
- type Operation
- type PostgresAPI
- func (a *PostgresAPI) CreateBranch(ctx context.Context, request CreateBranchRequest) (CreateBranchOperationInterface, error)
- func (a *PostgresAPI) CreateEndpoint(ctx context.Context, request CreateEndpointRequest) (CreateEndpointOperationInterface, error)
- func (a *PostgresAPI) CreateProject(ctx context.Context, request CreateProjectRequest) (CreateProjectOperationInterface, error)
- func (a *PostgresAPI) CreateRole(ctx context.Context, request CreateRoleRequest) (CreateRoleOperationInterface, error)
- func (a *PostgresAPI) DeleteBranch(ctx context.Context, request DeleteBranchRequest) (DeleteBranchOperationInterface, error)
- func (a *PostgresAPI) DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) (DeleteEndpointOperationInterface, error)
- func (a *PostgresAPI) DeleteProject(ctx context.Context, request DeleteProjectRequest) (DeleteProjectOperationInterface, error)
- func (a *PostgresAPI) DeleteRole(ctx context.Context, request DeleteRoleRequest) (DeleteRoleOperationInterface, error)
- func (a *PostgresAPI) GetBranch(ctx context.Context, request GetBranchRequest) (*Branch, error)
- func (a *PostgresAPI) GetEndpoint(ctx context.Context, request GetEndpointRequest) (*Endpoint, error)
- func (a *PostgresAPI) GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error)
- func (a *PostgresAPI) GetProject(ctx context.Context, request GetProjectRequest) (*Project, error)
- func (a *PostgresAPI) GetRole(ctx context.Context, request GetRoleRequest) (*Role, error)
- func (a *PostgresAPI) ListBranches(ctx context.Context, request ListBranchesRequest) listing.Iterator[Branch]
- func (a *PostgresAPI) ListBranchesAll(ctx context.Context, request ListBranchesRequest) ([]Branch, error)
- func (a *PostgresAPI) ListEndpoints(ctx context.Context, request ListEndpointsRequest) listing.Iterator[Endpoint]
- func (a *PostgresAPI) ListEndpointsAll(ctx context.Context, request ListEndpointsRequest) ([]Endpoint, error)
- func (a *PostgresAPI) ListProjects(ctx context.Context, request ListProjectsRequest) listing.Iterator[Project]
- func (a *PostgresAPI) ListProjectsAll(ctx context.Context, request ListProjectsRequest) ([]Project, error)
- func (a *PostgresAPI) ListRoles(ctx context.Context, request ListRolesRequest) listing.Iterator[Role]
- func (a *PostgresAPI) ListRolesAll(ctx context.Context, request ListRolesRequest) ([]Role, error)
- func (a *PostgresAPI) UpdateBranch(ctx context.Context, request UpdateBranchRequest) (UpdateBranchOperationInterface, error)
- func (a *PostgresAPI) UpdateEndpoint(ctx context.Context, request UpdateEndpointRequest) (UpdateEndpointOperationInterface, error)
- func (a *PostgresAPI) UpdateProject(ctx context.Context, request UpdateProjectRequest) (UpdateProjectOperationInterface, error)
- type PostgresInterface
- type PostgresServicedeprecated
- type Project
- type ProjectDefaultEndpointSettings
- type ProjectOperationMetadata
- type ProjectSettings
- type ProjectSpec
- type ProjectStatus
- type Role
- type RoleAuthMethod
- type RoleIdentityType
- type RoleOperationMetadata
- type RoleRoleSpec
- type RoleRoleStatus
- type UpdateBranchOperationInterface
- type UpdateBranchRequest
- type UpdateEndpointOperationInterface
- type UpdateEndpointRequest
- type UpdateProjectOperationInterface
- type UpdateProjectRequest
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 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 desired state of a Branch.
Spec *BranchSpec `json:"spec,omitempty"`
// The current status of a Branch.
Status *BranchStatus `json:"status,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 (*Branch) UnmarshalJSON ¶
type BranchOperationMetadata ¶
type BranchOperationMetadata struct {
}
type BranchSpec ¶ added in v0.96.0
type BranchSpec struct {
// Whether the branch is the project's default branch.
Default bool `json:"default,omitempty"`
// Whether the branch is protected.
IsProtected bool `json:"is_protected,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"`
ForceSendFields []string `json:"-" url:"-"`
}
func (BranchSpec) MarshalJSON ¶ added in v0.96.0
func (s BranchSpec) MarshalJSON() ([]byte, error)
func (*BranchSpec) UnmarshalJSON ¶ added in v0.96.0
func (s *BranchSpec) UnmarshalJSON(b []byte) error
type BranchStatus ¶ added in v0.96.0
type BranchStatus struct {
// The branch's state, indicating if it is initializing, ready for use, or
// archived.
CurrentState BranchStatusState `json:"current_state,omitempty"`
// Whether the branch is the project's default branch.
Default bool `json:"default,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 pending state of the branch, if a state transition is in progress.
PendingState BranchStatusState `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"`
ForceSendFields []string `json:"-" url:"-"`
}
func (BranchStatus) MarshalJSON ¶ added in v0.96.0
func (s BranchStatus) MarshalJSON() ([]byte, error)
func (*BranchStatus) UnmarshalJSON ¶ added in v0.96.0
func (s *BranchStatus) UnmarshalJSON(b []byte) error
type BranchStatusState ¶ added in v0.96.0
type BranchStatusState string
The state of the database branch.
const BranchStatusStateArchived BranchStatusState = `ARCHIVED`
const BranchStatusStateImporting BranchStatusState = `IMPORTING`
const BranchStatusStateInit BranchStatusState = `INIT`
const BranchStatusStateReady BranchStatusState = `READY`
const BranchStatusStateResetting BranchStatusState = `RESETTING`
func (*BranchStatusState) Set ¶ added in v0.96.0
func (f *BranchStatusState) Set(v string) error
Set raw string value and validate it against allowed values
func (*BranchStatusState) String ¶ added in v0.96.0
func (f *BranchStatusState) String() string
String representation for fmt.Print
func (*BranchStatusState) Type ¶ added in v0.96.0
func (f *BranchStatusState) Type() string
Type always returns BranchStatusState to satisfy [pflag.Value] interface
func (*BranchStatusState) Values ¶ added in v0.96.0
func (f *BranchStatusState) Values() []BranchStatusState
Values returns all possible values for BranchStatusState.
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"`
// The Project where this Branch will be created. Format:
// projects/{project_id}
Parent string `json:"-" url:"-"`
}
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"`
// The Branch where this Endpoint will be created. Format:
// projects/{project_id}/branches/{branch_id}
Parent string `json:"-" url:"-"`
}
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"`
}
type CreateRoleOperationInterface ¶ added in v0.96.0
type CreateRoleOperationInterface 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) (*Role, 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() (*RoleOperationMetadata, error)
// Done reports whether the long-running operation has completed.
Done() (bool, error)
}
type CreateRoleRequest ¶ added in v0.96.0
type CreateRoleRequest struct {
// The Branch where this Role is created. Format:
// projects/{project_id}/branches/{branch_id}
Parent string `json:"-" url:"-"`
// The desired specification of a Role.
Role Role `json:"role"`
// The ID to use for the Role, which will become the final component of the
// branch's resource name. This ID becomes the role in postgres.
//
// This value should be 4-63 characters, and only use characters available
// in DNS names, as defined by RFC-1123
RoleId string `json:"-" url:"role_id"`
}
type DatabricksServiceExceptionWithDetailsProto ¶
type DatabricksServiceExceptionWithDetailsProto struct {
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 (s DatabricksServiceExceptionWithDetailsProto) MarshalJSON() ([]byte, error)
func (*DatabricksServiceExceptionWithDetailsProto) UnmarshalJSON ¶
func (s *DatabricksServiceExceptionWithDetailsProto) UnmarshalJSON(b []byte) error
type DeleteBranchOperationInterface ¶ added in v0.97.0
type DeleteBranchOperationInterface 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
// 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 DeleteBranchRequest ¶
type DeleteBranchRequest struct {
// The name of the Branch to delete. Format:
// projects/{project_id}/branches/{branch_id}
Name string `json:"-" url:"-"`
}
type DeleteEndpointOperationInterface ¶ added in v0.97.0
type DeleteEndpointOperationInterface 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
// 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 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 DeleteProjectOperationInterface ¶ added in v0.97.0
type DeleteProjectOperationInterface 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
// 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 DeleteProjectRequest ¶
type DeleteProjectRequest struct {
// The name of the Project to delete. Format: projects/{project_id}
Name string `json:"-" url:"-"`
}
type DeleteRoleOperationInterface ¶ added in v0.96.0
type DeleteRoleOperationInterface 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
// 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() (*RoleOperationMetadata, error)
// Done reports whether the long-running operation has completed.
Done() (bool, error)
}
type DeleteRoleRequest ¶ added in v0.96.0
type DeleteRoleRequest struct {
// The resource name of the postgres role. Format:
// projects/{project_id}/branch/{branch_id}/roles/{role_id}
Name string `json:"-" url:"-"`
// Reassign objects. If this is set, all objects owned by the role are
// reassigned to the role specified in this parameter.
//
// NOTE: setting this requires spinning up a compute to succeed, since it
// involves running SQL queries.
//
// TODO: #LKB-7187 implement reassign_owned_to on LBM side. This might
// end-up being a synchronous query when this parameter is used.
ReassignOwnedTo string `json:"-" url:"reassign_owned_to,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (DeleteRoleRequest) MarshalJSON ¶ added in v0.96.0
func (s DeleteRoleRequest) MarshalJSON() ([]byte, error)
func (*DeleteRoleRequest) UnmarshalJSON ¶ added in v0.96.0
func (s *DeleteRoleRequest) UnmarshalJSON(b []byte) error
type Endpoint ¶
type Endpoint struct {
// A timestamp indicating when the compute endpoint was created.
CreateTime *time.Time `json:"create_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"`
// The desired state of an Endpoint.
Spec *EndpointSpec `json:"spec,omitempty"`
// The current status of an Endpoint.
Status *EndpointStatus `json:"status,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 (*Endpoint) UnmarshalJSON ¶
type EndpointOperationMetadata ¶
type EndpointOperationMetadata struct {
}
type EndpointSettings ¶
type EndpointSettings struct {
// A raw representation of Postgres settings.
PgSettings map[string]string `json:"pg_settings,omitempty"`
}
A collection of settings for a compute endpoint.
type EndpointSpec ¶ added in v0.96.0
type EndpointSpec 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"`
// 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 endpoint type. A branch can only have one READ_WRITE endpoint.
EndpointType EndpointType `json:"endpoint_type"`
Settings *EndpointSettings `json:"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:"-"`
}
func (EndpointSpec) MarshalJSON ¶ added in v0.96.0
func (s EndpointSpec) MarshalJSON() ([]byte, error)
func (*EndpointSpec) UnmarshalJSON ¶ added in v0.96.0
func (s *EndpointSpec) UnmarshalJSON(b []byte) error
type EndpointStatus ¶ added in v0.96.0
type EndpointStatus 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"`
CurrentState EndpointStatusState `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 endpoint type. A branch can only have one READ_WRITE endpoint.
EndpointType EndpointType `json:"endpoint_type,omitempty"`
// 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"`
PendingState EndpointStatusState `json:"pending_state,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"`
ForceSendFields []string `json:"-" url:"-"`
}
func (EndpointStatus) MarshalJSON ¶ added in v0.96.0
func (s EndpointStatus) MarshalJSON() ([]byte, error)
func (*EndpointStatus) UnmarshalJSON ¶ added in v0.96.0
func (s *EndpointStatus) UnmarshalJSON(b []byte) error
type EndpointStatusState ¶ added in v0.96.0
type EndpointStatusState string
The state of the compute endpoint.
const EndpointStatusStateActive EndpointStatusState = `ACTIVE`
const EndpointStatusStateIdle EndpointStatusState = `IDLE`
const EndpointStatusStateInit EndpointStatusState = `INIT`
func (*EndpointStatusState) Set ¶ added in v0.96.0
func (f *EndpointStatusState) Set(v string) error
Set raw string value and validate it against allowed values
func (*EndpointStatusState) String ¶ added in v0.96.0
func (f *EndpointStatusState) String() string
String representation for fmt.Print
func (*EndpointStatusState) Type ¶ added in v0.96.0
func (f *EndpointStatusState) Type() string
Type always returns EndpointStatusState to satisfy [pflag.Value] interface
func (*EndpointStatusState) Values ¶ added in v0.96.0
func (f *EndpointStatusState) Values() []EndpointStatusState
Values returns all possible values for EndpointStatusState.
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 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`
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 GetRoleRequest ¶ added in v0.96.0
type GetRoleRequest struct {
// The name of the Role to retrieve. Format:
// projects/{project_id}/branches/{branch_id}/roles/{role_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 ListRolesRequest ¶ added in v0.96.0
type ListRolesRequest struct {
// Upper bound for items returned.
PageSize int `json:"-" url:"page_size,omitempty"`
// Pagination token to go to the next page of Roles. Requests first page if
// absent.
PageToken string `json:"-" url:"page_token,omitempty"`
// The Branch that owns this collection of roles. Format:
// projects/{project_id}/branches/{branch_id}
Parent string `json:"-" url:"-"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListRolesRequest) MarshalJSON ¶ added in v0.96.0
func (s ListRolesRequest) MarshalJSON() ([]byte, error)
func (*ListRolesRequest) UnmarshalJSON ¶ added in v0.96.0
func (s *ListRolesRequest) UnmarshalJSON(b []byte) error
type ListRolesResponse ¶ added in v0.96.0
type ListRolesResponse struct {
// Pagination token to request the next page of roles.
NextPageToken string `json:"next_page_token,omitempty"`
// List of roles.
Roles []Role `json:"roles,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListRolesResponse) MarshalJSON ¶ added in v0.96.0
func (s ListRolesResponse) MarshalJSON() ([]byte, error)
func (*ListRolesResponse) UnmarshalJSON ¶ added in v0.96.0
func (s *ListRolesResponse) 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 (*Operation) UnmarshalJSON ¶
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 (a *PostgresAPI) CreateBranch(ctx context.Context, request CreateBranchRequest) (CreateBranchOperationInterface, error)
func (*PostgresAPI) CreateEndpoint ¶
func (a *PostgresAPI) CreateEndpoint(ctx context.Context, request CreateEndpointRequest) (CreateEndpointOperationInterface, error)
func (*PostgresAPI) CreateProject ¶
func (a *PostgresAPI) CreateProject(ctx context.Context, request CreateProjectRequest) (CreateProjectOperationInterface, error)
func (*PostgresAPI) CreateRole ¶ added in v0.96.0
func (a *PostgresAPI) CreateRole(ctx context.Context, request CreateRoleRequest) (CreateRoleOperationInterface, error)
func (*PostgresAPI) DeleteBranch ¶
func (a *PostgresAPI) DeleteBranch(ctx context.Context, request DeleteBranchRequest) (DeleteBranchOperationInterface, error)
func (*PostgresAPI) DeleteEndpoint ¶
func (a *PostgresAPI) DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) (DeleteEndpointOperationInterface, error)
func (*PostgresAPI) DeleteProject ¶
func (a *PostgresAPI) DeleteProject(ctx context.Context, request DeleteProjectRequest) (DeleteProjectOperationInterface, error)
func (*PostgresAPI) DeleteRole ¶ added in v0.96.0
func (a *PostgresAPI) DeleteRole(ctx context.Context, request DeleteRoleRequest) (DeleteRoleOperationInterface, 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) GetRole ¶ added in v0.96.0
func (a *PostgresAPI) GetRole(ctx context.Context, request GetRoleRequest) (*Role, 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) ListRoles ¶ added in v0.96.0
func (a *PostgresAPI) ListRoles(ctx context.Context, request ListRolesRequest) listing.Iterator[Role]
List Roles.
func (*PostgresAPI) ListRolesAll ¶ added in v0.96.0
func (a *PostgresAPI) ListRolesAll(ctx context.Context, request ListRolesRequest) ([]Role, error)
List Roles.
func (*PostgresAPI) UpdateBranch ¶
func (a *PostgresAPI) UpdateBranch(ctx context.Context, request UpdateBranchRequest) (UpdateBranchOperationInterface, error)
func (*PostgresAPI) UpdateEndpoint ¶
func (a *PostgresAPI) UpdateEndpoint(ctx context.Context, request UpdateEndpointRequest) (UpdateEndpointOperationInterface, error)
func (*PostgresAPI) UpdateProject ¶
func (a *PostgresAPI) UpdateProject(ctx context.Context, request UpdateProjectRequest) (UpdateProjectOperationInterface, error)
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)
CreateRole(ctx context.Context, request CreateRoleRequest) (CreateRoleOperationInterface, error)
DeleteBranch(ctx context.Context, request DeleteBranchRequest) (DeleteBranchOperationInterface, error)
DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) (DeleteEndpointOperationInterface, error)
DeleteProject(ctx context.Context, request DeleteProjectRequest) (DeleteProjectOperationInterface, error)
DeleteRole(ctx context.Context, request DeleteRoleRequest) (DeleteRoleOperationInterface, 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)
// Get a Role.
GetRole(ctx context.Context, request GetRoleRequest) (*Role, 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)
// List Roles.
//
// This method is generated by Databricks SDK Code Generator.
ListRoles(ctx context.Context, request ListRolesRequest) listing.Iterator[Role]
// List Roles.
//
// This method is generated by Databricks SDK Code Generator.
ListRolesAll(ctx context.Context, request ListRolesRequest) ([]Role, 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)
// Create a role for a branch.
CreateRole(ctx context.Context, request CreateRoleRequest) (*Operation, error)
// Delete a Branch.
DeleteBranch(ctx context.Context, request DeleteBranchRequest) (*Operation, error)
// Delete an Endpoint.
DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) (*Operation, error)
// Delete a Project.
DeleteProject(ctx context.Context, request DeleteProjectRequest) (*Operation, error)
// Delete a role in a branch.
DeleteRole(ctx context.Context, request DeleteRoleRequest) (*Operation, 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)
// Get a Role.
GetRole(ctx context.Context, request GetRoleRequest) (*Role, 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)
// List Roles.
ListRoles(ctx context.Context, request ListRolesRequest) (*ListRolesResponse, 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 {
// A timestamp indicating when the project was created.
CreateTime *time.Time `json:"create_time,omitempty"`
// The resource name of the project. Format: projects/{project_id}
Name string `json:"name,omitempty"`
// The desired state of a Project.
Spec *ProjectSpec `json:"spec,omitempty"`
// The current status of a Project.
Status *ProjectStatus `json:"status,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 (*Project) UnmarshalJSON ¶
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"`
// 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 ProjectSpec ¶ added in v0.96.0
type ProjectSpec struct {
DefaultEndpointSettings *ProjectDefaultEndpointSettings `json:"default_endpoint_settings,omitempty"`
// Human-readable project name.
DisplayName string `json:"display_name,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 major Postgres version number.
PgVersion int `json:"pg_version,omitempty"`
Settings *ProjectSettings `json:"settings,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ProjectSpec) MarshalJSON ¶ added in v0.96.0
func (s ProjectSpec) MarshalJSON() ([]byte, error)
func (*ProjectSpec) UnmarshalJSON ¶ added in v0.96.0
func (s *ProjectSpec) UnmarshalJSON(b []byte) error
type ProjectStatus ¶ added in v0.96.0
type ProjectStatus 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"`
// The effective default endpoint settings.
DefaultEndpointSettings *ProjectDefaultEndpointSettings `json:"default_endpoint_settings,omitempty"`
// The effective human-readable project name.
DisplayName string `json:"display_name,omitempty"`
// The effective number of seconds to retain the shared history for point in
// time recovery.
HistoryRetentionDuration *duration.Duration `json:"history_retention_duration,omitempty"`
// The email of the project owner.
Owner string `json:"owner,omitempty"`
// The effective major Postgres version number.
PgVersion int `json:"pg_version,omitempty"`
// The effective project settings.
Settings *ProjectSettings `json:"settings,omitempty"`
// The current space occupied by the project in storage.
SyntheticStorageSizeBytes int64 `json:"synthetic_storage_size_bytes,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ProjectStatus) MarshalJSON ¶ added in v0.96.0
func (s ProjectStatus) MarshalJSON() ([]byte, error)
func (*ProjectStatus) UnmarshalJSON ¶ added in v0.96.0
func (s *ProjectStatus) UnmarshalJSON(b []byte) error
type Role ¶ added in v0.96.0
type Role struct {
CreateTime *time.Time `json:"create_time,omitempty"`
// The resource name of the role. Format:
// projects/{project_id}/branch/{branch_id}/roles/{role_id}
Name string `json:"name,omitempty"`
// The Branch where this Role exists. Format:
// projects/{project_id}/branches/{branch_id}
Parent string `json:"parent,omitempty"`
// The desired state of the Role.
Spec *RoleRoleSpec `json:"spec,omitempty"`
// The observed state of the Role.
Status *RoleRoleStatus `json:"status,omitempty"`
UpdateTime *time.Time `json:"update_time,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Role represents a Postgres role within a Branch.
func (Role) MarshalJSON ¶ added in v0.96.0
func (*Role) UnmarshalJSON ¶ added in v0.96.0
type RoleAuthMethod ¶ added in v0.96.0
type RoleAuthMethod string
How the role is authenticated when connecting to Postgres.
const RoleAuthMethodLakebaseOauthV1 RoleAuthMethod = `LAKEBASE_OAUTH_V1`
const RoleAuthMethodNoLogin RoleAuthMethod = `NO_LOGIN`
const RoleAuthMethodPgPasswordScramSha256 RoleAuthMethod = `PG_PASSWORD_SCRAM_SHA_256`
func (*RoleAuthMethod) Set ¶ added in v0.96.0
func (f *RoleAuthMethod) Set(v string) error
Set raw string value and validate it against allowed values
func (*RoleAuthMethod) String ¶ added in v0.96.0
func (f *RoleAuthMethod) String() string
String representation for fmt.Print
func (*RoleAuthMethod) Type ¶ added in v0.96.0
func (f *RoleAuthMethod) Type() string
Type always returns RoleAuthMethod to satisfy [pflag.Value] interface
func (*RoleAuthMethod) Values ¶ added in v0.96.0
func (f *RoleAuthMethod) Values() []RoleAuthMethod
Values returns all possible values for RoleAuthMethod.
There is no guarantee on the order of the values in the slice.
type RoleIdentityType ¶ added in v0.96.0
type RoleIdentityType string
The type of the Databricks managed identity that this Role represents. Leave empty if you wish to create a regular Postgres role not associated with a Databricks identity.
const RoleIdentityTypeGroup RoleIdentityType = `GROUP`
const RoleIdentityTypeServicePrincipal RoleIdentityType = `SERVICE_PRINCIPAL`
const RoleIdentityTypeUser RoleIdentityType = `USER`
func (*RoleIdentityType) Set ¶ added in v0.96.0
func (f *RoleIdentityType) Set(v string) error
Set raw string value and validate it against allowed values
func (*RoleIdentityType) String ¶ added in v0.96.0
func (f *RoleIdentityType) String() string
String representation for fmt.Print
func (*RoleIdentityType) Type ¶ added in v0.96.0
func (f *RoleIdentityType) Type() string
Type always returns RoleIdentityType to satisfy [pflag.Value] interface
func (*RoleIdentityType) Values ¶ added in v0.96.0
func (f *RoleIdentityType) Values() []RoleIdentityType
Values returns all possible values for RoleIdentityType.
There is no guarantee on the order of the values in the slice.
type RoleOperationMetadata ¶ added in v0.96.0
type RoleOperationMetadata struct {
}
type RoleRoleSpec ¶ added in v0.96.0
type RoleRoleSpec struct {
// If auth_method is left unspecified, a meaningful authentication method is
// derived from the identity_type: * For the managed identities, OAUTH is
// used. * For the regular postgres roles, authentication based on postgres
// passwords is used.
//
// NOTE: this is ignored for the Databricks identity type GROUP, and
// NO_LOGIN is implicitly assumed instead for the GROUP identity type.
AuthMethod RoleAuthMethod `json:"auth_method,omitempty"`
// The type of the role. When specifying a managed-identity, the chosen
// role_id must be a valid:
//
// * application ID for SERVICE_PRINCIPAL * user email for USER * group name
// for GROUP
IdentityType RoleIdentityType `json:"identity_type,omitempty"`
}
type RoleRoleStatus ¶ added in v0.96.0
type RoleRoleStatus struct {
AuthMethod RoleAuthMethod `json:"auth_method,omitempty"`
// The type of the role.
IdentityType RoleIdentityType `json:"identity_type,omitempty"`
}
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"`
}