vAPI configuration addr url parser
Get the scheme from the url (as described in http://www.rabbitmq.com/uri-spec.html)
Parameters: | url (str) – The addr url to parse |
---|---|
Return type: | str |
Returns: | url scheme |
Parse addr url (as described in http://www.rabbitmq.com/uri-spec.html) Note: This fn make no attempt to unescape the url, just like the urlparse
Parameters: | url (str) – The addr url to parse |
---|---|
Return type: | tuple of (scheme, host, port, user, password, path, query_dict) where scheme: url scheme host: hostname port: query_dict is a dictionary of (name, [values]) |
Returns: | Parsed addr url |
vAPI Connection factory
Check if name is a file and exists
:type str :param file name
Create a connection to the vAPI Provider using the specified arguments
Parameters: |
|
---|---|
Return type: | |
Returns: | Connection to the vAPI provider |
Create a connection that uses ‘requests’ library for http connections
Parameters: |
|
---|---|
Return type: | |
Returns: | Connection to the vAPI provider |
Create a connection that uses SAML Hok based authentication to connect to a vAPI Provider
Parameters: |
|
---|---|
Return type: | |
Returns: | Connection to the vAPI provider |
String Constants used in vAPI runtime
Bases: object
String constants used in introsection service
Factory methods for creating application context
Create a default application context. The created context will only have opId.
Return type: | vmware.vapi.core.ApplicationContext |
---|---|
Returns: | Newly created application context |
Convenience methods for converting variable names
Bases: object
Convenience methods for converting variable names
Converts the argument from vAPI canonical format to PEP8 compliant parameter or attribute name
Parameters: | name (str) – The string to be converted |
---|---|
Return type: | str |
Returns: | The converted string |
Capitalize the first letter of the name
Parameters: | name (str) – name to be converted |
---|---|
Return type: | str |
Returns: | name with first letter capitalized |
Convert from CapWords to lower_case_with_underscore format
Parameters: | name (str) – name in CapWords format |
---|---|
Return type: | str |
Returns: | name in lower_case_with_underscore format |
Convert from mixedCase to lower_case_with_underscore format
Parameters: | name (str) – name in mixedCase format |
---|---|
Return type: | str |
Returns: | name in lower_case_with_underscore format |
Converts the argument into a name that conforms to PEP8 standard. i.e. lower_case_with_underscore
Parameters: | name (str) – The string to be converted |
---|---|
Return type: | str |
Returns: | The converted string |
Uncapitalize the first letter of the name
Parameters: | name (str) – name to be converted |
---|---|
Return type: | str |
Returns: | name with first letter uncapitalized |
Convert from lower_case_with_underscore to CapWords format
Parameters: | name (str) – name in lower_case_with_underscore |
---|---|
Return type: | str |
Returns: | name in CapWords |
Fingerprint related functions
Convenience methods for dynamic loading
Dynamically import a module and get the specified module attribute
Parameters: | constructor (str) – Fully qualified module attribute |
---|---|
Return type: | object |
Returns: | Python object |
Import multiple class names provided in the config file
Parameters: |
|
---|---|
Return type: | list of str |
Returns: | List of class references |
Convenience methods for loading the profiler
Mock decorator that is used when the PROFILER is not set
Mock decorator that is used when the PROFILER is not set
SSL Context factories
Bases: object
Context factory base class. This class should be used to set the SSL options
Bases: vmware.vapi.lib.ssl.ClientContextFactory
Default SSL context class. This chooses some default options for SSL context. Clients can retrieve the context.
To modify the context and set some options directly. Create a class like below and set the options. Pass this to the get_connector function
Initialize DefaultClientContextFactory
Parameters: |
|
---|
Helper functions for manipulating vAPI runtime objects corresponding to the standard types (e.g. LocalizableMessage) and errors
Create an error result for a “standard” error from a cause ErrorValue and an list of messages.
The list of message will be prepended to the messages from the cause (if any).
Parameters: |
|
---|---|
Return type: | |
Returns: | ErrorValue containing a single message |
Create an error result for a “standard” error
Parameters: |
|
---|---|
Return type: | |
Returns: | ErrorValue containing a single message |
Create an error result for a “standard” error
Parameters: |
|
---|---|
Return type: | |
Returns: | ErrorValue containing a single message |
Internal function to create a “standard” ErrorDefinition for use only by the vAPI runtime. :type name: str :param args: Fully qualified name of the standard error type :rtype: vmware.vapi.data.definition.ErrorDefinition :return: ErrorDefinition containing a single message field
This module is YATP (Yet another thread pool)
Bases: object
Thread pool
Thread pool constructor
Params min_workers: | |
---|---|
Min number of worker threads | |
Params max_workers: | |
Max number of worker threads | |
Params idle_timeout: | |
Worker threads idle timeout | |
Params logger: | logger to use. Default to stdout |
Generator to return work in normalize form: (fn, args, kwargs)
Parameters: | works (iteratable of fn / (fn, args) / (fn, args, kwargs)) – An iteratable of possible functor form |
---|---|
Return type: | tuple of (fn, args, kwargs) |
Returns: | A normalize tuple of (functor, args, kwargs) |
Queue work
Returns a work_item when work is queued to work queue The work will start when a ready worker is available to process the work User could call {work_item}.join() to wait for the work item to finish
Parameters: |
|
---|---|
Return type: | |
Returns: | work item when work is queued to work queue |
Queue a work and wait until the work is completed / error out
Parameters: |
|
---|---|
Return type: | tuple of (bool, object) or (bool, Exception) |
Returns: | (True, return val) / (False, exception) when work is done |
Queue a brunch of works and wait until all works are completed / error out
Parameters: | works (iteratable of fn / (fn, args) / (fn, args, kwargs)) – An iteratable of possible functor form |
---|---|
Return type: | list of {tuple} of bool,:class:object or bool,:class:Exception |
Returns: | A list of (True, return val) / (False, exception) when all works done |
Visitor helper class
Workers thread pool
get workers pool
Parameters: | pool_tag (str) – workers pool tag |
---|---|
Return type: | vmware.vapi.lib.thread_pool.ThreadPool |
Returns: | workers pool |