streamsx.rest_primitives module

class streamsx.rest_primitives.ActiveService(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

class streamsx.rest_primitives.ActiveVersion(json_active_version)

Bases: object

class streamsx.rest_primitives.ActiveView(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

The deprecated active view element resource provides access to information about a view that is active.

class streamsx.rest_primitives.ConfiguredView(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

The deprecated configured view element resource provides access to configuration information for a view.

class streamsx.rest_primitives.Domain(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

The domain element resource provides access to information about an InfoSphere Streams domain.

get_active_services()
get_hosts()
get_instances()
get_resource_allocations()
get_resources()
class streamsx.rest_primitives.ExportedStream(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

class streamsx.rest_primitives.Host(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

The host element resource provides access to information about a host that is allocated to a domain as a resource for running Streams services and applications.

class streamsx.rest_primitives.ImportedStream(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

class streamsx.rest_primitives.Installation(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

class streamsx.rest_primitives.Instance(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

The instance element resource provides access to information about a Streams instance.

get_active_services()
get_active_views()
get_configured_views()
get_domain()
get_exported_streams()
get_hosts()
get_imported_streams()
get_jobs(id=None, name=None)
get_operator_connections()
get_operators()
get_pe_connections()
get_pes()
get_resource_allocations()
get_views()
class streamsx.rest_primitives.Job(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

The job element resource provides access to information about a submitted job within a specified instance.

cancel(force=False)

Cancel this job.

Parameters:force (bool) – Forcefully cancel this job.
Returns:True if the job was cancelled, otherwise False if an error occurred.
get_active_views()
get_domain()
get_hosts()
get_instance()
get_operator_connections()
get_operators()
get_pe_connections()
get_pes()
get_resource_allocations()
get_views()
class streamsx.rest_primitives.Metric(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

Metric resource provides access to information about a Streams metric.

class streamsx.rest_primitives.Operator(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

The operator element resource provides access to information about a specific operator in a job.

get_metrics(name=None)

Get metrics for an operator.

Parameters:name (str) – Only return metrics matching name as a regular expression using re.match(name, metric_name. If name is not supplied then all metrics for this operator are returned.
Returns:list – List of matching metrics.
Return type:Metric
class streamsx.rest_primitives.OperatorConnection(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

The operator connection element resource provides access to information about a connection between two operator ports.

class streamsx.rest_primitives.PE(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

The processing element (PE) resource provides access to information about a PE.

class streamsx.rest_primitives.PEConnection(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

The processing element (PE) connection resource provides access to information about a connection between two processing element (PE) ports.

class streamsx.rest_primitives.Resource(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

get_resource()
class streamsx.rest_primitives.ResourceAllocation(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

class streamsx.rest_primitives.ResourceTag(json_resource_tag)

Bases: object

class streamsx.rest_primitives.StreamingAnalyticsService(rest_client, credentials)

Bases: object

Streaming Analytics service running on IBM Bluemix cloud platform.

cancel_job(job_id=None, job_name=None)

Cancel a running job.

Parameters:
  • job_id (str) – Identifier of job to be canceled.
  • job_name (str) – Name of job to be canceled.

Returns:

class streamsx.rest_primitives.StreamsRestClient(username, password, resource_url)

Bases: object

Handles the session connection with the Streams REST API.

Parameters:
  • username (str.) – The username of an authorized Streams user.
  • password (str.) – The password associated with the username.
  • resource_url – The resource endpoint of the instance. Can be found with st geturl –api for local Streams

installs. :type resource_url: str.

make_request(url)
class streamsx.rest_primitives.View(json_view, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

The view element resource provides access to information about a view that is associated with an active job, and exposes methods to retrieve data from the View’s Stream.

get_domain()
get_instance()
get_job()
get_view_items()
start_data_fetch()
stop_data_fetch()
class streamsx.rest_primitives.ViewItem(json_rep, rest_client)

Bases: streamsx.rest_primitives._ResourceElement

Represents the data of a tuple, it’s type, and the time when it was collected from the stream.

class streamsx.rest_primitives.ViewThread(view)

Bases: threading.Thread

A thread which, when invoked, begins fetching data from the supplied view and populates the View.items queue.

streamsx.rest_primitives.get_view_obj(_view, rc)