Parent

Methods

Class/Module Index [+]

Quicksearch

Fog::Compute::AWS::Subnet

Public Instance Methods

destroy() click to toggle source

Removes an existing subnet

subnet.destroy

Returns

True or false depending on the result

# File lib/fog/aws/models/compute/subnet.rb, line 27
def destroy
  requires :subnet_id

  service.delete_subnet(subnet_id)
  true
end
save() click to toggle source

Create a subnet

>> g = AWS.subnets.new(:vpc_id => "vpc-someId", :cidr_block => "10.0.0.0/24")
>> g.save

Returns:

requestId and a subnetSet object

# File lib/fog/aws/models/compute/subnet.rb, line 44
def save
  requires :vpc_id, :cidr_block
  data = service.create_subnet(vpc_id, cidr_block).body['subnetSet'].first
  new_attributes = data.reject {|key,value| key == 'requestId'}
  merge_attributes(new_attributes)
  true

  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.