File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
src/cloudforet/cost_analysis/manager Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,19 @@ class DataSourceManager(BaseManager):
16
16
def init_response (options ):
17
17
plugin_metadata = PluginMetadata ()
18
18
plugin_metadata .validate ()
19
+ currency = options .get ("currency" , "USD" )
19
20
20
21
if "bucket_name" in options :
22
+ provider = options .get ("provider" , "google_cloud" )
23
+ source = "additional_info.Project ID"
24
+ target = "data.project_id"
25
+ if provider == "aws" :
26
+ source = "additional_info.Account ID"
27
+ target = "data.account_id"
28
+ elif provider == "azure" :
29
+ source = "additional_info.Subscription Id"
30
+ target = "data.subscription_id"
31
+
21
32
return {
22
33
"metadata" : {
23
34
"data_source_rules" : [
@@ -26,14 +37,14 @@ def init_response(options):
26
37
"conditions_policy" : "ALWAYS" ,
27
38
"actions" : {
28
39
"match_service_account" : {
29
- "source" : "additional_info.Project ID" ,
30
- "target" : "data.project_id" ,
40
+ "source" : source ,
41
+ "target" : target ,
31
42
}
32
43
},
33
44
"options" : {"stop_processing" : True },
34
45
}
35
46
],
36
- "currency" : "KRW" ,
47
+ "currency" : currency ,
37
48
}
38
49
}
39
50
You can’t perform that action at this time.
0 commit comments