Sha256: 70c45388d8bdf977f884814e43d16a2aa7b79f21eb5cbc22385c14ba91952cb5

Contents?: true

Size: 1.4 KB

Versions: 47

Compression:

Stored size: 1.4 KB

Contents

module Fog
  module Compute
    class AzureRM
      # This class provides the actual implementation for service calls.
      class Real
        def list_availability_sets(resource_group)
          msg = "Listing Availability Sets in Resource Group: #{resource_group}"
          Fog::Logger.debug msg
          begin
            avail_sets = @compute_mgmt_client.availability_sets.list(resource_group)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          Fog::Logger.debug "Listing Availability Sets in Resource Group: #{resource_group} successful."
          avail_sets.value
        end
      end
      # This class provides the mock implementation for unit tests.
      class Mock
        def list_availability_sets(resource_group)
          [
            {
              'id' => "/subscriptions/{subscription-id}/resourceGroups/#{resource_group}/providers/Microsoft.Compute/availabilitySets/test_availability_set",
              'name' => 'test_availability_set',
              'type' => 'Microsoft.Compute/availabilitySets',
              'location' => 'westus',
              'tags' =>  {},
              'properties' =>
              {
                'platformUpdateDomainCount' => 5,
                'platformFaultDomainCount' => 3,
                'virtualMachines' => []
              }
            }
          ]
        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/compute/list_availability_sets.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/requests/compute/list_availability_sets.rb
far-gem-0.5.6 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/requests/compute/list_availability_sets.rb
far-gem-0.5.5 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/requests/compute/list_availability_sets.rb
far-gem-0.5.4 lib/fog/azurerm/requests/compute/list_availability_sets.rb
far-gem-0.5.3 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/requests/compute/list_availability_sets.rb
far-gem-0.5.2 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/requests/compute/list_availability_sets.rb
far-gem-0.5.1 lib/fog/azurerm/requests/compute/list_availability_sets.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/requests/compute/list_availability_sets.rb