From 369760febd6335e8d9ed4e4a4ffd2ab354a2a552 Mon Sep 17 00:00:00 2001 From: Oleksiy Mishchenko Date: Thu, 29 May 2008 16:39:10 +0000 Subject: [PATCH] RAPI Docstrings update. Reviewed-by: imsnah --- lib/rapi/resources.py | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/lib/rapi/resources.py b/lib/rapi/resources.py index 6490b02..5b11b15 100644 --- a/lib/rapi/resources.py +++ b/lib/rapi/resources.py @@ -207,6 +207,9 @@ class R_root(R_Generic): def GET(self): """Show the list of mapped resources. + + Returns: + A dictionary with 'name' and 'uri' keys for each of them. """ root_pattern = re.compile('^R_([a-zA-Z0-9]+)$') @@ -246,8 +249,19 @@ class R_instances(R_Generic): def GET(self): """Returns a list of all available instances. - - Example: ["web1.example.com", "mail1.example.com"] + + Returns: + A dictionary with 'name' and 'uri' keys for each of them. + + Example: [ + { + "name": "web.example.com", + "uri": "\/instances\/web.example.com" + }, + { + "name": "mail.example.com", + "uri": "\/instances\/mail.example.com" + }] """ op = ganeti.opcodes.OpQueryInstances(output_fields=["name"], names=[]) @@ -310,8 +324,19 @@ class R_nodes(R_Generic): def GET(self): """Returns a list of all nodes. - - Example: ["node1.example.com", "node2.example.com"] + + Returns: + A dictionary with 'name' an 'uri' keys for each of them. + + Example: [ + { + "name": "node1.example.com", + "uri": "\/instances\/node1.example.com" + }, + { + "name": "node2.example.com", + "uri": "\/instances\/node2.example.com" + }] """ op = ganeti.opcodes.OpQueryNodes(output_fields=["name"], names=[]) @@ -328,7 +353,7 @@ class R_nodes_name(R_Generic): @RequireLock() def GET(self): - """Send information about a node. + """Send information about a node. """ node_name = self.items[0] -- 1.7.10.4