Class: Inspec::Resources::AzureGenericResource
- Inherits:
-
AzureResourceBase
- Object
- AzureResourceBase
- Inspec::Resources::AzureGenericResource
- Defined in:
- lib/resources/azure/azure_generic_resource.rb
Instance Attribute Summary collapse
-
#counts ⇒ Object
Returns the value of attribute counts.
-
#filter ⇒ Object
Returns the value of attribute filter.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#probes ⇒ Object
Returns the value of attribute probes.
-
#total ⇒ Object
Returns the value of attribute total.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from AzureResourceBase
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ AzureGenericResource
constructor
A new instance of AzureGenericResource.
- #parse_resource(resource) ⇒ Object
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 31 32 |
# File 'lib/resources/azure/azure_generic_resource.rb', line 18 def initialize(opts = {}) warn "[DEPRECATED] use a specific azure resources instead of 'azure_generic_resource'. See https://github.com/inspec/inspec/issues/3131" # 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
#counts ⇒ Object
Returns the value of attribute counts.
16 17 18 |
# File 'lib/resources/azure/azure_generic_resource.rb', line 16 def counts @counts end |
#filter ⇒ Object
Returns the value of attribute filter.
16 17 18 |
# File 'lib/resources/azure/azure_generic_resource.rb', line 16 def filter @filter end |
#location ⇒ Object
Returns the value of attribute location.
16 17 18 |
# File 'lib/resources/azure/azure_generic_resource.rb', line 16 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/resources/azure/azure_generic_resource.rb', line 16 def name @name end |
#probes ⇒ Object
Returns the value of attribute probes.
16 17 18 |
# File 'lib/resources/azure/azure_generic_resource.rb', line 16 def probes @probes end |
#total ⇒ Object
Returns the value of attribute total.
16 17 18 |
# File 'lib/resources/azure/azure_generic_resource.rb', line 16 def total @total end |
#type ⇒ Object
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
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/resources/azure/azure_generic_resource.rb', line 44 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 |