Joulectl CLI

Use Joulectl to deploy and manage use cases within the Joule platform

Joulectl helps you deploy and manage use cases within the Joule platform. It uses a context configuration which connects to the desired Joule platform.

Installation

To install joulectl visit here.

pip install joulectl

Joule usecase Lifecycle

Joulectl allows you to manage the entire usecase lifecycle which includes these phases:

  • Deployment

  • Getting status

  • Runtime management

  • Undeployment

The follwing sections cover each of these areas.

Available Commands

Joulectl has a set of commands to support the deployment and management of use cases for both single node and cluster deployment:

Execute joulectl <command> --help will show further details on how to use a command.

Configure command

Joulectl can be configured to execute commands against a cluster or single node.

Command: joulectl config <sub-command> <arguments>

create

On first usage of the tool a configuration file must be created. A config.json file will created using default setting under the ~/.config/joule directory.

The default setting will be applied for single Joule node operation on 127.0.0.1:9080

update

To change the host address and port using the update command. The example below configures connects to the Joule Guardian process which manages a cluster of Joule processes, to learn more about Joule's capabilities running in cluster mode under the deployment section.

show

Display the current configuration setting.

Deploy command

Deploying a use requires at minimum four components to be deploy:

  1. Source data transport

  2. Stream definition

  3. Sink data transport

  4. Use case definition which binds source, stream and sink together

A set of sub command elements provide these functionalities.

We shall use the IoT valve control use case found under the quick start project

Note the --pod option will be used to deploy artefacts to a specifc cluster of Joule nodes

Command: joulectl deploy <sub-command> <json-filename> --pod <pod-name>

Transports

Register transports in to the system.

Transports are reusable across use cases

Sources

Connect to the MQTT sensor data event source

Sinks

Deploy a MQTT event publisher and a file sink.

Now list out the deployed transports

Stream

Use case

By deploying a use case the Joule platform creates a runtime context which binds all defined dependencies together to act as a single use case unit

At this point you will have a running use case processing sensor event data and publishing alerts both to MQTT and to file.

List command

List deployed clusters, artefacts and running processes:

  • Pods

  • Members

  • Transports

  • Streams

  • Use cases

Command: joulectl ls <type>

Pods

List the deployed clusters joule nodes.

Members

List the cluster connected Joule nodes.

Transports

List deployed transports.

Streams

List the deployed stream processing definitions.

Use cases

List the deployed use cases.

Inspect command

This command queries the Joule registry for a given data-type and returns the deployed artefact as a file.

Supported sub commands:

  • usecase

  • stream

  • transport

Command: joulectl inspect <sub-command> --help for required arguments.

This will return a sensor_analytics_uc.json file in to the local directory.

Process command

Control a deployed use case by either pausing processing or resuming the stream processing. This may be useful in the event of debugging.

Command: joulectl process <sub-command> <usecase-name> --pod <pod-name>

Pause

Pause a use case processing

Resume

Resume a use case processing

Undeploy command

To undeploy use cases, stream and transport from the Joule platform.

Command: joulectl undeploy <type> <deployment-name> --pod <pod-name>

Note streams and transports cannot be undeployed if there is a dependency on them.

Usecase

Stream

Transport

Last updated

Was this helpful?