Class: AnsibleTowerClient::Inventory

Inherits:
BaseModel show all
Defined in:
lib/ansible_tower_client/base_models/inventory.rb

Instance Attribute Summary

Attributes inherited from BaseModel

#api, #raw_hash

Instance Method Summary collapse

Methods inherited from BaseModel

base_class, create, create!, #destroy, #destroy!, endpoint, #hashify, #initialize, #override_raw_attributes, #save, #save!, #update_attributes, #update_attributes!

Methods inherited from HashModel

#==, #[], #initialize, #inspect, #to_h, #to_json

Constructor Details

This class inherits a constructor from AnsibleTowerClient::BaseModel

Instance Method Details

#inventory_sourcesObject



3
4
5
# File 'lib/ansible_tower_client/base_models/inventory.rb', line 3

def inventory_sources
  Collection.new(api, api.inventory_source_class).find_all_by_url(related['inventory_sources'])
end

#root_groupsObject



13
14
15
# File 'lib/ansible_tower_client/base_models/inventory.rb', line 13

def root_groups
  Collection.new(api).find_all_by_url(related['root_groups'])
end

#update_all_inventory_sourcesObject



7
8
9
10
11
# File 'lib/ansible_tower_client/base_models/inventory.rb', line 7

def update_all_inventory_sources
  inventory_sources.each do |inventory_source|
    inventory_source.update if inventory_source.can_update?
  end
end