Revision b58a4d16
b/lib/rapi/connector.py | ||
---|---|---|
134 | 134 |
|
135 | 135 |
|
136 | 136 |
class R_2(baserlib.R_Generic): |
137 |
""" /2 resource, the root of the version 2 API. |
|
137 |
"""/2 resource. |
|
138 |
|
|
139 |
This is the root of the version 2 API. |
|
138 | 140 |
|
139 | 141 |
""" |
140 | 142 |
@staticmethod |
b/lib/rapi/rlib2.py | ||
---|---|---|
122 | 122 |
|
123 | 123 |
|
124 | 124 |
class R_2_info(baserlib.R_Generic): |
125 |
"""Cluster info.
|
|
125 |
"""/2/info resource.
|
|
126 | 126 |
|
127 | 127 |
""" |
128 | 128 |
@staticmethod |
... | ... | |
329 | 329 |
|
330 | 330 |
|
331 | 331 |
class R_2_nodes_name(baserlib.R_Generic): |
332 |
"""/2/nodes/[node_name] resources.
|
|
332 |
"""/2/nodes/[node_name] resource. |
|
333 | 333 |
|
334 | 334 |
""" |
335 | 335 |
def GET(self): |
... | ... | |
470 | 470 |
|
471 | 471 |
|
472 | 472 |
class R_2_nodes_name_storage(baserlib.R_Generic): |
473 |
"""/2/nodes/[node_name]/storage ressource.
|
|
473 |
"""/2/nodes/[node_name]/storage resource. |
|
474 | 474 |
|
475 | 475 |
""" |
476 | 476 |
# LUQueryNodeStorage acquires locks, hence restricting access to GET |
... | ... | |
496 | 496 |
|
497 | 497 |
|
498 | 498 |
class R_2_nodes_name_storage_modify(baserlib.R_Generic): |
499 |
"""/2/nodes/[node_name]/storage/modify ressource.
|
|
499 |
"""/2/nodes/[node_name]/storage/modify resource. |
|
500 | 500 |
|
501 | 501 |
""" |
502 | 502 |
def PUT(self): |
... | ... | |
526 | 526 |
|
527 | 527 |
|
528 | 528 |
class R_2_nodes_name_storage_repair(baserlib.R_Generic): |
529 |
"""/2/nodes/[node_name]/storage/repair ressource.
|
|
529 |
"""/2/nodes/[node_name]/storage/repair resource. |
|
530 | 530 |
|
531 | 531 |
""" |
532 | 532 |
def PUT(self): |
... | ... | |
594 | 594 |
|
595 | 595 |
|
596 | 596 |
class R_2_groups_name(baserlib.R_Generic): |
597 |
"""/2/groups/[group_name] resources.
|
|
597 |
"""/2/groups/[group_name] resource. |
|
598 | 598 |
|
599 | 599 |
""" |
600 | 600 |
def GET(self): |
... | ... | |
670 | 670 |
|
671 | 671 |
|
672 | 672 |
class R_2_groups_name_rename(baserlib.R_Generic): |
673 |
"""/2/groups/[groupe_name]/rename resource.
|
|
673 |
"""/2/groups/[group_name]/rename resource. |
|
674 | 674 |
|
675 | 675 |
""" |
676 | 676 |
def PUT(self): |
... | ... | |
686 | 686 |
|
687 | 687 |
|
688 | 688 |
class R_2_groups_name_assign_nodes(baserlib.R_Generic): |
689 |
"""/2/groups/[groupe_name]/assign-nodes resource.
|
|
689 |
"""/2/groups/[group_name]/assign-nodes resource. |
|
690 | 690 |
|
691 | 691 |
""" |
692 | 692 |
def PUT(self): |
... | ... | |
912 | 912 |
|
913 | 913 |
|
914 | 914 |
class R_2_instances_name(baserlib.R_Generic): |
915 |
"""/2/instances/[instance_name] resources.
|
|
915 |
"""/2/instances/[instance_name] resource. |
|
916 | 916 |
|
917 | 917 |
""" |
918 | 918 |
def GET(self): |
... | ... | |
1319 | 1319 |
|
1320 | 1320 |
|
1321 | 1321 |
class R_2_instances_name_disk_grow(baserlib.R_Generic): |
1322 |
"""/2/instances/[instance_name]/disk/[index]/grow resource. |
|
1322 |
"""/2/instances/[instance_name]/disk/[disk_index]/grow resource.
|
|
1323 | 1323 |
|
1324 | 1324 |
""" |
1325 | 1325 |
def POST(self): |
... | ... | |
1420 | 1420 |
|
1421 | 1421 |
|
1422 | 1422 |
class R_2_tags(_R_Tags): |
1423 |
""" /2/instances/tags resource.
|
|
1423 |
""" /2/tags resource. |
|
1424 | 1424 |
|
1425 | 1425 |
Manages cluster tags. |
1426 | 1426 |
|
b/test/docs_unittest.py | ||
---|---|---|
72 | 72 |
msg=("Missing documentation for hook %s/%s" % |
73 | 73 |
(lucls.HTYPE, lucls.HPATH))) |
74 | 74 |
|
75 |
def _CheckRapiResource(self, uri, fixup): |
|
75 |
def _CheckRapiResource(self, uri, fixup, handler): |
|
76 |
docline = "%s resource." % uri |
|
77 |
self.assertEqual(handler.__doc__.splitlines()[0].strip(), docline, |
|
78 |
msg=("First line of %r's docstring is not %r" % |
|
79 |
(handler, docline))) |
|
80 |
|
|
76 | 81 |
# Apply fixes before testing |
77 | 82 |
for (rx, value) in fixup.items(): |
78 | 83 |
uri = rx.sub(value, uri) |
... | ... | |
131 | 136 |
if title.startswith("``") and title.endswith("``"): |
132 | 137 |
uri = title[2:-2] |
133 | 138 |
if key.match(uri): |
134 |
self._CheckRapiResource(uri, uri_check_fixup) |
|
139 |
self._CheckRapiResource(uri, uri_check_fixup, handler)
|
|
135 | 140 |
found = True |
136 | 141 |
break |
137 | 142 |
|
... | ... | |
144 | 149 |
msg="Path %r does not start with '/2/'" % key) |
145 | 150 |
|
146 | 151 |
if ("``%s``" % key) in titles: |
147 |
self._CheckRapiResource(key, {}) |
|
152 |
self._CheckRapiResource(key, {}, handler)
|
|
148 | 153 |
else: |
149 | 154 |
undocumented.append(key) |
150 | 155 |
|
Also available in: Unified diff