Documentation
¶
Index ¶
- func CalculateAdditionalDisk(requestedDisk resource.ByteQuantity, pkg *bookingv1.Package) (uint32, error)
- func FilteredPackages(cmd *cobra.Command, s *state.State, cloudProvider string, cloudRegion *string, ...) ([]*bookingv1.Package, error)
- func ResolvePackageByID(ctx context.Context, booking bookingv1.BookingServiceClient, ...) (*bookingv1.Package, error)
- func ResolvePackageByName(ctx context.Context, booking bookingv1.BookingServiceClient, ...) (*bookingv1.Package, error)
- func ResolvePackageByResources(ctx context.Context, booking bookingv1.BookingServiceClient, ...) (*bookingv1.Package, error)
- func WaitForClusterHealthy(ctx context.Context, svc clusterv1.ClusterServiceClient, out io.Writer, ...) (*clusterv1.Cluster, error)
- type PackageFilter
- type PackageResourceQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateAdditionalDisk ¶ added in v0.16.0
func CalculateAdditionalDisk(requestedDisk resource.ByteQuantity, pkg *bookingv1.Package) (uint32, error)
CalculateAdditionalDisk returns the additional disk (in GiB) needed beyond what the package includes. Returns 0 if the requested disk is not larger than the package's included disk.
func FilteredPackages ¶ added in v0.16.0
func FilteredPackages( cmd *cobra.Command, s *state.State, cloudProvider string, cloudRegion *string, f PackageFilter, ) ([]*bookingv1.Package, error)
FilteredPackages fetches active packages matching the given filter.
func ResolvePackageByID ¶ added in v0.16.0
func ResolvePackageByID( ctx context.Context, booking bookingv1.BookingServiceClient, accountID, cloudProvider string, cloudRegion *string, id string, ) (*bookingv1.Package, error)
ResolvePackageByID fetches a single package by its UUID.
func ResolvePackageByName ¶ added in v0.16.0
func ResolvePackageByName( ctx context.Context, booking bookingv1.BookingServiceClient, accountID, cloudProvider string, cloudRegion *string, name string, multiAz bool, ) (*bookingv1.Package, error)
ResolvePackageByName lists active packages and returns the first matching by name.
func ResolvePackageByResources ¶ added in v0.16.0
func ResolvePackageByResources( ctx context.Context, booking bookingv1.BookingServiceClient, q PackageResourceQuery, ) (*bookingv1.Package, error)
ResolvePackageByResources lists active packages and returns the unique one matching all non-zero resource dimensions (cpu, ram, gpu) and the multiAz flag. Returns an error if zero or more than one package matches.
func WaitForClusterHealthy ¶
func WaitForClusterHealthy( ctx context.Context, svc clusterv1.ClusterServiceClient, out io.Writer, accountID, clusterID string, timeout, pollInterval time.Duration, ) (*clusterv1.Cluster, error)
WaitForClusterHealthy polls cluster status until it becomes healthy, times out, or enters a failure phase. Progress lines are written to out.
Types ¶
type PackageFilter ¶ added in v0.16.0
type PackageFilter struct {
CPU resource.Millicores
RAM resource.ByteQuantity
GPU resource.Millicores
IncludeGPU bool
MultiAz bool
}
PackageFilter holds the parameters for filtering packages. Zero values for CPU/RAM/GPU mean "do not filter on that dimension".
type PackageResourceQuery ¶ added in v0.16.0
type PackageResourceQuery struct {
AccountID string
CloudProvider string
CloudRegion *string
CPU resource.Millicores
GPU resource.Millicores
RAM resource.ByteQuantity
MultiAz bool
}
PackageResourceQuery holds the parameters for resolving a package by resources.