streamsx.build

REST API bindings for IBM® Streams Cloud Pak for Data build service.

Streams Build REST API

The REST Build API provides programmatic support for creating, submitting and managing Streams builds. You can use the REST Build API from any application that can establish an HTTPS connection to the server that is running the build service. The current support includes only methods for managing toolkits in the build service.

Cloud Pak for Data

of_endpoint() is the entry point to using the Streams Build REST API bindings, returning an BuildService.

Module contents

Classes

BuildService

IBM Streams build service.

class streamsx.build.BuildService(username=None, password=None, resource_url=None, auth=None)

Bases: streamsx.rest._AbstractStreamsConnection

IBM Streams build service.

A instance of a BuildService is created using of_endpoint().

New in version 1.13.

get_resources()

Retrieves a list of all known Streams high-level Build REST resources.

Returns

List of all Streams high-level Build REST resources.

Return type

list of RestResource

get_toolkit(id)

Retrieves available toolkit matching a specific toolkit ID.

Parameters

id (str) – Toolkit identifier to retrieve. This is the name and version of a toolkit. For sample, com.ibm.streamsx.rabbitmq-1.1.3

Returns

Toolkit matching id.

Return type

Toolkit

Raises

ValueError – No matching toolkit exists.

get_toolkits(name=None)

Retrieves a list of all installed Streams Toolkits.

Returns

List of all Toolkit resources.

Return type

list of Toolkit

Parameters

name (str) – Return toolkits matching name as a regular expression.

static of_endpoint(endpoint=None, service_name=None, username=None, password=None, verify=None)

Connect to a Cloud Pak for Data IBM Streams build service instance.

Two configurations are supported.

Integrated configuration

The build service is bound to a Streams instance and is defined using the Cloud Pak for Data deployment endpoint (URL) and the Streams service name.

The endpoint is passed in as endpoint defaulting the the environment variable CP4D_URL. An example is https://cp4d_server:31843.

The Streams service name is passed in as service_name defaulting to the environment variable STREAMS_INSTANCE_ID.

Standalone configuration

A build service is independent of a Streams instance and is defined using the build service endpoint.

The endpoint is passed in as endpoint defaulting the the environment variable STREAMS_BUILD_URL. An example is https://build_service:34679.

No service name is specified thus service_name should be passed as None or not set.

Parameters
  • endpoint (str) – Endpoint defining the build service.

  • service_name (str) – Streams instance name for a integrated configuration. This value is ignored for a standalone configuration.

  • username (str) – User name to authenticate as. Defaults to the environment variable STREAMS_USERNAME or the operating system identifier if not set.

  • password (str) – Password for authentication. Defaults to the environment variable STREAMS_PASSWORD or the operating system identifier if not set.

  • verify – SSL verification. Set to False to disable SSL verification. Defaults to SSL verification being enabled.

Returns

Connection to Streams build service or None of insufficient configuration was provided.

Return type

BuildService

property resource_url

Endpoint URL for IBM Streams REST build API.

Type

str

upload_toolkit(path)

Upload a toolkit from a directory in the local filesystem to the Streams build service.

Multiple versions of a toolkit may be uploaded as long as each has a unique version. If a toolkit is uploaded with a name and version matching an existing toolkit, it will not replace the existing toolkit, and None will be returned.

Parameters

path (str) – The path to the toolkit directory in the local filesystem.

Returns

The created Toolkit, or None if it was not uploaded.

Return type

Toolkit