module documentation

Ganeti RAPI client.

Unknown Field: attention
To use the RAPI client, the application must call pycurl.global_init during initialization and pycurl.global_cleanup before exiting the process. This is very important in multi-threaded programs. See curl_global_init(3) and curl_global_cleanup(3) for details. The decorator UsesRapiClient can be used.
Class GanetiRapiClient Ganeti RAPI client.
Exception CertificateError Raised when a problem is found with the SSL certificate.
Exception Error Base error class for this module.
Exception GanetiApiError Generic error raised from Ganeti API.
Function EpochNano Return the current timestamp expressed as number of nanoseconds since the unix epoch
Function GenericCurlConfig Curl configuration function generator.
Function UsesRapiClient Decorator for code using RAPI client to initialize pycURL.
Constant ECODE_ALL Undocumented
Constant ECODE_ENVIRON Undocumented
Constant ECODE_EXISTS Undocumented
Constant ECODE_FAULT Undocumented
Constant ECODE_INVAL Undocumented
Constant ECODE_NOENT Undocumented
Constant ECODE_NORES Undocumented
Constant ECODE_NOTUNIQUE Undocumented
Constant ECODE_RESOLVER Undocumented
Constant ECODE_STATE Undocumented
Constant ECODE_TEMP_NORES Undocumented
Constant GANETI_RAPI_PORT Undocumented
Constant GANETI_RAPI_VERSION Undocumented
Constant HTTP_APP_JSON Undocumented
Constant HTTP_DELETE Undocumented
Constant HTTP_GET Undocumented
Constant HTTP_NOT_FOUND Undocumented
Constant HTTP_OK Undocumented
Constant HTTP_POST Undocumented
Constant HTTP_PUT Undocumented
Constant INST_CREATE_REQV1 Undocumented
Constant INST_REINSTALL_REQV1 Undocumented
Constant JOB_STATUS_ALL Undocumented
Constant JOB_STATUS_CANCELED Undocumented
Constant JOB_STATUS_CANCELING Undocumented
Constant JOB_STATUS_ERROR Undocumented
Constant JOB_STATUS_FINALIZED Undocumented
Constant JOB_STATUS_PENDING Undocumented
Constant JOB_STATUS_QUEUED Undocumented
Constant JOB_STATUS_RUNNING Undocumented
Constant JOB_STATUS_SUCCESS Undocumented
Constant JOB_STATUS_WAITING Undocumented
Constant NODE_EVAC_ALL Undocumented
Constant NODE_EVAC_PRI Undocumented
Constant NODE_EVAC_RES1 Undocumented
Constant NODE_EVAC_SEC Undocumented
Constant NODE_MIGRATE_REQV1 Undocumented
Constant NODE_ROLE_DRAINED Undocumented
Constant NODE_ROLE_MASTER Undocumented
Constant NODE_ROLE_MASTER_CANDIDATE Undocumented
Constant NODE_ROLE_OFFLINE Undocumented
Constant NODE_ROLE_REGULAR Undocumented
Constant REPLACE_DISK_AUTO Undocumented
Constant REPLACE_DISK_CHG Undocumented
Constant REPLACE_DISK_PRI Undocumented
Constant REPLACE_DISK_SECONDARY Undocumented
Class _CompatIO Stream that lazy-allocates its buffer based on the first write's type
Function _AppendDryRunIf Appends a "dry-run" parameter if a condition evaluates to truth.
Function _AppendForceIf Appends a "force" parameter if a condition evaluates to truth.
Function _AppendIf Appends to a list if a condition evaluates to truth.
Function _AppendReason Appends an element to the reason trail.
Function _SetItemIf Sets an item if a condition evaluates to truth.
Constant _CURL_SSL_CERT_ERRORS Undocumented
Constant _QPARAM_DRY_RUN Undocumented
Constant _QPARAM_FORCE Undocumented
Constant _REQ_DATA_VERSION_FIELD Undocumented
def EpochNano():

Return the current timestamp expressed as number of nanoseconds since the unix epoch

Returns
nanoseconds since the Unix epoch
def GenericCurlConfig(verbose=False, use_signal=False, use_curl_cabundle=False, cafile=None, capath=None, proxy=None, verify_hostname=False, connect_timeout=None, timeout=None, _pycurl_version_fn=pycurl.version_info):

Curl configuration function generator.

Parameters
verbose:boolWhether to set cURL to verbose mode
use_signal:boolWhether to allow cURL to use signals
use_curl_cabundle:boolWhether to use cURL's default CA bundle
cafile:stringIn which file we can find the certificates
capath:stringIn which directory we can find the certificates
proxy:stringProxy to use, None for default behaviour and empty string for disabling proxies (see curl_easy_setopt(3))
verify_hostname:boolWhether to verify the remote peer certificate's commonName
connect_timeout:numberTimeout for establishing connection in seconds
timeout:numberTimeout for complete transfer in seconds (see curl_easy_setopt(3)).
_pycurl_version_fnUndocumented
def UsesRapiClient(fn):

Decorator for code using RAPI client to initialize pycURL.

ECODE_ENVIRON: str =

Undocumented

Value
'environment_error'
ECODE_EXISTS: str =

Undocumented

Value
'already_exists'
ECODE_FAULT: str =

Undocumented

Value
'internal_error'
ECODE_INVAL: str =

Undocumented

Value
'wrong_input'
ECODE_NOENT: str =

Undocumented

Value
'unknown_entity'
ECODE_NORES: str =

Undocumented

Value
'insufficient_resources'
ECODE_NOTUNIQUE: str =

Undocumented

Value
'resource_not_unique'
ECODE_RESOLVER: str =

Undocumented

Value
'resolver_error'
ECODE_STATE: str =

Undocumented

Value
'wrong_state'
ECODE_TEMP_NORES: str =

Undocumented

Value
'temp_insufficient_resources'
GANETI_RAPI_PORT: int =

Undocumented

Value
5080
GANETI_RAPI_VERSION: int =

Undocumented

Value
2
HTTP_APP_JSON: str =

Undocumented

Value
'application/json'
HTTP_DELETE: str =

Undocumented

Value
'DELETE'
HTTP_GET: str =

Undocumented

Value
'GET'
HTTP_NOT_FOUND: int =

Undocumented

Value
404
HTTP_OK: int =

Undocumented

Value
200
HTTP_POST: str =

Undocumented

Value
'POST'
HTTP_PUT: str =

Undocumented

Value
'PUT'
INST_CREATE_REQV1: str =

Undocumented

Value
'instance-create-reqv1'
INST_REINSTALL_REQV1: str =

Undocumented

Value
'instance-reinstall-reqv1'
JOB_STATUS_ALL =
JOB_STATUS_CANCELED: str =

Undocumented

Value
'canceled'
JOB_STATUS_CANCELING: str =

Undocumented

Value
'canceling'
JOB_STATUS_ERROR: str =

Undocumented

Value
'error'
JOB_STATUS_FINALIZED =

Undocumented

Value
frozenset([JOB_STATUS_CANCELED, JOB_STATUS_SUCCESS, JOB_STATUS_ERROR])
JOB_STATUS_PENDING =

Undocumented

Value
frozenset([JOB_STATUS_QUEUED, JOB_STATUS_WAITING, JOB_STATUS_CANCELING])
JOB_STATUS_QUEUED: str =

Undocumented

Value
'queued'
JOB_STATUS_RUNNING: str =

Undocumented

Value
'running'
JOB_STATUS_SUCCESS: str =

Undocumented

Value
'success'
JOB_STATUS_WAITING: str =

Undocumented

Value
'waiting'
NODE_EVAC_ALL: str =

Undocumented

Value
'all'
NODE_EVAC_PRI: str =

Undocumented

Value
'primary-only'
NODE_EVAC_RES1: str =

Undocumented

Value
'node-evac-res1'
NODE_EVAC_SEC: str =

Undocumented

Value
'secondary-only'
NODE_MIGRATE_REQV1: str =

Undocumented

Value
'node-migrate-reqv1'
NODE_ROLE_DRAINED: str =

Undocumented

Value
'drained'
NODE_ROLE_MASTER: str =

Undocumented

Value
'master'
NODE_ROLE_MASTER_CANDIDATE: str =

Undocumented

Value
'master-candidate'
NODE_ROLE_OFFLINE: str =

Undocumented

Value
'offline'
NODE_ROLE_REGULAR: str =

Undocumented

Value
'regular'
REPLACE_DISK_AUTO: str =

Undocumented

Value
'replace_auto'
REPLACE_DISK_CHG: str =

Undocumented

Value
'replace_new_secondary'
REPLACE_DISK_PRI: str =

Undocumented

Value
'replace_on_primary'
REPLACE_DISK_SECONDARY: str =

Undocumented

Value
'replace_on_secondary'
def _AppendDryRunIf(container, condition):

Appends a "dry-run" parameter if a condition evaluates to truth.

def _AppendForceIf(container, condition):

Appends a "force" parameter if a condition evaluates to truth.

def _AppendIf(container, condition, value):

Appends to a list if a condition evaluates to truth.

def _AppendReason(container, reason):

Appends an element to the reason trail.

If the user provided a reason, it is added to the reason trail.

def _SetItemIf(container, condition, item, value):

Sets an item if a condition evaluates to truth.

_CURL_SSL_CERT_ERRORS =

Undocumented

Value
frozenset([_CURLE_SSL_CACERT, _CURLE_SSL_CACERT_BADFILE])
_QPARAM_DRY_RUN: str =

Undocumented

Value
'dry-run'
_QPARAM_FORCE: str =

Undocumented

Value
'force'
_REQ_DATA_VERSION_FIELD: str =

Undocumented

Value
'__version__'