Sha256: c0c1aed3eafd06990ad0dce2779a72a828b3606540464cbc8e0319d44305865c

Contents?: true

Size: 1.2 KB

Versions: 47

Compression:

Stored size: 1.2 KB

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Network Request
      class Real
        def set_connection_shared_key(resource_group_name, virtual_network_gateway_connection_name, shared_key_value)
          msg = "Setting the shared key of Connection #{virtual_network_gateway_connection_name} from Resource Group #{resource_group_name}."
          Fog::Logger.debug msg
          shared_key = get_shared_key_object(shared_key_value)
          begin
            @network_client.virtual_network_gateway_connections.set_shared_key(resource_group_name, virtual_network_gateway_connection_name, shared_key)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          true
        end

        private

        def get_shared_key_object(shared_key_value)
          shared_key = Azure::ARM::Network::Models::ConnectionSharedKey.new
          shared_key.value = shared_key_value
          shared_key
        end
      end

      # Mock class for Network Request
      class Mock
        def set_connection_shared_key(*)
          Fog::Logger.debug 'Set the shared key of Connection successfully.'
          true
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
fog-azure-rm-0.6.0 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
far-gem-0.5.6 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
far-gem-0.5.5 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
far-gem-0.5.4 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
far-gem-0.5.3 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
far-gem-0.5.2 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
far-gem-0.5.1 lib/fog/azurerm/requests/network/set_connection_shared_key.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/requests/network/set_connection_shared_key.rb