Skip to content

Commit

Permalink
Merge pull request #68 from ImMin5/master
Browse files Browse the repository at this point in the history
Add additional info data
  • Loading branch information
ImMin5 authored Jul 2, 2024
2 parents 6224336 + 16aacab commit 001f3f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cloudforet/cost_analysis/manager/cost_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ def _get_additional_info(self, result: dict, options: dict, tenant_id: str = Non
if result.get("pricingmodel") != "" and result.get("pricingmodel"):
additional_info["Pricing Model"] = result["pricingmodel"]

if result.get("reservationname") != "" and result.get("reservationname"):
additional_info["Reservation Name"] = result["reservationname"]

if result.get("benefitname") != "" and result.get("benefitname"):
benefit_name = result["benefitname"]
additional_info["Benefit Name"] = benefit_name
Expand Down Expand Up @@ -244,6 +247,9 @@ def _get_additional_info(self, result: dict, options: dict, tenant_id: str = Non
):
additional_info["Enrollment Account Name"] = result["enrollmentaccountname"]

if result.get("chargetype") != "" and result.get("chargetype"):
additional_info["Charge Type"] = result["chargetype"]

collect_resource_id = options.get("collect_resource_id", False)
if (
collect_resource_id
Expand Down
4 changes: 4 additions & 0 deletions src/cloudforet/cost_analysis/manager/data_source_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def init_response(options):
"name": "Amortized Cost",
"unit": options.get("currency", "KRW"),
}
plugin_metadata.data_info["PayAsYouGo"] = {
"name": "PayAsYouGo",
"unit": options.get("currency", "KRW"),
}
else:
plugin_metadata.cost_info = {
"name": "Actual Cost",
Expand Down

0 comments on commit 001f3f0

Please sign in to comment.