6.4. Capabilities Example

The following example demonstrates a sample representation of capabilities.

Example 6.1. XML representation of capabilities

An API user performs the following request:
GET /api/capabilities HTTP/1.1
Accept: application/xml
The API returns the following representation:
HTTP/1.1 200 OK
Content-Type: application/xml

<capabilities>
    <version minor="0" major="3">
        <current>true</current>
        <features>
            <transparent_hugepages/>
        </features>
        <cpus>
            <cpu id="Intel Conroe Family">
                <level>3</level>
            </cpu>
            <cpu id="Intel Penryn Family">
                <level>4</level>
            </cpu>
            <cpu id="Intel Nehalem Family">
                <level>5</level>
            </cpu>
            <cpu id="Intel Westmere Family">
                <level>6</level>
            </cpu>
            <cpu id="AMD Opteron G1">
                <level>2</level>
            </cpu>
            <cpu id="AMD Opteron G2">
                <level>3</level>
            </cpu>
            <cpu id="AMD Opteron G3">
                <level>4</level>
            </cpu>
        </cpus>
        <power_managers>
            <power_management type="alom">
                <options>
                    <option type="bool" name="secure"/>
                    <option type="int" name="port"/>
                </options>
            </power_management>
            <power_management type="apc">
                <options>
                    <option type="bool" name="secure"/>
                    <option type="int" name="port"/>
                    <option type="int" name="slot"/>
                </options>
            </power_management>
            <power_management type="bladecenter">
                <options>
                    <option type="bool" name="secure"/>
                    <option type="int" name="port"/>
                    <option type="int" name="slot"/>
                </options>
            </power_management>
            ...
        </power_managers>
        <fence_types>
            <fence_type>manual</fence_type>
            <fence_type>restart</fence_type>
            <fence_type>start</fence_type>
            <fence_type>stop</fence_type>
            <fence_type>status</fence_type>
        </fence_types>
        <storage_types>
            <storage_type>iscsi</storage_type>
            <storage_type>fcp</storage_type>
            <storage_type>nfs</storage_type>
            <storage_type>localfs</storage_type>
        </storage_types>
        <storage_domain_types>
            <storage_domain_type>data</storage_domain_type>
            <storage_domain_type>iso</storage_domain_type>
            <storage_domain_type>export</storage_domain_type>
        </storage_domain_types>
        <vm_types>
            <vm_type>desktop</vm_type>
            <vm_type>server</vm_type>
        </vm_types>
        <boot_devices>
            <boot_device>cdrom</boot_device>
            <boot_device>hd</boot_device>
            <boot_device>network</boot_device>
        </boot_devices>
        <display_types>
            <display_type>vnc</display_type>
            <display_type>spice</display_type>
        </display_types>
        <nic_interfaces>
            <nic_interface>e1000</nic_interface>
            <nic_interface>virtio</nic_interface>
            <nic_interface>rtl8139</nic_interface>
            <nic_interface>rtl8139_virtio</nic_interface>
        </nic_interfaces>
        <disk_types>
            <disk_type>data</disk_type>
            <disk_type>system</disk_type>
        </disk_types>
        <os_types>
            <os_type>unassigned</os_type>
            <os_type>windows_xp</os_type>
            <os_type>windows_2003</os_type>
            <os_type>windows_2008</os_type>
            <os_type>other_linux</os_type>
            <os_type>other</os_type>
            <os_type>rhel_5</os_type>
            <os_type>rhel_4</os_type>
            <os_type>rhel_3</os_type>
            <os_type>windows_2003x64</os_type>
            <os_type>windows_7</os_type>
            <os_type>windows_7x64</os_type>
            <os_type>rhel_5x64</os_type>
            <os_type>rhel_4x64</os_type>
            <os_type>rhel_3x64</os_type>
            <os_type>windows_2008x64</os_type>
            <os_type>windows_2008r2x64</os_type>
            <os_type>rhel_6</os_type>
            <os_type>rhel_6x64</os_type>
        </os_types>
        <disk_formats>
            <disk_format>cow</disk_format>
            <disk_format>raw</disk_format>
        </disk_formats>
        <disk_interfaces>
            <disk_interface>ide</disk_interface>
            <disk_interface>virtio</disk_interface>
        </disk_interfaces>
        <vm_affinities>
            <affinity>migratable</affinity>
            <affinity>user_migratable</affinity>
            <affinity>pinned</affinity>
        </vm_affinities>
        <custom_properties>
            <custom_property regexp="^(true|false)$" name="sap_agent"/>
            <custom_property regexp="^[0-9]+$" name="sndbuf"/>
            <custom_property
              regexp="^(([a-zA-Z0-9_]*):(true|false))(,(([a-zA-Z0-9_]*):(true|false)))*$" name="vhost"/>
            <custom_property
              regexp="^(none|writeback|writethrough)$" name="viodiskcache"/>
        </custom_properties>
        <boot_protocols>
            <boot_protocol>dhcp</boot_protocol>
            <boot_protocol>static</boot_protocol>
        </boot_protocols>
        <error_handling>
            <on_error>migrate</on_error>
            <on_error>do_not_migrate</on_error>
            <on_error>migrate_highly_available</on_error>
        </error_handling>
        <storage_formats>
            <format>v1</format>
            <format>v2</format>
        </storage_formats>
    </version>
    ...
    <permits>
        <permit id="1">
            <name>create_vm</name>
            <administrative>false</administrative>
        </permit>
        <permit id="2">
            <name>delete_vm</name>
            <administrative>false</administrative>
        </permit>
        <permit id="3">
            <name>edit_vm_properties</name>
            <administrative>false</administrative>
        </permit>
        <permit id="4">
            <name>vm_basic_operations</name>
            <administrative>false</administrative>
        </permit>
        ...
    </permits>
    <scheduling_policies>
        <policy>evenly_distributed</policy>
        <policy>power_saving</policy>
    </scheduling_policies>
</capabilities>