Skip to content

Commit

Permalink
Merge pull request #17557 from xlab-si/add-physical-infra-default-col…
Browse files Browse the repository at this point in the history
…lections

Add physical infra related default collections
  • Loading branch information
agrare authored Jun 12, 2018
2 parents afae58a + 6455b1c commit 419aa35
Showing 1 changed file with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,51 @@ def physical_server_details(extra_attributes = {})

attributes.merge!(extra_attributes)
end

def computer_systems(extra_attributes = {})
attributes = {
:model_class => ::ComputerSystem,
:association => :computer_systems,
:manager_ref => [:managed_entity],
:parent_inventory_collections => [:physical_servers],
}

attributes.merge!(extra_attributes)
end

def hardwares(extra_attributes = {})
attributes = {
:model_class => ::Hardware,
:association => :hardwares,
:manager_ref => [:computer_system],
:parent_inventory_collections => [:physical_servers],
}

attributes.merge!(extra_attributes)
end

def physical_racks(extra_attributes = {})
attributes = {
:model_class => ::PhysicalRack,
:association => :physical_racks,
:builder_params => {
:ems_id => ->(persister) { persister.manager.id }
}
}

attributes.merge!(extra_attributes)
end

def physical_chassis(extra_attributes = {})
attributes = {
:model_class => ::PhysicalChassis,
:association => :physical_chassis,
:builder_params => {
:ems_id => ->(persister) { persister.manager.id }
}
}

attributes.merge!(extra_attributes)
end
end
end

0 comments on commit 419aa35

Please sign in to comment.