Class: Fog::Network::HuaweiCloud::Vpc

Inherits:
HuaweiCloud::Model show all
Defined in:
lib/fog/network/huaweicloud/models/vpc.rb

Instance Attribute Summary

Attributes inherited from HuaweiCloud::Model

#project

Instance Method Summary collapse

Methods inherited from HuaweiCloud::Model

#initialize, #save, #update

Constructor Details

This class inherits a constructor from Fog::HuaweiCloud::Model

Instance Method Details

#createObject



13
14
15
16
17
# File 'lib/fog/network/huaweicloud/models/vpc.rb', line 13

def create
  requires :name, :cidr
  merge_attributes(service.create_vpc(name, cidr).body['vpc'])
  self
end

#destroyObject

TODO not support def update

requires :id
merge_attributes(service.update_subnet(id, attributes).body['subnet'])
self

end



26
27
28
29
30
# File 'lib/fog/network/huaweicloud/models/vpc.rb', line 26

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