Get List of Auto-Import Rules

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

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

XML Request Example

1
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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<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