client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultEndpoint is the default Qdrant Cloud API endpoint
	DefaultEndpoint = "cloud.qdrant.io:443"
)

Variables

This section is empty.

Functions

func ConvertPhaseToString

func ConvertPhaseToString(phase clusterv1.ClusterPhase) string

ConvertPhaseToString converts protobuf phase enum to string

func ConvertStorageTier

func ConvertStorageTier(tier string) commonv1.StorageTierType

ConvertStorageTier converts our API storage tier to protobuf enum

func IsFailedPhase

func IsFailedPhase(phase clusterv1.ClusterPhase) bool

IsFailedPhase checks if the phase indicates a failure

func IsHealthyPhase

func IsHealthyPhase(phase clusterv1.ClusterPhase) bool

IsHealthyPhase checks if the phase indicates a healthy cluster

func IsTransitionalPhase

func IsTransitionalPhase(phase clusterv1.ClusterPhase) bool

IsTransitionalPhase checks if the phase indicates an in-progress operation

Types

type Client

type Client struct {

	// Service clients
	ClusterService     clusterv1.ClusterServiceClient
	BookingService     bookingv1.BookingServiceClient
	DatabaseKeyService authv2.DatabaseApiKeyServiceClient
	// contains filtered or unexported fields
}

Client wraps the Qdrant Cloud gRPC clients with authentication

func NewClient

func NewClient(apiKey string, opts ...Option) (*Client, error)

NewClient creates a new Qdrant Cloud API client

func (*Client) Close

func (c *Client) Close() error

Close closes the underlying gRPC connection

func (*Client) CreateCluster

CreateCluster creates a new cluster

func (*Client) CreateDatabaseApiKey

CreateDatabaseApiKey creates a new database API key for a cluster

func (*Client) DeleteCluster

func (c *Client) DeleteCluster(ctx context.Context, accountID, clusterID string) (*clusterv1.DeleteClusterResponse, error)

DeleteCluster deletes a cluster

func (*Client) DeleteDatabaseApiKey

func (c *Client) DeleteDatabaseApiKey(ctx context.Context, accountID, clusterID, keyID string) (*authv2.DeleteDatabaseApiKeyResponse, error)

DeleteDatabaseApiKey deletes a database API key

func (*Client) GetCluster

func (c *Client) GetCluster(ctx context.Context, accountID, clusterID string) (*clusterv1.GetClusterResponse, error)

GetCluster retrieves a specific cluster

func (*Client) ListClusters

func (c *Client) ListClusters(ctx context.Context, accountID string) (*clusterv1.ListClustersResponse, error)

ListClusters lists all clusters for an account

func (*Client) ListPackages

func (c *Client) ListPackages(ctx context.Context, accountID, cloudProviderID, cloudProviderRegionID string) (*bookingv1.ListPackagesResponse, error)

ListPackages lists available packages for a region

func (*Client) SuspendCluster

func (c *Client) SuspendCluster(ctx context.Context, accountID, clusterID string) (*clusterv1.SuspendClusterResponse, error)

SuspendCluster suspends a cluster

func (*Client) UnsuspendCluster

func (c *Client) UnsuspendCluster(ctx context.Context, accountID, clusterID string) (*clusterv1.UnsuspendClusterResponse, error)

UnsuspendCluster resumes a suspended cluster

func (*Client) UpdateCluster

UpdateCluster updates an existing cluster

type Config

type Config struct {
	Endpoint string
}

Config holds the client configuration

type Option

type Option func(*Config)

Option is a functional option for configuring the client

func WithEndpoint

func WithEndpoint(endpoint string) Option

WithEndpoint sets a custom API endpoint

type PackageSelector

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

PackageSelector helps select the appropriate package based on resource requirements

func NewPackageSelector

func NewPackageSelector(packages []*bookingv1.Package) *PackageSelector

NewPackageSelector creates a new package selector from a list of packages

func (*PackageSelector) SelectPackage

func (ps *PackageSelector) SelectPackage(minRAM, minCPU, minDisk *resource.Quantity) (*bookingv1.Package, error)

SelectPackage finds the smallest package that meets the given requirements

Jump to

Keyboard shortcuts

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