Sha256: 96f5b98a78e754edefe599aa4030c0771ce2cd49520cbab49b1f1b826635124d

Contents?: true

Size: 1.8 KB

Versions: 47

Compression:

Stored size: 1.8 KB

Contents

module Fog
  module Compute
    class AzureRM
      # Real class for Compute Request
      class Real
        def get_vm_extension(resource_group_name, virtual_machine_name, vm_extension_name)
          msg = "Getting Extension #{vm_extension_name} of Virtual Machine #{virtual_machine_name} in Resource Group #{resource_group_name}"
          Fog::Logger.debug msg
          begin
            vm_extension = @compute_mgmt_client.virtual_machine_extensions.get(resource_group_name, virtual_machine_name, vm_extension_name)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          Fog::Logger.debug "#{msg} successful"
          vm_extension
        end
      end

      # Mock class for Compute Request
      class Mock
        def get_vm_extension(*)
          body = {
            'id' => '/subscriptions/########-####-####-####-############/resourceGroups/TestRG/providers/Microsoft.Compute/virtualMachines/TestVM/extensions/IaaSAntimalware',
            'name' => 'IaasAntimalware',
            'resource_group' => 'fog-test-rg',
            'location' => 'West US',
            'properties' => {
              'publisher' => 'Microsoft.Azure.Security',
              'type' => 'IaaSAntimalware',
              'typeHandlerVersion' => '1.3',
              'autoUpgradeMinorVersion' => 'true',
              'forceUpdateTag' => 'RerunExtension',
              'settings' => {
                'AnitmalwareEnabled' => 'true',
                'RealtimeProtectionEnabled' => 'false'
              },
              'protected_settings' => {}
            }
          }
          extension_mapper = Azure::ARM::Compute::Models::VirtualMachineExtension.mapper
          @compute_mgmt_client.deserialize(extension_mapper, body, 'result.body')
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
fog-azure-rm-0.4.1 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.4.0 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.2.7 lib/fog/azurerm/requests/compute/get_vm_extension.rb
fog-azure-rm-0.2.6 lib/fog/azurerm/requests/compute/get_vm_extension.rb