yao 0.2.13 → 0.3.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
  SHA1:
3
- metadata.gz: c27d60a20885fe296430fea680eaba2355e26959
4
- data.tar.gz: 3378ef250357185bcf33dbfda9240b4dbafe1586
3
+ metadata.gz: cb8a0a2dadc975011f644129f9373df0ae5d361c
4
+ data.tar.gz: 193b029611bdd15bbd73e8e6eaf23b0b2ffa5284
5
5
  SHA512:
6
- metadata.gz: d29c106b73b0c385048fb6ef2620f9da5ae423c354738a2060654699a967d5c3fdb9f40ffcb6d89211d1dd985d74968b80787f31588c3e52029f9fd2e8501109
7
- data.tar.gz: 9f5319428190d79f28964c949e24de2342d1f550a93fa76b4d42aa5936eb8c5a52fda9b07b251f31ef8a7ccb08ba05d76a932addb119277f21f0209d6b415573
6
+ metadata.gz: d596134cae2041930bb56177ce417dced0437c24d3589c8e6a1a0081a264b261c150bdc51360ecee5e8a340aea44cb1e79d4f989bcf7ecc5559acf55d33f3b4e
7
+ data.tar.gz: fd6c3d18fe67ea85a399f31919213eac3a69a50fa7bffa08e7984a0addaf3ae42c07c1fbee2a08eb394920274138504a0ed68b735cb46cdf7d1d0f8edd1cba31
@@ -0,0 +1,30 @@
1
+ module Yao::Resources
2
+ class Router < Base
3
+ friendly_attributes :tenant_id, :project_id, :name, :description, :admin_state_up, :status, :external_gateway_info,
4
+ :network_id, :enable_snat, :external_fixed_ips, :routes, :destination, :nexthop, :distributed,
5
+ :ha, :availability_zone_hints, :availability_zones
6
+
7
+ self.service = 'network'
8
+ self.resource_name = 'router'
9
+ self.resources_name = 'routers'
10
+
11
+ def interfaces
12
+ Yao::Port.list(device_id: id)
13
+ end
14
+
15
+ class << self
16
+ def add_interface(id, param)
17
+ PUT(['routers', id, 'add_router_interface.json'].join('/'), param.to_json)
18
+ end
19
+
20
+ def remove_interface(id, param)
21
+ PUT(['routers', id, 'remove_router_interface.json'].join('/'), param.to_json)
22
+ end
23
+
24
+ def get_by_name(name)
25
+ self.list(name: name)
26
+ end
27
+ alias find_by_name get_by_name
28
+ end
29
+ end
30
+ end
data/lib/yao/resources.rb CHANGED
@@ -13,6 +13,7 @@ module Yao
13
13
  autoload :Network, "yao/resources/network"
14
14
  autoload :Subnet, "yao/resources/subnet"
15
15
  autoload :Port, "yao/resources/port"
16
+ autoload :Router, "yao/resources/router"
16
17
  autoload :Tenant, "yao/resources/tenant"
17
18
  autoload :Host, "yao/resources/host"
18
19
  autoload :User, "yao/resources/user"
data/lib/yao/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yao
2
- VERSION = "0.2.13"
2
+ VERSION = "0.3.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.2.13
4
+ version: 0.3.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: 2016-06-28 00:00:00.000000000 Z
11
+ date: 2016-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -193,6 +193,7 @@ files:
193
193
  - lib/yao/resources/resource.rb
194
194
  - lib/yao/resources/restfully_accessible.rb
195
195
  - lib/yao/resources/role.rb
196
+ - lib/yao/resources/router.rb
196
197
  - lib/yao/resources/sample.rb
197
198
  - lib/yao/resources/security_group.rb
198
199
  - lib/yao/resources/security_group_rule.rb