diff --git a/src/spaceone/cost_analysis/model/budget_model.py b/src/spaceone/cost_analysis/model/budget_model.py index a5a8a97f..4d39c81e 100644 --- a/src/spaceone/cost_analysis/model/budget_model.py +++ b/src/spaceone/cost_analysis/model/budget_model.py @@ -71,8 +71,9 @@ class Budget(MongoModel): "ordering": ["name"], "indexes": [ "name", - "project_id", "data_source_id", + "project_id", + "workspace_id", "domain_id", ], } diff --git a/src/spaceone/cost_analysis/model/cost_model.py b/src/spaceone/cost_analysis/model/cost_model.py index d3869f57..67ff7305 100644 --- a/src/spaceone/cost_analysis/model/cost_model.py +++ b/src/spaceone/cost_analysis/model/cost_model.py @@ -61,13 +61,14 @@ class Cost(MongoModel): "domain_id", "data_source_id", "-billed_date", + "workspace_id", "project_id", "cost", ], "name": "COMPOUND_INDEX_FOR_SEARCH", }, { - "fields": ["domain_id", "cost_id", "project_id"], + "fields": ["domain_id", "cost_id", "workspace_id", "project_id"], "name": "COMPOUND_INDEX_FOR_DELETE", }, ], @@ -109,6 +110,7 @@ class MonthlyCost(MongoModel): "domain_id", "data_source_id", "-billed_month", + "workspace_id", "project_id", "cost", ], @@ -119,6 +121,7 @@ class MonthlyCost(MongoModel): "domain_id", "data_source_id", "-billed_year", + "workspace_id", "project_id", "cost", ], diff --git a/src/spaceone/cost_analysis/model/cost_query_set_model.py b/src/spaceone/cost_analysis/model/cost_query_set_model.py index 6058fcd6..89ad43ce 100644 --- a/src/spaceone/cost_analysis/model/cost_query_set_model.py +++ b/src/spaceone/cost_analysis/model/cost_query_set_model.py @@ -25,5 +25,5 @@ class CostQuerySet(MongoModel): "workspace_id", ], "ordering": ["name"], - "indexes": ["name", "user_id", "data_source_id", "domain_id"], + "indexes": ["name", "user_id", "data_source_id", "workspace_id", "domain_id"], } diff --git a/src/spaceone/cost_analysis/model/data_source_model.py b/src/spaceone/cost_analysis/model/data_source_model.py index 82427a01..8c33126f 100644 --- a/src/spaceone/cost_analysis/model/data_source_model.py +++ b/src/spaceone/cost_analysis/model/data_source_model.py @@ -81,5 +81,5 @@ class DataSource(MongoModel): "provider", ], "ordering": ["name"], - "indexes": ["name", "state", "data_source_type", "provider", "domain_id"], + "indexes": ["state", "data_source_type", "provider", "workspace_id", "domain_id"], } diff --git a/src/spaceone/cost_analysis/model/data_source_rule_model.py b/src/spaceone/cost_analysis/model/data_source_rule_model.py index 5c8955b6..8a7fc366 100644 --- a/src/spaceone/cost_analysis/model/data_source_rule_model.py +++ b/src/spaceone/cost_analysis/model/data_source_rule_model.py @@ -57,6 +57,7 @@ class DataSourceRule(MongoModel): "order", "conditions_policy", "data_source_id", + "workspace_id", "domain_id", ], }