cloudstack-cli 0.13.0 → 0.13.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59af9b18e579f5acce2144abcf2aff9db1affb2d
4
- data.tar.gz: 49e7e5d576b28cd87ade5522a4541de96b662395
3
+ metadata.gz: 5cae23abc9a8273ab51dabe0a7547b53c571fd45
4
+ data.tar.gz: b6fb172ab5e198a54dd94bfd9e20ef341e71a4a9
5
5
  SHA512:
6
- metadata.gz: 420b6b48551919f82f1614e1f223012e8091cc80f01341fe79ad578457663c9e486acd594e5ba5d131a408e7bd45686e86600eabb480762feacce45fd7deeb0c
7
- data.tar.gz: 04932a176b192b6f1f070abacfad2a86b91a1b6f560a898197f2d266b9b3d8e601addb0c73b9b9a049992dddc4a78bba5b42a30eb35aea7e5341782e3d02c6fc
6
+ metadata.gz: 1903a80864f56b3b7abfecd72752a43a1c50d27bd360af0b4df1292c6f7150d28cf38822cff14534a27b83c8a02f6b1dc781d9822670903ef4b9dcc70185386f
7
+ data.tar.gz: 86d74efc92137546e33906aa635abdcb5e3ff33c48d84f1fcd85563ffcbba438ac1fc0845f45eb9d3978423c0a3621306022a377add695129da15807651c06b3
@@ -1,15 +1,15 @@
1
1
  GIT
2
2
  remote: git@github.com:niwo/cloudstack_client.git
3
- revision: 9bffcd5b7ed587973b09ced13fae52030b77ff72
3
+ revision: b6fdbc1a50a06f3596b1e07c0e7973cb34bbf203
4
4
  branch: master
5
5
  specs:
6
- cloudstack_client (0.9.0)
6
+ cloudstack_client (0.9.2)
7
7
 
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- cloudstack-cli (0.13.0)
12
- cloudstack_client (~> 0.9.0)
11
+ cloudstack-cli (0.13.1)
12
+ cloudstack_client (~> 0.9.2)
13
13
  thor (~> 0.19.1)
14
14
 
15
15
  GEM
@@ -25,5 +25,5 @@ Gem::Specification.new do |gem|
25
25
  gem.add_development_dependency('rake', '~> 10.4')
26
26
 
27
27
  gem.add_dependency('thor', '~> 0.19.1')
28
- gem.add_dependency('cloudstack_client', '~> 0.9.0')
28
+ gem.add_dependency('cloudstack_client', '~> 0.9.2')
29
29
  end
@@ -1,11 +1,11 @@
1
1
  require "thor"
2
2
  require "yaml"
3
3
 
4
- module CloudstackCli
4
+ module CloudstackCli
5
5
  class Base < Thor
6
6
  include Thor::Actions
7
7
  include CloudstackCli::Helper
8
-
8
+
9
9
  attr_reader :config
10
10
 
11
11
  # catch control-c and exit
@@ -19,7 +19,7 @@ module CloudstackCli
19
19
  true
20
20
  end
21
21
 
22
- no_commands do
22
+ no_commands do
23
23
  def client(opts = {})
24
24
  @config ||= load_configuration
25
25
  @client ||= CloudstackClient::Connection.new(
@@ -43,7 +43,7 @@ module CloudstackCli
43
43
  say "Can't load configuration from file #{config_file}.", :red
44
44
  exit 1
45
45
  end
46
-
46
+
47
47
  env ||= config[:default]
48
48
  if env
49
49
  unless config = config[env]
@@ -63,7 +63,7 @@ module CloudstackCli
63
63
  def find_project(name = options[:project], allow_all = true)
64
64
  return nil unless name
65
65
  if allow_all && %w(ALL -1).include?(name)
66
- return {'id' => '-1'}
66
+ return {'id' => '-1'}
67
67
  end
68
68
  unless project = client.get_project(name)
69
69
  say "Project '#{name}' not found", :red
@@ -77,4 +77,4 @@ module CloudstackCli
77
77
  end
78
78
  end
79
79
  end
80
- end
80
+ end
@@ -110,6 +110,7 @@ class ResourceLimit < CloudstackCli::Base
110
110
  domains = client.list_domains(options[:domain])
111
111
  if domains.size < 1
112
112
  say "Domain #{options[:domain]} not found.", :red
113
+ exit -1
113
114
  else
114
115
  options[:domain_id] = domains.first['id']
115
116
  end
@@ -7,6 +7,7 @@ class Server < CloudstackCli::Base
7
7
  option :command, desc: "command to execute for each server: START, STOP or RESTART"
8
8
  option :state
9
9
  option :listall
10
+ option :storage_id
10
11
  option :keyword, desc: "filter by keyword"
11
12
  def list
12
13
  if options[:project]
@@ -14,6 +15,8 @@ class Server < CloudstackCli::Base
14
15
  options[:project_id] = project_id
15
16
  options[:project] = nil
16
17
  end
18
+ options[:custom] = { 'storageid' => options[:storage_id] } if options[:storage_id]
19
+ client.verbose = true
17
20
  servers = client.list_servers(options)
18
21
  if servers.size < 1
19
22
  puts "No servers found."
@@ -28,4 +28,22 @@ class Volume < CloudstackCli::Base
28
28
  end
29
29
  end
30
30
 
31
- end
31
+ desc "show NAME", "show volume details"
32
+ option :project, desc: 'project of volume'
33
+ def show(name)
34
+ options[:name] = name
35
+ options[:project_id] = find_project['id'] if options[:project]
36
+ volumes = client.list_volumes(options)
37
+ if volumes.size < 1
38
+ say "No volume with name \"#{name}\" found."
39
+ else
40
+ volume = volumes.first
41
+ table = volume.map do |key, value|
42
+ [ set_color("#{key}:", :yellow), "#{value}" ]
43
+ end
44
+ print_table table
45
+ end
46
+ end
47
+
48
+
49
+ end
@@ -1,3 +1,3 @@
1
1
  module CloudstackCli
2
- VERSION = "0.13.0"
2
+ VERSION = "0.13.1"
3
3
  end
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.13.0
4
+ version: 0.13.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: 2015-02-09 00:00:00.000000000 Z
11
+ date: 2015-02-13 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.9.0
61
+ version: 0.9.2
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.9.0
68
+ version: 0.9.2
69
69
  description: cloudstack-cli is a CloudStack API command line client written in Ruby.
70
70
  email:
71
71
  - nik.wolfgramm@gmail.com