Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetElasticSearchParams ¶
func GetElasticSearchParams(accountList []string, durationBegin time.Time, durationEnd time.Time, aggregationPeriod string, client *elastic.Client, index string) *elastic.SearchService
GetElasticSearchParams is used to construct an ElasticSearch *elastic.SearchService used to retrieve the cost by usageType for each week/month in the time range It takes as paramters :
- accountList []string : A slice of string 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.
- 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
func TaskDiffData ¶
func TaskDiffData(ctx context.Context, aa aws.AwsAccount, date time.Time) (data costDiff, err error)
TaskDiffData prepares an elasticsearch query and retrieves cost differentiator data
Types ¶
type PricePoint ¶
PricePoint struct stores elements for cost differentiator
Click to show internal directories.
Click to hide internal directories.