morpheus-cli 4.2.4 → 4.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cb4101fbb710060028dcbfcda3ad4caeb117950e68506f804a6d0fa604c8c08
4
- data.tar.gz: 5d12f8d57d4d4ad8b83a8f9fc731e893b6f29ae6a8b36faa0bb5cb4b904d4eb8
3
+ metadata.gz: 7b6ccabcdbd7fef021565aa109c55832f6e1f67e4fff957849aa31bfff81b14b
4
+ data.tar.gz: 4241cdcba0dfacfccfd15916340a5ffe1f876067e1565bac202e87c415603c09
5
5
  SHA512:
6
- metadata.gz: c1673ab1af718c3570d502ba4323102e58999b2c2a8c883df79c6043a84ba92c9a49fe831160cd273f5912d1624965be0dbc854a78b23105d8e2a6768cd5ec17
7
- data.tar.gz: 644dc0ded92efb77ca3c3007c7dc0d84c3e147c6f42acb49b5635024a4ea268ba9a5887af4733589a8b6794e0f6a67432252fe9f66ff50d88e9a5b05981d96b5
6
+ metadata.gz: 5bda2a86a83aa395736e0fd133d6aae6dd388f474e521252ef5c4bed9855b0e8a4325881c2daa0bdf6fe0ca52f650c853385b0974f1e7d399664e9dd997d4d6f
7
+ data.tar.gz: 948e5582db73d74a27a270b61155a0ecb5844c0c5e6a58b5e0b6148ea6fbd5bfeb707e42592509ac4be2adab8c59978491caafef8c5e1f465b30cfad8d550529
data/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
1
  FROM ruby:2.5.1
2
2
 
3
- RUN gem install morpheus-cli -v 4.2.4
3
+ RUN gem install morpheus-cli -v 4.2.5
4
4
 
5
5
  ENTRYPOINT ["morpheus"]
@@ -24,14 +24,18 @@ class Morpheus::Cli::InvoicesCommand
24
24
  optparse = Morpheus::Cli::OptionParser.new do |opts|
25
25
  opts.banner = subcommand_usage()
26
26
  opts.on('-a', '--all', "Display all costs, prices and raw data" ) do
27
+ options[:show_actual_costs] = true
27
28
  options[:show_costs] = true
28
29
  options[:show_prices] = true
29
30
  options[:show_raw_data] = true
30
31
  end
32
+ opts.on('--actuals', '--actuals', "Display all actual costs: Compute, Memory, Storage, etc." ) do
33
+ options[:show_actual_costs] = true
34
+ end
31
35
  opts.on('--costs', '--costs', "Display all costs: Compute, Memory, Storage, etc." ) do
32
36
  options[:show_costs] = true
33
37
  end
34
- opts.on('--prices', '--prices', "Display all costs: Compute, Memory, Storage, etc." ) do
38
+ opts.on('--prices', '--prices', "Display prices: Total, Compute, Memory, Storage, etc." ) do
35
39
  options[:show_prices] = true
36
40
  end
37
41
  opts.on('--type TYPE', String, "Filter by Ref Type eg. ComputeSite (Group), ComputeZone (Cloud), ComputeServer (Host), Instance, Container, User") do |val|
@@ -164,7 +168,22 @@ class Morpheus::Cli::InvoicesCommand
164
168
  {"PERIOD" => lambda {|it| format_invoice_period(it) } },
165
169
  {"START" => lambda {|it| format_date(it['startDate']) } },
166
170
  {"END" => lambda {|it| it['endDate'] ? format_date(it['endDate']) : '' } },
167
-
171
+ {"MTD" => lambda {|it| format_money(it['runningCost']) } },
172
+ {"TOTAL" => lambda {|it|
173
+ if it['period'] == current_period && it['totalCost'].to_f > 0
174
+ format_money(it['totalCost']) + " (Projected)"
175
+ else
176
+ format_money(it['totalCost'])
177
+ end
178
+ } },
179
+ {"ACTUAL MTD" => lambda {|it| format_money(it['actualRunningCost']) } },
180
+ {"ACTUAL TOTAL" => lambda {|it|
181
+ if it['period'] == current_period && it['actualTotalCost'].to_f > 0
182
+ format_money(it['actualTotalCost']) + " (Projected)"
183
+ else
184
+ format_money(it['actualTotalCost'])
185
+ end
186
+ } }
168
187
  ]
169
188
  if options[:show_costs]
170
189
  columns += [
@@ -175,16 +194,24 @@ class Morpheus::Cli::InvoicesCommand
175
194
  {"OTHER" => lambda {|it| format_money(it['extraCost']) } },
176
195
  ]
177
196
  end
178
- columns += [
179
- {"MTD" => lambda {|it| format_money(it['runningCost']) } },
180
- {"TOTAL" => lambda {|it|
181
- if it['period'] == current_period && it['totalCost'].to_f > 0
182
- format_money(it['totalCost']) + " (Projected)"
183
- else
184
- format_money(it['totalCost'])
185
- end
186
- } }
187
- ]
197
+ if options[:show_actual_costs]
198
+ columns += [
199
+ {"ACTUAL COMPUTE" => lambda {|it| format_money(it['actualComputePrice']) } },
200
+ # {"ACTUAL MEMORY" => lambda {|it| format_money(it['actualMemoryPrice']) } },
201
+ {"ACTUAL STORAGE" => lambda {|it| format_money(it['actualStoragePrice']) } },
202
+ {"ACTUAL NETWORK" => lambda {|it| format_money(it['actualNetworkPrice']) } },
203
+ {"ACTUAL OTHER" => lambda {|it| format_money(it['actualExtraPrice']) } },
204
+ # {"ACTUAL MTD" => lambda {|it| format_money(it['actualRunningPrice']) } },
205
+ # {"ACTUAL TOTAL" => lambda {|it|
206
+ # if it['period'] == current_period && it['actualTotalPrice'].to_f > 0
207
+ # format_money(it['actualTotalPrice']) + " (Projected)"
208
+ # else
209
+ # format_money(it['actualTotalPrice'])
210
+ # end
211
+ # } }
212
+ ]
213
+ end
214
+
188
215
  if options[:show_prices]
189
216
  columns += [
190
217
  {"COMPUTE PRICE" => lambda {|it| format_money(it['computePrice']) } },
@@ -309,8 +336,9 @@ class Morpheus::Cli::InvoicesCommand
309
336
  print "\n"
310
337
  # print_h2 "Costs"
311
338
  cost_rows = [
312
- {label: 'Cost'.upcase, compute: invoice['computeCost'], memory: invoice['memoryCost'], storage: invoice['storageCost'], network: invoice['networkCost'], license: invoice['licenseCost'], extra: invoice['extraCost'], running: invoice['runningCost'], total: invoice['totalCost']},
313
- {label: 'Price'.upcase, compute: invoice['computePrice'], memory: invoice['memoryPrice'], storage: invoice['storagePrice'], network: invoice['networkPrice'], license: invoice['licensePrice'], extra: invoice['extraPrice'], running: invoice['runningPrice'], total: invoice['totalPrice']},
339
+ {label: 'Usage Price'.upcase, compute: invoice['computePrice'], memory: invoice['memoryPrice'], storage: invoice['storagePrice'], network: invoice['networkPrice'], license: invoice['licensePrice'], extra: invoice['extraPrice'], running: invoice['runningPrice'], total: invoice['totalPrice']},
340
+ {label: 'Usage Cost'.upcase, compute: invoice['computeCost'], memory: invoice['memoryCost'], storage: invoice['storageCost'], network: invoice['networkCost'], license: invoice['licenseCost'], extra: invoice['extraCost'], running: invoice['runningCost'], total: invoice['totalCost']},
341
+ {label: 'Actual Cost'.upcase, compute: invoice['actualComputeCost'], memory: invoice['actualMemoryCost'], storage: invoice['actualStorageCost'], network: invoice['actualNetworkCost'], license: invoice['actualLicenseCost'], extra: invoice['actualExtraCost'], running: invoice['actualRunningCost'], total: invoice['actualTotalCost']},
314
342
  ]
315
343
  cost_columns = {
316
344
  "" => lambda {|it| it[:label] },
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Morpheus
3
3
  module Cli
4
- VERSION = "4.2.4"
4
+ VERSION = "4.2.5"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morpheus-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.4
4
+ version: 4.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Estes