Documentation
¶
Index ¶
- Constants
- func DefaultPlannerClientConfigPath() string
- func NewFromConfig(config *Config) (*client.ClientWithResponses, error)
- func NewFromConfigFile(filename string) (*client.ClientWithResponses, error)
- func NewHTTPClientFromConfig(config *Config) (*http.Client, error)
- func WriteConfig(filename string, server string) error
- type CPUResources
- type Config
- type ControlPlaneReserved
- type DiskResources
- type MachineSet
- type MemoryResources
- type Node
- type NodeResources
- type OverCommitRatio
- type ResourceConsumption
- type ResourceLimits
- type Service
- type ServiceDescriptor
- type SizerClient
- type SizerData
- type SizerRequest
- type SizerResponse
- type Workload
- type Zone
Constants ¶
View Source
const (
// TestRootDirEnvKey is the environment variable key used to set the file system root when testing.
TestRootDirEnvKey = "PLANNER_TEST_ROOT_DIR"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultPlannerClientConfigPath ¶
func DefaultPlannerClientConfigPath() string
DefaultPlannerClientConfigPath returns the default path to the Planner client config file.
func NewFromConfig ¶
func NewFromConfig(config *Config) (*client.ClientWithResponses, error)
NewFromConfig returns a new Planner API client from the given config.
func NewFromConfigFile ¶
func NewFromConfigFile(filename string) (*client.ClientWithResponses, error)
NewFromConfigFile returns a new Planner API client using the config read from the given file.
func NewHTTPClientFromConfig ¶
NewHTTPClientFromConfig returns a new HTTP Client from the given config.
func WriteConfig ¶
WriteConfig writes a client config file using the given parameters.
Types ¶
type CPUResources ¶ added in v0.4.0
type Config ¶
type Config struct {
Service Service `json:"service"`
// contains filtered or unexported fields
}
Config holds the information needed to connect to a Planner API server
func NewDefault ¶
func NewDefault() *Config
func ParseConfigFile ¶
func (*Config) SetBaseDir ¶
type ControlPlaneReserved ¶ added in v0.4.0
type DiskResources ¶ added in v0.4.0
type MachineSet ¶ added in v0.4.0
type MachineSet struct {
Name string `json:"name"`
CPU int `json:"cpu"`
Memory int `json:"memory"`
InstanceName string `json:"instanceName"`
NumberOfDisks int `json:"numberOfDisks"`
OnlyFor []string `json:"onlyFor,omitempty"`
Label string `json:"label,omitempty"`
AllowWorkloadScheduling *bool `json:"allowWorkloadScheduling,omitempty"`
ControlPlaneReserved *ControlPlaneReserved `json:"controlPlaneReserved,omitempty"`
}
type MemoryResources ¶ added in v0.4.0
type Node ¶ added in v0.4.0
type Node struct {
Node string `json:"node"`
MachineSet string `json:"machineSet"`
IsControlPlane bool `json:"isControlPlane"`
Resources NodeResources `json:"resources"`
Services []string `json:"services"`
}
type NodeResources ¶ added in v0.4.0
type NodeResources struct {
CPU CPUResources `json:"cpu"`
Memory MemoryResources `json:"memory"`
Disks DiskResources `json:"disks"`
}
type OverCommitRatio ¶ added in v0.4.0
type ResourceConsumption ¶ added in v0.4.0
type ResourceConsumption struct {
CPU float64 `json:"cpu"`
Memory float64 `json:"memory"`
Limits *ResourceLimits `json:"limits,omitempty"`
OverCommitRatio *OverCommitRatio `json:"overCommitRatio,omitempty"`
}
type ResourceLimits ¶ added in v0.4.0
type Service ¶
type Service struct {
// Server is the URL of the Planner API server (the part before /api/v1/...).
Server string `json:"server"`
UI string `json:"ui"`
}
Service contains information how to connect to and authenticate the Planner API server.
type ServiceDescriptor ¶ added in v0.4.0
type ServiceDescriptor struct {
Name string `json:"name"`
RequiredCPU float64 `json:"requiredCPU"`
RequiredMemory float64 `json:"requiredMemory"`
LimitCPU float64 `json:"limitCPU,omitempty"`
LimitMemory float64 `json:"limitMemory,omitempty"`
Zones int `json:"zones"`
RunsWith []string `json:"runsWith,omitempty"`
Avoid []string `json:"avoid,omitempty"`
}
type SizerClient ¶ added in v0.4.0
type SizerClient struct {
// contains filtered or unexported fields
}
SizerClient is an HTTP client for the sizer service
func NewSizerClient ¶ added in v0.4.0
func NewSizerClient(baseURL string, timeout time.Duration) *SizerClient
func (*SizerClient) CalculateSizing ¶ added in v0.4.0
func (c *SizerClient) CalculateSizing(ctx context.Context, req *SizerRequest) (*SizerResponse, error)
func (*SizerClient) HealthCheck ¶ added in v0.4.0
func (c *SizerClient) HealthCheck(ctx context.Context) error
type SizerRequest ¶ added in v0.4.0
type SizerRequest struct {
Platform string `json:"platform"`
MachineSets []MachineSet `json:"machineSets"`
Workloads []Workload `json:"workloads"`
Detailed bool `json:"detailed,omitempty"`
}
type SizerResponse ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.