plainbox.impl.highlevel – High-level API

class plainbox.impl.highlevel.Explorer(provider_list=None, repository_list=None)[source]

Bases: builtins.object

Class simplifying discovery of various PlainBox objects.

get_object_tree()[source]

Get a tree of PlainBoxObject that represents everything that PlainBox knows about.

Returns:A PlainBoxObject that represents the explorer object itself, along with all the children reachable from it.

This function computes the following set of data:

the explorer itself
    - all providers
        - all jobs
        - all whitelists
        - all executables
    - all repositories
        - all storages
class plainbox.impl.highlevel.PlainBoxObject(impl, name=None, group=None, children=None, attrs=None)[source]

Bases: builtins.object

A thin wrapper around some other plainbox object.

attrs[source]

A mapping of key-value attributes that this object has

This mapping is mutable and is always guaranteed to exist.

children[source]

A list of children that this object has

This list is mutable and is always guaranteed to exist.

group[source]

group this object belongs to.

This is a way to distinguish high-level “classes” that may not map one-to-one to a internal python class.

name[source]

name of this object

This may be an abbreviated form that assumes the group is displayed before the name. It will probably take a few iterations before we get right names (and other, additional properties) for everything.

class plainbox.impl.highlevel.PrimedJob(service, session, provider_list, job)[source]

Bases: builtins.object

Job primed for execution.

job[source]

The job to be executed

run()[source]

Run the primed job.

Returns:Future for the job result

Note

This method returns immediately, before the job finishes running.

class plainbox.impl.highlevel.Service(provider_list, session_list, config)[source]

Bases: builtins.object

close()[source]
create_session(job_list)[source]
export_session(session, output_format, option_list)[source]
export_session_to_file(session, output_format, option_list, output_file)[source]
get_all_exporters()[source]
get_all_transports()[source]
prime_job(session, job)[source]

Prime the specified job for running.

The job will be invoked in a context specific to the session. The configuration object associated with this service instance might be used to fetch any additional configuration data for certain jobs (environment variables)

Returns:a primed job, ready to be started
provider_list[source]
send_data_via_transport(session, transport, where, options, data)[source]
session_list[source]
version[source]

Previous topic

plainbox.impl.exporter.xml

Next topic

plainbox.impl.integration_tests – integration tests

This Page