Class: Fog::Compute::AzureRM::AvailabilitySets

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/azurerm/models/compute/availability_sets.rb

Overview

This class is giving implementation of all/list, get and check name availability for storage account.

Instance Method Summary collapse

Instance Method Details

#allObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fog/azurerm/models/compute/availability_sets.rb', line 12

def all
  accounts = []
  requires :resource_group
  list_of_availability_sets =
    service.list_availability_sets(resource_group)
  unless list_of_availability_sets.nil?
    list_of_availability_sets.each do ||
      hash = {}
      .instance_variables.each do |var|
        hash[var.to_s.delete('@')] = .instance_variable_get(var)
      end
      hash['resource_group'] = resource_group
      accounts << hash
    end
  end
  load(accounts)
end

#get(resource_group, identity) ⇒ Object



30
31
32
# File 'lib/fog/azurerm/models/compute/availability_sets.rb', line 30

def get(resource_group, identity)
  all.find { |as| as.resource_group == resource_group && as.name == identity }
end