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.



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

def initialize(opts = {})
  Inspec.deprecate(:resource_azure_generic_resource)

  # 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.



14
15
16
# File 'lib/resources/azure/azure_generic_resource.rb', line 14

def counts
  @counts
end

#filterObject

Returns the value of attribute filter.



14
15
16
# File 'lib/resources/azure/azure_generic_resource.rb', line 14

def filter
  @filter
end

#locationObject

Returns the value of attribute location.



14
15
16
# File 'lib/resources/azure/azure_generic_resource.rb', line 14

def location
  @location
end

#nameObject

Returns the value of attribute name.



14
15
16
# File 'lib/resources/azure/azure_generic_resource.rb', line 14

def name
  @name
end

#probesObject

Returns the value of attribute probes.



14
15
16
# File 'lib/resources/azure/azure_generic_resource.rb', line 14

def probes
  @probes
end

#totalObject

Returns the value of attribute total.



14
15
16
# File 'lib/resources/azure/azure_generic_resource.rb', line 14

def total
  @total
end

#typeObject

Returns the value of attribute type.



14
15
16
# File 'lib/resources/azure/azure_generic_resource.rb', line 14

def type
  @type
end

Instance Method Details

#parse_resource(resource) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/resources/azure/azure_generic_resource.rb', line 42

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