cloudstack-cli 1.6.2 → 1.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +11 -11
- data/LICENSE.txt +2 -2
- data/README.md +8 -1
- data/cloudstack-cli.gemspec +4 -4
- data/lib/cloudstack-cli/commands/template.rb +1 -1
- data/lib/cloudstack-cli/version.rb +1 -1
- data/spec/cloudstack-cli/commands/template_spec.rb +18 -0
- data/spec/cloudstack-cli/commands/virtual_machine_spec.rb +23 -27
- data/spec/spec_helper.rb +2 -3
- metadata +16 -17
- data/spec/cloudstack.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 68dbd64fdf3c848cd725e6c20fb96d42681a7467c6987639418a253dc88e9061
|
4
|
+
data.tar.gz: 46a0d4472c71f3e2f03b12b2f73c926a1f2c3d3a3106c0c3f607f3460121d9d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ea4176edf6df0668093843fce14e4302be6b7cc16b91d28bb295af735d65eed81217f3524ca6877118cd24fe771f447046d5eecee5a8d2ed0b0acbae396ecc1
|
7
|
+
data.tar.gz: 9a6f01931f5e487e15819ce0d627c7b7011cb9772b600ecd3781c2a40a6393d561f25071cfad597b55002defb75618a3c96818932e5ac5b421b561995ff6059c
|
data/Gemfile.lock
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cloudstack-cli (1.6.
|
5
|
-
cloudstack_client (~> 1.5.
|
6
|
-
thor (~>
|
4
|
+
cloudstack-cli (1.6.6)
|
5
|
+
cloudstack_client (~> 1.5.6)
|
6
|
+
thor (~> 1.1.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
cloudstack_client (1.5.
|
12
|
-
minitest (5.
|
13
|
-
rake (
|
14
|
-
thor (
|
11
|
+
cloudstack_client (1.5.8)
|
12
|
+
minitest (5.14.4)
|
13
|
+
rake (13.0.5)
|
14
|
+
thor (1.1.0)
|
15
15
|
|
16
16
|
PLATFORMS
|
17
|
-
|
17
|
+
x86_64-linux
|
18
18
|
|
19
19
|
DEPENDENCIES
|
20
20
|
cloudstack-cli!
|
21
|
-
minitest (~> 5.
|
22
|
-
rake (~>
|
21
|
+
minitest (~> 5.11)
|
22
|
+
rake (~> 13.0)
|
23
23
|
|
24
24
|
BUNDLED WITH
|
25
|
-
|
25
|
+
2.2.15
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2013 Nik Wolfgramm
|
3
|
+
Copyright (c) 2013-2018 Nik Wolfgramm
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -102,7 +102,7 @@ $ cloudstack-cli vm help list
|
|
102
102
|
*Bootstraps a server using a template and creating port-forwarding rules for port 22 and 80:*
|
103
103
|
|
104
104
|
```bash
|
105
|
-
$ cloudstack-cli server create
|
105
|
+
$ cloudstack-cli server create web-01 --template CentOS-7.5-x64 --zone DC1 --offering 2cpu_2gb --port-rules :22 :80
|
106
106
|
```
|
107
107
|
|
108
108
|
### Example: Run any custom API command
|
@@ -190,6 +190,13 @@ $ cloudstack-cli router list --project Demo --status running --redundant-state B
|
|
190
190
|
- This tool was inspired by the Knife extension for Cloudstack: [knife-cloudstack](https://github.com/CloudStack-extras/knife-cloudstack)
|
191
191
|
|
192
192
|
|
193
|
+
## Test
|
194
|
+
|
195
|
+
1. Requires the [cloudstack-simulator](https://hub.docker.com/r/cloudstack/simulator/) docker images running on your local machine
|
196
|
+
2. You need to add the admin secrets to your local cloudstack environment an make it default
|
197
|
+
3. Currently you need to create a isolated network named "test-network" manually on the simulator
|
198
|
+
4. Run `bundle exec rake test`
|
199
|
+
|
193
200
|
## Contributing
|
194
201
|
|
195
202
|
1. Fork it
|
data/cloudstack-cli.gemspec
CHANGED
@@ -21,9 +21,9 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.require_paths = %w(lib)
|
22
22
|
gem.rdoc_options = %w[--line-numbers --inline-source]
|
23
23
|
|
24
|
-
gem.add_development_dependency('rake', '~>
|
25
|
-
gem.add_development_dependency('minitest', '~> 5.
|
24
|
+
gem.add_development_dependency('rake', '~> 13.0')
|
25
|
+
gem.add_development_dependency('minitest', '~> 5.11')
|
26
26
|
|
27
|
-
gem.add_dependency('cloudstack_client', '~> 1.5.
|
28
|
-
gem.add_dependency('thor', '~>
|
27
|
+
gem.add_dependency('cloudstack_client', '~> 1.5.6')
|
28
|
+
gem.add_dependency('thor', '~> 1.1.0')
|
29
29
|
end
|
@@ -26,7 +26,7 @@ class Template < CloudstackCli::Base
|
|
26
26
|
templates.each do |template|
|
27
27
|
table << [
|
28
28
|
template['name'],
|
29
|
-
Time.parse(template['created']).strftime("%F"),
|
29
|
+
(Time.parse(template['created']).strftime("%F") rescue "-"),
|
30
30
|
template['zonename'],
|
31
31
|
template['isfeatured'],
|
32
32
|
template['ispublic'],
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "cloudstack-cli"
|
3
|
+
|
4
|
+
describe Template do
|
5
|
+
|
6
|
+
it "should list templates" do
|
7
|
+
out, err = capture_io do
|
8
|
+
CloudstackCli::Cli.start [
|
9
|
+
"template",
|
10
|
+
"list",
|
11
|
+
"--zone=#{ZONE}"
|
12
|
+
]
|
13
|
+
end
|
14
|
+
err.must_equal ""
|
15
|
+
out.must_include TEMPLATE
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -3,29 +3,31 @@ require "cloudstack-cli"
|
|
3
3
|
|
4
4
|
describe VirtualMachine do
|
5
5
|
|
6
|
+
#TODO: test-network must be created beforehand
|
7
|
+
|
6
8
|
it "should support all CRUD actions" do
|
7
9
|
vmname = "testvm1"
|
8
10
|
|
9
11
|
# CREATE
|
10
|
-
out, err = capture_io
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
out, err = capture_io do
|
13
|
+
CloudstackCli::Cli.start [
|
14
|
+
"vm",
|
15
|
+
"create",
|
16
|
+
vmname,
|
17
|
+
"--zone=#{ZONE}",
|
18
|
+
"--template=#{TEMPLATE}",
|
19
|
+
"--offering=#{OFFERING_S}",
|
20
|
+
"--networks=test-network",
|
21
|
+
"--port-rules=:80",
|
22
|
+
"--assumeyes"
|
23
|
+
]
|
24
|
+
end
|
22
25
|
err.must_equal ""
|
23
26
|
|
24
27
|
# READ - LIST
|
25
28
|
out, err = capture_io{ CloudstackCli::Cli.start [
|
26
29
|
"vm",
|
27
|
-
"list"
|
28
|
-
CONFIG
|
30
|
+
"list"
|
29
31
|
]}
|
30
32
|
err.must_equal ""
|
31
33
|
out.must_match(
|
@@ -36,8 +38,7 @@ describe VirtualMachine do
|
|
36
38
|
out, err = capture_io{ CloudstackCli::Cli.start [
|
37
39
|
"vm",
|
38
40
|
"show",
|
39
|
-
vmname
|
40
|
-
CONFIG
|
41
|
+
vmname
|
41
42
|
]}
|
42
43
|
err.must_equal ""
|
43
44
|
out.must_match(
|
@@ -49,8 +50,7 @@ describe VirtualMachine do
|
|
49
50
|
"vm",
|
50
51
|
"stop",
|
51
52
|
vmname,
|
52
|
-
"--force"
|
53
|
-
CONFIG,
|
53
|
+
"--force"
|
54
54
|
]}
|
55
55
|
err.must_equal ""
|
56
56
|
|
@@ -61,8 +61,7 @@ describe VirtualMachine do
|
|
61
61
|
"update",
|
62
62
|
vmname,
|
63
63
|
"--name=#{new_vmname}",
|
64
|
-
"--force"
|
65
|
-
CONFIG,
|
64
|
+
"--force"
|
66
65
|
]}
|
67
66
|
err.must_equal ""
|
68
67
|
|
@@ -70,8 +69,7 @@ describe VirtualMachine do
|
|
70
69
|
out, err = capture_io{ CloudstackCli::Cli.start [
|
71
70
|
"vm",
|
72
71
|
"start",
|
73
|
-
new_vmname
|
74
|
-
CONFIG,
|
72
|
+
new_vmname
|
75
73
|
]}
|
76
74
|
err.must_equal ""
|
77
75
|
|
@@ -80,8 +78,7 @@ describe VirtualMachine do
|
|
80
78
|
"vm",
|
81
79
|
"reboot",
|
82
80
|
new_vmname,
|
83
|
-
"--force"
|
84
|
-
CONFIG,
|
81
|
+
"--force"
|
85
82
|
]}
|
86
83
|
err.must_equal ""
|
87
84
|
|
@@ -91,11 +88,10 @@ describe VirtualMachine do
|
|
91
88
|
"destroy",
|
92
89
|
new_vmname,
|
93
90
|
"--expunge",
|
94
|
-
"--force"
|
95
|
-
CONFIG,
|
91
|
+
"--force"
|
96
92
|
]}
|
97
93
|
err.must_equal ""
|
98
|
-
|
94
|
+
|
99
95
|
end
|
100
96
|
|
101
97
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,9 +4,8 @@ require "minitest/spec"
|
|
4
4
|
require "minitest/autorun"
|
5
5
|
require "minitest/pride"
|
6
6
|
|
7
|
-
# make the config file setup
|
8
|
-
CONFIG = "--config-file=#{File.expand_path('cloudstack.yml', File.dirname(__FILE__))}"
|
7
|
+
# make the config file setup available to all specs
|
9
8
|
ZONE = "Sandbox-simulator"
|
10
|
-
TEMPLATE = "CentOS 5.
|
9
|
+
TEMPLATE = "CentOS 5.6 (64-bit) no GUI (Simulator)"
|
11
10
|
OFFERING_S = "Small Instance"
|
12
11
|
OFFERING_M = "Medium Instance"
|
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.6.
|
4
|
+
version: 1.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nik Wolfgramm
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '13.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '13.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '5.
|
33
|
+
version: '5.11'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '5.
|
40
|
+
version: '5.11'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cloudstack_client
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.5.
|
47
|
+
version: 1.5.6
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.5.
|
54
|
+
version: 1.5.6
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: thor
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 1.1.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 1.1.0
|
69
69
|
description: cloudstack-cli is a CloudStack API command line client written in Ruby.
|
70
70
|
email:
|
71
71
|
- nik.wolfgramm@gmail.com
|
@@ -128,15 +128,15 @@ files:
|
|
128
128
|
- lib/cloudstack-cli/option_resolver.rb
|
129
129
|
- lib/cloudstack-cli/thor_patch.rb
|
130
130
|
- lib/cloudstack-cli/version.rb
|
131
|
+
- spec/cloudstack-cli/commands/template_spec.rb
|
131
132
|
- spec/cloudstack-cli/commands/virtual_machine_spec.rb
|
132
|
-
- spec/cloudstack.yml
|
133
133
|
- spec/fixtures/stack.yml
|
134
134
|
- spec/spec_helper.rb
|
135
135
|
homepage: http://github.com/niwo/cloudstack-cli
|
136
136
|
licenses:
|
137
137
|
- MIT
|
138
138
|
metadata: {}
|
139
|
-
post_install_message:
|
139
|
+
post_install_message:
|
140
140
|
rdoc_options:
|
141
141
|
- "--line-numbers"
|
142
142
|
- "--inline-source"
|
@@ -153,13 +153,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
|
-
|
157
|
-
|
158
|
-
signing_key:
|
156
|
+
rubygems_version: 3.2.15
|
157
|
+
signing_key:
|
159
158
|
specification_version: 4
|
160
159
|
summary: cloudstack-cli CloudStack API client
|
161
160
|
test_files:
|
161
|
+
- spec/cloudstack-cli/commands/template_spec.rb
|
162
162
|
- spec/cloudstack-cli/commands/virtual_machine_spec.rb
|
163
|
-
- spec/cloudstack.yml
|
164
163
|
- spec/fixtures/stack.yml
|
165
164
|
- spec/spec_helper.rb
|
data/spec/cloudstack.yml
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
:default: development
|
2
|
-
development:
|
3
|
-
:url: http://127.0.0.1:8080/client/api
|
4
|
-
:api_key: 3B1lE0C33ceSOUg0jaIo8STNZ55I-mdvza0LXpZA8mrvtpBpgzJgE9YSsURBcQ6qKX090w5vv_AgGRZeYS9AiQ
|
5
|
-
:secret_key: mneyw6fg__Gt-ENg0E_9BfxcuiMJPSThe701Kuz7f5_EsJ0POoN4z9eoslECP5V9oDzB6XOlsCw1FuBqPjMmLg
|