costexplorer

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	GranularityMonthly = SDK.GranularityMonthly
	GranularityDaily   = SDK.GranularityDaily
	GranularityHourly  = SDK.GranularityHourly

	GroupByDimension = SDK.GroupDefinitionTypeDimension
	GroupByTag       = SDK.GroupDefinitionTypeTag

	MetricBlendedCost           = SDK.MetricBlendedCost
	MetricUnblendedCost         = SDK.MetricUnblendedCost
	MetricAmortizedCost         = SDK.MetricAmortizedCost
	MetricNetUnblendedCost      = SDK.MetricNetUnblendedCost
	MetricNetAmortizedCost      = SDK.MetricNetAmortizedCost
	MetricUsageQuantity         = SDK.MetricUsageQuantity
	MetricNormalizedUsageAmount = SDK.MetricNormalizedUsageAmount
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CostExplorer

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

CostExplorer has *SDK.CostExplorer client.

func New

func New(conf config.Config) (*CostExplorer, error)

New returns initialized *CostExplorer.

func NewFromSession added in v1.17.0

func NewFromSession(sess *session.Session) *CostExplorer

NewFromSession returns initialized *CostExplorer from aws.Session.

func (*CostExplorer) DoGetCostAndUsage

func (svc *CostExplorer) DoGetCostAndUsage(input *SDK.GetCostAndUsageInput) (UsageResult, error)

DoGetCostAndUsage executes GetCostAndUsage operation.

func (*CostExplorer) Errorf

func (svc *CostExplorer) Errorf(format string, v ...interface{})

Errorf logging error information.

func (*CostExplorer) GetClient added in v1.17.1

func (svc *CostExplorer) GetClient() *SDK.CostExplorer

GetClient gets aws client.

func (*CostExplorer) GetCostAndUsage

func (svc *CostExplorer) GetCostAndUsage(input GetCostAndUsageInput) (UsageResult, error)

GetCostAndUsage executes GetCostAndUsage operation with customized input.

func (*CostExplorer) Infof

func (svc *CostExplorer) Infof(format string, v ...interface{})

Infof logging information.

func (*CostExplorer) SetLogger

func (svc *CostExplorer) SetLogger(logger log.Logger)

SetLogger sets logger.

type GetCostAndUsageInput

type GetCostAndUsageInput struct {
	NextPageToken   string
	TimePeriodStart time.Time
	TimePeriodEnd   time.Time

	GranularityMonthly bool
	GranularityDaily   bool
	GranularityHourly  bool

	GroupByDimensionAZ              bool
	GroupByDimensionInstanceType    bool
	GroupByDimensionLegalEntityName bool
	GroupByDimensionLinkedAccount   bool
	GroupByDimensionOperation       bool
	GroupByDimensionPlatform        bool
	GroupByDimensionPurchaseType    bool
	GroupByDimensionService         bool
	GroupByDimensionTenancy         bool
	GroupByDimensionRecordType      bool
	GroupByDimensionUsageType       bool
	GroupByTagKeys                  []string

	MetricAmortizedCost         bool
	MetricBlendedCost           bool
	MetricNetAmortizedCost      bool
	MetricNetUnblendedCost      bool
	MetricNormalizedUsageAmount bool
	MetricUnblendedCost         bool
	MetricUsageQuantity         bool

	Filter *SDK.Expression
}

GetCostAndUsageInput is optional parameters for `GetCostAndUsage`.

func (GetCostAndUsageInput) ToInput

ToInput converts to *SDK.GetCostAndUsageInput.

type Group

type Group struct {
	Keys []string
	MetricValues
}

type GroupDefinition

type GroupDefinition struct {
	Key  string
	Type string
}

type MetricValue

type MetricValue struct {
	Amount string
	Unit   string
}

type MetricValues

type MetricValues struct {
	AmortizedCost         MetricValue
	NetAmortizedCost      MetricValue
	BlendedCost           MetricValue
	UnblendedCost         MetricValue
	NetUnblendedCost      MetricValue
	NormalizedUsageAmount MetricValue
	UsageQuantity         MetricValue
}

func (MetricValues) GetOne

func (v MetricValues) GetOne() (amount, unit string)

type ResultByTime

type ResultByTime struct {
	Estimated       bool
	TimePeriodStart string
	TimePeriodEnd   string

	Groups []Group
	Total  MetricValues
}

type UsageResult

type UsageResult struct {
	GroupDefinitions []GroupDefinition
	ResultsByTime    []ResultByTime
	NextPageToken    string
}

UsageResult represents results from `GetCostAndUsage` operation.

func NewUsageResult

func NewUsageResult(output *SDK.GetCostAndUsageOutput) UsageResult

Jump to

Keyboard shortcuts

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