query

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddQueryFlags

AddQueryFlags returns the flags required to query expired infrastructure in the order:

  • Infrastructure filter tags, in the order needed by cloud.AddFilterFlags
  • Maximum age flag
  • Expiry tag flag
  • Expiry tag not applicable value
  • Expiry tag format flag

func GetExpiredResources

func GetExpiredResources(
	providerFlag *flags.StringArray,
	regionFlag *flags.StringArray,
	typeFlag *flags.StringArray,
	tagFlag *flags.StringArray,
	maxAgeFlag *string,
	expiryTagFlag *string,
	expiryTagNAValueFlag *string,
	expiryTagFormatFlag *string,
	expiredResourceHandler ExpiredResourceHandler) error

GetExpiredResources returns a list of expired resources

Types

type ExpiredResourceHandler

type ExpiredResourceHandler func(resource *cloud.Resource, hasExpired bool, expiryTime time.Time, err error)

type Query

type Query struct {
	// contains filtered or unexported fields
}

Query queries then notifies (using configured notification channels) infrastructure that has expired

func (*Query) GetDescription

func (query *Query) GetDescription() string

GetDescription returns the description for the query command

func (*Query) GetFlagSet

func (query *Query) GetFlagSet() *flag.FlagSet

GetFlagSet returns a pointer to the flag.FlagSet associated to the command

func (*Query) GetHelpFlag

func (query *Query) GetHelpFlag() *bool

GetHelpFlag returns a pointer to the initialized help flag for the command

func (*Query) GetName

func (query *Query) GetName() string

GetName returns the value of the name constant

func (*Query) GetSubCommands

func (query *Query) GetSubCommands() []cli.Command

GetSubCommands returns a slice of subcommands under the query command (expect empty slice if none)

func (*Query) Init

func (query *Query) Init(helpFlagName string, helpFlagDescription string)

Init initializes the command object

func (*Query) Process

func (query *Query) Process()

Process fetches the list of infrastructure that matches the criteria provided by the user and that has expired and sends notifications to the configured notification channels

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL