Class: Fog::HP::Network::Network

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/hp/models/network/network.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



16
17
18
19
20
# File 'lib/fog/hp/models/network/network.rb', line 16

def destroy
  requires :id
  service.delete_network(id)
  true
end

#ready?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/fog/hp/models/network/network.rb', line 22

def ready?
  self.status == 'ACTIVE'
end

#saveObject



35
36
37
# File 'lib/fog/hp/models/network/network.rb', line 35

def save
  identity ? update : create
end

#subnetsObject



26
27
28
29
30
31
32
33
# File 'lib/fog/hp/models/network/network.rb', line 26

def subnets
  @subnets ||= begin
    Fog::HP::Network::Subnets.new({
      :service => service,
      :filters => {:network_id => self.id}
    })
  end
end