elasticache

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: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElastiCacheQueryParams

type ElastiCacheQueryParams struct {
	AccountList []string
	IndexList   []string
	Date        time.Time
}

ElastiCacheQueryParams will store the parsed query params

type ElastiCacheUnusedQueryParams

type ElastiCacheUnusedQueryParams struct {
	AccountList []string
	IndexList   []string
	Date        time.Time
	Count       int
}

ElastiCacheUnusedQueryParams will store the parsed query params

type Instance

type Instance struct {
	elasticache.InstanceBase
	Tags  map[string]string  `json:"tags"`
	Costs map[string]float64 `json:"costs"`
	Stats elasticache.Stats  `json:"stats"`
}

Instance contains the information of an ElastiCache instance

type InstanceReport

type InstanceReport struct {
	utils.ReportBase
	Instance Instance `json:"instance"`
}

InstanceReport has all the information of an ElastiCache instance report

func GetElastiCacheDailyInstances

func GetElastiCacheDailyInstances(ctx context.Context, params ElastiCacheQueryParams, user users.User, tx *sql.Tx) (int, []InstanceReport, error)

GetElastiCacheDailyInstances does an elastic request and returns an array of instances daily report based on query params

func GetElastiCacheData

func GetElastiCacheData(ctx context.Context, parsedParams ElastiCacheQueryParams, user users.User, tx *sql.Tx) (int, []InstanceReport, error)

GetElastiCacheData gets ElastiCache monthly reports based on query params, if there isn't a monthly report, it gets daily reports

func GetElastiCacheMonthlyInstances

func GetElastiCacheMonthlyInstances(ctx context.Context, params ElastiCacheQueryParams) (int, []InstanceReport, error)

GetElastiCacheMonthlyInstances does an elastic request and returns an array of instances monthly report based on query params

func GetElastiCacheUnusedData

func GetElastiCacheUnusedData(ctx context.Context, params ElastiCacheUnusedQueryParams, user users.User, tx *sql.Tx) (int, []InstanceReport, error)

GetElastiCacheUnusedData gets ElastiCache reports and parse them based on query params to have an array of unused instances

type ResponseCost

type ResponseCost struct {
	Accounts struct {
		Buckets []struct {
			Key       string `json:"key"`
			Instances struct {
				Buckets []struct {
					Key  string `json:"key"`
					Cost struct {
						Value float64 `json:"value"`
					} `json:"cost"`
				} `json:"buckets"`
			} `json:"instances"`
		} `json:"buckets"`
	} `json:"accounts"`
}

Structure that allow to parse ES response for costs

type ResponseElastiCacheDaily

type ResponseElastiCacheDaily struct {
	Accounts struct {
		Buckets []struct {
			Dates struct {
				Buckets []struct {
					Time      string `json:"key_as_string"`
					Instances struct {
						Hits struct {
							Hits []struct {
								Instance elasticache.InstanceReport `json:"_source"`
							} `json:"hits"`
						} `json:"hits"`
					} `json:"instances"`
				} `json:"buckets"`
			} `json:"dates"`
		} `json:"buckets"`
	} `json:"accounts"`
}

Structure that allow to parse ES response for ElastiCache Daily instances

type ResponseElastiCacheMonthly

type ResponseElastiCacheMonthly struct {
	Accounts struct {
		Buckets []struct {
			Instances struct {
				Hits struct {
					Hits []struct {
						Instance elasticache.InstanceReport `json:"_source"`
					} `json:"hits"`
				} `json:"hits"`
			} `json:"instances"`
		} `json:"buckets"`
	} `json:"accounts"`
}

Structure that allow to parse ES response for ElastiCache Monthly instances

Jump to

Keyboard shortcuts

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