costs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package s3/costs gets billing information from an ElasticSearch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetS3UsageAndCostElasticSearchParams

func GetS3UsageAndCostElasticSearchParams(accountList []string, durationBegin time.Time,
	durationEnd time.Time, filters []esFilter, client *elastic.Client, index string) *elastic.SearchService

GetS3UsageAndCostElasticSearchParams is used to construct an ElasticSearch *elastic.SearchService used to perform an S3 usage and cost request on ES It takes as paramters :

  • accountList []uint : A slice of uint representing aws account number, in the format of the field 'awsdetailedlineitem.linked_account_id'
  • durationBeing time.Time : A time.Time struct representing the begining of the time range in the query
  • durationEnd time.Time : A time.Time struct representing the end of the time range in the query
  • client *elastic.Client : an instance of *elastic.Client that represent an Elastic Search client.
  • filters []esFilter : A slice of esFilter containing the filters (key/value) to apply to the request It needs to be fully configured and ready to execute a client.Search()
  • index string : The Elastic Search index on wich to execute the query. In this context the default value should be "awsdetailedlineitems"

This function excepts arguments passed to it to be sanitize. If they are not, the following cases will make it crash :

  • If the client is nil or malconfigured, it will crash
  • If the index is not an index present in the ES, it will crash

Types

type S3BucketCost

type S3BucketCost struct {
	GbMonth       float64
	StorageCost   float64
	BandwidthCost float64
	DataIn        float64
	DataOut       float64
	RequestsCost  float64
	Requests      float64
}

S3BucketCost represents the detail of the costs for a given bucket

Jump to

Keyboard shortcuts

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