cloudstack-cli 0.6.1 → 0.7.0

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
  SHA1:
3
- metadata.gz: 8c84a6cc2f45502ece2b41bc5ed0e6072ea46177
4
- data.tar.gz: 711d6cbd04fef37025dabdd8c6602ca20f5e750a
3
+ metadata.gz: a97df035e630db4043315ea7c5c585fb32fef7f5
4
+ data.tar.gz: c05bf78a012dfe6055bdc159b7d72c3de5300008
5
5
  SHA512:
6
- metadata.gz: 98bcb7e4f9cb968f4ee0d0de76c926bb9f63d82455afa73d73191ebd607c50fa947b4bb0f0d0fddc27bc8dd1806b2dfd55bc33f615f447efdc7880959005c787
7
- data.tar.gz: 86a8f0c8b9db66df1d50cc09622968b350e42d18065c0f3e5c5a3ff46702735f92dfad51ba53bbd649f7d364d78c40996940dd84db7177145d6fd5557639ccae
6
+ metadata.gz: d64285b8068c11414a865af1b117e8871aeca2083423bfed1e78ebe7c599f8db9876e78b5349182b80ff9cc1ce9a961c019a991a3a65937dc7cccd85c58aa369
7
+ data.tar.gz: 9c6e3ea2822657b7cf6535295b9a77cf518e5f822fbc48c8e2b38507d3dd6b33f796fde19ccfaf04275108e2697c84f709fc9d7f3abd75c485d2d594db9bafb1
data/Gemfile.lock CHANGED
@@ -1,15 +1,15 @@
1
1
  GIT
2
2
  remote: git@github.com:niwo/cloudstack_client.git
3
- revision: f3a88de630e26439a78f4fb3f41a3a0e1b0e29a4
3
+ revision: 0b1195c8584220a39289970085c824cd4df4e328
4
4
  branch: master
5
5
  specs:
6
- cloudstack_client (0.3.6)
6
+ cloudstack_client (0.4.0)
7
7
 
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- cloudstack-cli (0.6.1)
12
- cloudstack_client (~> 0.3, >= 0.3.6)
11
+ cloudstack-cli (0.7.0)
12
+ cloudstack_client (~> 0.4, >= 0.4.0)
13
13
  thor (~> 0.18)
14
14
 
15
15
  GEM
@@ -25,5 +25,5 @@ Gem::Specification.new do |gem|
25
25
  gem.add_development_dependency('rake', '~> 10.1')
26
26
 
27
27
  gem.add_dependency('thor', '~> 0.18')
28
- gem.add_dependency('cloudstack_client', '~> 0.3', '>= 0.3.6')
28
+ gem.add_dependency('cloudstack_client', '~> 0.4', '>= 0.4.0')
29
29
  end
@@ -123,5 +123,11 @@ module CloudstackCli
123
123
 
124
124
  desc "ssh_key_pair SUBCOMMAND ...ARGS", "Manage ssh key pairs"
125
125
  subcommand :ssh_key_pair, SshKeyPair
126
+
127
+ desc "storage_pool SUBCOMMAND ...ARGS", "Manage storage pools"
128
+ subcommand :storage_pool, StoragePool
129
+
130
+ desc "region SUBCOMMAND ...ARGS", "Manage regions"
131
+ subcommand :region, Region
126
132
  end
127
133
  end
@@ -6,7 +6,7 @@ class Cluster < CloudstackCli::Base
6
6
  if clusters.size < 1
7
7
  say "No clusters found."
8
8
  else
9
- table = [["Name", "Pod-Name", "Type", "Zone"]]
9
+ table = [%w(Name Pod_Name Type Zone)]
10
10
  clusters.each do |cluster|
11
11
  table << [
12
12
  cluster['name'], cluster['podname'],
@@ -74,9 +74,16 @@ class Environment < CloudstackCli::Base
74
74
  end
75
75
  end
76
76
 
77
- desc "default ENV", "set the default environment"
78
- def default(env)
77
+ desc "default [ENV]", "show or set the default environment"
78
+ def default(env = nil)
79
79
  config = parse_config_file
80
+
81
+ unless env
82
+ default_env = config[:default] || '-'
83
+ say "The current default environment is \"#{default_env}\""
84
+ exit 0
85
+ end
86
+
80
87
  if env == '-'
81
88
  config.delete :default
82
89
  else
@@ -86,6 +93,7 @@ class Environment < CloudstackCli::Base
86
93
  end
87
94
  config[:default] = env
88
95
  end
96
+
89
97
  write_config_file(config)
90
98
  say "Default environment set to #{env}."
91
99
  end
@@ -0,0 +1,20 @@
1
+ class Region < CloudstackCli::Base
2
+
3
+ desc 'list', 'list regions'
4
+ def list
5
+ regions = client.list_regions
6
+ if regions.size < 1
7
+ say "No regions found."
8
+ else
9
+ table = [%w(Name, Endpoint)]
10
+ regions.each do |region|
11
+ table << [
12
+ region['name'], region['endpoint']
13
+ ]
14
+ end
15
+ print_table table
16
+ say "Total number of regions: #{regions.size}"
17
+ end
18
+ end
19
+
20
+ end
@@ -0,0 +1,24 @@
1
+ class StoragePool < CloudstackCli::Base
2
+
3
+ desc 'list', 'list storage_pool'
4
+ option :zone, desc: "zone name for the storage pool"
5
+ option :name, desc: "name of the storage pool"
6
+ option :keyword, desc: "list by keyword"
7
+ def list
8
+ storage_pools = client.list_storage_pools(options)
9
+ if storage_pools.size < 1
10
+ say "No storage pools found."
11
+ else
12
+ table = [%w(Name Pod_Name State Zone)]
13
+ storage_pools.each do |storage_pool|
14
+ table << [
15
+ storage_pool['name'], storage_pool['podname'],
16
+ storage_pool['state'], storage_pool['zonename']
17
+ ]
18
+ end
19
+ print_table table
20
+ say "Total number of storage_pools: #{storage_pools.size}"
21
+ end
22
+ end
23
+
24
+ end
@@ -6,7 +6,7 @@ class Zone < CloudstackCli::Base
6
6
  if zones.size < 1
7
7
  puts "No projects found"
8
8
  else
9
- table = [["Name", "Description"]]
9
+ table = [%w(Name Description)]
10
10
  zones.each do |zone|
11
11
  table << [zone['name'] ,zone['description']]
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module CloudstackCli
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudstack-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nik Wolfgramm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-16 00:00:00.000000000 Z
11
+ date: 2014-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -58,20 +58,20 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0.3'
61
+ version: '0.4'
62
62
  - - '>='
63
63
  - !ruby/object:Gem::Version
64
- version: 0.3.6
64
+ version: 0.4.0
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - ~>
70
70
  - !ruby/object:Gem::Version
71
- version: '0.3'
71
+ version: '0.4'
72
72
  - - '>='
73
73
  - !ruby/object:Gem::Version
74
- version: 0.3.6
74
+ version: 0.4.0
75
75
  description: cloudstack-cli is a CloudStack API client written in Ruby.
76
76
  email:
77
77
  - nik.wolfgramm@gmail.com
@@ -107,11 +107,13 @@ files:
107
107
  - lib/cloudstack-cli/commands/pod.rb
108
108
  - lib/cloudstack-cli/commands/port_rule.rb
109
109
  - lib/cloudstack-cli/commands/project.rb
110
+ - lib/cloudstack-cli/commands/region.rb
110
111
  - lib/cloudstack-cli/commands/router.rb
111
112
  - lib/cloudstack-cli/commands/server.rb
112
113
  - lib/cloudstack-cli/commands/snapshot.rb
113
114
  - lib/cloudstack-cli/commands/ssh_key_pairs.rb
114
115
  - lib/cloudstack-cli/commands/stack.rb
116
+ - lib/cloudstack-cli/commands/storage_pool.rb
115
117
  - lib/cloudstack-cli/commands/template.rb
116
118
  - lib/cloudstack-cli/commands/user.rb
117
119
  - lib/cloudstack-cli/commands/volume.rb