Sha256: 50306f49650fd8c9fe4dc075a5c2e88af515b860e383363a0176f3044029d14d

Contents?: true

Size: 906 Bytes

Versions: 1

Compression:

Stored size: 906 Bytes

Contents

module Fog
  module Sql
    class AzureRM
      # Sql Server Collection for Firewall Rules Service
      class FirewallRules < Fog::Collection
        attribute :resource_group
        attribute :server_name
        model FirewallRule

        def all
          requires :resource_group, :server_name

          firewall_rules = []
          service.list_firewall_rules(resource_group, server_name).each do |firewall_rule|
            firewall_rules << FirewallRule.parse(firewall_rule)
          end
          load(firewall_rules)
        end

        def get(resource_group, server_name, rule_name)
          firewall_rule = service.get_firewall_rule(resource_group, server_name, rule_name)
          firewall_rule_obj = FirewallRule.new(service: service)
          firewall_rule_obj.merge_attributes(FirewallRule.parse(firewall_rule))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.0 lib/fog/azurerm/models/sql/firewall_rules.rb