cloudstack-cli 0.4.0 → 0.4.1
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 +2 -2
- data/README.md +15 -14
- data/cloudstack-cli.gemspec +1 -1
- data/lib/cloudstack-cli/commands/capacity.rb +12 -2
- data/lib/cloudstack-cli/commands/router.rb +5 -1
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a876ce7d8ef2e32233cf613eb044b3564ae4abd2
|
4
|
+
data.tar.gz: e46d3829f5265ee233cc168cc1408b17d99d79d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fbc6528cc8be324cd5c0c0c921b1b0b9cc6703cec975af99421ee3568136a1cb03bbd30c864d1a50e233c4423ba77f0051b3bc34f6dfec82e6d2e1a87140787
|
7
|
+
data.tar.gz: 6946f2bb6999ecc5b66e8e0cdc93f39b4fa99e453b8eed1ac145fba762167ebefc3d37c99c6ac39a859ea3972552f420ff431f59a3cde7b5ee23c7e31ce0ebc7
|
data/Gemfile.lock
CHANGED
@@ -2,13 +2,13 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
cloudstack-cli (0.4.0)
|
5
|
-
cloudstack_client (~> 0.2.
|
5
|
+
cloudstack_client (~> 0.2.13)
|
6
6
|
thor (~> 0.18.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
cloudstack_client (0.2.
|
11
|
+
cloudstack_client (0.2.13)
|
12
12
|
json (1.8.1)
|
13
13
|
rake (10.0.4)
|
14
14
|
rdoc (4.0.1)
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Cloudstack CLI
|
2
2
|
|
3
|
-
|
3
|
+
cloudstack-cli is a [CloudStack](http://cloudstack.apache.org/) API client written in Ruby.
|
4
|
+
cloudstack-cli uses the [cloudstack_client](https://bitbucket.org/swisstxt/cloudstack_client) to talk to the Cloudstack API.
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
@@ -37,25 +38,21 @@ See the help screen:
|
|
37
38
|
|
38
39
|
$ cs
|
39
40
|
|
40
|
-
### Example
|
41
|
+
### Example: Bootsrapping a server
|
41
42
|
|
42
|
-
|
43
|
+
Bootsraps a server using a template and creating port-forwarding rules for port 22 and 80.
|
43
44
|
|
44
|
-
$ cs server create server-01 --template CentOS-6.4-x64-v1.4 --offering 1cpu_1gb --port-rules
|
45
|
+
$ cs server create server-01 --template CentOS-6.4-x64-v1.4 --offering 1cpu_1gb --port-rules :22 :80
|
45
46
|
|
46
|
-
### Example
|
47
|
+
### Example: Run a any custom API command
|
47
48
|
|
48
|
-
Run
|
49
|
+
Run the "listAlerts" command against the Cloudstack API with an argument of type=8:
|
49
50
|
|
50
51
|
$ cs command listAlerts type=8
|
51
52
|
|
52
|
-
### Example
|
53
|
+
### Example: Creating a complete stack of servers
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
$ cs stack create my_stackfile.json
|
57
|
-
|
58
|
-
An example stackfile looks like this
|
55
|
+
An example stackfile looks like this (my_stackfile.json)
|
59
56
|
|
60
57
|
{
|
61
58
|
"name": "web_stack-a",
|
@@ -85,13 +82,17 @@ An example stackfile looks like this
|
|
85
82
|
]
|
86
83
|
}
|
87
84
|
|
88
|
-
|
85
|
+
Create the stack of servers from above:
|
86
|
+
|
87
|
+
$ cs stack create my_stackfile.json
|
88
|
+
|
89
|
+
### Example: Sort computing offerings
|
89
90
|
|
90
91
|
Sort all computing offerings by CPU and Memory grouped my Domain:
|
91
92
|
|
92
93
|
$ cs offering sort
|
93
94
|
|
94
|
-
### Example
|
95
|
+
### Example: Stop all backup routers of a given project
|
95
96
|
|
96
97
|
Stop all virtual routers of project Demo (you could filter by zone too):
|
97
98
|
(This command is helpful if you have to deploy new versions of Cloudstack when using redundant routers)
|
data/cloudstack-cli.gemspec
CHANGED
@@ -14,8 +14,9 @@ class Capacity < CloudstackCli::Base
|
|
14
14
|
|
15
15
|
desc "capacity list", "list system capacity"
|
16
16
|
option :zone
|
17
|
+
option :type, desc: "specify type, see types for a list of types"
|
17
18
|
def list
|
18
|
-
capacities = client.list_capacity
|
19
|
+
capacities = client.list_capacity(options)
|
19
20
|
table = []
|
20
21
|
header = ["Zone", "Type", "Capacity Used", "Capacity Total", "Used"]
|
21
22
|
capacities.each do |c|
|
@@ -31,6 +32,15 @@ class Capacity < CloudstackCli::Base
|
|
31
32
|
print_table table
|
32
33
|
end
|
33
34
|
|
35
|
+
desc "capacity types", "show capacity types"
|
36
|
+
def types
|
37
|
+
table = [['type', 'name']]
|
38
|
+
CAPACITY_TYPES.each_pair do |type, data|
|
39
|
+
table << [type, data[:name]]
|
40
|
+
end
|
41
|
+
print_table table
|
42
|
+
end
|
43
|
+
|
34
44
|
no_commands do
|
35
45
|
|
36
46
|
def capacity_to_s(capacity, entity)
|
@@ -38,7 +48,7 @@ class Capacity < CloudstackCli::Base
|
|
38
48
|
(capacity[entity] / CAPACITY_TYPES[capacity['type']][:divider]).round(1) :
|
39
49
|
capacity[entity]
|
40
50
|
CAPACITY_TYPES[capacity['type']][:unit] ?
|
41
|
-
"#{value}#{CAPACITY_TYPES[capacity['type']][:unit]}" :
|
51
|
+
"#{value} #{CAPACITY_TYPES[capacity['type']][:unit]}" :
|
42
52
|
value.to_s
|
43
53
|
end
|
44
54
|
|
@@ -12,7 +12,11 @@ class Router < CloudstackCli::Base
|
|
12
12
|
option :reverse, type: :boolean, default: false, desc: "reverse listing of routers"
|
13
13
|
def list
|
14
14
|
if options[:project]
|
15
|
-
|
15
|
+
if ['-1', 'all'].include? options[:project]
|
16
|
+
projectid = '-1'
|
17
|
+
else
|
18
|
+
projectid = find_project['id']
|
19
|
+
end
|
16
20
|
end
|
17
21
|
routers = client.list_routers(
|
18
22
|
{
|
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.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nik Wolfgramm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.2.
|
61
|
+
version: 0.2.13
|
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: 0.2.
|
68
|
+
version: 0.2.13
|
69
69
|
description: cloudstack-cli is a CloudStack API client written in Ruby.
|
70
70
|
email:
|
71
71
|
- nik.wolfgramm@gmail.com
|