Documentation ¶
Index ¶
- Constants
- func FetchDailyInstancesStats(ctx context.Context, awsAccount taws.AwsAccount) error
- func PutEc2MonthlyReport(ctx context.Context, ec2Cost, cloudWatchCost []utils.CostPerResource, ...) (bool, error)
- type Cpu
- type Instance
- type InstanceBase
- type InstanceReport
- type Network
- type Stats
- type Volume
Constants ¶
View Source
const IndexPrefixEC2Report = "ec2-reports"
View Source
const MonitorInstanceStsSessionName = "monitor-instance"
View Source
const TemplateEc2Report = `` /* 1814-byte string literal not displayed */
View Source
const TemplateNameEC2Report = "ec2-reports"
View Source
const TypeEC2Report = "ec2-report"
Variables ¶
This section is empty.
Functions ¶
func FetchDailyInstancesStats ¶
func FetchDailyInstancesStats(ctx context.Context, awsAccount taws.AwsAccount) error
FetchDailyInstancesStats fetches the stats of the EC2 instances of an AwsAccount to import them in ElasticSearch. The stats are fetched from the last hour. In this way, FetchInstancesStats should be called every hour.
func PutEc2MonthlyReport ¶
func PutEc2MonthlyReport(ctx context.Context, ec2Cost, cloudWatchCost []utils.CostPerResource, aa taws.AwsAccount, startDate, endDate time.Time) (bool, error)
PutEc2MonthlyReport puts a monthly report of EC2 instance in ES
Types ¶
type Instance ¶
type Instance struct { InstanceBase Tags []utils.Tag `json:"tags"` Costs map[string]float64 `json:"costs"` Stats Stats `json:"stats"` }
Instance contains all the information of an EC2 instance
type InstanceBase ¶
type InstanceBase struct { Id string `json:"id"` Region string `json:"region"` State string `json:"state"` Purchasing string `json:"purchasing"` KeyPair string `json:"keyPair"` Type string `json:"type"` Platform string `json:"platform"` }
InstanceBase contains basics information of an EC2 instance
type InstanceReport ¶
type InstanceReport struct { utils.ReportBase Instance Instance `json:"instance"` }
InstanceReport is saved in ES to have all the information of an EC2 instance
Click to show internal directories.
Click to hide internal directories.