Sha256: 8b7ff395cf49653f40555b4104361223c884a7e7d6e41636105165478a8c55b4

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 KB

Contents

module Fog
  module Network
    class AzureRM
      # This class provides the actual implementation for service calls.
      class Real
        def check_express_route_cir_auth_exists(resource_group_name, circuit_name, authorization_name)
          msg = "Checking Express Route Circuit Authorization #{authorization_name}"
          Fog::Logger.debug msg
          begin
            @network_client.express_route_circuit_authorizations.get(resource_group_name, circuit_name, authorization_name)
            Fog::Logger.debug "Express Route Circuit Authorization #{authorization_name} exists."
            true
          rescue MsRestAzure::AzureOperationError => e
            if e.body['error']['code'] == 'NotFound'
              Fog::Logger.debug "Express Route Circuit Authorization #{authorization_name} doesn't exist."
              false
            else
              raise_azure_exception(e, msg)
            end
          end
        end
      end
      # This class provides the mock implementation for unit tests.
      class Mock
        def check_express_route_cir_auth_exists(*)
          true
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fog-azure-rm-0.4.0 lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb