Querying the Automate Domains and triggering actions on domains is provided via the following entrypoint:
/api/automate_domains
Querying the Automate Domains can be done via GET on the /api/automate_domains entrypoint and can be queried like any other collection:
GET /api/automate_domains
{
"name": "automate_domains",
"count": 9,
"subcount": 9,
"resources": [
{
"href": "http://localhost:3000/api/automate_domains/2352"
},
{
"href": "http://localhost:3000/api/automate_domains/2347"
},
...
],
"actions": [
{
"name": "query",
"method": "post",
"href": "http://localhost:3000/api/automate_domains"
},
{
"name": "refresh_from_source",
"method": "post",
"href": "http://localhost:3000/api/automate_domains"
}
]
}
Accessing individual domains can be done via their numeric id or their name (case sensitive) as follows:
GET /api/automate_domains/2352
GET /api/automate_domains/ManageIQ
When Automate domains are imported from external sources, i.e. Git, the refresh_from_source will re-fetch the Automate domain from external source and refresh the automate domain. This will refetch the Domain from the same reference, i.e. branch or tag and name.
POST /api/automate_domains/SampleDomain
{
"action": "refresh_from_source"
}
All refresh_from_source actions are done asynchronously and the related Task id and href are returned as follows:
{
"success": true,
"message": "Refreshing Automate Domain id:2347 name:'SampleDomain' from git repository",
"task_id": "61",
"task_href": "http://localhost:3000/api/tasks/61",
"href": "http://localhost:3000/api/automate_domains/SampleDomain"
}
If the Domain needs to be refreshed from a different branch or tag and name, the following can be passed in with the refresh_from_source action:
{
"action": "refresh_from_source",
"resource" : {
"ref_type" : "branch" | "tag",
"ref" : "other_branch_or_tag_name"
}
}