Sha256: e5f43d65739bb5c4679f8da10a599d547ff6b94463b7e6a93561cf83f01a5d21

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

module Fog
  module Network
    class AzureRM
      # Subnet model for Network Service
      class Subnet < Fog::Model
        identity :name
        attribute :id
        attribute :resource_group
        attribute :virtual_network_name
        attribute :properties
        attribute :addressPrefix
        attribute :networkSecurityGroupId
        attribute :routeTableId
        attribute :ipConfigurations

        def save
          requires :name
          requires :resource_group
          requires :virtual_network_name
          Fog::Logger.debug "Creating Subnet: #{name}..."
          #puts "Creating Subnet: #{name}..."
          subnet = service.create_subnet(resource_group, virtual_network_name, name, addressPrefix)
          Fog::Logger.debug "Subnet #{name} created successfully."
          #puts "Subnet #{name} created successfully."
          subnet
        end

        def destroy
          service.delete_subnet(resource_group, virtual_network_name, name)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.1 lib/fog/azurerm/models/network/subnet.rb
fog-azure-rm-0.0.0 lib/fog/azurerm/models/network/subnet.rb