Add v3 API samples for rescue
Partially implements blueprint v3-api-unittests Change-Id: I467e0f1ab5758f81698664ca198ebab0eb979cf4
This commit is contained in:
parent
91de035005
commit
e59689fc1c
56
doc/v3/api_samples/os-rescue/server-get-resp-rescue.json
Normal file
56
doc/v3/api_samples/os-rescue/server-get-resp-rescue.json
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
"server": {
|
||||
"access_ip_v4": "",
|
||||
"access_ip_v6": "",
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "192.168.0.3",
|
||||
"mac_addr": "aa:bb:cc:dd:ee:ff",
|
||||
"type": "fixed",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
"created": "2013-09-18T07:22:09Z",
|
||||
"flavor": {
|
||||
"id": "1",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/flavors/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"host_id": "f04994c5b4aac1cacbb83b09c2506e457d97dd54f620961624574690",
|
||||
"id": "2fd0c66b-50af-41d2-9253-9fa41e7e8dd8",
|
||||
"image": {
|
||||
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_name": null,
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v3/servers/2fd0c66b-50af-41d2-9253-9fa41e7e8dd8",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/servers/2fd0c66b-50af-41d2-9253-9fa41e7e8dd8",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"My Server Name": "Apache1"
|
||||
},
|
||||
"name": "new-server-test",
|
||||
"status": "RESCUE",
|
||||
"tenant_id": "openstack",
|
||||
"updated": "2013-09-18T07:22:11Z",
|
||||
"user_id": "fake"
|
||||
}
|
||||
}
|
19
doc/v3/api_samples/os-rescue/server-get-resp-rescue.xml
Normal file
19
doc/v3/api_samples/os-rescue/server-get-resp-rescue.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="RESCUE" updated="2013-09-18T07:22:11Z" user_id="fake" name="new-server-test" created="2013-09-18T07:22:09Z" tenant_id="openstack" access_ip_v4="" host_id="e244b05099c8c9dcf6bf3eba83bf113a81c79ad3e66444ae33e7e85c" id="46d75a5e-8eb5-4268-849a-b109c1fbed45" access_ip_v6="" key_name="None">
|
||||
<image id="70a599e0-31e7-49b7-b260-868f441e862b">
|
||||
<atom:link href="http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
|
||||
</image>
|
||||
<flavor id="1">
|
||||
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
|
||||
</flavor>
|
||||
<metadata>
|
||||
<meta key="My Server Name">Apache1</meta>
|
||||
</metadata>
|
||||
<addresses>
|
||||
<network id="private">
|
||||
<ip version="4" type="fixed" addr="192.168.0.3" mac_addr="aa:bb:cc:dd:ee:ff"/>
|
||||
</network>
|
||||
</addresses>
|
||||
<atom:link href="http://openstack.example.com/v3/servers/46d75a5e-8eb5-4268-849a-b109c1fbed45" rel="self"/>
|
||||
<atom:link href="http://openstack.example.com/servers/46d75a5e-8eb5-4268-849a-b109c1fbed45" rel="bookmark"/>
|
||||
</server>
|
57
doc/v3/api_samples/os-rescue/server-get-resp-unrescue.json
Normal file
57
doc/v3/api_samples/os-rescue/server-get-resp-unrescue.json
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"server": {
|
||||
"access_ip_v4": "",
|
||||
"access_ip_v6": "",
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "192.168.0.3",
|
||||
"mac_addr": "aa:bb:cc:dd:ee:ff",
|
||||
"type": "fixed",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
"created": "2013-09-18T07:22:09Z",
|
||||
"flavor": {
|
||||
"id": "1",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/flavors/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"host_id": "53cd4520a6cc639eeabcae4a0512b93e4675d431002e0b60e2dcfc04",
|
||||
"id": "edfc3905-1f3c-4819-8fc3-a7d8131cfa22",
|
||||
"image": {
|
||||
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_name": null,
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v3/servers/edfc3905-1f3c-4819-8fc3-a7d8131cfa22",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/servers/edfc3905-1f3c-4819-8fc3-a7d8131cfa22",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"My Server Name": "Apache1"
|
||||
},
|
||||
"name": "new-server-test",
|
||||
"progress": 0,
|
||||
"status": "ACTIVE",
|
||||
"tenant_id": "openstack",
|
||||
"updated": "2013-09-18T07:22:12Z",
|
||||
"user_id": "fake"
|
||||
}
|
||||
}
|
19
doc/v3/api_samples/os-rescue/server-get-resp-unrescue.xml
Normal file
19
doc/v3/api_samples/os-rescue/server-get-resp-unrescue.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="2013-09-18T07:22:16Z" user_id="fake" name="new-server-test" created="2013-09-18T07:22:14Z" tenant_id="openstack" access_ip_v4="" progress="0" host_id="1ea4183046453bc628b2c08deaff5dc35ae219f91a1879677307e4ec" id="40555ea8-e995-47fb-8959-9e383f58cdc5" access_ip_v6="" key_name="None">
|
||||
<image id="70a599e0-31e7-49b7-b260-868f441e862b">
|
||||
<atom:link href="http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
|
||||
</image>
|
||||
<flavor id="1">
|
||||
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
|
||||
</flavor>
|
||||
<metadata>
|
||||
<meta key="My Server Name">Apache1</meta>
|
||||
</metadata>
|
||||
<addresses>
|
||||
<network id="private">
|
||||
<ip version="4" type="fixed" addr="192.168.0.3" mac_addr="aa:bb:cc:dd:ee:ff"/>
|
||||
</network>
|
||||
</addresses>
|
||||
<atom:link href="http://openstack.example.com/v3/servers/40555ea8-e995-47fb-8959-9e383f58cdc5" rel="self"/>
|
||||
<atom:link href="http://openstack.example.com/servers/40555ea8-e995-47fb-8959-9e383f58cdc5" rel="bookmark"/>
|
||||
</server>
|
16
doc/v3/api_samples/os-rescue/server-post-req.json
Normal file
16
doc/v3/api_samples/os-rescue/server-post-req.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server" : {
|
||||
"name" : "new-server-test",
|
||||
"image_ref" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"flavor_ref" : "http://openstack.example.com/openstack/flavors/1",
|
||||
"metadata" : {
|
||||
"My Server Name" : "Apache1"
|
||||
},
|
||||
"personality" : [
|
||||
{
|
||||
"path" : "/etc/banner.txt",
|
||||
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
19
doc/v3/api_samples/os-rescue/server-post-req.xml
Normal file
19
doc/v3/api_samples/os-rescue/server-post-req.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<server xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" flavor_ref="http://openstack.example.com/openstack/flavors/1" name="new-server-test">
|
||||
<metadata>
|
||||
<meta key="My Server Name">Apache1</meta>
|
||||
</metadata>
|
||||
<personality>
|
||||
<file path="/etc/banner.txt">
|
||||
ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
|
||||
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
|
||||
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
|
||||
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
|
||||
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
|
||||
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
|
||||
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
|
||||
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
|
||||
b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
|
||||
</file>
|
||||
</personality>
|
||||
</server>
|
16
doc/v3/api_samples/os-rescue/server-post-resp.json
Normal file
16
doc/v3/api_samples/os-rescue/server-post-resp.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server": {
|
||||
"admin_pass": "8RK85ufqhJVq",
|
||||
"id": "edfc3905-1f3c-4819-8fc3-a7d8131cfa22",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v3/servers/edfc3905-1f3c-4819-8fc3-a7d8131cfa22",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/servers/edfc3905-1f3c-4819-8fc3-a7d8131cfa22",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
6
doc/v3/api_samples/os-rescue/server-post-resp.xml
Normal file
6
doc/v3/api_samples/os-rescue/server-post-resp.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" id="46d75a5e-8eb5-4268-849a-b109c1fbed45" admin_pass="rdATBmaKT7my">
|
||||
<metadata/>
|
||||
<atom:link href="http://openstack.example.com/v3/servers/46d75a5e-8eb5-4268-849a-b109c1fbed45" rel="self"/>
|
||||
<atom:link href="http://openstack.example.com/servers/46d75a5e-8eb5-4268-849a-b109c1fbed45" rel="bookmark"/>
|
||||
</server>
|
5
doc/v3/api_samples/os-rescue/server-rescue-req.json
Normal file
5
doc/v3/api_samples/os-rescue/server-rescue-req.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"rescue": {
|
||||
"admin_pass": "MySecretPass"
|
||||
}
|
||||
}
|
3
doc/v3/api_samples/os-rescue/server-rescue-req.xml
Normal file
3
doc/v3/api_samples/os-rescue/server-rescue-req.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rescue xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
admin_pass="MySecretPass"/>
|
3
doc/v3/api_samples/os-rescue/server-rescue.json
Normal file
3
doc/v3/api_samples/os-rescue/server-rescue.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"admin_pass": "MySecretPass"
|
||||
}
|
2
doc/v3/api_samples/os-rescue/server-rescue.xml
Normal file
2
doc/v3/api_samples/os-rescue/server-rescue.xml
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<admin_pass>MySecretPass</admin_pass>
|
3
doc/v3/api_samples/os-rescue/server-unrescue-req.json
Normal file
3
doc/v3/api_samples/os-rescue/server-unrescue-req.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"unrescue": null
|
||||
}
|
2
doc/v3/api_samples/os-rescue/server-unrescue-req.xml
Normal file
2
doc/v3/api_samples/os-rescue/server-unrescue-req.xml
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<unrescue xmlns="http://docs.openstack.org/compute/api/v1.1"/>
|
@ -0,0 +1,56 @@
|
||||
{
|
||||
"server": {
|
||||
"access_ip_v4": "",
|
||||
"access_ip_v6": "",
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "%(ip)s",
|
||||
"version": 4,
|
||||
"mac_addr": "aa:bb:cc:dd:ee:ff",
|
||||
"type": "fixed"
|
||||
}
|
||||
]
|
||||
},
|
||||
"created": "%(timestamp)s",
|
||||
"flavor": {
|
||||
"id": "1",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/flavors/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"host_id": "%(hostid)s",
|
||||
"id": "%(id)s",
|
||||
"image": {
|
||||
"id": "%(uuid)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(glance_host)s/images/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v3/servers/%(id)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/servers/%(id)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"My Server Name": "Apache1"
|
||||
},
|
||||
"name": "new-server-test",
|
||||
"status": "%(status)s",
|
||||
"tenant_id": "openstack",
|
||||
"updated": "%(timestamp)s",
|
||||
"user_id": "fake",
|
||||
"key_name": null
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="%(status)s" updated="%(timestamp)s" host_id="%(hostid)s" name="new-server-test" created="%(timestamp)s" user_id="fake" tenant_id="openstack" access_ip_v4="" access_ip_v6="" id="%(id)s" key_name="None">
|
||||
<image id="%(uuid)s">
|
||||
<atom:link href="%(glance_host)s/images/%(uuid)s" rel="bookmark"/>
|
||||
</image>
|
||||
<flavor id="1">
|
||||
<atom:link href="%(host)s/flavors/1" rel="bookmark"/>
|
||||
</flavor>
|
||||
<metadata>
|
||||
<meta key="My Server Name">Apache1</meta>
|
||||
</metadata>
|
||||
<addresses>
|
||||
<network id="private">
|
||||
<ip version="4" addr="%(ip)s" type="fixed" mac_addr="aa:bb:cc:dd:ee:ff"/>
|
||||
</network>
|
||||
</addresses>
|
||||
<atom:link href="%(host)s/v3/servers/%(id)s" rel="self"/>
|
||||
<atom:link href="%(host)s/servers/%(id)s" rel="bookmark"/>
|
||||
</server>
|
@ -0,0 +1,57 @@
|
||||
{
|
||||
"server": {
|
||||
"access_ip_v4": "",
|
||||
"access_ip_v6": "",
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "%(ip)s",
|
||||
"version": 4,
|
||||
"mac_addr": "aa:bb:cc:dd:ee:ff",
|
||||
"type": "fixed"
|
||||
}
|
||||
]
|
||||
},
|
||||
"created": "%(timestamp)s",
|
||||
"flavor": {
|
||||
"id": "1",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/flavors/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"host_id": "%(hostid)s",
|
||||
"id": "%(id)s",
|
||||
"image": {
|
||||
"id": "%(uuid)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(glance_host)s/images/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v3/servers/%(id)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/servers/%(id)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"My Server Name": "Apache1"
|
||||
},
|
||||
"name": "new-server-test",
|
||||
"progress": 0,
|
||||
"status": "%(status)s",
|
||||
"tenant_id": "openstack",
|
||||
"updated": "%(timestamp)s",
|
||||
"user_id": "fake",
|
||||
"key_name": null
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="%(status)s" updated="%(timestamp)s" host_id="%(hostid)s" name="new-server-test" created="%(timestamp)s" user_id="fake" tenant_id="openstack" access_ip_v4="" access_ip_v6="" progress="0" id="%(id)s" key_name="None">
|
||||
<image id="%(uuid)s">
|
||||
<atom:link href="%(glance_host)s/images/%(uuid)s" rel="bookmark"/>
|
||||
</image>
|
||||
<flavor id="1">
|
||||
<atom:link href="%(host)s/flavors/1" rel="bookmark"/>
|
||||
</flavor>
|
||||
<metadata>
|
||||
<meta key="My Server Name">Apache1</meta>
|
||||
</metadata>
|
||||
<addresses>
|
||||
<network id="private">
|
||||
<ip version="4" addr="%(ip)s" type="fixed" mac_addr="aa:bb:cc:dd:ee:ff"/>
|
||||
</network>
|
||||
</addresses>
|
||||
<atom:link href="%(host)s/v3/servers/%(id)s" rel="self"/>
|
||||
<atom:link href="%(host)s/servers/%(id)s" rel="bookmark"/>
|
||||
</server>
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server" : {
|
||||
"name" : "new-server-test",
|
||||
"image_ref" : "%(host)s/openstack/images/%(image_id)s",
|
||||
"flavor_ref" : "%(host)s/openstack/flavors/1",
|
||||
"metadata" : {
|
||||
"My Server Name" : "Apache1"
|
||||
},
|
||||
"personality" : [
|
||||
{
|
||||
"path" : "/etc/banner.txt",
|
||||
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<server xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="%(host)s/openstack/images/%(image_id)s" flavor_ref="%(host)s/openstack/flavors/1" name="new-server-test">
|
||||
<metadata>
|
||||
<meta key="My Server Name">Apache1</meta>
|
||||
</metadata>
|
||||
<personality>
|
||||
<file path="/etc/banner.txt">
|
||||
ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
|
||||
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
|
||||
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
|
||||
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
|
||||
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
|
||||
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
|
||||
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
|
||||
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
|
||||
b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
|
||||
</file>
|
||||
</personality>
|
||||
</server>
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server": {
|
||||
"admin_pass": "%(password)s",
|
||||
"id": "%(id)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v3/servers/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/servers/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" id="%(id)s" admin_pass="%(password)s">
|
||||
<metadata/>
|
||||
<atom:link href="%(host)s/v3/servers/%(uuid)s" rel="self"/>
|
||||
<atom:link href="%(host)s/servers/%(uuid)s" rel="bookmark"/>
|
||||
</server>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"rescue": {
|
||||
"admin_pass": "%(password)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rescue xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
admin_pass="%(password)s"/>
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"admin_pass": "%(password)s"
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<admin_pass>%(password)s</admin_pass>
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"unrescue": null
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<unrescue xmlns="http://docs.openstack.org/compute/api/v1.1"/>
|
67
nova/tests/integrated/v3/test_rescue.py
Normal file
67
nova/tests/integrated/v3/test_rescue.py
Normal file
@ -0,0 +1,67 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
# Copyright 2012 Nebula, Inc.
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova.tests.integrated.v3 import test_servers
|
||||
|
||||
|
||||
class RescueJsonTest(test_servers.ServersSampleBase):
|
||||
extension_name = "os-rescue"
|
||||
|
||||
def _rescue(self, uuid):
|
||||
req_subs = {
|
||||
'password': 'MySecretPass'
|
||||
}
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'server-rescue-req', req_subs)
|
||||
self._verify_response('server-rescue', req_subs, response, 200)
|
||||
|
||||
def _unrescue(self, uuid):
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'server-unrescue-req', {})
|
||||
self.assertEqual(response.status, 202)
|
||||
|
||||
def test_server_rescue(self):
|
||||
uuid = self._post_server()
|
||||
|
||||
self._rescue(uuid)
|
||||
|
||||
# Do a server get to make sure that the 'RESCUE' state is set
|
||||
response = self._do_get('servers/%s' % uuid)
|
||||
subs = self._get_regexes()
|
||||
subs['hostid'] = '[a-f0-9]+'
|
||||
subs['id'] = uuid
|
||||
subs['status'] = 'RESCUE'
|
||||
|
||||
self._verify_response('server-get-resp-rescue', subs, response, 200)
|
||||
|
||||
def test_server_unrescue(self):
|
||||
uuid = self._post_server()
|
||||
|
||||
self._rescue(uuid)
|
||||
self._unrescue(uuid)
|
||||
|
||||
# Do a server get to make sure that the 'ACTIVE' state is back
|
||||
response = self._do_get('servers/%s' % uuid)
|
||||
subs = self._get_regexes()
|
||||
subs['hostid'] = '[a-f0-9]+'
|
||||
subs['id'] = uuid
|
||||
subs['status'] = 'ACTIVE'
|
||||
|
||||
self._verify_response('server-get-resp-unrescue', subs, response, 200)
|
||||
|
||||
|
||||
class RescueXmlTest(RescueJsonTest):
|
||||
ctype = 'xml'
|
Loading…
x
Reference in New Issue
Block a user