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 +4 -4
- data/Gemfile.lock +4 -4
- data/cloudstack-cli.gemspec +1 -1
- data/lib/cloudstack-cli/cli.rb +6 -0
- data/lib/cloudstack-cli/commands/cluster.rb +1 -1
- data/lib/cloudstack-cli/commands/environment.rb +10 -2
- data/lib/cloudstack-cli/commands/region.rb +20 -0
- data/lib/cloudstack-cli/commands/storage_pool.rb +24 -0
- data/lib/cloudstack-cli/commands/zone.rb +1 -1
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a97df035e630db4043315ea7c5c585fb32fef7f5
|
4
|
+
data.tar.gz: c05bf78a012dfe6055bdc159b7d72c3de5300008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
3
|
+
revision: 0b1195c8584220a39289970085c824cd4df4e328
|
4
4
|
branch: master
|
5
5
|
specs:
|
6
|
-
cloudstack_client (0.
|
6
|
+
cloudstack_client (0.4.0)
|
7
7
|
|
8
8
|
PATH
|
9
9
|
remote: .
|
10
10
|
specs:
|
11
|
-
cloudstack-cli (0.
|
12
|
-
cloudstack_client (~> 0.
|
11
|
+
cloudstack-cli (0.7.0)
|
12
|
+
cloudstack_client (~> 0.4, >= 0.4.0)
|
13
13
|
thor (~> 0.18)
|
14
14
|
|
15
15
|
GEM
|
data/cloudstack-cli.gemspec
CHANGED
data/lib/cloudstack-cli/cli.rb
CHANGED
@@ -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 = [
|
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
|
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.
|
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-
|
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.
|
61
|
+
version: '0.4'
|
62
62
|
- - '>='
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 0.
|
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.
|
71
|
+
version: '0.4'
|
72
72
|
- - '>='
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 0.
|
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
|