Add Auto-Import Rule
To add an auto-import rule, use the following request:
1
2
| POST /settings/hypervisors/:hypervisor_id/auto_import_rules.xml
POST /settings/hypervisors/:hypervisor_id/auto_import_rules.json
|
XML Request Example
1
| curl -i -X POST http://onapp.test/settings/hypervisors/152/auto_import_rules.xml -d '<auto_import_rule><label>Test auto import label</label><source_type>VCenter::Cluster</source_type><source_id type="integer">1</source_id><target_type>User</target_type><target_id type="integer">1</target_id></auto_import_rule>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'
|
JSON Request Example
1
| curl -i -X POST http://onapp.test/settings/hypervisors/152/auto_import_rules.json -d '{"label": "Test auto import label", "source_type": "VCenter::Cluster", "source_id": 1, "target_type": "User", "target_id": 1}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'
|
Where:
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