Sha256: da99e2ac5bb3948ff46657db60b726e9a11b678cfee4ed369879e4f5856db17b

Contents?: true

Size: 1.97 KB

Versions: 1

Compression:

Stored size: 1.97 KB

Contents

require 'fog/azurerm/core'

module Fog
  module ApplicationGateway
    # Fog Service Class for AzureRM
    class AzureRM < Fog::Service
      requires :tenant_id
      requires :client_id
      requires :client_secret
      requires :subscription_id

      request_path 'fog/azurerm/requests/application_gateway'
      request :create_application_gateway
      request :delete_application_gateway
      request :list_application_gateways

      model_path 'fog/azurerm/models/application_gateway'
      model :gateway
      collection :gateways
      model :backend_address_pool
      model :backend_http_setting
      model :frontend_ip_configuration
      model :frontend_port
      model :ip_configuration
      model :http_listener
      model :probe
      model :request_routing_rule
      model :ssl_certificate
      model :url_path_map

      # Mock class for Application Gateway Service
      class Mock
        def initialize(_options = {})
          begin
            require 'azure_mgmt_network'
          rescue LoadError => e
            retry if require('rubygems')
            raise e.message
          end
        end
      end

      # Real class for Application Gateway Service
      class Real
        def initialize(options = {})
          begin
            require 'azure_mgmt_network'
          rescue LoadError => e
            retry if require('rubygems')
            raise e.message
          end

          credentials = Fog::Credentials::AzureRM.get_credentials(options[:tenant_id], options[:client_id], options[:client_secret])
          @network_client = ::Azure::ARM::Network::NetworkManagementClient.new(credentials)
          @network_client.subscription_id = options[:subscription_id]
          @tenant_id = options[:tenant_id]
          @client_id = options[:client_id]
          @client_secret = options[:client_secret]
          @subscription_id = options[:subscription_id]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.5 lib/fog/azurerm/application_gateway.rb