Revision cab667cc lib/rapi/client.py
b/lib/rapi/client.py | ||
---|---|---|
137 | 137 |
@param query: query arguments to pass to urllib.urlencode |
138 | 138 |
@type prepend_version: bool |
139 | 139 |
@param prepend_version: whether to automatically fetch and prepend the |
140 |
Ganeti version to the URL path |
|
140 |
Ganeti RAPI version to the URL path
|
|
141 | 141 |
|
142 | 142 |
@rtype: str |
143 | 143 |
@return: URL path |
... | ... | |
171 | 171 |
@param content: HTTP body content |
172 | 172 |
@type prepend_version: bool |
173 | 173 |
@param prepend_version: whether to automatically fetch and prepend the |
174 |
Ganeti version to the URL path |
|
174 |
Ganeti RAPI version to the URL path
|
|
175 | 175 |
|
176 | 176 |
@rtype: str |
177 | 177 |
@return: JSON-Decoded response |
... | ... | |
213 | 213 |
return self._version |
214 | 214 |
|
215 | 215 |
def GetVersion(self): |
216 |
"""Gets the ganeti version running on the cluster.
|
|
216 |
"""Gets the Remote API version running on the cluster.
|
|
217 | 217 |
|
218 | 218 |
@rtype: int |
219 | 219 |
@return: Ganeti version |
... | ... | |
266 | 266 |
if dry_run: |
267 | 267 |
query.append(("dry-run", 1)) |
268 | 268 |
|
269 |
self._SendRequest(HTTP_PUT, "/tags", query) |
|
269 |
return self._SendRequest(HTTP_PUT, "/tags", query)
|
|
270 | 270 |
|
271 | 271 |
def DeleteClusterTags(self, tags, dry_run=False): |
272 | 272 |
"""Deletes tags from the cluster. |
... | ... | |
339 | 339 |
@type instance: str |
340 | 340 |
@param instance: the instance to delete |
341 | 341 |
|
342 |
@rtype: int |
|
343 |
@return: job id |
|
344 |
|
|
342 | 345 |
""" |
343 | 346 |
query = [] |
344 | 347 |
if dry_run: |
345 | 348 |
query.append(("dry-run", 1)) |
346 | 349 |
|
347 |
self._SendRequest(HTTP_DELETE, "/instances/%s" % instance, query) |
|
350 |
return self._SendRequest(HTTP_DELETE, "/instances/%s" % instance, query)
|
|
348 | 351 |
|
349 | 352 |
def GetInstanceTags(self, instance): |
350 | 353 |
"""Gets tags for an instance. |
... | ... | |
376 | 379 |
if dry_run: |
377 | 380 |
query.append(("dry-run", 1)) |
378 | 381 |
|
379 |
self._SendRequest(HTTP_PUT, "/instances/%s/tags" % instance, query) |
|
382 |
return self._SendRequest(HTTP_PUT, "/instances/%s/tags" % instance, query)
|
|
380 | 383 |
|
381 | 384 |
def DeleteInstanceTags(self, instance, tags, dry_run=False): |
382 | 385 |
"""Deletes tags from an instance. |
Also available in: Unified diff