infra

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddResourceTableFlags

func AddResourceTableFlags(flagSet *flag.FlagSet) (*flags.StringArray, *bool, *bool, *string, *string, *bool, *string)

func BackupResource added in v0.11.0

func BackupResource(resource *types.InfraResource, safe *bool, wait *bool) error

func GetCostsAndUsages

func GetCostsAndUsages(filter *types.CostAndUsageFilter) (map[string]*types.CostAndUsageOutput, error)

func GetFiltersFromCommandFlags

func GetFiltersFromCommandFlags(providerFlag *flags.StringArray, regionFlag *flags.StringArray, typeFlag *flags.StringArray, tagFlag *flags.StringArray) *types.InfraFilter

func GetResources

func GetResources(filter *types.InfraFilter) ([]*types.InfraResource, error)

func GetTagKeys

func GetTagKeys(resource *types.InfraResource) []string

func UpdateResourceState added in v0.11.0

func UpdateResourceState(resource *types.InfraResource, safe *bool, wait *bool, state *types.InfraResourceState) error

func UpdateResourceTag

func UpdateResourceTag(resource *types.InfraResource, tagKey *string, tagValue *string) error

Types

type Provider

type Provider interface {
	Init() error
	GetName() string
	GetResources(filter *types.InfraFilter) ([]*types.InfraResource, error)
	GetCostsAndUsages(filter *types.CostAndUsageFilter) (*types.CostAndUsageOutput, error)
	UpdateResourceTag(resource *types.InfraResource, tagKey *string, tagValue *string) error
	// Update's a resource's state.
	//   If safe is set to true, then the implementation must guarantee that the resource can be restored
	//   to its previous state. This might mean safely backing up the resource
	//   If wait is set to true, the implementation must block execution until the resource changes state completely
	UpdateResourceState(resource *types.InfraResource, safe *bool, wait *bool, state *types.InfraResourceState) error
	// Creates a backup of the resource
	//   If safe is set, the implemtation must guarantee the integrity of the backup. We make an assumption that
	//   guaranteeing the integrity of the backup might temporarily impact the availability of the resource
	//   If wait is set to true, the implementation must block execution until the resource's backup is available
	BackupResource(resource *types.InfraResource, safe *bool, wait *bool) error
}

type ResourceTable

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

ResourceTable is responsible for rendering cloud resources in a table

func (*ResourceTable) Init

func (rt *ResourceTable) Init(
	showFlag *flags.StringArray,
	hideHeadersFlag *bool,
	csvFlag *bool,
	fieldSeparatorFlag *string,
	resourceSeparatorFlag *string,
	listFieldsFlag *bool,
	defaultFieldValueFlag *string)

func (*ResourceTable) Render

func (rt *ResourceTable) Render(headers map[string]bool, rows []map[string]string) (string, error)

func (*ResourceTable) RenderCostSpikes

func (rt *ResourceTable) RenderCostSpikes(costSpikes []*types.CostSpikeOutput) (string, error)

func (*ResourceTable) RenderResources

func (rt *ResourceTable) RenderResources(allResources []*types.InfraResource) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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