cloudstack-cli 0.12.2 → 0.12.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/Gemfile.lock +1 -1
- data/README.md +27 -27
- data/lib/cloudstack-cli/commands/account.rb +5 -4
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0aaa064bdf46d5aa2eb58d9df7a3f1e538ad0fc
|
4
|
+
data.tar.gz: 6bbd5c89739859be9cd154695dd65d24f978dfdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dde868c6f42746e0d56295636bb05baa55fda0ea98938c375ef66b477e4bd3677f8807c115c7229f0d7eea029f624d41606db2bf8788d485c16398f55c2c122
|
7
|
+
data.tar.gz: f2494582998bcf36d42fcb06d5ecf947cf5da52c095adfb899af1eac48f5b948b3e615a43dd0ae42e6f3bbb108da829ef1e5e26a6c160b2303fa1acb1edd67b1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ cloudstack-cli uses the [cloudstack_client](https://github.com/niwo/cloudstack_c
|
|
9
9
|
|
10
10
|
Install the cloudstack-cli gem:
|
11
11
|
|
12
|
-
```
|
12
|
+
```bash
|
13
13
|
$ gem install cloudstack-cli
|
14
14
|
```
|
15
15
|
|
@@ -19,15 +19,15 @@ $ gem install cloudstack-cli
|
|
19
19
|
|
20
20
|
Create your first environment, which defines your connection options:
|
21
21
|
|
22
|
-
```
|
23
|
-
$
|
22
|
+
```bash
|
23
|
+
$ cloudstack-cli environment add [environment-name]
|
24
24
|
```
|
25
25
|
|
26
26
|
cloudstack-cli expects to find a configuartion file with the API URL and your CloudStack credentials in your home directory named .cloudstack-cli.yml. If the file is located elsewhere you can specify the loaction using the --config option.
|
27
27
|
|
28
28
|
cloudstack-cli supports multiple environments using the --environment option.
|
29
29
|
|
30
|
-
see `
|
30
|
+
see `cloudstack-cli help environment` for more options.
|
31
31
|
|
32
32
|
Example content of the configuration file:
|
33
33
|
|
@@ -46,9 +46,9 @@ test:
|
|
46
46
|
|
47
47
|
To enable tab auto-completion for cloudstack-cli, add the following lines to your ~/.bash_profile file.
|
48
48
|
|
49
|
-
```
|
49
|
+
```bash
|
50
50
|
# Bash, ~/.bash_profile
|
51
|
-
eval "$(
|
51
|
+
eval "$(cloudstack-cli completion --shell=bash)"
|
52
52
|
```
|
53
53
|
|
54
54
|
__Note__: use `~/.bashrc` on Ubuntu
|
@@ -59,24 +59,24 @@ For additional documentation find the RubyDoc [here](http://rubydoc.info/gems/cl
|
|
59
59
|
|
60
60
|
See the help screen:
|
61
61
|
|
62
|
-
```
|
63
|
-
$
|
62
|
+
```bash
|
63
|
+
$ cloudstack-cli
|
64
64
|
```
|
65
65
|
|
66
66
|
### Example: Bootsrapping a server
|
67
67
|
|
68
68
|
Bootsraps a server using a template and creating port-forwarding rules for port 22 and 80.
|
69
69
|
|
70
|
-
```
|
71
|
-
$
|
70
|
+
```bash
|
71
|
+
$ cloudstack-cli server create server-01 --template CentOS-6.4-x64-v1.4 --zone DC1 --offering 1cpu_1gb --port-rules :22 :80
|
72
72
|
```
|
73
73
|
|
74
74
|
### Example: Run a any custom API command
|
75
75
|
|
76
76
|
Run the "listAlerts" command against the Cloudstack API with an argument of type=8:
|
77
77
|
|
78
|
-
```
|
79
|
-
$
|
78
|
+
```bash
|
79
|
+
$ cloudstack-cli command listAlerts type=8
|
80
80
|
```
|
81
81
|
|
82
82
|
### Example: Creating a complete stack of servers
|
@@ -115,29 +115,29 @@ An example stackfile could look like this (my_stackfile.yml):
|
|
115
115
|
|
116
116
|
Create the stack of servers from above:
|
117
117
|
|
118
|
-
```
|
119
|
-
$
|
118
|
+
```bash
|
119
|
+
$ cloudstack-cli stack create my_stackfile.yml
|
120
120
|
```
|
121
|
-
|
121
|
+
|
122
|
+
**Hint:** You can also parse a stackfile from a URI.
|
122
123
|
|
123
124
|
The following command destroys a stack using a definition gathered from a stackfile lying on a Github repository:
|
124
125
|
|
125
|
-
```
|
126
|
-
|
126
|
+
```bash
|
127
|
+
$ cloudstack-cli stack destroy https://raw.githubusercontent.com/niwo/cloudstack-cli/master/test/stack_example.json
|
127
128
|
Destroy the following servers web-001, web-002, db-001? [y/N]: y
|
128
129
|
Destroy server web-001 : job completed
|
129
130
|
Destroy server web-002 : job completed
|
130
|
-
Destroy server db-001 :
|
131
|
-
Completed:
|
132
|
-
Finished.
|
131
|
+
Destroy server db-001 : /
|
132
|
+
Completed: 2/3 (15.4s)
|
133
133
|
```
|
134
134
|
|
135
135
|
### Example: Sort computing offerings
|
136
136
|
|
137
137
|
Sort all computing offerings by CPU and Memory grouped my Domain:
|
138
138
|
|
139
|
-
```
|
140
|
-
$
|
139
|
+
```bash
|
140
|
+
$ cloudstack-cli offering sort
|
141
141
|
```
|
142
142
|
|
143
143
|
### Example: Stop all backup routers of a given project
|
@@ -145,14 +145,14 @@ $ cs offering sort
|
|
145
145
|
Stop all virtual routers of project Demo (you could filter by zone too):
|
146
146
|
(This command is helpful if you have to deploy new versions of Cloudstack when using redundant routers)
|
147
147
|
|
148
|
-
```
|
149
|
-
$
|
148
|
+
```bash
|
149
|
+
$ cloudstack-cli router list --project Demo --status running --redundant-state BACKUP --command stop
|
150
150
|
````
|
151
151
|
|
152
|
-
Hint
|
152
|
+
**Hint:** You can watch the status of the command with watch.
|
153
153
|
|
154
|
-
```
|
155
|
-
$ watch -n
|
154
|
+
```bash
|
155
|
+
$ watch -n cloudstack-cli router list --project Demo
|
156
156
|
```
|
157
157
|
|
158
158
|
|
@@ -8,10 +8,11 @@ class Account < CloudstackCli::Base
|
|
8
8
|
|
9
9
|
desc "show NAME", "show detailed infos about an account"
|
10
10
|
def show(name)
|
11
|
-
|
12
|
-
|
11
|
+
accounts = client.list_accounts(name: name)
|
12
|
+
if accounts.size < 1
|
13
|
+
say "No account named \"#{name}\" found.", :red
|
13
14
|
else
|
14
|
-
account =
|
15
|
+
account = accounts.first
|
15
16
|
account.delete 'user'
|
16
17
|
account['accounttype'] = "#{account['accounttype']} (#{TYPES[account['accounttype']]})"
|
17
18
|
table = account.map do |key, value|
|
@@ -23,7 +24,7 @@ class Account < CloudstackCli::Base
|
|
23
24
|
|
24
25
|
desc 'list [NAME]', 'list accounts (by name)'
|
25
26
|
def list(name = nil)
|
26
|
-
accounts = client.list_accounts(
|
27
|
+
accounts = client.list_accounts(name: name)
|
27
28
|
if accounts.size < 1
|
28
29
|
puts "No accounts found."
|
29
30
|
else
|
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.12.
|
4
|
+
version: 0.12.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-02-
|
11
|
+
date: 2015-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|