ilmt

package
v0.3.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REQUIRED_FORMAT string = "2006-01-02"
	BLANK_VALUE     string = " "
)
View Source
const (
	COLUMN_NAMES_APPEND        string = "" /* 290-byte string literal not displayed */
	CRITERIA_STANDALONE        string = "&limit=2&criteria={'and':[['bundle_id','<=','0']]}&criteria={'and':[['bundle_type','=','-1']]}"
	CRITEIRA_PRODUCTPARTOFBNDL string = "&criteria={'and':[['bundle_id','>','0']]}"
	CRITERIA_PARENTPRODUCT     string = "&criteria={'and':[['bundle_type','>','-1']]}"
	START_DATE_FLD_APPEND      string = "&startdate="
	END_DATE_FLD_APPEND        string = "&enddate="
	EMPTY                      string = ""
)

Variables

This section is empty.

Functions

func Date

func Date(year, month, day int) time.Time

func GetParentProduct

func GetParentProduct(prodPartOfbndl ProductPartOfBndlLicenceUsage, parentProdResp ParentProductResp) (int64, string, string, error)

func GetProductConversionRatio

func GetProductConversionRatio(prodBndlRatioDivider int, prodBndlRatioFactor int) string

Types

type AdditionalAttributes

type AdditionalAttributes struct {
	HostName               string `json:"hostname"`
	MeasuredMetricId       string `json:"measuredMetricId"`
	MeasuredValue          int    `json:"measuredValue"`
	MetricType             string `json:"metricType"`
	ParentProductId        int64  `json:"parentProductId,omitempty"`
	ParentProductName      string `json:"parentProductName,omitempty"`
	ProductConversionRatio string `json:"productConversionRatio,omitempty"`
	ProductId              int64  `json:"productId"`
	ProductName            string `json:"productName"`
	Source                 string `json:"source"`
}

type Client

type Client interface {
	FetchUsageData(ctx context.Context, dateRange DateRange) (int, string, error)
}

func NewClient

func NewClient(config *IlmtConfig) Client

type DateRange

type DateRange struct {
	StartDate string
	EndDate   string
}

type IlmtConfig

type IlmtConfig struct {
	Host  string `json:"host"`
	Port  string `json:"port"`
	Token string `json:"token"`

	TlsConfig *tls.Config
}

type MeasuredUsage

type MeasuredUsage struct {
	MetricId string  `json:"metricId"`
	Value    float64 `json:"value"`
}

type ParentProductLicenceUsage

type ParentProductLicenceUsage struct {
	ProductId            int64  `json:"product_id"`
	ProductName          string `json:"product_name"`
	MetricCodeName       string `json:"metric_code_name"`
	HwmQuantity          int    `json:"hwm_quantity"`
	BundleId             int    `json:"bundle_id"`
	FlexId               int    `json:"flex_id"`
	BundleType           int    `json:"bundle_type"`
	BundleName           string `json:"bundle_name"`
	BundleMetricContrbtn int    `json:"bundle_metric_contribution"`
	ProdBndlRatioFactor  int    `json:"product_bundle_ratio_factor"`
	ProdBndlRatioDivider int    `json:"product_bundle_ratio_divider"`
}

type ParentProductResp

type ParentProductResp struct {
	TotalRows                 int                         `json:"total"`
	ParentProductLicenceUsage []ParentProductLicenceUsage `json:"rows"`
}

type ProductPartOfBndlLicenceUsage

type ProductPartOfBndlLicenceUsage struct {
	ProductId            int64  `json:"product_id"`
	ProductName          string `json:"product_name"`
	MetricCodeName       string `json:"metric_code_name"`
	HwmQuantity          int    `json:"hwm_quantity"`
	BundleId             int    `json:"bundle_id"`
	FlexId               int    `json:"flex_id"`
	BundleType           int    `json:"bundle_type"`
	BundleName           string `json:"bundle_name"`
	BundleMetricContrbtn int    `json:"bundle_metric_contribution"`
	ProdBndlRatioFactor  int    `json:"product_bundle_ratio_factor"`
	ProdBndlRatioDivider int    `json:"product_bundle_ratio_divider"`
}

type ProductPartOfBndlResp

type ProductPartOfBndlResp struct {
	TotalRows                     int                             `json:"total"`
	ProductPartOfBndlLicenceUsage []ProductPartOfBndlLicenceUsage `json:"rows"`
}

type ProductUsageTransformedEvent

type ProductUsageTransformedEvent struct {
	ProductUsageTransformedEventData []ProductUsageTransformedEventData `json:"data"`
}

type ProductUsageTransformedEventData

type ProductUsageTransformedEventData struct {
	//AccountId            string `json:"accountId"`
	AdditionalAttributes `json:"additionalAttributes"`
	EndDate              int64           `json:"end"`
	StartDate            int64           `json:"start"`
	EventId              string          `json:"eventId"`
	MeasuredUsage        []MeasuredUsage `json:"measuredUsage"`
}

type StandaloneProductLicenceUsage

type StandaloneProductLicenceUsage struct {
	ProductId            int64  `json:"product_id"`
	ProductName          string `json:"product_name"`
	MetricCodeName       string `json:"metric_code_name"`
	HwmQuantity          int    `json:"hwm_quantity"`
	BundleId             int    `json:"bundle_id"`
	FlexId               int    `json:"flex_id"`
	BundleType           int    `json:"bundle_type"`
	BundleName           string `json:"bundle_name"`
	BundleMetricContrbtn int    `json:"bundle_metric_contribution"`
	ProdBndlRatioFactor  int    `json:"product_bundle_ratio_factor"`
	ProdBndlRatioDivider int    `json:"product_bundle_ratio_divider"`
}

type StandaloneProductResp

type StandaloneProductResp struct {
	TotalRows                     int                             `json:"total"`
	StandaloneProductLicenceUsage []StandaloneProductLicenceUsage `json:"rows"`
}

Jump to

Keyboard shortcuts

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