ccmcommons

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CCMFetchPerspectiveFiltersValueQuery = `` /* 447-byte string literal not displayed */
View Source
const CCMMetadataQuery = `` /* 610-byte string literal not displayed */
View Source
const CCMPerspectiveBudgetQuery = `` /* 220-byte string literal not displayed */
View Source
const CCMPerspectiveGridQuery = `` /* 822-byte string literal not displayed */
View Source
const CCMPerspectiveRecommendationsQuery = `` /* 363-byte string literal not displayed */
View Source
const CCMPerspectiveSummaryWithBudgetQuery = `` /* 1316-byte string literal not displayed */
View Source
const CCMPerspectiveTimeSeriesQuery = `` /* 683-byte string literal not displayed */

Variables

View Source
var ConditionFieldDescriptions = []map[string]string{
	{
		"fieldId":     "region",
		"description": "Use this field to create a view filter rule to filter by cloud region.",
	},
	{
		"fieldId":     "awsUsageaccountid",
		"description": "Use this field to create a view filter rule to filter by AWS usage account ID.",
	},
	{
		"fieldId":     "awsServicecode",
		"description": "Use this field to create a view filter rule to filter by AWS service code.",
	},
	{
		"fieldId":     "awsBillingEntity",
		"description": "Use this field to create a view filter rule to filter by AWS billing entity.",
	},
	{
		"fieldId":     "awsInstancetype",
		"description": "Use this field to create a view filter rule to filter by AWS instance type.",
	},
	{
		"fieldId":     "awsLineItemType",
		"description": "Use this field to create a view filter rule to filter by AWS line item type.",
	},
	{
		"fieldId":     "awspayeraccountid",
		"description": "Use this field to create a view filter rule to filter by AWS payer account ID.",
	},
	{
		"fieldId":     "awsUsageType",
		"description": "Use this field to create a view filter rule to filter by AWS usage type.",
	},
	{
		"fieldId":     "cloudprovider",
		"description": "use this field to create a view filter rule to filter by cloud provider.",
	},
	{
		"fieldId":     "none",
		"description": "use this field to create a view filter rule with no filter or grouping applied.",
	},
	{
		"fieldId":     "product",
		"description": "use this field to create a view filter rule to filter by product.",
	},
}
View Source
var ConditionKeyValueFieldDescriptions = []map[string]string{
	{
		"fieldId":     "label",
		"description": labelDescription,
	},
	{
		"fieldId":     "label_v2",
		"description": labelV2Description,
	},
	{
		"fieldId":     "business_mapping",
		"description": costCategoryDescription,
	},
}
View Source
var DefaultGroupBy = []map[string]any{
	{
		"entityGroupBy": map[string]any{
			"fieldId":        "product",
			"fieldName":      "Product",
			"identifier":     "COMMON",
			"identifierName": "Common",
		},
	},
}
View Source
var OutputFields = []map[string]string{
	{
		"fieldId":        "region",
		"fieldName":      "Region",
		"identifier":     "COMMON",
		"identifierName": "Common",
	},
	{
		"fieldId":        "awsUsageaccountid",
		"fieldName":      "Account",
		"identifier":     "AWS",
		"identifierName": "AWS",
	},
	{
		"fieldId":        "awsServicecode",
		"fieldName":      "Service",
		"identifier":     "AWS",
		"identifierName": "AWS",
	},
	{
		"fieldId":        "awsBillingEntity",
		"fieldName":      "Billing Entity",
		"identifier":     "AWS",
		"identifierName": "AWS",
	},
	{
		"fieldId":        "awsInstancetype",
		"fieldName":      "Instance Type",
		"identifier":     "AWS",
		"identifierName": "AWS",
	},
	{
		"fieldId":        "awsLineItemType",
		"fieldName":      "Line Item Type",
		"identifier":     "AWS",
		"identifierName": "AWS",
	},
	{
		"fieldId":        "awspayeraccountid",
		"fieldName":      "Payer Account",
		"identifier":     "AWS",
		"identifierName": "AWS",
	},
	{
		"fieldId":        "awsUsageType",
		"fieldName":      "Usage Type",
		"identifier":     "AWS",
		"identifierName": "AWS",
	},
	{
		"fieldId":        "cloudProvider",
		"fieldName":      "Cloud Provider",
		"identifier":     "COMMON",
		"identifierName": "Common",
	},
	{
		"fieldId":        "none",
		"fieldName":      "None",
		"identifier":     "COMMON",
		"identifierName": "Common",
	},
	{
		"fieldId":        "product",
		"fieldName":      "Product",
		"identifier":     "COMMON",
		"identifierName": "Common",
	},
}
View Source
var OutputKeyFields = []map[string]string{
	{
		"fieldId":    "labels.key",
		"fieldName":  "",
		"identifier": "LABEL",
	},
	{
		"fieldId":    "labels.key2",
		"fieldName":  "",
		"identifier": "LABEL_V2",
	},
}
View Source
var OutputKeyValueFields = []map[string]string{
	{
		"fieldId":        "labels.value",
		"fieldName":      "",
		"identifier":     "LABEL",
		"identifierName": "Label",
	},
	{
		"fieldId":        "labels.value",
		"fieldName":      "",
		"identifier":     "LABEL_V2",
		"identifierName": "Label V2",
	},
	{
		"fieldId":        "",
		"fieldName":      "",
		"identifier":     "BUSINESS_MAPPING",
		"identifierName": "Cost Categories",
	},
}

Functions

func BuildAggregateFunction

func BuildAggregateFunction() []map[string]any

func BuildFieldFilters

func BuildFieldFilters(input map[string][]string, output []map[string]string) []map[string]any

func BuildFieldFiltersWithOperator

func BuildFieldFiltersWithOperator(input map[string][]string, output []map[string]string, operator string) []map[string]any

func BuildFilterValues

func BuildFilterValues(options *dto.CCMPerspectiveFilterValuesOptions) []map[string]any

func BuildFilters

func BuildFilters(viewId string, timeFilters string, idFilters dto.CCMGraphQLFilters, keyValueFilters dto.CCMGraphQLKeyValueFilters) []map[string]any

func BuildGroupBy

func BuildGroupBy(input map[string]any, outputFields []map[string]string, outputKeyValueFields []map[string]string) []map[string]any

func BuildKeyFieldFilter

func BuildKeyFieldFilter(input string, output map[string]map[string]any) ([]map[string]any, error)

func BuildKeyFieldFilterWithOperator

func BuildKeyFieldFilterWithOperator(fieldKey string, output map[string]map[string]any, operator string) ([]map[string]any, error)

func BuildKeyValueFieldFilter

func BuildKeyValueFieldFilter(fieldKey string, fieldSubKey string, output map[string]map[string]any) ([]map[string]any, error)

func BuildKeyValueFieldFilterWithOperator

func BuildKeyValueFieldFilterWithOperator(fieldKey string, fieldSubKey string, output map[string]map[string]any, operator string) ([]map[string]any, error)

func BuildKeyValueFieldFilters

func BuildKeyValueFieldFilters(input dto.CCMGraphQLKeyValueFilters, output []map[string]string) []map[string]any

func BuildKeyValueFieldFiltersWithOperator

func BuildKeyValueFieldFiltersWithOperator(input dto.CCMGraphQLKeyValueFilters, output []map[string]string, operator string) []map[string]any

func BuildLabelsV2KeysFilters

func BuildLabelsV2KeysFilters(options *dto.CCMListLabelsV2KeysOptions) []map[string]any

BuildLabelsV2KeysFilters builds the filters specifically for fetching labelsV2 keys

func BuildOutputFieldsMap

func BuildOutputFieldsMap() map[string]map[string]any

func BuildPreferences

func BuildPreferences() map[string]any

func BuildTimeFilters

func BuildTimeFilters(timeFilter string) []map[string]any

func BuildViewFilter

func BuildViewFilter(viewId string) []map[string]any

func DebugPayload

func DebugPayload(ctx context.Context, operation string, payload map[string]any)

func GetFilterFieldByType

func GetFilterFieldByType(fieldType string) map[string]string

func GetTimeRangeFromFilter

func GetTimeRangeFromFilter(filter string, now time.Time) (start, end time.Time)

func MapToJSONString

func MapToJSONString(m map[string]any) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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