Class: Inspec::Resources::AzureGenericResource

Inherits:
AzureResourceBase show all
Defined in:
lib/resources/azure/azure_generic_resource.rb

Instance Attribute Summary collapse

Attributes inherited from AzureResourceBase

#azure, #client, #opts

Instance Method Summary collapse

Methods inherited from AzureResourceBase

#catch_azure_errors, #create_tag_methods, #failed_resource?, #has_tags?, #resource_group, #resources, #tag_count

Constructor Details

#initialize(opts = {}) ⇒ AzureGenericResource

Returns a new instance of AzureGenericResource.



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/resources/azure/azure_generic_resource.rb', line 18

def initialize(opts = {})
  # Call the parent class constructor
  super(opts)

  # Get the resource group
  resource_group

  # Get the resources
  resources

  # Create the tag methods
  create_tag_methods
end

Instance Attribute Details

#countsObject

Returns the value of attribute counts.



16
17
18
# File 'lib/resources/azure/azure_generic_resource.rb', line 16

def counts
  @counts
end

#filterObject

Returns the value of attribute filter.



16
17
18
# File 'lib/resources/azure/azure_generic_resource.rb', line 16

def filter
  @filter
end

#locationObject

Returns the value of attribute location.



16
17
18
# File 'lib/resources/azure/azure_generic_resource.rb', line 16

def location
  @location
end

#nameObject

Returns the value of attribute name.



16
17
18
# File 'lib/resources/azure/azure_generic_resource.rb', line 16

def name
  @name
end

#probesObject

Returns the value of attribute probes.



16
17
18
# File 'lib/resources/azure/azure_generic_resource.rb', line 16

def probes
  @probes
end

#totalObject

Returns the value of attribute total.



16
17
18
# File 'lib/resources/azure/azure_generic_resource.rb', line 16

def total
  @total
end

#typeObject

Returns the value of attribute type.



16
17
18
# File 'lib/resources/azure/azure_generic_resource.rb', line 16

def type
  @type
end

Instance Method Details

#parse_resource(resource) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/resources/azure/azure_generic_resource.rb', line 46

def parse_resource(resource)
  # return a hash of information
  parsed = {
    'location' => resource.location,
    'name' => resource.name,
    'type' => resource.type,
    'exist?' => true,
    'properties' => AzureResourceProbe.new(resource.properties),
  }

  parsed
end