ec2Coverage

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: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ec2CoverageQueryParams

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

Ec2CoverageQueryParams will store the parsed query params

type ReservationReport

type ReservationReport struct {
	utils.ReportBase
	Reservation ec2Coverage.Reservation `json:"reservation"`
}

ReservationReport has all the information of an EC2 Coverage report

func GetEc2CoverageData

func GetEc2CoverageData(ctx context.Context, parsedParams Ec2CoverageQueryParams, user users.User, tx *sql.Tx) (int, []ReservationReport, error)

GetEc2CoverageData gets EC2 Coverage monthly reports based on query params

func GetEc2CoverageMonthlyReservations

func GetEc2CoverageMonthlyReservations(ctx context.Context, params Ec2CoverageQueryParams) (int, []ReservationReport, error)

GetEc2CoverageMonthlyReservations does an elastic request and returns an array of reservations monthly report based on query params

type ResponseEc2CoverageMonthly

type ResponseEc2CoverageMonthly struct {
	Accounts struct {
		Buckets []struct {
			Reservations struct {
				Hits struct {
					Hits []struct {
						Reservation ec2Coverage.ReservationReport `json:"_source"`
					} `json:"hits"`
				} `json:"hits"`
			} `json:"reservations"`
		} `json:"buckets"`
	} `json:"accounts"`
}

Structure that allow to parse ES response for EC2 Coverage Monthly report

Jump to

Keyboard shortcuts

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