Add API sample files of "unshelve a server" API
Now there are not API sample files of "unshelve a server" and "shelve-offload" APIs, and OpenStack API documentation also does not show these APIs. This patch adds these API sample files. DocImpact Closes-Bug: #1285482 Change-Id: Idf797eb6723b94abae71a77c12bc2bb9b330fa28
This commit is contained in:
parent
126dd63b41
commit
ccb68ab1cd
3
doc/api_samples/os-shelve/os-shelve-offload.json
Normal file
3
doc/api_samples/os-shelve/os-shelve-offload.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"shelveOffload": null
|
||||
}
|
2
doc/api_samples/os-shelve/os-shelve-offload.xml
Normal file
2
doc/api_samples/os-shelve/os-shelve-offload.xml
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shelveOffload/>
|
3
doc/api_samples/os-shelve/os-unshelve.json
Normal file
3
doc/api_samples/os-shelve/os-unshelve.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"unshelve": null
|
||||
}
|
2
doc/api_samples/os-shelve/os-unshelve.xml
Normal file
2
doc/api_samples/os-shelve/os-unshelve.xml
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<unshelve/>
|
3
doc/v3/api_samples/os-shelve/os-shelve-offload.json
Normal file
3
doc/v3/api_samples/os-shelve/os-shelve-offload.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"shelve_offload": null
|
||||
}
|
3
doc/v3/api_samples/os-shelve/os-unshelve.json
Normal file
3
doc/v3/api_samples/os-shelve/os-unshelve.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"unshelve": null
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"%(action)s": null
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<%(action)s/>
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"%(action)s": null
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<%(action)s/>
|
@ -1182,26 +1182,25 @@ class ShelveJsonTest(ServersSampleBase):
|
||||
# Don't offload instance, so we can test the offload call.
|
||||
CONF.set_override('shelved_offload_time', -1)
|
||||
|
||||
def _test_server_action(self, uuid, action):
|
||||
def _test_server_action(self, uuid, template, action):
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'os-shelve',
|
||||
{'action': action})
|
||||
template, {'action': action})
|
||||
self.assertEqual(response.status, 202)
|
||||
self.assertEqual(response.read(), "")
|
||||
|
||||
def test_shelve(self):
|
||||
uuid = self._post_server()
|
||||
self._test_server_action(uuid, 'shelve')
|
||||
self._test_server_action(uuid, 'os-shelve', 'shelve')
|
||||
|
||||
def test_shelve_offload(self):
|
||||
uuid = self._post_server()
|
||||
self._test_server_action(uuid, 'shelve')
|
||||
self._test_server_action(uuid, 'shelveOffload')
|
||||
self._test_server_action(uuid, 'os-shelve', 'shelve')
|
||||
self._test_server_action(uuid, 'os-shelve-offload', 'shelveOffload')
|
||||
|
||||
def test_unshelve(self):
|
||||
uuid = self._post_server()
|
||||
self._test_server_action(uuid, 'shelve')
|
||||
self._test_server_action(uuid, 'unshelve')
|
||||
self._test_server_action(uuid, 'os-shelve', 'shelve')
|
||||
self._test_server_action(uuid, 'os-unshelve', 'unshelve')
|
||||
|
||||
|
||||
class ShelveXmlTest(ShelveJsonTest):
|
||||
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"%(action)s": null
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"%(action)s": null
|
||||
}
|
@ -29,23 +29,22 @@ class ShelveJsonTest(test_servers.ServersSampleBase):
|
||||
# Don't offload instance, so we can test the offload call.
|
||||
CONF.set_override('shelved_offload_time', -1)
|
||||
|
||||
def _test_server_action(self, uuid, action):
|
||||
def _test_server_action(self, uuid, template, action):
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'os-shelve',
|
||||
{'action': action})
|
||||
template, {'action': action})
|
||||
self.assertEqual(response.status, 202)
|
||||
self.assertEqual(response.read(), "")
|
||||
|
||||
def test_shelve(self):
|
||||
uuid = self._post_server()
|
||||
self._test_server_action(uuid, 'shelve')
|
||||
self._test_server_action(uuid, 'os-shelve', 'shelve')
|
||||
|
||||
def test_shelve_offload(self):
|
||||
uuid = self._post_server()
|
||||
self._test_server_action(uuid, 'shelve')
|
||||
self._test_server_action(uuid, 'shelve_offload')
|
||||
self._test_server_action(uuid, 'os-shelve', 'shelve')
|
||||
self._test_server_action(uuid, 'os-shelve-offload', 'shelve_offload')
|
||||
|
||||
def test_unshelve(self):
|
||||
uuid = self._post_server()
|
||||
self._test_server_action(uuid, 'shelve')
|
||||
self._test_server_action(uuid, 'unshelve')
|
||||
self._test_server_action(uuid, 'os-shelve', 'shelve')
|
||||
self._test_server_action(uuid, 'os-unshelve', 'unshelve')
|
||||
|
Loading…
x
Reference in New Issue
Block a user