Package enomalism2 :: Module json
[hide private]

Module json

Provides interfaces used to convert Python objects used in Enomalism to JSON format.


Requires:

Status: Stable

Functions [hide private]
String
jsonify_group(obj)
Return the JSON representation of the specified group.
String
jsonify_user(obj)
Return the JSON representation of the specified user.
String
jsonify_machine(obj)
Return the JSON representation of the specified machine.
String
jsonify_hypervisor(obj)
Return the JSON representation of the specified hypervisor.
String
jsonify_elementtree(obj)
Return the JSON representation of the specified element interface.
String
jsonify_package(obj)
Return the JSON representation of the specified machine.
String
jsonify_exception(obj)
Return the JSON representation of the specified exception.
String
jsonify_locker(obj)
Return the JSON representation of the specified locker.
String
jsonify_transaction(obj)
Return the JSON representation of the specified transaction.
String
jsonify_cluster(obj)
Return the JSON representation of the specified cluster.
String
jsonify_queue(obj)
Return the JSON representation of the specified queue.
Function Details [hide private]

jsonify_group(obj)

 

Return the JSON representation of the specified group. The result will contain the users belonging to the group as well as the permissions on the group.

Example usage:

>>> from enomalism2.json import jsonify_group
>>> from enomalism2 import model
>>> jsonify_group(model.UUIDSearch.group('123'))
Parameters:
Returns: String
The group object in JSON format.
Decorators:
  • @jsonify.when('isinstance(obj, EnomalismGroup)')
Raises:
  • None - No exceptions are raised by this function.

Status: Stable

jsonify_user(obj)

 

Return the JSON representation of the specified user. The result will contain the groups the user belongs to as well as the permissions on the user.

Example usage:

>>> from enomalism2.json import jsonify_user
>>> from enomalism import model
>>> jsonify_user(model.UUIDSearch.user('123'))
Parameters:
Returns: String
The user object in JSON format.
Decorators:
  • @jsonify.when('isinstance(obj, EnomalismUser)')
Raises:
  • None - No exceptions are raised by this function.

Status: Stable

jsonify_machine(obj)

 

Return the JSON representation of the specified machine. The result will contain all the attributes of the machine.

Example usage:

>>> from enomalism2.json import jsonify_machine
>>> from enomalism2 import model
>>> jsonify_machine(model.UUIDSearch.machine('123'))
Parameters:
Returns: String
The machine object in JSON format.
Decorators:
  • @jsonify.when('isinstance(obj, Machine)')
Raises:
  • None - No exceptions are raised by this function.

Status: Stable

jsonify_hypervisor(obj)

 

Return the JSON representation of the specified hypervisor. The result will contain all the attributes of the hypervisor.

Example usage:

>>> from enomalism2.json import jsonify_hypervisor
>>> from enomalism2 import model
>>> jsonify_hypervisor(model.UUIDSearch.hypervisor('123'))
Parameters:
Returns: String
The hypervisor object in JSON format.
Decorators:
  • @jsonify.when('isinstance(obj, Hypervisor)')
Raises:
  • None - No exceptions are raised by this function.

Status: Stable

jsonify_elementtree(obj)

 

Return the JSON representation of the specified element interface.

Example usage:

>>> from enomalism2.json import jsonify_elementtree
>>> jsonify_elementtree(e)
Parameters:
  • obj (_ElementInterface) - The element interface to convert to JSON format.
Returns: String
The element interface object in JSON format.
Decorators:
  • @jsonify.when('isinstance(obj, elementtree.ElementTree._ElementInterface)')
Raises:
  • None - No exceptions are raised by this function.

jsonify_package(obj)

 

Return the JSON representation of the specified machine. The result will contain all the attributes of the machine.

Example usage:

>>> from enomalism2.json import jsonify_package
>>> from enomalism2 import model
>>> jsonify_package(model.UUIDSearch.pakages('123'))
Parameters:
Returns: String
The machine object in JSON format.
Decorators:
  • @jsonify.when('isinstance(obj, Package)')
Raises:
  • None - No exceptions are raised by this function.

Status: Stable

jsonify_exception(obj)

 

Return the JSON representation of the specified exception.

Example usage:

>>> from enomalism2.json import jsonify_exception
>>> from enomalism2 import model
>>> jsonify_exception(model.UUIDSearch.exception('123'))
Parameters:
Returns: String
The exception object in JSON format.
Decorators:
  • @jsonify.when('isinstance(obj, E2BaseException)')
Raises:
  • None - No exceptions are raised by this method.

Status: Stable

jsonify_locker(obj)

 

Return the JSON representation of the specified locker.

Example usage:

>>> from enomalism2.json import jsonify_locker
>>> from enomalism2 import model
>>> jsonify_locker(model.UUIDSearch.locker('123'))
Parameters:
Returns: String
The locker object in JSON format.
Decorators:
  • @jsonify.when('isinstance(obj, Locker)')
Raises:
  • None - No exceptions are raised by this method.

Status: Stable

jsonify_transaction(obj)

 

Return the JSON representation of the specified transaction.

Example usage:

>>> from enomalism2.json import jsonify_transaction
>>> from enomalism2 import model
>>> jsonify_transaction(model.UUIDSearch.transaction('123'))
Parameters:
Returns: String
The transaction object in JSON format.
Decorators:
  • @jsonify.when('isinstance(obj, Transaction)')
Raises:
  • None - No exceptions are raised by this function.

Status: Stable

jsonify_cluster(obj)

 

Return the JSON representation of the specified cluster.

Example usage:

>>> from enomalism2.json import jsonify_cluster
>>> from enomalism2 import model
>>> jsonify_cluster(model.UUIDSearch.cluster('123'))
Parameters:
Returns: String
The cluster object in JSON format.
Decorators:
  • @jsonify.when('isinstance(obj, Cluster)')
Raises:
  • None - No exceptions are raised by this method.

Status: Stable

jsonify_queue(obj)

 

Return the JSON representation of the specified queue.

Example usage:

>>> from enomalism2.json import jsonify_queue
>>> from enomalism2 import model
>>> jsonify_queue(model.UUIDSearch.queue('123'))
Parameters:
Returns: String
The queue object in JSON format.
Decorators:
  • @jsonify.when('isinstance(obj, Queue)')
Raises:
  • None - No exceptions are raised by this method.

Status: Stable