pyvcloud.vcd.api_extension module

class pyvcloud.vcd.api_extension.APIExtension(client)

Bases: object

ATTRIBUTES = ['name', 'namespace', 'enabled', 'exchange', 'routingKey', 'priority', 'isAuthorizationEnabled', 'href', 'id']
TYPE_NAME = 'adminService'
add_extension(name, namespace, routing_key, exchange, patterns)

Add an API extension.

Parameters:
  • name – (str): The name of the new API extension service.
  • namespace – (str): The namespace of the new API extension service.
  • routing_key – (str): AMQP routing key to use with the extension.
  • exchange – (str): AMQP exchange to use with the extension.
  • patterns – (str): URI API filters to register with the extension.
Returns:

(lxml.objectify.ObjectifiedElement): object containing the sparse representation of the API extension.

delete_extension(name, namespace)

Delete the API extension service.

Parameters:
  • name – (str): The name of the extension service.
  • namespace – (str): The namespace of the extension service. If None, it will use the value defined by the name parameter.
Returns:

(lxml.objectify.ObjectifiedElement): object containing the representation of the API extension.

enable_extension(name, enabled=True, namespace=None)

Enable or disable the API extension service.

Parameters:
  • name – (str): The name of the extension service.
  • namespace – (str): The namespace of the extension service. If None, it will use the value defined by the name parameter.
  • enabled – (bool): Flag to enable or disable the extension.
Returns:

(lxml.objectify.ObjectifiedElement): object containing the representation of the API extension.

get_api_filters(service_id)

Return the API filters defined for the service.

Parameters:service_id – (str): The id of the extension service.
Returns:(lxml.objectify.ObjectifiedElement): list with the API filters registered for the API extension.
get_extension(name, namespace=None)

Return the info about an API extension.

Parameters:
  • name – (str): The name of the extension service.
  • namespace – (str): The namespace of the extension service. If None, it will use the value defined by the name parameter.
Returns:

(dict): dictionary with the information about the extension.

get_extension_info(name, namespace=None)

Return the info about an API extension, including filters.

Parameters:
  • name – (str): The name of the extension service.
  • namespace – (str): The namespace of the extension service. If None, it will use the value defined by the name parameter.
Returns:

(dict): dictionary with the information about the extension.

list_extensions()

Return the API extensions defined in the system.

Returns:(dict): list with the API extensions defined in the system.