Documentation ¶
Index ¶
- Constants
- type Manifest
- type MarketplaceReportData
- type MarketplaceReportDataBuilder
- func (d *MarketplaceReportDataBuilder) AddMeterDefinitionLabels(meterDef *marketplacecommon.MeterDefPrometheusLabelsTemplated)
- func (d *MarketplaceReportDataBuilder) Build() (interface{}, error)
- func (d *MarketplaceReportDataBuilder) SetAccountID(accountID string)
- func (d *MarketplaceReportDataBuilder) SetClusterID(clusterID string)
- func (d *MarketplaceReportDataBuilder) SetReportInterval(start, end common.Time)
- type MarketplaceReportSlice
- type MeasuredUsage
- type SourceMetadata
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") ErrNotFloat64 = errors.Sentinel("meterdefinition value not float64") )
View Source
const AccountMetrics = "accountMetrics"
View Source
const Version = "v2alpha1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MarketplaceReportData ¶
type MarketplaceReportData struct { /* A GUID uniquely identifying this event being sent. A second event with the same eventId will be processed as an amendment. Two events in the same uploaded archive MUST NOT have the same event id. This may be across all the files in the archive. */ EventID string `json:"eventId"` // Milliseconds from epoch UTC representing the start of the window for the usage data being reported IntervalStart int64 `json:"start"` // Milliseconds from epoch UTC representing the end of the window for the usage data being reported IntervalEnd int64 `json:"end"` // The Id of the Red Hat Marketplace account that usage is being reported for. AccountID string `json:"accountId,omitempty" mapstructure:"accountId"` /* An object allowing for additional attributes related to the usage data. This object will be merged with measuredUsage.additionalAttributes for processing. See measuredUsage.additionalAttributes for details and the Additional Attributes section below. */ AdditionalAttributes map[string]interface{} `json:"additionalAttributes,omitempty"` // An array of usage objects. MeasuredUsage []MeasuredUsage `json:"measuredUsage"` }
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 MarketplaceReportSlice ¶
type MarketplaceReportSlice struct { /* This is required only because RH Insights forces the metadata field. It will exist only in the case where data is sent through the RH pipeline to the COS bucket directly. It will not be inspected or processed. */ Metadata *SourceMetadata `json:"metadata,omitempty"` // An array of metrics data objects. Metrics []*MarketplaceReportData `json:"data"` }
type MeasuredUsage ¶
type MeasuredUsage struct { /* The ID of the metric being reported. If multiple objects inside measuredUsage have the same metricId for the same product the complete event will be rejected and NOT processed. */ MetricID string `json:"metricId"` // The recorded usage value for the time window. Value float64 `json:"value"` /* The additionalAttributes associated with the metric will be merged with the additionalAttributes for the event overall. Priority will be give to metric level additionalAttributes */ AdditionalAttributes map[string]interface{} `json:"additionalAttributes,omitempty"` }
type SourceMetadata ¶
type SourceMetadata struct { RhmClusterID string `json:"rhmClusterId" mapstructure:"rhmClusterId"` RhmAccountID string `json:"rhmAccountId,omitempty" mapstructure:"rhmAccountId"` RhmEnvironment common.ReportEnvironment `json:"rhmEnvironment,omitempty" mapstructure:"rhmEnvironment,omitempty"` Version string `json:"version,omitempty" mapstructure:"version,omitempty"` ReportVersion string `json:"reportVersion,omitempty"` }
Click to show internal directories.
Click to hide internal directories.