Clean up extended server output samples
The extended status extension was testing list instead of get and the extended server attribute extension was misnaming its sample files. This makes the names of the samples consistent. Change-Id: I5b6f8d00c85d7817775c190b2a7645a47f8085db DocImpact: The api sample site may need to be updated as well
This commit is contained in:
parent
104efb3b8b
commit
1ea366be70
57
doc/api_samples/OS-EXT-STS/server-get-resp.json
Normal file
57
doc/api_samples/OS-EXT-STS/server-get-resp.json
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"server": {
|
||||
"OS-EXT-STS:power_state": 1,
|
||||
"OS-EXT-STS:task_state": null,
|
||||
"OS-EXT-STS:vm_state": "active",
|
||||
"accessIPv4": "",
|
||||
"accessIPv6": "",
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "192.168.0.3",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
"created": "2013-02-07T19:35:09Z",
|
||||
"flavor": {
|
||||
"id": "1",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/openstack/flavors/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"hostId": "570eff4776ab310707d11d181037337197086998a8b3305c90bf87c8",
|
||||
"id": "ecb5e433-fa75-4db2-af3d-a29ae8618edc",
|
||||
"image": {
|
||||
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v2/openstack/servers/ecb5e433-fa75-4db2-af3d-a29ae8618edc",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/openstack/servers/ecb5e433-fa75-4db2-af3d-a29ae8618edc",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"My Server Name": "Apache1"
|
||||
},
|
||||
"name": "new-server-test",
|
||||
"progress": 0,
|
||||
"status": "ACTIVE",
|
||||
"tenant_id": "openstack",
|
||||
"updated": "2013-02-07T19:35:10Z",
|
||||
"user_id": "fake"
|
||||
}
|
||||
}
|
19
doc/api_samples/OS-EXT-STS/server-get-resp.xml
Normal file
19
doc/api_samples/OS-EXT-STS/server-get-resp.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<server xmlns:OS-EXT-STS="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="2013-02-07T19:35:10Z" hostId="372afb648339fb6f22faa0b75fdd8834e2382fe02b352af8d7ee0b84" name="new-server-test" created="2013-02-07T19:35:09Z" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="68647408-85a7-4d9b-85e7-7f1e238983ad" OS-EXT-STS:vm_state="active" OS-EXT-STS:task_state="None" OS-EXT-STS:power_state="1">
|
||||
<image id="70a599e0-31e7-49b7-b260-868f441e862b">
|
||||
<atom:link href="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
|
||||
</image>
|
||||
<flavor id="1">
|
||||
<atom:link href="http://openstack.example.com/openstack/flavors/1" rel="bookmark"/>
|
||||
</flavor>
|
||||
<metadata>
|
||||
<meta key="My Server Name">Apache1</meta>
|
||||
</metadata>
|
||||
<addresses>
|
||||
<network id="private">
|
||||
<ip version="4" addr="192.168.0.3"/>
|
||||
</network>
|
||||
</addresses>
|
||||
<atom:link href="http://openstack.example.com/v2/openstack/servers/68647408-85a7-4d9b-85e7-7f1e238983ad" rel="self"/>
|
||||
<atom:link href="http://openstack.example.com/openstack/servers/68647408-85a7-4d9b-85e7-7f1e238983ad" rel="bookmark"/>
|
||||
</server>
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"servers": [
|
||||
{
|
||||
"id": "a5dd5b16-552c-441c-8a03-f19c4da9e6f5",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v2/openstack/servers/a5dd5b16-552c-441c-8a03-f19c4da9e6f5",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/openstack/servers/a5dd5b16-552c-441c-8a03-f19c4da9e6f5",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "new-server-test"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<servers xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
|
||||
<server name="new-server-test" id="7128d3b9-1993-402c-91ca-ed59a0193ffa">
|
||||
<atom:link href="http://openstack.example.com/v2/openstack/servers/7128d3b9-1993-402c-91ca-ed59a0193ffa" rel="self"/>
|
||||
<atom:link href="http://openstack.example.com/openstack/servers/7128d3b9-1993-402c-91ca-ed59a0193ffa" rel="bookmark"/>
|
||||
</server>
|
||||
</servers>
|
@ -0,0 +1,57 @@
|
||||
{
|
||||
"server": {
|
||||
"OS-EXT-STS:task_state": null,
|
||||
"OS-EXT-STS:vm_state": "active",
|
||||
"OS-EXT-STS:power_state": 1,
|
||||
"accessIPv4": "",
|
||||
"accessIPv6": "",
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "%(ip)s",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
"created": "%(timestamp)s",
|
||||
"flavor": {
|
||||
"id": "1",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/openstack/flavors/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"hostId": "%(hostid)s",
|
||||
"id": "%(id)s",
|
||||
"image": {
|
||||
"id": "%(uuid)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/openstack/images/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v2/openstack/servers/%(id)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/openstack/servers/%(id)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"My Server Name": "Apache1"
|
||||
},
|
||||
"name": "new-server-test",
|
||||
"progress": 0,
|
||||
"status": "ACTIVE",
|
||||
"tenant_id": "openstack",
|
||||
"updated": "%(timestamp)s",
|
||||
"user_id": "fake"
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<server xmlns:OS-EXT-STS="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="%(timestamp)s" hostId="%(hostid)s" name="new-server-test" created="%(timestamp)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" OS-EXT-STS:vm_state="active" OS-EXT-STS:task_state="None" OS-EXT-STS:power_state="1">
|
||||
<image id="%(uuid)s">
|
||||
<atom:link href="%(host)s/openstack/images/%(uuid)s" rel="bookmark"/>
|
||||
</image>
|
||||
<flavor id="1">
|
||||
<atom:link href="%(host)s/openstack/flavors/1" rel="bookmark"/>
|
||||
</flavor>
|
||||
<metadata>
|
||||
<meta key="My Server Name">Apache1</meta>
|
||||
</metadata>
|
||||
<addresses>
|
||||
<network id="private">
|
||||
<ip version="4" addr="%(ip)s"/>
|
||||
</network>
|
||||
</addresses>
|
||||
<atom:link href="%(host)s/v2/openstack/servers/%(id)s" rel="self"/>
|
||||
<atom:link href="%(host)s/openstack/servers/%(id)s" rel="bookmark"/>
|
||||
</server>
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"servers": [
|
||||
{
|
||||
"id": "%(id)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v2/openstack/servers/%(id)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/openstack/servers/%(id)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "new-server-test"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<servers xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
|
||||
<server name="new-server-test" id="%(id)s">
|
||||
<atom:link href="%(host)s/v2/openstack/servers/%(id)s" rel="self"/>
|
||||
<atom:link href="%(host)s/openstack/servers/%(id)s" rel="bookmark"/>
|
||||
</server>
|
||||
</servers>
|
@ -1175,7 +1175,7 @@ class ExtendedServerAttributesJsonTest(ServersSampleBase):
|
||||
".extended_server_attributes" + \
|
||||
".Extended_server_attributes"
|
||||
|
||||
def test_extended_server_attrs_get(self):
|
||||
def test_show(self):
|
||||
uuid = self._post_server()
|
||||
|
||||
response = self._do_get('servers/%s' % uuid)
|
||||
@ -1184,10 +1184,10 @@ class ExtendedServerAttributesJsonTest(ServersSampleBase):
|
||||
subs['id'] = uuid
|
||||
subs['instance_name'] = 'instance-\d{8}'
|
||||
subs['hypervisor_hostname'] = r'[\w\.\-]+'
|
||||
return self._verify_response('extended-server-attrs-get',
|
||||
return self._verify_response('server-get-resp',
|
||||
subs, response)
|
||||
|
||||
def test_extended_server_attrs_list(self):
|
||||
def test_detail(self):
|
||||
uuid = self._post_server()
|
||||
|
||||
response = self._do_get('servers/detail')
|
||||
@ -1196,7 +1196,7 @@ class ExtendedServerAttributesJsonTest(ServersSampleBase):
|
||||
subs['id'] = uuid
|
||||
subs['instance_name'] = 'instance-\d{8}'
|
||||
subs['hypervisor_hostname'] = r'[\w\.\-]+'
|
||||
return self._verify_response('extended-server-attrs-list',
|
||||
return self._verify_response('servers-detail-resp',
|
||||
subs, response)
|
||||
|
||||
|
||||
@ -2220,15 +2220,15 @@ class QuotasSampleXmlTests(QuotasSampleJsonTests):
|
||||
|
||||
class ExtendedStatusSampleJsonTests(ServersSampleBase):
|
||||
extension_name = ("nova.api.openstack.compute.contrib"
|
||||
".extended_status.Extended_status")
|
||||
".extended_status.Extended_status")
|
||||
|
||||
def test_show(self):
|
||||
uuid = self._post_server()
|
||||
response = self._do_get('servers')
|
||||
response = self._do_get('servers/%s' % uuid)
|
||||
self.assertEqual(response.status, 200)
|
||||
subs = self._get_regexes()
|
||||
subs['id'] = uuid
|
||||
return self._verify_response('servers-list-resp', subs, response)
|
||||
subs['hostid'] = '[a-f0-9]+'
|
||||
return self._verify_response('server-get-resp', subs, response)
|
||||
|
||||
def test_detail(self):
|
||||
uuid = self._post_server()
|
||||
@ -2862,7 +2862,7 @@ class ExtendedAvailabilityZoneJsonTests(ServersSampleBase):
|
||||
".extended_availability_zone"
|
||||
".Extended_availability_zone")
|
||||
|
||||
def test_get(self):
|
||||
def test_show(self):
|
||||
uuid = self._post_server()
|
||||
response = self._do_get('servers/%s' % uuid)
|
||||
self.assertEqual(response.status, 200)
|
||||
|
Loading…
Reference in New Issue
Block a user