Skip to content

Commit 0cc2991

Browse files
Add VM inventory CSV endpoint to api-ref docs
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
1 parent 4598337 commit 0cc2991

3 files changed

Lines changed: 68 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vm_id,vm_name,guest_id,firmware,num_cpu,memory_mb,nested_virtualization,dynamic_memory_enabled,secure_boot,os_type,disks,nics,boot_order,hostname,parent_vapp,host,power_state
2+
4cb7e5e1-d3c4-4b0a-8742-f2b1b3d9a1c2,web-server-01,ubuntu64Guest,efi,4,8192,False,True,False,linux,100GB; 50GB,Network adapter 1|00:50:56:aa:bb:cc|VM Network|10.0.0.10,,,web-server-01,,esxi-host-01.example.com,poweredOn
3+
9fa23b11-7e2a-4c10-a3f8-0d1e2f3c4a5b,db-server-01,windows9Server64Guest,bios,8,16384,False,False,False,windows,200GB; 100GB,Network adapter 1|00:50:56:aa:cc:dd|VM Network|10.0.0.20,,db-vapp,db-server-01,esxi-host-02.example.com,poweredOn

coriolis/api-refs/source/endpoint.inc

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,64 @@ Response
325325
.. literalinclude:: ../api_samples/endpoint/endpoint-instance-show-resp.json
326326
:language: javascript
327327

328+
Get Endpoint VM Inventory
329+
=========================
330+
331+
.. rest_method:: GET /endpoints/{endpoint_id}/inventory
332+
333+
Exports the full VM inventory of an endpoint as a CSV file.
334+
335+
**Preconditions**
336+
337+
The endpoint must exist and the platform must support inventory export.
338+
339+
Normal response codes: 200
340+
341+
Error response codes: unauthorized(401), forbidden(403),
342+
itemNotFound(404)
343+
344+
Request
345+
-------
346+
347+
.. rest_parameters:: parameters.yaml
348+
349+
- endpoint_id : endpoint_id_path
350+
- env : inventory_source_env
351+
352+
Response
353+
--------
354+
355+
The response body is a UTF-8 encoded CSV file with the following columns:
356+
357+
- **vm_id** – Unique identifier (UUID) of the VM.
358+
- **vm_name** – Display name of the VM.
359+
- **guest_id** – Raw VMware guest OS identifier (e.g. ``ubuntu64Guest``).
360+
- **firmware** – Firmware type (``bios`` or ``efi``).
361+
- **num_cpu** – Number of vCPUs.
362+
- **memory_mb** – Memory in megabytes.
363+
- **nested_virtualization** – Whether nested virtualisation is enabled.
364+
- **dynamic_memory_enabled** – Whether dynamic memory is enabled.
365+
- **secure_boot** – Whether EFI Secure Boot is enabled.
366+
- **os_type** – Coriolis-normalised OS type (e.g. ``linux``, ``windows``).
367+
- **disks** – Semicolon-separated list of disk sizes (e.g. ``100GB; 50GB``).
368+
- **nics** – Semicolon-separated list of NIC entries, each formatted as
369+
``label|mac[|network[|ip1,ip2,...]]``.
370+
- **boot_order** – Semicolon-separated boot device list. May be empty if the
371+
provider does not populate boot order information.
372+
- **hostname** – Guest hostname as reported by VMware Tools (empty if tools
373+
are not running).
374+
- **parent_vapp** – Name of the parent vApp, if any.
375+
- **host** – ESXi host the VM is currently running on.
376+
- **power_state** – Current power state (e.g. ``poweredOn``, ``poweredOff``).
377+
378+
The response is returned with ``Content-Type: text/csv`` and a
379+
``Content-Disposition: attachment`` header suggesting a filename of the form
380+
``vm_inventory_{endpoint_id}.csv``.
381+
382+
**Example VM Inventory CSV Response**
383+
384+
.. literalinclude:: ../api_samples/endpoint/endpoint-inventory-resp.csv
385+
328386
Get Endpoint Destination Options
329387
================================
330388

coriolis/api-refs/source/parameters.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ instance_refresh:
9696
required: false
9797
type: boolean
9898
default: false
99+
inventory_source_env:
100+
description: |
101+
Optional base64-encoded JSON object containing source environment options
102+
for the inventory export When omitted, the provider's defaults are used.
103+
in: query
104+
required: false
105+
type: string
99106
show_deleted:
100107
description: |
101108
Whether to include deleted resources in the response.

0 commit comments

Comments
 (0)