| Verb | URI | Description | |||
| GET | /servers?image=imageRef&
flavor=flavorRef&
name=serverName&
status=serverStatus&
marker=markerID&limit=int&
changes-since=dateTime
|
List all servers (IDs, names, links) | |||
| GET | /servers/detail?image=imageRef&
flavor=flavorRef&
name=serverName&
status=serverStatus&
marker=markerID&limit=int&
changes-since=dateTime
|
List all servers (all details) | |||
Normal Response Code(s): 200, 203
Error Response Code(s): computeFault (400, 500, …), serviceUnavailable (503), unauthorized (401), forbidden (403), badRequest (400), badMethod (405), overLimit (413)
This operation provides a list of servers
associated with your account. Servers that have
been deleted are not included in this list.
Servers contain a status attribute that can be
used as an indication of the current server state.
Servers with an ACTIVE status are
available for use. Other possible values for the
status attribute include: BUILD,
REBUILD, SUSPENDED,
RESIZE, VERIFY_RESIZE,
PASSWORD, REBOOT,
HARD_REBOOT, DELETED,
UNKNOWN, and ERROR.
The list of servers may be filtered by image,
flavor, name, and status via the respective query
parameters. Image and flavor references may be IDs
or full URLs. When retrieving a list of servers
via the changes-since parameter, the list will
contain servers that have been deleted since the
changes-since time (see Section 3.5, “Efficient Polling with the
Changes-Since Parameter”).
The compute provisioning algorithm has an anti-affinity property that attempts to spread out customer VMs across hosts. Under certain situations, VMs from the same customer may be placed on the same host. hostId represents the host your server runs on and can be used to determine this scenario if it's relevant to your application.
![]() | Note |
|---|---|
HostId is unique per account and is not globally unique. |
This operation does not require a request body.
Example 4.1. Servers List Response: XML (detail)
<?xml version="1.0" encoding="UTF-8"?>
<servers xmlns="http://docs.openstack.org/compute/api/v1.1"
xmlns:atom="http://www.w3.org/2005/Atom">
<server id="52415800-8b69-11e0-9b19-734f6af67565"
tenantId="1234" userId="5678"
name="sample-server" status="BUILD"
progress="60" hostId="e4d909c290d0fb1ca068ffaddf22cbd0"
updated="2010-10-10T12:00:00Z"
created="2010-08-10T12:00:00Z"
accessIPv4="67.23.10.132"
accessIPv6="::babe:67.23.10.132"
>
<image id="52415800-8b69-11e0-9b19-734f6f006e54">
<atom:link
rel="self"
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"/>
<atom:link
rel="bookmark"
href="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"/>
</image>
<flavor id="52415800-8b69-11e0-9b19-734f216543fd">
<atom:link
rel="self"
href="http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
<atom:link
rel="bookmark"
href="http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
</flavor>
<metadata>
<meta key="Server Label">Web Head 1</meta>
<meta key="Image Version">2.1</meta>
</metadata>
<addresses>
<network id="public">
<ip version="4" addr="67.23.10.132"/>
<ip version="6" addr="::babe:67.23.10.132"/>
<ip version="4" addr="67.23.10.131"/>
<ip version="6" addr="::babe:4317:0A83"/>
</network>
<network id="private">
<ip version="4" addr="10.176.42.16"/>
<ip version="6" addr="::babe:10.176.42.16"/>
</network>
</addresses>
<atom:link
rel="self"
href="http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"/>
<atom:link
rel="bookmark"
href="http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"/>
</server>
<server id="52415800-8b69-11e0-9b19-734f1f1350e5"
tenantId="1234" userId="5678"
name="sample-server2"
status="ACTIVE" hostId="9e107d9d372bb6826bd81d3542a419d6"
updated="2010-10-10T12:00:00Z"
created="2010-08-10T12:00:00Z"
accessIPv4="67.23.10.133"
accessIPv6="::babe:67.23.10.133"
>
<image id="52415800-8b69-11e0-9b19-734f5736d2a2">
<atom:link
rel="self"
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
<atom:link
rel="bookmark"
href="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
</image>
<flavor id="52415800-8b69-11e0-9b19-734f216543fd">
<atom:link
rel="self"
href="http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
<atom:link
rel="bookmark"
href="http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
</flavor>
<metadata>
<meta key="Server Label">DB 1</meta>
</metadata>
<addresses>
<network id="public">
<ip version="4" addr="67.23.10.133"/>
<ip version="6" addr="::babe:67.23.10.133"/>
</network>
<network id="private">
<ip version="4" addr="10.176.42.17"/>
<ip version="6" addr="::babe:10.176.42.17"/>
</network>
</addresses>
<atom:link
rel="self"
href="http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f1f1350e5"/>
<atom:link
rel="bookmark"
href="http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f1f1350e5"/>
</server>
</servers>
Example 4.2. Servers List Response: JSON (detail)
{
"servers": [
{
"id": "52415800-8b69-11e0-9b19-734f6af67565",
"tenantId": "1234",
"userId": "5678",
"name": "sample-server",
"updated": "2010-10-10T12:00:00Z",
"created": "2010-08-10T12:00:00Z",
"hostId": "e4d909c290d0fb1ca068ffaddf22cbd0",
"status": "BUILD",
"progress": 60,
"accessIPv4" : "67.23.10.132",
"accessIPv6" : "::babe:67.23.10.132",
"image" : {
"id": "52415800-8b69-11e0-9b19-734f6f006e54",
"links": [
{
"rel": "self",
"href": "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
},
{
"rel": "bookmark",
"href": "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
}
]
},
"flavor" : {
"id": "52415800-8b69-11e0-9b19-734f216543fd",
"links": [
{
"rel": "self",
"href": "http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
},
{
"rel": "bookmark",
"href": "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
}
]
},
"addresses": {
"public" : [
{
"version": 4,
"addr": "67.23.10.132"
},
{
"version": 6,
"addr": "::babe:67.23.10.132"
},
{
"version": 4,
"addr": "67.23.10.131"
},
{
"version": 6,
"addr": "::babe:4317:0A83"
}
],
"private" : [
{
"version": 4,
"addr": "10.176.42.16"
},
{
"version": 6,
"addr": "::babe:10.176.42.16"
}
]
},
"metadata": {
"Server Label": "Web Head 1",
"Image Version": "2.1"
},
"links": [
{
"rel": "self",
"href": "http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"
},
{
"rel": "bookmark",
"href": "http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"
}
]
},
{
"id": "52415800-8b69-11e0-9b19-734f1f1350e5",
"userId": "5678",
"name": "sample-server2",
"tenantId": "1234",
"updated": "2010-10-10T12:00:00Z",
"created": "2010-08-10T12:00:00Z",
"hostId": "9e107d9d372bb6826bd81d3542a419d6",
"status": "ACTIVE",
"accessIPv4" : "67.23.10.133",
"accessIPv6" : "::babe:67.23.10.133",
"image" : {
"id": "52415800-8b69-11e0-9b19-734f5736d2a2",
"links": [
{
"rel": "self",
"href": "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
},
{
"rel": "bookmark",
"href": "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
}
]
},
"flavor" : {
"id": "52415800-8b69-11e0-9b19-734f216543fd",
"links": [
{
"rel": "self",
"href": "http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
},
{
"rel": "bookmark",
"href": "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
}
]
},
"addresses": {
"public" : [
{
"version": 4,
"addr": "67.23.10.133"
},
{
"version": 6,
"addr": "::babe:67.23.10.133"
}
],
"private" : [
{
"version": 4,
"addr": "10.176.42.17"
},
{
"version": 6,
"addr": "::babe:10.176.42.17"
}
]
},
"metadata": {
"Server Label": "DB 1"
},
"links": [
{
"rel": "self",
"href": "http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f1f1350e5"
},
{
"rel": "bookmark",
"href": "http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f1f1350e5"
}
]
}
]
}
![[Note]](../common/images/admon/note.png)
