Documentation
¶
Index ¶
- Constants
- func Confirm(message string, defaultYes bool) (bool, error)
- func OutputData(data interface{}, format string) error
- func PromptForString(message, defaultValue string) (string, error)
- type Client
- func (c *Client) Authenticate(ctx context.Context) (string, error)
- func (c *Client) GetAPI() rxtspot.SpotAPI
- func (c *Client) GetOnDemandPrice(region, serverClass string) (string, error)
- func (c *Client) PromptForBidPrice(message, defaultValue string) (string, error)
- func (c *Client) PromptForCNI(defaultCNI string) (string, error)
- func (c *Client) PromptForKubernetesVersion(defaultVersion string) (string, error)
- func (c *Client) PromptForNodeCount(poolType string) (string, error)
- func (c *Client) PromptForPoolType() (string, error)
- func (c *Client) PromptForRegion(ctx context.Context) (string, error)
- func (c *Client) PromptForRegionWithDefault(ctx context.Context, defaultRegion string) (string, error)
- func (c *Client) PromptForServerClass(ctx context.Context, region string) (string, error)
- func (c *Client) PromptForServerClassWithBidPrice(ctx context.Context, region, poolType string) (string, string, string, error)
- type ClientConfig
Constants ¶
const ( BaseURL = "https://spot.rackspace.com" OAuthURL = "https://login.spot.rackspace.com" )
Variables ¶
This section is empty.
Functions ¶
func OutputData ¶
OutputData formats and prints data according to the specified format
func PromptForString ¶
PromptForString prompts the user to enter a string value
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the Spot SDK client with CLI-specific functionality
func NewClient ¶
func NewClient(cfg ClientConfig) (*Client, error)
NewClient creates a new CLI client with the given configuration
func NewClientWithTokens ¶
NewClientWithTokens is a convenience function to create a new client with just tokens
func (*Client) Authenticate ¶
Authenticate performs authentication
func (*Client) GetOnDemandPrice ¶
GetOnDemandPrice retrieves the on-demand price for a given region and server class
func (*Client) PromptForBidPrice ¶
PromptForBidPrice prompts the user to enter a bid price for a spot node pool
func (*Client) PromptForCNI ¶
PromptForCNI prompts the user to select a CNI plugin
func (*Client) PromptForKubernetesVersion ¶
PromptForKubernetesVersion prompts the user to select a Kubernetes version
func (*Client) PromptForNodeCount ¶
PromptForNodeCount prompts the user to enter the number of nodes for a node pool
func (*Client) PromptForPoolType ¶
PromptForPoolType prompts the user to select a node pool type (Spot or On-Demand)
func (*Client) PromptForRegion ¶
PromptForRegion prompts the user to select a region from the available regions
func (*Client) PromptForRegionWithDefault ¶
func (c *Client) PromptForRegionWithDefault(ctx context.Context, defaultRegion string) (string, error)
PromptForRegionWithDefault prompts the user to select a region with an optional default using a dropdown
func (*Client) PromptForServerClass ¶
PromptForServerClass prompts the user to select a server class for the given region
func (*Client) PromptForServerClassWithBidPrice ¶
func (c *Client) PromptForServerClassWithBidPrice(ctx context.Context, region, poolType string) (string, string, string, error)
PromptForServerClassWithBidPrice prompts the user to select a server class and returns the class name, minimum bid price, and on-demand price poolType should be either "spot" or "ondemand" to determine which pricing information to display
type ClientConfig ¶
type ClientConfig struct {
RefreshToken string
AccessToken string
BaseURL string
OAuthURL string
Timeout time.Duration
}
ClientConfig holds configuration for creating a new Client
func DefaultConfig ¶
func DefaultConfig() ClientConfig
DefaultConfig returns a default ClientConfig with sensible defaults