Documentation
¶
Index ¶
- Constants
- func ConvertPhaseToString(phase clusterv1.ClusterPhase) string
- func ConvertStorageTier(tier string) commonv1.StorageTierType
- func IsFailedPhase(phase clusterv1.ClusterPhase) bool
- func IsHealthyPhase(phase clusterv1.ClusterPhase) bool
- func IsTransitionalPhase(phase clusterv1.ClusterPhase) bool
- type Client
- func (c *Client) Close() error
- func (c *Client) CreateCluster(ctx context.Context, req *clusterv1.CreateClusterRequest) (*clusterv1.CreateClusterResponse, error)
- func (c *Client) CreateDatabaseApiKey(ctx context.Context, req *authv2.CreateDatabaseApiKeyRequest) (*authv2.CreateDatabaseApiKeyResponse, error)
- func (c *Client) DeleteCluster(ctx context.Context, accountID, clusterID string) (*clusterv1.DeleteClusterResponse, error)
- func (c *Client) DeleteDatabaseApiKey(ctx context.Context, accountID, clusterID, keyID string) (*authv2.DeleteDatabaseApiKeyResponse, error)
- func (c *Client) GetCluster(ctx context.Context, accountID, clusterID string) (*clusterv1.GetClusterResponse, error)
- func (c *Client) ListClusters(ctx context.Context, accountID string) (*clusterv1.ListClustersResponse, error)
- func (c *Client) ListPackages(ctx context.Context, accountID, cloudProviderID, cloudProviderRegionID string) (*bookingv1.ListPackagesResponse, error)
- func (c *Client) SuspendCluster(ctx context.Context, accountID, clusterID string) (*clusterv1.SuspendClusterResponse, error)
- func (c *Client) UnsuspendCluster(ctx context.Context, accountID, clusterID string) (*clusterv1.UnsuspendClusterResponse, error)
- func (c *Client) UpdateCluster(ctx context.Context, req *clusterv1.UpdateClusterRequest) (*clusterv1.UpdateClusterResponse, error)
- type Config
- type Option
- type PackageSelector
Constants ¶
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 (*Client) CreateCluster ¶
func (c *Client) CreateCluster(ctx context.Context, req *clusterv1.CreateClusterRequest) (*clusterv1.CreateClusterResponse, error)
CreateCluster creates a new cluster
func (*Client) CreateDatabaseApiKey ¶
func (c *Client) CreateDatabaseApiKey(ctx context.Context, req *authv2.CreateDatabaseApiKeyRequest) (*authv2.CreateDatabaseApiKeyResponse, error)
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 ¶
func (c *Client) UpdateCluster(ctx context.Context, req *clusterv1.UpdateClusterRequest) (*clusterv1.UpdateClusterResponse, error)
UpdateCluster updates an existing cluster
type Option ¶
type Option func(*Config)
Option is a functional option for configuring the client
func WithEndpoint ¶
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