Sha256: a7e775fbc3b081928fd5ca78b4bb27ea4c1654eefd675f2df7ac36d926645299

Contents?: true

Size: 1.41 KB

Versions: 15

Compression:

Stored size: 1.41 KB

Contents

module Fog
  module Compute
    class AzureRM
      # This class is giving implementation of create/save and
      # delete/destroy for Availability Set.
      class AvailabilitySet < Fog::Model
        attribute :id
        identity  :name
        attribute :type
        attribute :location
        attribute :resource_group
        attribute :platform_update_domain_count
        attribute :platform_fault_domain_count

        def self.parse(availability_set)
          hash = {}
          hash['id'] = availability_set.id
          hash['name'] = availability_set.name
          hash['type'] = availability_set.type
          hash['location'] = availability_set.location
          hash['resource_group'] = get_resource_group_from_id(availability_set.id)
          hash['platform_update_domain_count'] = availability_set.platform_update_domain_count
          hash['platform_fault_domain_count'] = availability_set.platform_fault_domain_count
          hash
        end

        def save
          requires :name
          requires :location
          requires :resource_group
          # need to create the availability set
          as = service.create_availability_set(resource_group, name, location)
          hash = Fog::Compute::AzureRM::AvailabilitySet.parse(as)
          merge_attributes(hash)
        end

        def destroy
          service.delete_availability_set(resource_group, name)
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.2.7 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.2.6 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.2.5 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.2.4 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.2.3 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.2.2 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.2.1 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.2.0 lib/fog/azurerm/models/compute/availability_set.rb
fog-azure-rm-0.1.2 lib/fog/azurerm/models/compute/availability_set.rb