Class: Fog::Resources::AzureRM::AzureResources

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/azurerm/models/resources/azure_resources.rb

Overview

This class is giving implementation of all/list and get.

Instance Method Summary collapse

Instance Method Details

#allObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fog/azurerm/models/resources/azure_resources.rb', line 10

def all
  unless tag_name.nil? && tag_value.nil?
    resources = []
    service.list_tagged_resources(tag_name, tag_value).each do |resource|
      resources << Fog::Resources::AzureRM::AzureResource.parse(resource)
    end
    resources.inspect
    return load(resources)
  end
  nil
end

#check_azure_resource_exists(resource_id, api_version) ⇒ Object



26
27
28
# File 'lib/fog/azurerm/models/resources/azure_resources.rb', line 26

def check_azure_resource_exists(resource_id, api_version)
  service.check_azure_resource_exists(resource_id, api_version)
end

#get(resource_id) ⇒ Object



22
23
24
# File 'lib/fog/azurerm/models/resources/azure_resources.rb', line 22

def get(resource_id)
  all.find { |f| f.id == resource_id }
end

#list_resources_in_resource_group(resource_group_name) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/fog/azurerm/models/resources/azure_resources.rb', line 30

def list_resources_in_resource_group(resource_group_name)
  resources = []
  service.list_resources_in_resource_group(resource_group_name).each do |resource|
    resources.push(Fog::Resources::AzureRM::AzureResource.parse(resource))
  end
  load(resources)
end