yao 0.2.13 → 0.3.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/lib/yao/resources/router.rb +30 -0
- data/lib/yao/resources.rb +1 -0
- data/lib/yao/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb8a0a2dadc975011f644129f9373df0ae5d361c
|
4
|
+
data.tar.gz: 193b029611bdd15bbd73e8e6eaf23b0b2ffa5284
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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
|
+
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-
|
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
|