diff --git a/src/cloudforet/cost_analysis/main.py b/src/cloudforet/cost_analysis/main.py index 71d462f..12240f8 100644 --- a/src/cloudforet/cost_analysis/main.py +++ b/src/cloudforet/cost_analysis/main.py @@ -156,7 +156,7 @@ def cost_get_data(params: dict) -> Generator[dict, None, None]: params["schema"] = params.pop("schema_name", None) params["secret_data"] = __get_secret_data_with_tenant_id( - secret_data, task_options.get("tenant_id") + secret_data, task_options.get("billing_tenant_id") ) if options.get("cost_metric") == "AmortizedCost" and task_options.get( @@ -187,7 +187,7 @@ def __get_secret_data_with_tenant_id(secret_data: dict, tenant_id: str = None) - return secrets[0] for _secret_data in secrets: - if _secret_data["billing_tenant_id"] == tenant_id: + if _secret_data["tenant_id"] == tenant_id: secret_data = _secret_data return secret_data diff --git a/src/cloudforet/cost_analysis/manager/cost_manager.py b/src/cloudforet/cost_analysis/manager/cost_manager.py index e1ae601..e8d7198 100644 --- a/src/cloudforet/cost_analysis/manager/cost_manager.py +++ b/src/cloudforet/cost_analysis/manager/cost_manager.py @@ -409,6 +409,9 @@ def _get_additional_info(self, result: dict, options: dict, tenant_id: str = Non ): result["metercategory"] = result.get("metercategory") + if result.get("meterid") != "" and result.get("meterid"): + additional_info["Meter Id"] = result["meterid"] + if result.get("customername") is None: if result.get("invoicesectionname") != "" and result.get( "invoicesectionname"