cloudstack-cli 0.4.3 → 0.5.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 +3 -3
- data/README.md +2 -2
- data/cloudstack-cli.gemspec +2 -2
- data/lib/cloudstack-cli/cli.rb +6 -24
- data/lib/cloudstack-cli/commands/account.rb +1 -1
- data/lib/cloudstack-cli/commands/capacity.rb +2 -2
- data/lib/cloudstack-cli/commands/cluster.rb +1 -1
- data/lib/cloudstack-cli/commands/{offering.rb → compute_offer.rb} +4 -5
- data/lib/cloudstack-cli/commands/{disk_offering.rb → disk_offer.rb} +2 -2
- data/lib/cloudstack-cli/commands/domain.rb +1 -1
- data/lib/cloudstack-cli/commands/environment.rb +22 -0
- data/lib/cloudstack-cli/commands/host.rb +1 -1
- data/lib/cloudstack-cli/commands/ip_address.rb +2 -2
- data/lib/cloudstack-cli/commands/iso.rb +1 -1
- data/lib/cloudstack-cli/commands/job.rb +2 -2
- data/lib/cloudstack-cli/commands/load_balancer.rb +3 -3
- data/lib/cloudstack-cli/commands/network.rb +5 -5
- data/lib/cloudstack-cli/commands/physical_network.rb +1 -1
- data/lib/cloudstack-cli/commands/pod.rb +1 -1
- data/lib/cloudstack-cli/commands/port_rule.rb +2 -2
- data/lib/cloudstack-cli/commands/project.rb +2 -2
- data/lib/cloudstack-cli/commands/router.rb +5 -5
- data/lib/cloudstack-cli/commands/server.rb +39 -11
- data/lib/cloudstack-cli/commands/snapshot.rb +1 -1
- data/lib/cloudstack-cli/commands/ssh_key_pairs.rb +4 -4
- data/lib/cloudstack-cli/commands/stack.rb +1 -1
- data/lib/cloudstack-cli/commands/template.rb +1 -1
- data/lib/cloudstack-cli/commands/user.rb +1 -1
- data/lib/cloudstack-cli/commands/volume.rb +1 -1
- data/lib/cloudstack-cli/commands/zone.rb +1 -1
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52d453553a4f7b0d1ae7f1d925b4fb684f222d79
|
4
|
+
data.tar.gz: 25f406366cacbd8cb6b0c6ac2c7265034b841d0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4406c555844a0ccfac4f8c6240c8d68332f48374b389485c20b822481a41e2ccdead30ff8751a560f0b00af9e0219572548ebd48af53f3686bf9d61e2906a3ad
|
7
|
+
data.tar.gz: 0520556e1ba0a2624113019c5dbfcb8e40e9329ef3578063bd41803fec280c5906cbf79c92303455e041a6cc187d362363465f7e0a5a5b1f300b7850aa6ac075
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cloudstack-cli (0.
|
5
|
-
cloudstack_client (~> 0.2.
|
4
|
+
cloudstack-cli (0.5.0)
|
5
|
+
cloudstack_client (~> 0.2.16)
|
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.16)
|
12
12
|
json (1.8.1)
|
13
13
|
rake (10.0.4)
|
14
14
|
rdoc (4.0.1)
|
data/README.md
CHANGED
@@ -1,7 +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://
|
4
|
+
cloudstack-cli uses the [cloudstack_client](https://github.com/niwo/cloudstack_client) to talk to the Cloudstack API.
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
@@ -120,4 +120,4 @@ Hint: You can watch the status of the command with watch.
|
|
120
120
|
|
121
121
|
## License
|
122
122
|
|
123
|
-
Released under the MIT License. See the [LICENSE](https://
|
123
|
+
Released under the MIT License. See the [LICENSE](https://raw.github.com/niwo/cloudstack-cli/master/LICENSE.txt) file for further details.
|
data/cloudstack-cli.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.email = ["nik.wolfgramm@gmail.com"]
|
11
11
|
gem.description = %q{cloudstack-cli is a CloudStack API client written in Ruby.}
|
12
12
|
gem.summary = %q{cloudstack-cli CloudStack API client}
|
13
|
-
gem.homepage = "https://
|
13
|
+
gem.homepage = "https://github.com/niwo/cloudstack-cli"
|
14
14
|
gem.license = 'MIT'
|
15
15
|
|
16
16
|
gem.required_ruby_version = '>= 1.9.3'
|
@@ -24,5 +24,5 @@ Gem::Specification.new do |gem|
|
|
24
24
|
gem.add_development_dependency('rake', '~> 10.0.4')
|
25
25
|
|
26
26
|
gem.add_dependency('thor', '~> 0.18.1')
|
27
|
-
gem.add_dependency('cloudstack_client', '~> 0.2.
|
27
|
+
gem.add_dependency('cloudstack_client', '~> 0.2.16')
|
28
28
|
end
|
data/lib/cloudstack-cli/cli.rb
CHANGED
@@ -58,26 +58,6 @@ module CloudstackCli
|
|
58
58
|
File.open(file, 'w+') {|f| f.write(config.to_yaml) }
|
59
59
|
end
|
60
60
|
|
61
|
-
desc "environments", "list cloudstack-cli environments"
|
62
|
-
def environments(file = options[:config])
|
63
|
-
config = {}
|
64
|
-
if File.exists? file
|
65
|
-
begin
|
66
|
-
config = YAML::load(IO.read(file))
|
67
|
-
rescue
|
68
|
-
error "Can't load configuration from file #{config_file}."
|
69
|
-
exit 1
|
70
|
-
end
|
71
|
-
table = [%w(Name URL)]
|
72
|
-
table << ["default", config[:url]]
|
73
|
-
config.each_key do |key|
|
74
|
-
table << [key, config[key][:url]] unless key.class == Symbol
|
75
|
-
end
|
76
|
-
print_table table
|
77
|
-
end
|
78
|
-
end
|
79
|
-
map :envs => :environments
|
80
|
-
|
81
61
|
desc "command COMMAND [arg1=val1 arg2=val2...]", "run a custom api command"
|
82
62
|
def command(command, *args)
|
83
63
|
params = {'command' => command}
|
@@ -93,6 +73,8 @@ module CloudstackCli
|
|
93
73
|
require command
|
94
74
|
end
|
95
75
|
|
76
|
+
map :env => :environment
|
77
|
+
|
96
78
|
desc "zone SUBCOMMAND ...ARGS", "Manage zones"
|
97
79
|
subcommand :zone, Zone
|
98
80
|
|
@@ -111,11 +93,11 @@ module CloudstackCli
|
|
111
93
|
desc "server SUBCOMMAND ...ARGS", "Manage servers"
|
112
94
|
subcommand :server, Server
|
113
95
|
|
114
|
-
desc "
|
115
|
-
subcommand :
|
96
|
+
desc "compute_offer SUBCOMMAND ...ARGS", "Manage offerings"
|
97
|
+
subcommand :compute_offer, ComputeOffer
|
116
98
|
|
117
|
-
desc "
|
118
|
-
subcommand :disk_offering,
|
99
|
+
desc "disk_offer SUBCOMMAND ...ARGS", "Manage disk offerings"
|
100
|
+
subcommand :disk_offering, DiskOffer
|
119
101
|
|
120
102
|
desc "network SUBCOMMAND ...ARGS", "Manage networks"
|
121
103
|
subcommand :network, Network
|
@@ -12,7 +12,7 @@ class Capacity < CloudstackCli::Base
|
|
12
12
|
9 => {name: "Local Storage", unit: "TB", divider: 1024.0**4}
|
13
13
|
}
|
14
14
|
|
15
|
-
desc "
|
15
|
+
desc "list", "list system capacity"
|
16
16
|
option :zone
|
17
17
|
option :type, desc: "specify type, see types for a list of types"
|
18
18
|
def list
|
@@ -32,7 +32,7 @@ class Capacity < CloudstackCli::Base
|
|
32
32
|
print_table table
|
33
33
|
end
|
34
34
|
|
35
|
-
desc "
|
35
|
+
desc "types", "show capacity types"
|
36
36
|
def types
|
37
37
|
table = [['type', 'name']]
|
38
38
|
CAPACITY_TYPES.each_pair do |type, data|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
class
|
1
|
+
class ComputeOffer < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc '
|
3
|
+
desc 'list', 'list compute offerings'
|
4
4
|
option :domain
|
5
5
|
def list
|
6
6
|
offerings = client.list_service_offerings(options[:domain])
|
@@ -20,7 +20,7 @@ class Offering < CloudstackCli::Base
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
desc '
|
23
|
+
desc 'create NAME', 'create offering'
|
24
24
|
option :cpunumber, required: true
|
25
25
|
option :cpuspeed, required: true
|
26
26
|
option :displaytext, required: true
|
@@ -38,8 +38,7 @@ class Offering < CloudstackCli::Base
|
|
38
38
|
puts "OK" if client.delete_offering(id)
|
39
39
|
end
|
40
40
|
|
41
|
-
|
42
|
-
desc 'offering sort', 'sort by cpu and memory grouped by domain'
|
41
|
+
desc 'sort', 'sort by cpu and memory grouped by domain'
|
43
42
|
def sort
|
44
43
|
offerings = client.list_service_offerings(options[:domain])
|
45
44
|
sortkey = -1
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Environment < CloudstackCli::Base
|
2
|
+
|
3
|
+
desc "list", "list cloudstack-cli environments"
|
4
|
+
def environments(file = options[:config])
|
5
|
+
config = {}
|
6
|
+
if File.exists? file
|
7
|
+
begin
|
8
|
+
config = YAML::load(IO.read(file))
|
9
|
+
rescue
|
10
|
+
error "Can't load configuration from file #{config_file}."
|
11
|
+
exit 1
|
12
|
+
end
|
13
|
+
table = [%w(Name URL)]
|
14
|
+
table << ["default", config[:url]]
|
15
|
+
config.each_key do |key|
|
16
|
+
table << [key, config[key][:url]] unless key.class == Symbol
|
17
|
+
end
|
18
|
+
print_table table
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class IpAddress < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc "
|
3
|
+
desc "release ID", "release public IP address"
|
4
4
|
def release(id)
|
5
5
|
say("OK", :green) if client.disassociate_ip_address(id)
|
6
6
|
end
|
@@ -18,7 +18,7 @@ class IpAddress < CloudstackCli::Base
|
|
18
18
|
say ip['ipaddress']
|
19
19
|
end
|
20
20
|
|
21
|
-
desc "
|
21
|
+
desc "list", "list public IP address"
|
22
22
|
option :project
|
23
23
|
option :account
|
24
24
|
option :listall
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class Iso < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc '
|
3
|
+
desc 'list [TYPE]', "list iso's by type [featured|self|self-executable|executable|community], default is featured"
|
4
4
|
option :project
|
5
5
|
option :zone
|
6
6
|
option :account
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class Job < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc '
|
3
|
+
desc 'list', 'list async jobs'
|
4
4
|
def list
|
5
5
|
jobs = client.list_jobs()
|
6
6
|
if jobs.size < 1
|
@@ -14,7 +14,7 @@ class Job < CloudstackCli::Base
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
desc '
|
17
|
+
desc 'query ID', 'query async job'
|
18
18
|
def query(id)
|
19
19
|
job = client.query_job(id)
|
20
20
|
job.each do |key, value|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class LoadBalancer < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc "
|
3
|
+
desc "list", "list load balancer rules"
|
4
4
|
option :project
|
5
5
|
def list
|
6
6
|
project = find_project if options[:project]
|
@@ -18,7 +18,7 @@ class LoadBalancer < CloudstackCli::Base
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
desc "
|
21
|
+
desc "create NAME", "create load balancer rule"
|
22
22
|
option :project
|
23
23
|
option :ip, required: true
|
24
24
|
option :public_port, required: true
|
@@ -36,7 +36,7 @@ class LoadBalancer < CloudstackCli::Base
|
|
36
36
|
say "OK!", :green
|
37
37
|
end
|
38
38
|
|
39
|
-
desc "
|
39
|
+
desc "add NAME", "assign servers to balancer rule"
|
40
40
|
option :servers, required: true, type: :array, description: 'server names'
|
41
41
|
def add(name)
|
42
42
|
say "Add #{names.join(', ')} to rule #{id}...", :yellow
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class Network < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc "
|
3
|
+
desc "list", "list networks"
|
4
4
|
option :project
|
5
5
|
option :account
|
6
6
|
option :showid, type: :boolean
|
@@ -38,7 +38,7 @@ class Network < CloudstackCli::Base
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
desc "
|
41
|
+
desc "default", "get the default network"
|
42
42
|
option :zone
|
43
43
|
def default
|
44
44
|
network = client.get_default_network(options[:zone])
|
@@ -58,7 +58,7 @@ class Network < CloudstackCli::Base
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
desc "
|
61
|
+
desc "show NAME", "show detailed infos about a network"
|
62
62
|
option :project
|
63
63
|
def show(name)
|
64
64
|
if options[:project]
|
@@ -79,7 +79,7 @@ class Network < CloudstackCli::Base
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
-
desc "
|
82
|
+
desc "restart NAME", "restart network"
|
83
83
|
option :cleanup, type: :boolean, default: true
|
84
84
|
def restart(name)
|
85
85
|
network = client.get_network(name)
|
@@ -93,7 +93,7 @@ class Network < CloudstackCli::Base
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
-
desc "
|
96
|
+
desc "delete NAME", "delete network"
|
97
97
|
def delete(name)
|
98
98
|
network = client.get_network(name)
|
99
99
|
network = client.get_network(name, -1) unless network
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class PortRule < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc "
|
3
|
+
desc "create SERVER", "create portforwarding rules"
|
4
4
|
option :rules, type: :array,
|
5
5
|
required: true,
|
6
6
|
desc: "Port Forwarding Rules [public_ip]:port ...",
|
@@ -35,7 +35,7 @@ class PortRule < CloudstackCli::Base
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
desc "
|
38
|
+
desc "list", "list portforwarding rules"
|
39
39
|
option :project
|
40
40
|
def list
|
41
41
|
project_id = find_project['id'] if options[:project]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class Project < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc "
|
3
|
+
desc "show NAME", "show detailed infos about a project"
|
4
4
|
option :project
|
5
5
|
def show(name)
|
6
6
|
unless project = client.get_project(name)
|
@@ -13,7 +13,7 @@ class Project < CloudstackCli::Base
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
desc "
|
16
|
+
desc "list", "list projects"
|
17
17
|
def list
|
18
18
|
projects = client.list_projects
|
19
19
|
if projects.size < 1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class Router < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc "
|
3
|
+
desc "list", "list virtual routers"
|
4
4
|
option :project
|
5
5
|
option :account
|
6
6
|
option :zone
|
@@ -70,7 +70,7 @@ class Router < CloudstackCli::Base
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
desc "
|
73
|
+
desc "stop NAME [NAME2 ..]", "stop virtual router(s)"
|
74
74
|
option :force, description: "stop without asking", type: :boolean, aliases: '-f'
|
75
75
|
def stop(*names)
|
76
76
|
routers = names.map {|name| get_router(name)}
|
@@ -83,7 +83,7 @@ class Router < CloudstackCli::Base
|
|
83
83
|
watch_jobs(jobs)
|
84
84
|
end
|
85
85
|
|
86
|
-
desc "
|
86
|
+
desc "start NAME [NAME2 ..]", "start virtual router(s)"
|
87
87
|
option :force, description: "start without asking", type: :boolean, aliases: '-f'
|
88
88
|
def start(*names)
|
89
89
|
routers = names.map {|name| get_router(name)}
|
@@ -96,7 +96,7 @@ class Router < CloudstackCli::Base
|
|
96
96
|
watch_jobs(jobs)
|
97
97
|
end
|
98
98
|
|
99
|
-
desc "
|
99
|
+
desc "start NAME [NAME2 ..]", "restart virtual router(s) (stop and start)"
|
100
100
|
option :force, description: "restart without asking", type: :boolean, aliases: '-f'
|
101
101
|
def restart(*names)
|
102
102
|
routers = names.map {|name| get_router(name)}
|
@@ -117,7 +117,7 @@ class Router < CloudstackCli::Base
|
|
117
117
|
say "Finished.", :green
|
118
118
|
end
|
119
119
|
|
120
|
-
desc "
|
120
|
+
desc "destroy NAME [NAME2 ..]", "destroy virtual router(s)"
|
121
121
|
option :force, description: "destroy without asking", type: :boolean, aliases: '-f'
|
122
122
|
def destroy(*names)
|
123
123
|
routers = names.map {|name| get_router(name)}
|
@@ -1,38 +1,66 @@
|
|
1
1
|
class Server < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc "
|
3
|
+
desc "list", "list servers"
|
4
4
|
option :project
|
5
5
|
option :account
|
6
6
|
option :zone
|
7
|
+
option :command, desc: "command to execute for each server: START, STOP or RESTART"
|
7
8
|
def list
|
8
9
|
if options[:project]
|
9
10
|
if options[:project].downcase == "all"
|
10
11
|
options[:project_id] = -1
|
12
|
+
project_id = -1
|
11
13
|
else
|
12
14
|
project = find_project
|
13
15
|
options[:project_id] = project['id']
|
16
|
+
project_id = project['id']
|
14
17
|
end
|
15
18
|
end
|
16
19
|
servers = client.list_servers(options)
|
17
20
|
if servers.size < 1
|
18
21
|
puts "No servers found."
|
19
22
|
else
|
20
|
-
table = [["Name", "State", "Offering", "Zone",
|
23
|
+
table = [["Name", "State", "Offering", "Zone", project_id ? "Project" : "Account", "IP's"]]
|
21
24
|
servers.each do |server|
|
22
25
|
table << [
|
23
26
|
server['name'],
|
24
27
|
server['state'],
|
25
28
|
server['serviceofferingname'],
|
26
29
|
server['zonename'],
|
27
|
-
|
30
|
+
project_id ? server['project'] : server['account'],
|
28
31
|
server['nic'].map { |nic| nic['ipaddress']}.join(' ')
|
29
32
|
]
|
30
33
|
end
|
31
34
|
print_table table
|
32
|
-
|
35
|
+
|
36
|
+
if options[:command]
|
37
|
+
case options[:command].downcase
|
38
|
+
when "start"
|
39
|
+
exit unless yes?("\nStart the server(s) above? [y/N]:", :magenta)
|
40
|
+
jobs = servers.map do |server|
|
41
|
+
{id: client.start_server(server['name'], project_id, false)['jobid'], name: "Start server #{server['name']}"}
|
42
|
+
end
|
43
|
+
when "stop"
|
44
|
+
exit unless yes?("\nStop the server(s) above? [y/N]:", :magenta)
|
45
|
+
jobs = servers.map do |server|
|
46
|
+
{id: client.stop_server(server['name'], nil, project_id, false)['jobid'], name: "Stop server #{server['name']}"}
|
47
|
+
end
|
48
|
+
when "restart"
|
49
|
+
exit unless yes?("\nRestart the server(s) above? [y/N]:", :magenta)
|
50
|
+
jobs = servers.map do |server|
|
51
|
+
{id: client.reboot_server(server['name'], project_id, false)['jobid'], name: "Restart server #{server['name']}"}
|
52
|
+
end
|
53
|
+
else
|
54
|
+
say "\nCommand #{options[:command]} not supported.", :red
|
55
|
+
exit 1
|
56
|
+
end
|
57
|
+
puts
|
58
|
+
watch_jobs(jobs)
|
59
|
+
end
|
60
|
+
end
|
33
61
|
end
|
34
62
|
|
35
|
-
desc "
|
63
|
+
desc "show NAME", "show detailed infos about a server"
|
36
64
|
option :project
|
37
65
|
def show(name)
|
38
66
|
if options[:project]
|
@@ -53,7 +81,7 @@ class Server < CloudstackCli::Base
|
|
53
81
|
end
|
54
82
|
end
|
55
83
|
|
56
|
-
desc "
|
84
|
+
desc "create NAME [NAME2 ...]", "create server(s)"
|
57
85
|
option :template, aliases: '-t', desc: "name of the template"
|
58
86
|
option :iso, desc: "name of the iso", desc: "name of the iso template"
|
59
87
|
option :offering, aliases: '-o', required: true, desc: "computing offering name"
|
@@ -107,7 +135,7 @@ class Server < CloudstackCli::Base
|
|
107
135
|
say "Finished.", :green
|
108
136
|
end
|
109
137
|
|
110
|
-
desc "
|
138
|
+
desc "destroy NAME [NAME2 ..]", "destroy server(s)"
|
111
139
|
option :project
|
112
140
|
option :force, description: "destroy without asking", type: :boolean, aliases: '-f'
|
113
141
|
def destroy(*names)
|
@@ -127,24 +155,24 @@ class Server < CloudstackCli::Base
|
|
127
155
|
end
|
128
156
|
end
|
129
157
|
|
130
|
-
desc "
|
158
|
+
desc "bootstrap", "interactive creation of a server with network access"
|
131
159
|
def bootstrap
|
132
160
|
bootstrap_server_interactive
|
133
161
|
end
|
134
162
|
|
135
|
-
desc "
|
163
|
+
desc "stop NAME", "stop a server"
|
136
164
|
def stop(name)
|
137
165
|
client.stop_server(name)
|
138
166
|
puts
|
139
167
|
end
|
140
168
|
|
141
|
-
desc "
|
169
|
+
desc "start NAME", "start a server"
|
142
170
|
def start(name)
|
143
171
|
client.start_server(name)
|
144
172
|
puts
|
145
173
|
end
|
146
174
|
|
147
|
-
desc "
|
175
|
+
desc "reboot NAME", "reboot a server"
|
148
176
|
def restart(name)
|
149
177
|
client.reboot_server(name)
|
150
178
|
puts
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class SshKeyPair < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc "
|
3
|
+
desc "list", 'list ssh key pairs'
|
4
4
|
option :listall
|
5
5
|
option :account
|
6
6
|
option :project
|
@@ -17,7 +17,7 @@ class SshKeyPair < CloudstackCli::Base
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
desc '
|
20
|
+
desc 'create NAME', 'create ssh key pair'
|
21
21
|
option :account
|
22
22
|
option :project
|
23
23
|
def create(name)
|
@@ -28,7 +28,7 @@ class SshKeyPair < CloudstackCli::Base
|
|
28
28
|
say pair['privatekey']
|
29
29
|
end
|
30
30
|
|
31
|
-
desc '
|
31
|
+
desc 'register NAME', 'register ssh key pair'
|
32
32
|
option :account
|
33
33
|
option :project
|
34
34
|
option :public_key, required: true, desc: "path to public_key file"
|
@@ -46,7 +46,7 @@ class SshKeyPair < CloudstackCli::Base
|
|
46
46
|
say pair['privatekey']
|
47
47
|
end
|
48
48
|
|
49
|
-
desc '
|
49
|
+
desc 'delete NAME', 'delete ssh key pair'
|
50
50
|
option :account
|
51
51
|
option :project
|
52
52
|
option :force, aliases: '-f', desc: "delete without asking"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class Template < CloudstackCli::Base
|
2
2
|
|
3
|
-
desc '
|
3
|
+
desc 'list [TYPE]', 'list templates by type [featured|self|self-executable|executable|community], default is featured'
|
4
4
|
option :project
|
5
5
|
option :zone
|
6
6
|
def list(type='featured')
|
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.5.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: 2013-
|
11
|
+
date: 2013-12-16 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.16
|
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.16
|
69
69
|
description: cloudstack-cli is a CloudStack API client written in Ruby.
|
70
70
|
email:
|
71
71
|
- nik.wolfgramm@gmail.com
|
@@ -87,15 +87,16 @@ files:
|
|
87
87
|
- lib/cloudstack-cli/commands/account.rb
|
88
88
|
- lib/cloudstack-cli/commands/capacity.rb
|
89
89
|
- lib/cloudstack-cli/commands/cluster.rb
|
90
|
-
- lib/cloudstack-cli/commands/
|
90
|
+
- lib/cloudstack-cli/commands/compute_offer.rb
|
91
|
+
- lib/cloudstack-cli/commands/disk_offer.rb
|
91
92
|
- lib/cloudstack-cli/commands/domain.rb
|
93
|
+
- lib/cloudstack-cli/commands/environment.rb
|
92
94
|
- lib/cloudstack-cli/commands/host.rb
|
93
95
|
- lib/cloudstack-cli/commands/ip_address.rb
|
94
96
|
- lib/cloudstack-cli/commands/iso.rb
|
95
97
|
- lib/cloudstack-cli/commands/job.rb
|
96
98
|
- lib/cloudstack-cli/commands/load_balancer.rb
|
97
99
|
- lib/cloudstack-cli/commands/network.rb
|
98
|
-
- lib/cloudstack-cli/commands/offering.rb
|
99
100
|
- lib/cloudstack-cli/commands/physical_network.rb
|
100
101
|
- lib/cloudstack-cli/commands/pod.rb
|
101
102
|
- lib/cloudstack-cli/commands/port_rule.rb
|
@@ -112,7 +113,7 @@ files:
|
|
112
113
|
- lib/cloudstack-cli/helper.rb
|
113
114
|
- lib/cloudstack-cli/version.rb
|
114
115
|
- test/stack_example.json
|
115
|
-
homepage: https://
|
116
|
+
homepage: https://github.com/niwo/cloudstack-cli
|
116
117
|
licenses:
|
117
118
|
- MIT
|
118
119
|
metadata: {}
|