Parent

Methods

Class/Module Index [+]

Quicksearch

Fog::Compute::AWS::VPC

Public Class Methods

new(attributes={}) click to toggle source
# File lib/fog/aws/models/compute/vpc.rb, line 17
def initialize(attributes={})
  self.dhcp_options_id ||= "default"
  self.tenancy ||= "default"
  super
end

Public Instance Methods

destroy() click to toggle source

Removes an existing vpc

vpc.destroy

Returns

True or false depending on the result

# File lib/fog/aws/models/compute/vpc.rb, line 32
def destroy
  requires :id

  service.delete_vpc(id)
  true
end
save() click to toggle source

Create a vpc

>> g = AWS.vpcs.new(:cidr_block => "10.1.2.0/24") >> g.save

Returns:

True or an exception depending on the result. Keep in mind that this creates a new vpc. As such, it yields an InvalidGroup.Duplicate exception if you attempt to save an existing vpc.

# File lib/fog/aws/models/compute/vpc.rb, line 50
def save
  requires :cidr_block

  data = service.create_vpc(cidr_block).body['vpcSet'].first
  new_attributes = data.reject {|key,value| key == 'requestId'}
  merge_attributes(new_attributes)
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.