v1alpha1

package
v2.0.0-...-6831f71 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNoValuesSet                  = errors.Sentinel("no values set")
	ErrValueHashAreDifferent        = errors.Sentinel("value hashes are different")
	ErrDuplicateLabel               = errors.Sentinel("duplicate label")
	ErrAdditionalLabelsAreDifferent = errors.Sentinel("different additional label values")
)
View Source
const Version = "v1alpha1"

Variables

This section is empty.

Functions

This section is empty.

Types

type MarketplaceMetric

type MarketplaceMetric struct {
	Label  string                 `json:"label"`
	Value  string                 `json:"value"`
	Labels map[string]interface{} `json:"labelSet,omitempty"`
}

type MarketplaceReportData

type MarketplaceReportData struct {
	MetricID          string                          `json:"metric_id"`
	ReportPeriodStart common.Time                     `json:"report_period_start"`
	ReportPeriodEnd   common.Time                     `json:"report_period_end"`
	IntervalStart     common.Time                     `json:"interval_start"`
	IntervalEnd       common.Time                     `json:"interval_end"`
	MeterDomain       string                          `json:"domain"`
	MeterKind         string                          `json:"kind"`
	MeterVersion      string                          `json:"version,omitempty"`
	Label             string                          `json:"workload,omitempty"`
	ResourceNamespace string                          `json:"resource_namespace,omitempty"`
	ResourceName      string                          `json:"resource_name,omitempty"`
	Unit              string                          `json:"unit,omitempty"`
	AdditionalLabels  map[string]interface{}          `json:"additionalLabels"`
	Metrics           map[string]interface{}          `json:"rhmUsageMetrics"`
	MetricsExtended   []MarketplaceMetric             `json:"rhmUsageMetricsDetailed"`
	RecordSummary     *MarketplaceReportRecordSummary `json:"rhmUsageMetricsDetailedSummary,omitempty"`
}

type MarketplaceReportDataBuilder

type MarketplaceReportDataBuilder struct {
	// contains filtered or unexported fields
}

func (*MarketplaceReportDataBuilder) AddMeterDefinitionLabels

func (d *MarketplaceReportDataBuilder) AddMeterDefinitionLabels(
	meterDef *marketplacecommon.MeterDefPrometheusLabelsTemplated,
)

func (*MarketplaceReportDataBuilder) Build

func (d *MarketplaceReportDataBuilder) Build() (interface{}, error)

func (*MarketplaceReportDataBuilder) SetAccountID

func (d *MarketplaceReportDataBuilder) SetAccountID(
	accountID string,
)

func (*MarketplaceReportDataBuilder) SetClusterID

func (d *MarketplaceReportDataBuilder) SetClusterID(
	clusterID string,
)

func (*MarketplaceReportDataBuilder) SetReportInterval

func (d *MarketplaceReportDataBuilder) SetReportInterval(start, end common.Time)

type MarketplaceReportRecordSummary

type MarketplaceReportRecordSummary struct {
	TotalMetricCount int `json:"totalMetricCount"`
}

type MarketplaceReportSlice

type MarketplaceReportSlice struct {
	ReportSliceID common.ReportSliceKey    `json:"report_slice_id"`
	Metadata      *SourceMetadata          `json:"metadata,omitempty"`
	Metrics       []*MarketplaceReportData `json:"metrics"`
}

type ReportMetadata

type ReportMetadata struct {
	ReportID       uuid.UUID                                   `json:"report_id"`
	Source         uuid.UUID                                   `json:"source"`
	SourceMetadata SourceMetadata                              `json:"source_metadata"`
	ReportSlices   map[common.ReportSliceKey]ReportSlicesValue `json:"report_slices"`
}

type ReportSlicesValue

type ReportSlicesValue struct {
	NumberMetrics int `json:"number_metrics"`
}

type SourceMetadata

type SourceMetadata struct {
	RhmClusterID   string                   `json:"rhmClusterId" mapstructure:"rhmClusterId"`
	RhmAccountID   string                   `json:"rhmAccountId" mapstructure:"rhmAccountId"`
	RhmEnvironment common.ReportEnvironment `json:"rhmEnvironment,omitempty" mapstructure:"rhmEnvironment,omitempty"`
	Version        string                   `json:"version,omitempty" mapstructure:"version,omitempty"`
	ReportVersion  string                   `json:"reportVersion,omitempty"`
}

Jump to

Keyboard shortcuts

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