From 009c91b99b92d6816d12c9422bb0c4d299c28941 Mon Sep 17 00:00:00 2001 From: ImMin5 Date: Wed, 31 Jul 2024 16:35:21 +0900 Subject: [PATCH] feat: modify get_tasks for getting benefit cost data Signed-off-by: ImMin5 --- src/cloudforet/cost_analysis/manager/job_manager.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/cloudforet/cost_analysis/manager/job_manager.py b/src/cloudforet/cost_analysis/manager/job_manager.py index 0bdbb62..a3f1de1 100644 --- a/src/cloudforet/cost_analysis/manager/job_manager.py +++ b/src/cloudforet/cost_analysis/manager/job_manager.py @@ -96,6 +96,19 @@ def get_tasks( synced_accounts = self._extend_synced_accounts( synced_accounts, first_sync_tenants ) + # Benefit Job Task + if options.get("cost_metric") == "AmortizedCost": + tasks.append( + { + "task_options": { + "start": start_month, + "account_agreement_type": billing_account_agreement_type, + "collect_scope": "billing_account_id", + "is_benefit_job": True, + } + } + ) + else: tasks = [ {