Skip to content

Commit d7e501d

Browse files
authored
Merge pull request #2560 from aleksandrychev/ENT-7664
Added inventoryFile parameter to the Hosts by class API documentation
2 parents 1200449 + ee3f506 commit d7e501d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

reference/enterprise-api-ref/host.markdown

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ and resume being collected from after being deleted.
154154
Output format. Default value is `json`. Allowed values: `json`, `yaml`.
155155
* **withInventory** *(boolean)*
156156
Include inventory data to the API response. Default value is `false`. Allowed values: `true`, `false`
157+
* **inventoryFile** *(boolean)*
158+
Make hosts' children values objects which aligns with Ansible inventory that is sourced from a file (so this format is appropriate for caching responses), wby default when `inventoryFile` is `false`, the output format aligns with Ansible inventory sourced from a script. Default value is `false`. Allowed values: `true`, `false`
157159

158160
**CURL unfiltered request example**
159161

@@ -183,6 +185,34 @@ curl -k --user admin:admin -X GET https://hub.example.com/api/hosts/by-class
183185
}
184186
```
185187

188+
**inventoryFile=true**
189+
190+
```
191+
curl -k --user admin:admin -X GET https://hub.example.com/api/hosts/by-class?inventoryFile=true
192+
```
193+
194+
**Example response:**
195+
196+
```
197+
{
198+
"10_0_2_15": {
199+
"hosts": [
200+
"ubuntu-xenial": {}
201+
]
202+
},
203+
"127_0_0_1": {
204+
"hosts": [
205+
"ubuntu-xenial": {}
206+
]
207+
},
208+
"ubuntu_16": {
209+
"hosts": [
210+
"ubuntu-xenial": {}
211+
]
212+
}
213+
}
214+
```
215+
186216
**CURL request with inventory data example**
187217

188218
```
@@ -440,3 +470,6 @@ HTTP 200 Ok
440470
* **count**
441471
The bootstrapped hosts to the hub count.
442472

473+
## History
474+
475+
* `inventoryFile=true` parameter added in CFEngine 3.19.0, 3.18.1

0 commit comments

Comments
 (0)