mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add subnets collection to the network model.
This commit is contained in:
parent
14b5ef24b9
commit
ef4726441a
1 changed files with 9 additions and 1 deletions
|
@ -10,7 +10,6 @@ module Fog
|
|||
attribute :name
|
||||
attribute :tenant_id
|
||||
attribute :status
|
||||
attribute :subnets
|
||||
attribute :shared
|
||||
attribute :admin_state_up
|
||||
attribute :router_external, :aliases => 'router:external'
|
||||
|
@ -25,6 +24,15 @@ module Fog
|
|||
self.status == 'ACTIVE'
|
||||
end
|
||||
|
||||
def subnets
|
||||
@subnets ||= begin
|
||||
Fog::HP::Network::Subnets.new({
|
||||
:service => service,
|
||||
:filters => {:network_id => self.id}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
def save
|
||||
identity ? update : create
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue