File tree 2 files changed +23
-3
lines changed
src/cloudforet/cost_analysis
2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,24 @@ def init_response(options):
17
17
plugin_metadata .currency = currency
18
18
19
19
if options .get ("pay_as_you_go" ):
20
- plugin_metadata .alias .update ({"cost" : "PayAsYouGo" })
20
+ plugin_metadata .cost_info = {
21
+ "name" : "PayAsYouGo" ,
22
+ "unit" : options .get ("currency" , "KRW" ),
23
+ }
21
24
elif options .get ("cost_metric" ) == "AmortizedCost" :
22
- plugin_metadata .alias .update ({"cost" : "Amortized Cost" })
25
+ plugin_metadata .cost_info = {
26
+ "name" : "Amortized Cost" ,
27
+ "unit" : options .get ("currency" , "KRW" ),
28
+ }
23
29
else :
24
- plugin_metadata .alias .update ({"cost" : "Actual Cost" })
30
+ plugin_metadata .cost_info = {
31
+ "name" : "Actual Cost" ,
32
+ "unit" : options .get ("currency" , "KRW" ),
33
+ }
34
+ plugin_metadata .data_info ["PayAsYouGo" ] = {
35
+ "name" : "PayAsYouGo" ,
36
+ "unit" : options .get ("currency" , "KRW" ),
37
+ }
25
38
26
39
if options .get ("use_account_routing" ):
27
40
plugin_metadata .use_account_routing = True
Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ class DataSourceRule(Model):
54
54
tags = DictType (StringType , default = {})
55
55
56
56
57
+ class MetadataDataInfo (Model ):
58
+ name = StringType (required = True )
59
+ unit = StringType (required = True )
60
+
61
+
57
62
class PluginMetadata (Model ):
58
63
data_source_rules = ListType (
59
64
ModelType (DataSourceRule ), default = _DEFAULT_DATA_SOURCE_RULES
@@ -64,3 +69,5 @@ class PluginMetadata(Model):
64
69
alias = DictType (StringType , default = {})
65
70
account_match_key = StringType (default = None )
66
71
exclude_license_cost = BooleanType (default = False )
72
+ cost_info = DictType (StringType , default = {})
73
+ data_info = DictType (ModelType (MetadataDataInfo ), default = {})
You can’t perform that action at this time.
0 commit comments