yao 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f0da0f480910417b6f051cb2450f683aa387a5f2ea24d81e1c25f90129af822
4
- data.tar.gz: 10784d983ea85ebfa79559fea9f93912d0f498e92b0bf65577b60b869846102d
3
+ metadata.gz: 25050407994239664ed794476f785770eee9f35ec4b408c4d56d16397e61d573
4
+ data.tar.gz: eb715c80c47212ac8d1812b7de154fe60268b28532de2c61c7b303ad6c077bc2
5
5
  SHA512:
6
- metadata.gz: 309cb837c30b9b7f6a68ec6af32b086bb1fce9d8ed0b668f53699ffe8fefd35be6e48082c0184ae8c8e637a70f920aa73bbc34361a3b8a2a2ca2d0739418dc2d
7
- data.tar.gz: 29ec510260386b7dc2d568368db6dfd9c49f849b725b6d290c72573a103248ae13cc2be67e2be891ae4b9ba999c384cbd41c73148baa93672702b1735fe8681c
6
+ metadata.gz: 7424508d48a8836a09ba560e1cfa1fe108fcc22b043f5914e9056e352830ed32974ae94b8db3946cf9f52af51fbce2f8599c36487c1208d8fc841d2fff69af2b
7
+ data.tar.gz: 7ed3b0b32af6d772a79830ec0dfa8cb517d0d3e2bbdac948648e2b056f2eb6495b650c4d8e5f85d69effb5741ce64d424fdf6bb9189efac9b96d963002b4cfc1
@@ -162,7 +162,8 @@ module Yao::Resources
162
162
  # At first, search by ID. If nothing is found, search by name.
163
163
  begin
164
164
  GET(create_url([api_version, resources_path, name]), query)
165
- rescue Yao::ItemNotFound
165
+ rescue => e
166
+ raise e unless e.class == Yao::ItemNotFound || e.class == Yao::NotFound
166
167
  item = find_by_name(name)
167
168
  if item.size > 1
168
169
  raise Yao::TooManyItemFonud.new("More than one resource exists with the name '#{name}'")
@@ -42,6 +42,14 @@ module Yao::Resources
42
42
  action(id,"resize" => { "flavorRef" => flavor_id })
43
43
  end
44
44
 
45
+ def self.add_security_group(id, sg_name)
46
+ action(id, {"addSecurityGroup": {"name": sg_name}})
47
+ end
48
+
49
+ def self.remove_security_group(id, sg_name)
50
+ action(id, {"removeSecurityGroup": {"name": sg_name}})
51
+ end
52
+
45
53
  class << self
46
54
  alias :stop :shutoff
47
55
 
data/lib/yao/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yao
2
- VERSION = "0.4.3"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yao
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uchio, KONDO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-06 00:00:00.000000000 Z
11
+ date: 2018-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json