cloudstack-cli 1.0.2 → 1.0.3
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/.ruby-version +1 -0
- data/Gemfile.lock +3 -0
- data/lib/cloudstack-cli/commands/template.rb +9 -3
- data/lib/cloudstack-cli/option_resolver.rb +12 -12
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2f8a34dcb67d4a930504ce13a213b48d3194c29
|
4
|
+
data.tar.gz: bb486ef7967e046a7a2964131fc75b562bd81a8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f43015921911741e0e9ba2eccfc109111a682243937cd4dda17df7580e10a4cc7b749176b21fc8de164b582739cc456e2443d99ed986d304024b5073f0df5f7
|
7
|
+
data.tar.gz: 48d5b1dec1c8f922dbb976ab59bd9b2ae3b40421afe006ff13825450234d3434db15d1b9dd109712a01a888a0f8e88902651877b9c06508b16bc613f244c7caa
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.2.2
|
data/Gemfile.lock
CHANGED
@@ -10,14 +10,20 @@ class Template < CloudstackCli::Base
|
|
10
10
|
resolve_project
|
11
11
|
resolve_zone
|
12
12
|
options[:template_filter] = options[:type]
|
13
|
-
options.delete(:filter)
|
14
13
|
templates = client.list_templates(options)
|
15
14
|
if templates.size < 1
|
16
15
|
puts "No templates found."
|
17
16
|
else
|
18
|
-
table = [%w(Name Zone Format)]
|
17
|
+
table = [%w(Name Created Zone Featured Public Format)]
|
19
18
|
templates.each do |template|
|
20
|
-
table <<
|
19
|
+
table << [
|
20
|
+
template['name'],
|
21
|
+
Time.parse(template['created']).strftime("%F"),
|
22
|
+
template['zonename'],
|
23
|
+
template['isfeatured'],
|
24
|
+
template['ispublic'],
|
25
|
+
template['format']
|
26
|
+
]
|
21
27
|
end
|
22
28
|
print_table(table)
|
23
29
|
say "Total number of templates: #{templates.size}"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module CloudstackCli
|
2
2
|
module OptionResolver
|
3
3
|
|
4
|
-
def vm_options_to_params
|
4
|
+
def vm_options_to_params
|
5
5
|
resolve_zone(options)
|
6
6
|
resolve_project(options)
|
7
7
|
resolve_compute_offering(options)
|
@@ -15,7 +15,7 @@ module CloudstackCli
|
|
15
15
|
resolve_networks(options)
|
16
16
|
end
|
17
17
|
|
18
|
-
def resolve_zone
|
18
|
+
def resolve_zone
|
19
19
|
if options[:zone]
|
20
20
|
zones = client.list_zones
|
21
21
|
zone = zones.find {|z| z['name'] == options[:zone] }
|
@@ -29,7 +29,7 @@ module CloudstackCli
|
|
29
29
|
options
|
30
30
|
end
|
31
31
|
|
32
|
-
def resolve_domain
|
32
|
+
def resolve_domain
|
33
33
|
if options[:domain]
|
34
34
|
if domain = client.list_domains(name: options[:domain]).first
|
35
35
|
options[:domain_id] = domain['id']
|
@@ -41,7 +41,7 @@ module CloudstackCli
|
|
41
41
|
options
|
42
42
|
end
|
43
43
|
|
44
|
-
def resolve_project
|
44
|
+
def resolve_project
|
45
45
|
if options[:project]
|
46
46
|
if %w(ALL -1).include? options[:project]
|
47
47
|
options[:project_id] = "-1"
|
@@ -55,7 +55,7 @@ module CloudstackCli
|
|
55
55
|
options
|
56
56
|
end
|
57
57
|
|
58
|
-
def resolve_account
|
58
|
+
def resolve_account
|
59
59
|
if options[:account]
|
60
60
|
if account = client.list_accounts(name: options[:account], listall: true).first
|
61
61
|
options[:account_id] = account['id']
|
@@ -68,7 +68,7 @@ module CloudstackCli
|
|
68
68
|
options
|
69
69
|
end
|
70
70
|
|
71
|
-
def resolve_networks
|
71
|
+
def resolve_networks
|
72
72
|
networks = []
|
73
73
|
available_networks = network = client.list_networks(
|
74
74
|
zone_id: options[:zone_id],
|
@@ -97,7 +97,7 @@ module CloudstackCli
|
|
97
97
|
options
|
98
98
|
end
|
99
99
|
|
100
|
-
def resolve_iso
|
100
|
+
def resolve_iso
|
101
101
|
if options[:iso]
|
102
102
|
unless iso = client.list_isos(
|
103
103
|
name: options[:iso],
|
@@ -116,7 +116,7 @@ module CloudstackCli
|
|
116
116
|
options
|
117
117
|
end
|
118
118
|
|
119
|
-
def resolve_template
|
119
|
+
def resolve_template
|
120
120
|
if options[:template]
|
121
121
|
if template = client.list_templates(
|
122
122
|
name: options[:template],
|
@@ -132,7 +132,7 @@ module CloudstackCli
|
|
132
132
|
options
|
133
133
|
end
|
134
134
|
|
135
|
-
def resolve_compute_offering
|
135
|
+
def resolve_compute_offering
|
136
136
|
if offering = client.list_service_offerings(name: options[:offering]).first
|
137
137
|
options[:service_offering_id] = offering['id']
|
138
138
|
else
|
@@ -142,7 +142,7 @@ module CloudstackCli
|
|
142
142
|
options
|
143
143
|
end
|
144
144
|
|
145
|
-
def resolve_disk_offering
|
145
|
+
def resolve_disk_offering
|
146
146
|
if options[:disk_offering]
|
147
147
|
unless disk_offering = client.list_disk_offerings(name: options[:disk_offering]).first
|
148
148
|
say "Error: Disk offering '#{options[:disk_offering]}' not found.", :red
|
@@ -153,7 +153,7 @@ module CloudstackCli
|
|
153
153
|
options
|
154
154
|
end
|
155
155
|
|
156
|
-
def resolve_virtual_machine
|
156
|
+
def resolve_virtual_machine
|
157
157
|
if options[:virtual_machine]
|
158
158
|
args = { name: options[:virtual_machine], listall: true }
|
159
159
|
args[:project_id] = options[:project_id]
|
@@ -166,7 +166,7 @@ module CloudstackCli
|
|
166
166
|
options
|
167
167
|
end
|
168
168
|
|
169
|
-
def resolve_snapshot
|
169
|
+
def resolve_snapshot
|
170
170
|
if options[:snapshot]
|
171
171
|
args = { name: options[:snapshot], listall: true }
|
172
172
|
args[:project_id] = options[:project_id]
|
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: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nik Wolfgramm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -76,6 +76,7 @@ extensions: []
|
|
76
76
|
extra_rdoc_files: []
|
77
77
|
files:
|
78
78
|
- ".gitignore"
|
79
|
+
- ".ruby-version"
|
79
80
|
- Gemfile
|
80
81
|
- Gemfile.lock
|
81
82
|
- LICENSE.txt
|
@@ -148,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
149
|
version: '0'
|
149
150
|
requirements: []
|
150
151
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.
|
152
|
+
rubygems_version: 2.4.5
|
152
153
|
signing_key:
|
153
154
|
specification_version: 4
|
154
155
|
summary: cloudstack-cli CloudStack API client
|