此内容没有您所选择的语言版本。

3.3. Example: List Host Collection


This example retrieves a representation of the host collection and shows a Red Hat Gluster Storage server named host1 registered with the default cluster.

Example 3.3. List hosts collection

GET /api/hosts HTTP/1.1
Accept: application/xml
Copy to Clipboard Toggle word wrap
cURL command:
curl -X GET -H "Accept: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC Host]/api/hosts
The API returns the following representation:
HTTP/1.1 200 OK
Accept: application/xml

<hosts>
    <host href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6" id="411fd862-1469-4dff-ad5a-a7be364d83a6">
        <actions>
            <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/approve" rel="approve"/>
            <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/forceselectspm" rel="forceselectspm"/>
            <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/iscsilogin" rel="iscsilogin"/>
            <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/iscsidiscover" rel="iscsidiscover"/>
            <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/commitnetconfig" rel="commitnetconfig"/>
            <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/fence" rel="fence"/>
            <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/deactivate" rel="deactivate"/>
            <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/install" rel="install"/>
            <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/activate" rel="activate"/>
        </actions>
        <name>host1</name>
        <comment></comment>
        <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/nics" rel="nics"/>
        <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/tags" rel="tags"/>
        <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/permissions" rel="permissions"/>
        <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/statistics" rel="statistics"/>
        <link href="/api/hosts/411fd862-1469-4dff-ad5a-a7be364d83a6/hooks" rel="hooks"/>
        <address>10.70.42.154</address>
        <certificate>
            <organization>TestOrg</organization>
            <subject>O=TestOrg,CN=10.70.42.154</subject>
        </certificate>
        <status>
            <state>up</state>
        </status>
        <cluster href="/api/clusters/02b2bd03-5e54-45f9-9302-33a4ba96eb32" id="02b2bd03-5e54-45f9-9302-33a4ba96eb32"/>
        <port>54321</port>
        <type>rhel</type>
        <storage_manager priority="5">false</storage_manager>
        <version major="4" minor="14" build="7" revision="2" full_version="vdsm-4.14.7.2-1.el6rhs"/>
        <hardware_information>
            <manufacturer>Red Hat</manufacturer>
            <version>6Server-6.4.0.4.el6</version>
            <serial_number>00000000-0000-0000-0000-00259078DB32</serial_number>
            <product_name>RHEV Hypervisor</product_name>
            <uuid>504dd302-0c14-4153-ae48-a0b2fa9484ce</uuid>
            <family>Red Hat Enterprise Linux</family>
        </hardware_information>
        <power_management type="apc">
            <enabled>false</enabled>
            <options/>
        </power_management>
        <ksm>
            <enabled>false</enabled>
        </ksm>
        <transparent_hugepages>
            <enabled>true</enabled>
        </transparent_hugepages>
        <iscsi>
            <initiator>iqn.1994-05.com.redhat:6f8b848932c9</initiator>
        </iscsi>
        <ssh>
            <port>22</port>
            <fingerprint>e7:02:ba:01:72:35:1c:5b:5a:ac:ba:b6:da:5d:23:8e</fingerprint>
        </ssh>
        <cpu>
            <topology sockets="1" cores="1" threads="1"/>
            <name>Intel Xeon E312xx (Sandy Bridge)</name>
            <speed>2200</speed>
        </cpu>
        <memory>2103443456</memory>        <max_scheduling_memory>1698693120</max_scheduling_memory>
        <summary>
            <active>0</active>
            <migrating>0</migrating>
            <total>0</total>
        </summary>
        <os type="RHEL">
            <version full_version="6Server - 6.5.0.1.el6"/>
        </os>
        <libvirt_version major="0" minor="10" build="2" revision="0" full_version="libvirt-0.10.2-29.el6_5.9"/>
    </host>
</hosts>
Copy to Clipboard Toggle word wrap
Note the id code of your Default server. This code identifies this host in relation to other resources of your virtual environment.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat