Skip to content
Snippets Groups Projects
Commit 682e2375 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

List returned fields in RAPI documentation


Also replace console types with constants.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent bd7b2070
No related branches found
No related tags found
No related merge requests found
...@@ -395,6 +395,8 @@ If the optional bool *bulk* argument is provided and set to a true value ...@@ -395,6 +395,8 @@ If the optional bool *bulk* argument is provided and set to a true value
(i.e ``?bulk=1``), the output contains detailed information about node (i.e ``?bulk=1``), the output contains detailed information about node
groups as a list. groups as a list.
Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.G_FIELDS))`
Example:: Example::
[ [
...@@ -448,6 +450,8 @@ It supports the following commands: ``GET``, ``DELETE``. ...@@ -448,6 +450,8 @@ It supports the following commands: ``GET``, ``DELETE``.
Returns information about a node group, similar to the bulk output from Returns information about a node group, similar to the bulk output from
the node group list. the node group list.
Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.G_FIELDS))`
``DELETE`` ``DELETE``
~~~~~~~~~~ ~~~~~~~~~~
...@@ -579,6 +583,8 @@ If the optional bool *bulk* argument is provided and set to a true value ...@@ -579,6 +583,8 @@ If the optional bool *bulk* argument is provided and set to a true value
(i.e ``?bulk=1``), the output contains detailed information about (i.e ``?bulk=1``), the output contains detailed information about
instances as a list. instances as a list.
Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.I_FIELDS))`
Example:: Example::
[ [
...@@ -648,6 +654,8 @@ It supports the following commands: ``GET``, ``DELETE``. ...@@ -648,6 +654,8 @@ It supports the following commands: ``GET``, ``DELETE``.
Returns information about an instance, similar to the bulk output from Returns information about an instance, similar to the bulk output from
the instance list. the instance list.
Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.I_FIELDS))`
``DELETE`` ``DELETE``
~~~~~~~~~~ ~~~~~~~~~~
...@@ -943,22 +951,32 @@ Supports the following commands: ``GET``. ...@@ -943,22 +951,32 @@ Supports the following commands: ``GET``.
Returns a dictionary containing information about the instance's Returns a dictionary containing information about the instance's
console. Contained keys: console. Contained keys:
.. pyassert::
constants.CONS_ALL == frozenset([
constants.CONS_MESSAGE,
constants.CONS_SSH,
constants.CONS_VNC,
])
``instance`` ``instance``
Instance name. Instance name.
``kind`` ``kind``
Console type, one of ``ssh``, ``vnc`` or ``msg``. Console type, one of :pyeval:`constants.CONS_SSH`,
:pyeval:`constants.CONS_VNC` or :pyeval:`constants.CONS_MESSAGE`.
``message`` ``message``
Message to display (``msg`` type only). Message to display (:pyeval:`constants.CONS_MESSAGE` type only).
``host`` ``host``
Host to connect to (``ssh`` and ``vnc`` only). Host to connect to (:pyeval:`constants.CONS_SSH` and
:pyeval:`constants.CONS_VNC` only).
``port`` ``port``
TCP port to connect to (``vnc`` only). TCP port to connect to (:pyeval:`constants.CONS_VNC` only).
``user`` ``user``
Username to use (``ssh`` only). Username to use (:pyeval:`constants.CONS_SSH` only).
``command`` ``command``
Command to execute on machine (``ssh`` only) Command to execute on machine (:pyeval:`constants.CONS_SSH` only)
``display`` ``display``
VNC display number (``vnc`` only). VNC display number (:pyeval:`constants.CONS_VNC` only).
``/2/instances/[instance_name]/tags`` ``/2/instances/[instance_name]/tags``
...@@ -1019,6 +1037,10 @@ If the optional bool *bulk* argument is provided and set to a true value ...@@ -1019,6 +1037,10 @@ If the optional bool *bulk* argument is provided and set to a true value
(i.e. ``?bulk=1``), the output contains detailed information about jobs (i.e. ``?bulk=1``), the output contains detailed information about jobs
as a list. as a list.
Returned fields for bulk requests (unlike other bulk requests, these
fields are not the same as for per-job requests):
:pyeval:`utils.CommaJoin(sorted(rlib2.J_FIELDS_BULK))`
``/2/jobs/[job_id]`` ``/2/jobs/[job_id]``
++++++++++++++++++++ ++++++++++++++++++++
...@@ -1030,9 +1052,8 @@ It supports the following commands: ``GET``, ``DELETE``. ...@@ -1030,9 +1052,8 @@ It supports the following commands: ``GET``, ``DELETE``.
``GET`` ``GET``
~~~~~~~ ~~~~~~~
Returns a job status. Returns a dictionary with job parameters, containing the fields
:pyeval:`utils.CommaJoin(sorted(rlib2.J_FIELDS))`.
Returns: a dictionary with job parameters.
The result includes: The result includes:
...@@ -1164,9 +1185,11 @@ Example:: ...@@ -1164,9 +1185,11 @@ Example::
} }
] ]
If the optional 'bulk' argument is provided and set to 'true' value (i.e If the optional bool *bulk* argument is provided and set to a true value
'?bulk=1'), the output contains detailed information about nodes as a (i.e ``?bulk=1``), the output contains detailed information about nodes
list. as a list.
Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.N_FIELDS))`
Example:: Example::
...@@ -1193,6 +1216,8 @@ Returns information about a node. ...@@ -1193,6 +1216,8 @@ Returns information about a node.
It supports the following commands: ``GET``. It supports the following commands: ``GET``.
Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.N_FIELDS))`
``/2/nodes/[node_name]/evacuate`` ``/2/nodes/[node_name]/evacuate``
+++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment