Documentation
¶
Overview ¶
Package options parses the estimate command's options, ported from the Node estimate (manager packages/estimate/src/options.ts): the same options, values, defaults, checks and messages, in the same order of checks, so a bad input gives the same first message. Only the usage names `dormeto estimate`.
Index ¶
Constants ¶
const Usage = `` /* 529-byte string literal not displayed */
Usage is Node's USAGE with `npm run estimate --` replaced by `dormeto estimate`.
Variables ¶
var ErrHelp = errors.New("help requested")
ErrHelp is what Parse returns for --help or -h: the command prints Usage and exits 0.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// One AWS profile or more: the accounts each reaches, merged.
Profiles []string `json:"-"`
// The organization's accounts the estimate is restricted to (--accounts): nil, every account reached.
Accounts []string `json:"accounts"`
Regions []string `json:"regions"`
// Workloads left out by their tags (--exclude-tags, repeated): any criterion excludes; in one, every key (and), each
// with one of its values (empty: any value), its keys in the order given (as describeTags writes them). Never nil.
ExcludeTags []discover.TagWants `json:"excludeTags"`
Ec2Uptime bool `json:"ec2Uptime"`
EcsUptime bool `json:"ecsUptime"`
RdsUptime bool `json:"rdsUptime"`
Role string `json:"role"`
Baseline prices.Baseline `json:"baseline"`
Discounts prices.Discounts `json:"discounts"`
// "discovery", "metrics" or nil.
Refresh *string `json:"refresh"`
Out string `json:"-"`
// The idle window, in minutes, the report's figures use for every workload (--window); nil: each workload's
// recommended window (Go only: Node's figures were at 60 minutes by default).
Window *int `json:"window"`
// The days of requests read before the run (--days, Go only), at most the 15 CloudWatch keeps by the minute.
Days int `json:"days"`
// nil: none (no limit).
MaxWakes *float64 `json:"maxWakes"`
MinSaving *float64 `json:"minSaving"`
Parallel int `json:"parallel"`
MaxWakesRds *float64 `json:"maxWakesRds"`
}
Options is the estimate command's options. Marshaled, it is the report's "options": Node's Options without out and profiles, field for field and in Node's order.
func Parse ¶
Parse parses the arguments after "estimate", which cobra passes unparsed. --help or -h gives ErrHelp.
func (Options) DaysRead ¶ added in v0.2.0
DaysRead is the days of requests read: --days, 14 when unset (Options not from Parse).
func (Options) ReplayWindow ¶ added in v0.2.0
ReplayWindow is the window the replay takes as the current one: --window, else the product's default (60 minutes). The recommendations do not depend on it but for a --window outside the product's windows, which the replay adds.
type UsageError ¶
type UsageError struct{ Message string }
UsageError is a bad option: the command prints its message and Usage, and exits 2.
func (*UsageError) Error ¶
func (e *UsageError) Error() string