riRds

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: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reservation

type Reservation struct {
	riRdS.InstanceBase
	Tags map[string]string `json:"tags"`
}

Reservation contains the information of an ReservedInstances reservation

type ReservationReport

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

ReservationReport has all the information of an ReservedInstances reservation report

func GetReservedInstancesDaily

func GetReservedInstancesDaily(ctx context.Context, params ReservedInstancesQueryParams, user users.User, tx *sql.Tx) (int, []ReservationReport, error)

GetReservedInstancesDaily does an elastic request and returns an array of daily report reservations based on query params

func GetReservedInstancesData

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

GetReservedInstancesData gets Reserved Instances daily reports

type ReservedInstancesQueryParams

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

ReservedInstancesQueryParams will store the parsed query params

type ResponseReservedInstancesDaily

type ResponseReservedInstancesDaily struct {
	Accounts struct {
		Buckets []struct {
			Dates struct {
				Buckets []struct {
					Time         string `json:"key_as_string"`
					Reservations struct {
						Hits struct {
							Hits []struct {
								Reservation riRdS.InstanceReport `json:"_source"`
							} `json:"hits"`
						} `json:"hits"`
					} `json:"reservations"`
				} `json:"buckets"`
			} `json:"dates"`
		} `json:"buckets"`
	} `json:"accounts"`
}

Structure that allow to parse ES response for ReservedInstances Daily reservations

Jump to

Keyboard shortcuts

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