cloudstack-cli 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,23 +8,23 @@ class PortRule < CloudstackCli::Base
8
8
  option :network, required: true, aliases: '-n'
9
9
  option :project
10
10
  def create(server_name)
11
- unless server = client.get_server(server_name)
11
+ projectid = find_project['id'] if options[:project]
12
+ unless server = client.get_server(server_name, projectid)
12
13
  error "Server #{server_name} not found."
13
14
  exit 1
14
15
  end
15
16
  frontendip = nil
16
- project = client.get_project(project)
17
17
  options[:rules].each do |pf_rule|
18
18
  ip = pf_rule.split(":")[0]
19
19
  if ip != ''
20
- ip_addr = client.get_public_ip_address(ip)
20
+ ip_addr = client.get_public_ip_address(ip, projectid)
21
21
  unless ip_addr
22
22
  say "Error: IP #{ip} not found.", :red
23
23
  next
24
24
  end
25
25
  else
26
26
  ip_addr = frontendip ||= client.associate_ip_address(
27
- client.get_network(options[:network], project ? project["id"] : nil)["id"]
27
+ client.get_network(options[:network], projectid)
28
28
  )
29
29
  end
30
30
  port = pf_rule.split(":")[1]
@@ -141,7 +141,7 @@ class Router < CloudstackCli::Base
141
141
  say "No routers found."
142
142
  else
143
143
  table = [[
144
- 'Name', 'Zone', 'Account', 'Project', 'Redundant-State', 'IP', 'Linklocal IP', 'Status', 'ID'
144
+ 'Name', 'Zone', 'Account', 'Project', 'Redundant-State', 'IP', 'Linklocal IP', 'Status', 'Redundant', 'ID'
145
145
  ]]
146
146
  table[0].delete('ID') unless options[:showid]
147
147
  routers.each do |router|
@@ -154,6 +154,7 @@ class Router < CloudstackCli::Base
154
154
  router["nic"].first ? router["nic"].first['ipaddress'] : "",
155
155
  router["linklocalip"],
156
156
  router["state"],
157
+ router["isredundantrouter"],
157
158
  router["id"]
158
159
  ]
159
160
  table[-1].delete_at(-1) unless table[0].index "ID"
@@ -1,3 +1,3 @@
1
1
  module CloudstackCli
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
@@ -36,11 +36,12 @@ module CloudstackClient
36
36
  ##
37
37
  # Finds the public ip address for a given ip address string.
38
38
 
39
- def get_public_ip_address(ip_address)
39
+ def get_public_ip_address(ip_address, project_id = nil)
40
40
  params = {
41
41
  'command' => 'listPublicIpAddresses',
42
42
  'ipaddress' => ip_address
43
43
  }
44
+ params['projectid'] = project_id if project_id
44
45
  json = send_request(params)
45
46
  ip_address = json['publicipaddress']
46
47
 
metadata CHANGED
@@ -1,32 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudstack-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Nik Wolfgramm
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-09-01 00:00:00.000000000 Z
12
+ date: 2013-09-23 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rdoc
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: thor
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -125,7 +132,6 @@ files:
125
132
  homepage: https://bitbucket.org/swisstxt/cloudstack-cli
126
133
  licenses:
127
134
  - MIT
128
- metadata: {}
129
135
  post_install_message:
130
136
  rdoc_options:
131
137
  - --line-numbers
@@ -133,20 +139,22 @@ rdoc_options:
133
139
  require_paths:
134
140
  - lib
135
141
  required_ruby_version: !ruby/object:Gem::Requirement
142
+ none: false
136
143
  requirements:
137
- - - '>='
144
+ - - ! '>='
138
145
  - !ruby/object:Gem::Version
139
146
  version: 1.9.3
140
147
  required_rubygems_version: !ruby/object:Gem::Requirement
148
+ none: false
141
149
  requirements:
142
- - - '>='
150
+ - - ! '>='
143
151
  - !ruby/object:Gem::Version
144
152
  version: '0'
145
153
  requirements: []
146
154
  rubyforge_project:
147
- rubygems_version: 2.0.2
155
+ rubygems_version: 1.8.23
148
156
  signing_key:
149
- specification_version: 4
157
+ specification_version: 3
150
158
  summary: cloudstack-cli CloudStack API client
151
159
  test_files:
152
160
  - test/stack_example.json
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 458ba90540b0b908c9a3a7a17e872398430d499d
4
- data.tar.gz: 4c4ecde3c9ec1258ba99a7ac977448a547730312
5
- SHA512:
6
- metadata.gz: 369788758e78349fe10e0f44909a9c9746f8f4f0ea4a34a3f3e2d5df8bb78b9fa5deae056c0d36345286a721b72b56f3c62d0183dac5092ab0dc166cf220724c
7
- data.tar.gz: 171a58cdafca0ee8a63dd1e77a3a4743eb61a0b7a579d7fd5f64669852d62386c30880178a94107770bb7c5d85c494725bba6fcb0f3248dd084cf0ad763efcd2