Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network and storage costs #3819

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 118 additions & 1 deletion locales/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -3439,6 +3439,91 @@
}
],
"distributeCosts": [
{
"options": {
"false": {
"value": [
{
"type": 0,
"value": "Do not distribute "
},
{
"options": {
"network": {
"value": [
{
"type": 0,
"value": "network"
}
]
},
"other": {
"value": []
},
"storage": {
"value": [
{
"type": 0,
"value": "storage"
}
]
}
},
"type": 5,
"value": "type"
},
{
"type": 0,
"value": " costs"
}
]
},
"other": {
"value": []
},
"true": {
"value": [
{
"type": 0,
"value": "Distribute "
},
{
"options": {
"network": {
"value": [
{
"type": 0,
"value": "network"
}
]
},
"other": {
"value": []
},
"storage": {
"value": [
{
"type": 0,
"value": "storage"
}
]
}
},
"type": 5,
"value": "type"
},
{
"type": 0,
"value": " costs"
}
]
}
},
"type": 5,
"value": "value"
}
],
"distributeUnallocatedCapacity": [
{
"options": {
"false": {
Expand Down Expand Up @@ -3526,7 +3611,7 @@
"distributionModelDesc": [
{
"type": 0,
"value": "This choice is for users to direct how their raw costs are distributed either by CPU or Memory on the project level breakdowns."
"value": "Choose how your raw costs are distributed at the project level."
}
],
"distributionType": [
Expand Down Expand Up @@ -9714,6 +9799,14 @@
}
]
},
"network": {
"value": [
{
"type": 0,
"value": "Network usage comparison"
}
]
},
"other": {
"value": []
},
Expand Down Expand Up @@ -10317,6 +10410,18 @@
"value": "count"
}
],
"network": [
{
"type": 0,
"value": "Network"
}
],
"networkDesc": [
{
"type": 0,
"value": "Distribute the cost of network traffic to projects based on distribution type."
}
],
"next": [
{
"type": 0,
Expand Down Expand Up @@ -12102,12 +12207,24 @@
"value": "Status/Actions"
}
],
"storage": [
{
"type": 0,
"value": "Storage"
}
],
"storageClass": [
{
"type": 0,
"value": "StorageClass"
}
],
"storageDesc": [
{
"type": 0,
"value": "Distribute the cost of storage to projects based on distribution type."
}
],
"suggestions": [
{
"type": 0,
Expand Down
11 changes: 8 additions & 3 deletions locales/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,9 @@
"disabled": "Disabled",
"discountMinus": "Discount (-)",
"distribute": "Distribute",
"distributeCosts": "{value, select, true {Distribute {type, select, platform {platform} worker {worker} other {}} unallocated capacity}false {Do not distribute {type, select, platform {platform} worker {worker} other {}} unallocated capacity}other {}}",
"distributionModelDesc": "This choice is for users to direct how their raw costs are distributed either by CPU or Memory on the project level breakdowns.",
"distributeCosts": "{value, select, true {Distribute {type, select, network {network} storage {storage} other {}} costs}false {Do not distribute {type, select, network {network} storage {storage} other {}} costs}other {}}",
"distributeUnallocatedCapacity": "{value, select, true {Distribute {type, select, platform {platform} worker {worker} other {}} unallocated capacity}false {Do not distribute {type, select, platform {platform} worker {worker} other {}} unallocated capacity}other {}}",
"distributionModelDesc": "Choose how your raw costs are distributed at the project level.",
"distributionType": "Distribution type",
"distributionTypeDesc": "{type, select, cpu {Distribute costs based on CPU usage}memory {Distribute costs based on memory usage}other {}}",
"doNotDistribute": "Do not distribute",
Expand Down Expand Up @@ -338,7 +339,7 @@
"groupByValuesTitleCase": "{value, select, account {{count, plural, one {Account} other {Accounts}}} aws_category {{count, plural, one {Cost category} other {Cost categories}}} cluster {{count, plural, one {Cluster} other {Clusters}}} gcp_project {{count, plural, one {GCP project} other {GCP projects}}} node {{count, plural, one {Node} other {Node}}} org_unit_id {{count, plural, one {Organizational unit} other {Organizational units}}} payer_tenant_id {{count, plural, one {Account} other {Accounts}}} product_service {{count, plural, one {Service} other {Services}}} project {{count, plural, one {Project} other {Projects}}} region {{count, plural, one {Region} other {Regions}}} resource_location {{count, plural, one {Region} other {Regions}}} service {{count, plural, one {Service} other {Services}}} service_name {{count, plural, one {Service} other {Services}}} subscription_guid {{count, plural, one {Account} other {Accounts}}} tag {{count, plural, one {Tag} other {Tags}}} other {}}",
"historicalChartCostLabel": "Cost ({units})",
"historicalChartDayOfMonthLabel": "Day of Month",
"historicalChartTitle": "{value, select, cost {Cost comparison} cpu {CPU usage, request, and limit comparison} instance_type {Compute usage comparison}memory {Memory usage, request, and limit comparison} modal {{name} daily usage comparison} storage {Storage usage comparison} virtual_machine {Virtual machine usage comparison}other {}}",
"historicalChartTitle": "{value, select, cost {Cost comparison} cpu {CPU usage, request, and limit comparison} instance_type {Compute usage comparison}memory {Memory usage, request, and limit comparison} modal {{name} daily usage comparison} network {Network usage comparison} storage {Storage usage comparison} virtual_machine {Virtual machine usage comparison}other {}}",
"historicalChartUsageLabel": "{value, select, instance_type {hrs} storage {gb-mo} other {}}",
"ibm": "IBM Cloud",
"ibmComputeTitle": "Compute instances usage",
Expand Down Expand Up @@ -380,6 +381,8 @@
"metricsOperatorVersion": "Cost Management operator version",
"monthOverMonthChange": "Month over month change",
"names": "{count, plural, one {Name} other {Names}}",
"network": "Network",
"networkDesc": "Distribute the cost of network traffic to projects based on distribution type.",
"next": "next",
"no": "No",
"noDataForDate": "No data available for {dateRange}",
Expand Down Expand Up @@ -546,7 +549,9 @@
"start": "Start",
"status": "{value, select, pending {Pending} running {Running} failed {Failed} other {}}",
"statusActions": "Status/Actions",
"storage": "Storage",
"storageClass": "StorageClass",
"storageDesc": "Distribute the cost of storage to projects based on distribution type.",
"suggestions": "Suggestions",
"sumPlatformCosts": "Sum platform costs",
"summary": "Summary",
Expand Down
4 changes: 4 additions & 0 deletions src/api/costModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export interface CostModel {
description: string;
distribution_info?: {
distribution_type?: string;
network_cost?: boolean;
platform_cost?: boolean;
storage_cost?: boolean;
worker_cost?: boolean;
};
markup: { value: string; unit: string };
Expand All @@ -32,7 +34,9 @@ export interface CostModelRequest {
description: string;
distribution_info?: {
distribution_type?: string;
network_cost?: boolean;
platform_cost?: boolean;
storage_cost?: boolean;
worker_cost?: boolean;
};
markup: { value: string; unit: string };
Expand Down
1 change: 1 addition & 0 deletions src/api/reports/ocpReports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const ReportTypePaths: Partial<Record<ReportType, string>> = {
[ReportType.cost]: 'reports/openshift/costs/',
[ReportType.cpu]: 'reports/openshift/compute/',
[ReportType.memory]: 'reports/openshift/memory/',
[ReportType.network]: 'reports/openshift/volumes/', // TBD: Use "network" when API is available
[ReportType.volume]: 'reports/openshift/volumes/',
};

Expand Down
40 changes: 34 additions & 6 deletions src/locales/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1410,17 +1410,24 @@ export default defineMessages({
distributeCosts: {
defaultMessage:
'{value, select, ' +
'true {Distribute {type, select, platform {platform} worker {worker} other {}} unallocated capacity}' +
'false {Do not distribute {type, select, platform {platform} worker {worker} other {}} unallocated capacity}' +
'true {Distribute {type, select, network {network} storage {storage} other {}} costs}' +
'false {Do not distribute {type, select, network {network} storage {storage} other {}} costs}' +
'other {}}',
description: 'distribute costs',
id: 'distributeCosts',
},
distributionModelDesc: {
distributeUnallocatedCapacity: {
defaultMessage:
'This choice is for users to direct how their raw costs are distributed either by CPU or Memory on the project level breakdowns.',
description:
'This choice is for users to direct how their raw costs are distributed either by CPU or Memory on the project level breakdowns.',
'{value, select, ' +
'true {Distribute {type, select, platform {platform} worker {worker} other {}} unallocated capacity}' +
'false {Do not distribute {type, select, platform {platform} worker {worker} other {}} unallocated capacity}' +
'other {}}',
description: 'distribute unallocated capacity',
id: 'distributeUnallocatedCapacity',
},
distributionModelDesc: {
defaultMessage: 'Choose how your raw costs are distributed at the project level.',
description: 'Choose how your raw costs are distributed at the project level.',
id: 'distributionModelDesc',
},
distributionType: {
Expand Down Expand Up @@ -2215,6 +2222,7 @@ export default defineMessages({
'instance_type {Compute usage comparison}' +
'memory {Memory usage, request, and limit comparison} ' +
'modal {{name} daily usage comparison} ' +
'network {Network usage comparison} ' +
'storage {Storage usage comparison} ' +
'virtual_machine {Virtual machine usage comparison}' +
'other {}}',
Expand Down Expand Up @@ -2457,6 +2465,16 @@ export default defineMessages({
description: 'Name plural or singular',
id: 'names',
},
network: {
defaultMessage: 'Network',
description: 'Network',
id: 'network',
},
networkDesc: {
defaultMessage: 'Distribute the cost of network traffic to projects based on distribution type.',
description: 'Distribute the cost of network traffic to projects based on distribution type.',
id: 'networkDesc',
},
next: {
defaultMessage: 'next',
description: 'next',
Expand Down Expand Up @@ -3364,11 +3382,21 @@ export default defineMessages({
description: 'Status/Actions',
id: 'statusActions',
},
storage: {
defaultMessage: 'Storage',
description: 'Storage',
id: 'storage',
},
storageClass: {
defaultMessage: 'StorageClass',
description: 'StorageClass',
id: 'storageClass',
},
storageDesc: {
defaultMessage: 'Distribute the cost of storage to projects based on distribution type.',
description: 'Distribute the cost of storage to projects based on distribution type.',
id: 'storageDesc',
},
suggestions: {
defaultMessage: 'Suggestions',
description: 'Suggestions',
Expand Down
Loading