brewtils.resolvers package

Submodules

brewtils.resolvers.bytes module

class brewtils.resolvers.bytes.BytesResolver(easy_client)[source]

Bases: brewtils.resolvers.ResolverBase

Resolver that uses the Beergarden file API

download(value, definition)[source]
should_download(value, definition)[source]
should_upload(value, definition)[source]
upload(value, definition)[source]

brewtils.resolvers.chunks module

class brewtils.resolvers.chunks.ChunksResolver(easy_client)[source]

Bases: brewtils.resolvers.ResolverBase

Resolver that uses the Beergarden chunks API

download(value, definition)[source]
should_download(value, definition)[source]
should_upload(value, definition)[source]

Parameter type must be Base64 and the value must be either:

  • String representation of a valid filename.
  • An IOBase object
upload(value, definition)[source]

brewtils.resolvers.identity module

class brewtils.resolvers.identity.IdentityResolver[source]

Bases: brewtils.resolvers.ResolverBase

Resolver that doesn’t actually resolve anything

On the upload side this is used to ensure that Resolvables always work when used in a SystemClient. For example, if you’re using a SystemClient to execute a command with a Bytes parameter but you already have a Resolvable for that parameter, this makes that work.

On the download side this is used to support autoresolve=False parameters. If a definition specifies “autoresolve”: False as part of the type_info dictionary then the parameter WILL NOT be resolved before the command function is invoked. Instead, the Resolvable itself will be passed as that parameter. This might be useful if you wanted to farm out a bytes object to multiple children commands without needing to re-upload the same bytes every time.

download(value, definition)[source]
should_download(value, definition)[source]
should_upload(value, definition)[source]
upload(value, definition)[source]

brewtils.resolvers.manager module

class brewtils.resolvers.manager.ResolutionManager(**kwargs)[source]

Bases: object

Parameter resolution manager

This class is used under-the-hood for various plugin functions. Its purpose is to remove all the various cleanup and housekeeping steps involved in resolving parameters. An example of an unresolved parameter is a dictionary which represents a bytes object. In this case the user wants the open file descriptor, not the random dictionary that they don’t know how to process. The parameter resolver helps handle these scenarios.

This is intended for internal use for the plugin class.

resolve(values, definitions=None, upload=True)[source]

Iterate through parameters, resolving as necessary

Parameters:
  • values – Dictionary of request parameter values
  • definitions – Parameter definitions
  • upload – Controls which methods will be called on resolvers
Returns:

The resolved parameter dict

brewtils.resolvers.manager.build_resolver_map(easy_client=None)[source]

Builds all resolvers

Module contents

class brewtils.resolvers.ResolverBase[source]

Bases: object

Base for all Resolver implementations

download(value, definition)[source]
should_download(value, definition)[source]
should_upload(value, definition)[source]
upload(value, definition)[source]