Sha256: 3a4360c9af2761d630ef545323b8246a4f08aff62bd7a5dbf63d0e06ea3af8a7

Contents?: true

Size: 946 Bytes

Versions: 33

Compression:

Stored size: 946 Bytes

Contents

module Fog
  module Resources
    class AzureRM
      # This class is giving implementation of all/list and get.
      class AzureResources < Fog::Collection
        attribute :tag_name
        attribute :tag_value
        model Fog::Resources::AzureRM::AzureResource

        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

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

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

Version data entries

33 entries across 33 versions & 4 rubygems

Version Path
fog-azure-rm-0.4.6 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/models/resources/azure_resources.rb
far-gem-0.5.1 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.4.1 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.4.0 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/models/resources/azure_resources.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/models/resources/azure_resources.rb