The oslo_vmware.service Module

The oslo_vmware.service Module

Common classes that provide access to vSphere services.

class oslo_vmware.service.LocalFileAdapter(pool_maxsize=10)

Bases: requests.adapters.HTTPAdapter

Transport adapter for local files.


send(request, stream=False, timeout=None, verify=True, cert=None, proxies=None)

Sends request for a local file.

class oslo_vmware.service.MemoryCache

Bases: suds.cache.ObjectCache


Retrieves the value for a key or None.

put(key, value, time=3600)

Sets the value for a key.

class oslo_vmware.service.RequestsTransport(cacert=None, insecure=True, pool_maxsize=10, connection_timeout=None)

Bases: suds.transport.Transport


Open the URL in the specified request.

@param request: A transport request. @type request: L{Request} @return: An input stream. @rtype: stream @raise TransportError: On all transport errors.

Send soap message. Implementations are expected to handle:
  • proxies
  • I{HTTP} headers
  • cookies
  • sending message
  • brokering exceptions into L{TransportError}

@param request: A transport request. @type request: L{Request} @return: The reply @rtype: L{Reply} @raise TransportError: On all transport errors.

class oslo_vmware.service.Response(stream, status=200, headers=None)

Bases: _io.BytesIO

Response with an input stream as source.

get_all(name, default)
read(chunk_size, **kwargs)

Read at most size bytes, returned as a bytes object.

If the size argument is negative, read until EOF is reached. Return an empty bytes object at EOF.

class oslo_vmware.service.Service(wsdl_url=None, soap_url=None, cacert=None, insecure=True, pool_maxsize=10, connection_timeout=None, op_id_prefix='oslo.vmware')

Bases: object

Base class containing common functionality for invoking vSphere services

static build_base_url(protocol, host, port)

Return the vCenter session cookie.

class oslo_vmware.service.ServiceMessagePlugin

Bases: suds.plugin.MessagePlugin

Suds plug-in handling some special cases while calling VI SDK.

EMPTY_ELEMENTS = ['VirtualMachineEmptyProfileSpec']

Helper to handle AnyType.

Suds does not handle AnyType properly. But VI SDK requires type attribute to be set when AnyType is used.

Parameters:node – XML value node

Modifies the envelope document before it is sent.

This method provides the plug-in with the opportunity to prune empty nodes and fix nodes before sending it to the server.

Parameters:context – send context
class oslo_vmware.service.SudsLogFilter(name='')

Bases: logging.Filter

Filter to mask/truncate vCenter credentials in suds logs.


Determine if the specified record is to be logged.

Is the specified record to be logged? Returns 0 for no, nonzero for yes. If deemed appropriate, the record may be modified in-place.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.