Get List of Auto Import Rules

To get the list of all available auto import rules, use the following request:

GET /settings/hypervisors/:hypervisor_id/auto_import_rules.xml
GET /settings/hypervisors/:hypervisor_id/auto_import_rules.json

XML Request Example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/settings/hypervisors/152/auto_import_rules.xml 

JSON Request Example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password --url http://onapp.test/settings/hypervisors/152/auto_import_rules.json 

XML Output Example

<auto_import_rules type="array">
 <auto_import_rule>
	<id type="integer">18</id>
	<event_type>vm_created</event_type>
	<label>All DC machines</label>
	<source_type>VCenter::Datacenter</source_type>
	<source_id type="integer">452</source_id>
	<target_type>User</target_type>
	<target_id type="integer">513</target_id>
	<hypervisor_id type="integer">862</hypervisor_id>
 </auto_import_rule>
 <auto_import_rule>
	<id type="integer">20</id>
	<event_type>vm_created</event_type>
	<label>test_rule</label>
	<source_type>VCenter::ResourcePool</source_type>
	<source_id type="integer">184</source_id>
	<target_type>User</target_type>
	<target_id type="integer">1</target_id>
	<hypervisor_id type="integer">862</hypervisor_id>
 </auto_import_rule>
</auto_import_rules>

Where:

id - the ID of an auto import rule
event_type - the type of event with which this rule will be associated
label - the label of auto import rule specified by the user
source_type - the type of vCenter source
source_id - the ID of the vCenter source
target_type - the type of target user
target_id - the ID of the user
hypervisor_id - the ID of the compute resource