Revision 7eac4a4d lib/rapi/client.py
b/lib/rapi/client.py | ||
---|---|---|
39 | 39 |
HTTP_PUT = "PUT" |
40 | 40 |
HTTP_POST = "POST" |
41 | 41 |
HTTP_OK = 200 |
42 |
HTTP_NOT_FOUND = 404 |
|
42 | 43 |
HTTP_APP_JSON = "application/json" |
43 | 44 |
|
44 | 45 |
REPLACE_DISK_PRI = "replace_on_primary" |
... | ... | |
433 | 434 |
""" |
434 | 435 |
return self._SendRequest(HTTP_GET, "/version", None, None) |
435 | 436 |
|
437 |
def GetFeatures(self): |
|
438 |
"""Gets the list of optional features supported by RAPI server. |
|
439 |
|
|
440 |
@rtype: list |
|
441 |
@return: List of optional features |
|
442 |
|
|
443 |
""" |
|
444 |
try: |
|
445 |
return self._SendRequest(HTTP_GET, "/%s/features" % GANETI_RAPI_VERSION, |
|
446 |
None, None) |
|
447 |
except GanetiApiError, err: |
|
448 |
# Older RAPI servers don't support this resource |
|
449 |
if err.code == HTTP_NOT_FOUND: |
|
450 |
return [] |
|
451 |
|
|
452 |
raise |
|
453 |
|
|
436 | 454 |
def GetOperatingSystems(self): |
437 | 455 |
"""Gets the Operating Systems running in the Ganeti cluster. |
438 | 456 |
|
Also available in: Unified diff