Using the Shell
You can use the shell with Spring Cloud Data Flow for PCF service instances in either of two ways:
- The Spring Cloud Data Flow for PCF Cloud Foundry CLI plugin (recommended)
- The open-source shell binary, with manually-configured command-line options
The Spring Cloud Data Flow for PCF Cloud Foundry CLI plugin was created to ease the use of the Spring Cloud Data Flow shell with Spring Cloud Data Flow service instances on PCF.
Note: To run the Spring Cloud Data Flow shell, you must have a Java Runtime Environment (JRE) installed. You can download the JRE from the Java website.
Note: Before connecting to a Data Flow service instance with the Spring Cloud Data Flow shell, be sure to log in to the PCF deployment using the Cloud Foundry Command Line Interface tool (cf CLI) and target the org and space of the Data Flow service instance. The Data Flow shell uses the cf CLI to authenticate to PCF.
Installing the Plugin
The Spring Cloud Data Flow for PCF Cloud Foundry CLI plugin is available through the Cloud Foundry Community Plugins repository.
To install the plugin, run the following command:
$ cf install-plugin -r CF-Community "spring-cloud-dataflow-for-pcf"
Using the Plugin
After installing the plugin, you can use it to attach the Data Flow shell to a Spring Cloud Data Flow for PCF service instance. Given an existing service instance named
data-flow, the following command will download the appropriate shell version and attach it to the service instance:
$ cf dataflow-shell data-flow Attaching shell to dataflow service data-flow in org myorg / space dev as user... Downloading https://repo.spring.io/libs-release/org/springframework/cloud/ spring-cloud-dataflow-shell/1.3.0.RELEASE/spring-cloud-dataflow-shell-1.3.0.RELEASE.jar Launching dataflow shell JAR ____ ____ _ __ / ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| | \___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` | ___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| | |____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_| ____ |_| _ __|___/ __________ | _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \ | | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \ | |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / / |____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/ 1.3.0.RELEASE Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help". dataflow:>
For more information about the Spring Cloud Data Flow shell, see its documentation.
If you would like to download and configure the Data Flow shell manually, download the shell JAR file from the Spring Releases Maven repository. Spring Cloud Data Flow for PCF can be used with version 1.3.0.RELEASE or later of the Spring Cloud Data Flow shell.
To target a Data Flow service instance’s server with the shell, you must obtain the server’s URL. Run
cf service SERVICE_NAME, where
SERVICE_NAME is the name of the service instance:
$ cf service data-flow Service instance: data-flow Service: p-dataflow Bound apps: Tags: Plan: standard Description: Deploys Spring Cloud Data Flow servers to orchestrate data pipelines Documentation url: http://cloud.spring.io/spring-cloud-dataflow/ Dashboard: https://p-dataflow.apps.wise.com/instances/f09e5c77-e526-4f49-86d6-721c6b8e2fd9/dashboard ...
Visit the URL given for “Dashboard” and authenticate using your PCF credentials. When redirected to the service instance’s dashboard, copy the dashboard’s domain name (the URL minus the path following the domain).
For example, given the following URL:
Copy the following:
From the directory containing the shell JAR file, run the shell from the command line using a command as shown below.
$ java -jar JAR_NAME SKIP_VALIDATION --dataflow.uri=SERVER_URL --dataflow.credentials-provider-command="cf oauth-token" --dataflow.mode=skipper
In this command, replace the following placeholders as shown below.
JAR_NAMEwith the name of the downloaded Spring Cloud Data Flow shell JAR file
SKIP_VALIDATIONwith the flag and value
--dataflow.skip-ssl-validation=trueif your PCF installation is using self-signed SSL certificates; otherwise remove
SERVER_URLwith the Data Flow service instance’s server URL (the domain copied above)
The complete command may look something like the following (newlines added for readability):
$ java -jar spring-cloud-dataflow-shell-1.3.0.RELEASE.jar --dataflow.skip-ssl-validation=true --dataflow.uri=https://dataflow-f09e5c77-e526-4f49-86d6-721c6b8e2fd9.apps.wise.com --dataflow.credentials-provider-command="cf oauth-token" --dataflow.mode=skipper
When you run the
java -jar command, the shell will initialize and give a
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help". dataflow:>
For a list of available shell commands, run
help from within the shell. For information about the flags which can be provided to the shell on startup, see the OSS Spring Cloud Data Flow project’s documentation.