sakurraform 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed44b5ae49e93dd9302608bf2e5a03548e48edee
4
- data.tar.gz: 9671d1bcc4b38ca2d916a454407c835d4feee828
3
+ metadata.gz: 4416aa881d34ded8fbd024c7e43b9dd7f0cbfee8
4
+ data.tar.gz: c80797a43f85f95c82a0bb0c8c9563a32671c554
5
5
  SHA512:
6
- metadata.gz: b31c9e260249834073869a09691157c19bd70668b7d139cc95aa5de094d747b61af9df65add730177784209ed211299e722fe63714a57a25db9ab9895c2670f1
7
- data.tar.gz: e88d4041efe29bf4e6df5eef78c6a55445b8115b319f444512739c3dc1f8dc58d052da1fd7b6664ee46609a1c2e8b11e8a3d28cbe1685e59c4d94c442a495363
6
+ metadata.gz: d9896cd932be452f615c9009682dbb0b1fc643212e4d2aa28e4f54d2ab66dc2be0f142a679d28742289023a94ef9d39ae6f77e5f3938fef164bb0072e63a59dc
7
+ data.tar.gz: 1159a819301a1e0eba877acb40748043d241f56dccf791d58828e3d8034ff9583f124d33f51ca0f91b58abfbf6b662d207b006c0df307b27938114644d3da497
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG of sakurraform
2
2
 
3
+ ## v0.2.1
4
+
5
+ - Add Json format for status.
6
+
3
7
  ## v0.2.0
4
8
 
5
9
  - Rename Base Storage to Object Storage
@@ -7,21 +7,32 @@ module SakurraForm
7
7
  File.expand_path("../../", __FILE__)
8
8
  end
9
9
 
10
- desc 'status', "show status [--sync](to update cached_state)"
10
+ desc 'status', "show status [--json] [--sync](to update cached_state)"
11
11
  option :sync, :type => :boolean
12
+ option :json, :type => :boolean
12
13
  def status
13
14
  ## Showdown Network
14
15
  col_network = SakurraForm::Collection.new('network')
15
16
  col_network.collection_resources(true)
16
- Formatador.display_line('[green]Nework resources[/]')
17
- Formatador.display_table(build_state_network(col_network), [:name, :sakurraform_name, :sakura_id, :subnet, :gateway])
18
- say()
17
+ if options[:json]
18
+ output = Hash.new
19
+ output["Networks"] = build_state_network(col_network)
20
+ else
21
+ Formatador.display_line('[green]Nework resources[/]')
22
+ Formatador.display_table(build_state_network(col_network), [:name, :sakurraform_name, :sakura_id, :subnet, :gateway])
23
+ say()
24
+ end
19
25
 
20
26
  ## Showdown Server
21
27
  col_server = SakurraForm::Collection.new('server')
22
28
  col_server.collection_resources(true)
23
- Formatador.display_line('[green]Server resources[/]')
24
- Formatador.display_table(build_state_server(col_server), [:name, :sakurraform_name, :sakura_id, :ipaddress, :status, :last_state_changed])
29
+ if options[:json]
30
+ output["Servers"] = build_state_server(col_server)
31
+ say(JSON.pretty_generate(output))
32
+ else
33
+ Formatador.display_line('[green]Server resources[/]')
34
+ Formatador.display_table(build_state_server(col_server), [:name, :sakurraform_name, :sakura_id, :ipaddress, :status, :last_state_changed])
35
+ end
25
36
  if options[:sync]
26
37
  col_server.resources.each do |r|
27
38
  create_file "state/server/#{r.resource_id}.yml", r.remote_state.to_yaml
@@ -1,3 +1,3 @@
1
1
  module SakurraForm
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sakurraform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sawanoboly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-06 00:00:00.000000000 Z
11
+ date: 2015-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor