Sha256: 480bf2856997b515535d6e7b30eb7b9082d7be00b35769103b42c10fbb625400

Contents?: true

Size: 1.51 KB

Versions: 2

Compression:

Stored size: 1.51 KB

Contents

module Fog
  module Network
    class AzureRM
      # Subnet model for Network Service
      class NetworkSecurityRule < Fog::Model
        identity :name
        attribute :id
        attribute :resource_group
        attribute :network_security_group_name
        attribute :description
        attribute :protocol
        attribute :source_port_range
        attribute :destination_port_range
        attribute :source_address_prefix
        attribute :destination_address_prefix
        attribute :access
        attribute :priority
        attribute :direction

        def self.parse(nsr)
          hash = {}
          hash['id'] = nsr['id']
          hash['name'] = nsr['name']
          hash['resource_group'] = nsr['id'].split('/')[4]
          hash['network_security_group_name'] = nsr['id'].split('/')[8]
          hash['description'] = nsr['properties']['description']
          hash['protocol'] = nsr['properties']['protocol']
          hash['source_port_range'] = nsr['properties']['sourcePortRange']
          hash['destination_port_range'] = nsr['properties']['destinationPortRange']
          hash['source_address_prefix'] = nsr['properties']['sourceAddressPrefix']
          hash['destination_address_prefix'] = nsr['properties']['destinationAddressPrefix']
          hash['access'] = nsr['properties']['access']
          hash['priority'] = nsr['properties']['priority']
          hash['direction'] = nsr['properties']['direction']
          hash
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.3 lib/fog/azurerm/models/network/network_security_rule.rb
fog-azure-rm-0.0.2 lib/fog/azurerm/models/network/network_security_rule.rb