Documentation
¶
Index ¶
- Constants
- Variables
- func CliCommandDefaultPreRun(c cliCommand, cmd *cobra.Command, args []string) error
- func CmdCheckRequiredFlags(cmd *cobra.Command, flags []string) error
- func CmdExitOnUsageError(cmd *cobra.Command, reason string)
- func CmdSetTemplateFlagFromDefault(cmd *cobra.Command)
- func CmdSetZoneFlagFromDefault(cmd *cobra.Command)
- func CmdShowHelpFlags(flags *pflag.FlagSet, prefix string)
- func ConvertIfSpecialEmptyMap(m map[string]string) map[string]string
- func Execute(version, commit string)
- func MustCLICommandFlagName(c cliCommand, field interface{}) string
- func RegisterCLICommand(parent *cobra.Command, c cliCommand) error
- func SwitchClientZoneV3(ctx context.Context, client *v3.Client, zone v3.ZoneName) (*v3.Client, error)
- type CliCommandSettings
- type LimitsItemOutput
- type LimitsOutput
Constants ¶
const ( ZoneFlagLong = "zone" ZoneFlagShort = "z" ZoneFlagMsg = "bucket zone" LegacyAPIVersion = "compute" DefaultEnvironment = "api" DefaultConfigFileName = "exoscale" DefaultInstanceType = "medium" DefaultInstanceTypeFamily = "standard" DefaultTemplate = "Linux Ubuntu 22.04 LTS 64-bit" DefaultTemplateVisibility = "public" DefaultSosEndpoint = "https://sos-{zone}.exo.io" DefaultZone = "ch-dk-2" DefaultOutputFormat = "table" DefaultClientTimeout = 20 )
const CmdFlagForceHelp = "attempt to perform the operation without prompting for confirmation"
Variables ¶
var GCommit string
var GConfig *viper.Viper
var GConfigFilePath string
var GContext context.Context
var GCreateAlias = []string{"add"}
var GDeleteAlias = []string{"del"}
var GListAlias = []string{"ls"}
Aliases
var GRemoveAlias = []string{"rm"}
var GShowAlias = []string{"get"}
var GVersion string
var RootCmd = &cobra.Command{ Use: "exo", Short: "Manage your Exoscale infrastructure easily", SilenceUsage: true, SilenceErrors: true, }
Functions ¶
func CliCommandDefaultPreRun ¶ added in v1.85.0
CliCommandDefaultPreRun is a convenience helper function that can be used in cliCommand.cmdPreRun() hooks to automagically retrieve values for the struct flags/args fields from a cobra.Command and args provided, and set corresponding fields on the struct implementing the cliCommand interface.
func CmdCheckRequiredFlags ¶ added in v1.85.1
CmdCheckRequiredFlags evaluates the specified flags as parsed in the cobra.Command flagset to check that their value is unset (i.e. null/empty/zero, depending on the type), and returns a multierror listing all flags missing a required value.
func CmdExitOnUsageError ¶ added in v1.85.0
func CmdSetTemplateFlagFromDefault ¶ added in v1.85.0
CmdSetTemplateFlagFromDefault attempts to set the "--template" flag value based on the current active account's default template setting if set. This is a convenience helper, there is no guarantee that the flag will be set once this function returns.
func CmdSetZoneFlagFromDefault ¶ added in v1.85.0
CmdSetZoneFlagFromDefault attempts to set the "--zone" flag value based on the current active account's default zone setting if set. This is a convenience helper, there is no guarantee that the flag will be set once this function returns.
func CmdShowHelpFlags ¶ added in v1.85.0
CmdShowHelpFlags outputs flags matching the specified prefix in the provided flag set. This can be used for example to craft specialized usage help messages for hidden flags.
func ConvertIfSpecialEmptyMap ¶ added in v1.85.0
func Execute ¶
func Execute(version, commit string)
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the RootCmd.
func MustCLICommandFlagName ¶ added in v1.85.0
func MustCLICommandFlagName(c cliCommand, field interface{}) string
func RegisterCLICommand ¶ added in v1.85.0
RegisterCLICommand registers the specified cliCommand instance to the current CLI framework (currently Cobra).
Types ¶
type CliCommandSettings ¶ added in v1.85.0
CliCommandSettings represents a CLI command settings.
func DefaultCLICmdSettings ¶ added in v1.85.0
func DefaultCLICmdSettings() CliCommandSettings
DefaultCLICmdSettings returns a cliCommandSettings struct initialized with default values.
type LimitsItemOutput ¶
type LimitsOutput ¶
type LimitsOutput []LimitsItemOutput
func (*LimitsOutput) ToJSON ¶ added in v1.68.0
func (o *LimitsOutput) ToJSON()
func (*LimitsOutput) ToTable ¶ added in v1.68.0
func (o *LimitsOutput) ToTable()
func (*LimitsOutput) ToText ¶ added in v1.68.0
func (o *LimitsOutput) ToText()