Commit fc7c3c4c authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Update documentation for server resize

Refs: #4153
parent eb8208a5
......@@ -160,6 +160,7 @@ server (Compute/Cyclades)
shutdown: Shutdown a server
start : Start a server
stats : Get server statistics
resize : Set a different flavor for an existing server
wait : Wait for server to finish
Showcase: Create a server
......
......@@ -130,6 +130,7 @@ server commands
* shutdown Shutdown an active server (VM)
* start Start an existing server (VM)
* stats Get server (VM) statistics
* resize Set a different flavor for an existing server
* wait Wait for server to finish [BUILD, STOPPED, REBOOT, ACTIVE]
......
......@@ -183,6 +183,7 @@ and of a command in that group (list) are shown.
shutdown: Shutdown an active server (VM)
start : Start an existing server (VM)
stats : Get server (VM) statistics
resize : Set a different flavor for an existing server
wait : Wait for server to finish [BUILD, STOPPED, REBOOT, ACTIVE]
.. code-block:: console
......
......@@ -434,8 +434,8 @@ class server_console(_init_cyclades, _optional_json):
class server_resize(_init_cyclades, _optional_output_cmd):
"""Set a different flavor for an existing server
To get server ids and flavor ids:
/server list
/flavor list
/server list
/flavor list
"""
@errors.generic.all
......
......@@ -143,6 +143,18 @@ class ComputeClient(ComputeRestClient):
r = self.servers_post(server_id, 'action', json_data=req)
return r.headers
def resize_server(self, server_id, flavor_id):
"""
:param server_id: (str)
:param flavor_id: (int)
:returns: (dict) request headers
"""
req = {'resize': {'flavorRef': flavor_id}}
r = self.servers_post(server_id, 'action', json_data=req)
return r.headers
def get_server_metadata(self, server_id, key=''):
"""
:param server_id: integer (str or int)
......@@ -349,13 +361,3 @@ class ComputeClient(ComputeRestClient):
"""
r = self.floating_ips_delete(tenant_id, fip_id)
return r.headers
def resize_server(self, server_id, flavor_id):
"""
:param server_id: (str)
:param flavor_id: (int)
"""
req = {'resize': {'flavorRef': flavor_id}}
r = self.servers_post(server_id, 'action', json_data=req)
return r.headers
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment