Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It can be installed on Distributed CDAP, in which case it will be installed either in /opt/cdap/cli or, in the case of Cloudera Manager, opt/cloudera/parcels/cdap/cli/.

You can use the CLI in two modes:

...

  • Linux: $./bin/cdap cli

  • Windows: > .\bin\cdap.bat cli

  • Distributed CDAP: $ /opt/cdap/cli/bin/cdap cliCloudera Manager clusters: $ /opt/cloudera/parcels/cdap/cli/bin/cdap cli

The executable should bring you into a shell, with a prompt similar to:

...

The CDAP CLI uses the following options:

Option

Argument

Description

--autoconnect
--a

true|false

If set to true, try provided connection (from uri)

--debug  
--d

n/a

Print exception stack traces.

--help 
--h

n/a

Print the usage message.

--link
--l

uri

CDAP instance URI to interact with in the format     "[http[s]://]<hostname>[:<port>][/<path>]"
Defaults to "http://<hostname>.local:11015".

--namespace
--n

namespace_name

CDAP Instance Namespace to connect to. Defaults to “default”.

--retries
--r

number_of_retries

Set the number of times to retry contacting a service if it is determined to be unavailable. Defaults to 0.

--script
--s

script_name

Execute a file containing a series of CLI commands, line-by-line.

--timeout
--t

read_timeout_in_seconds

Set HTTP read timeout of the CLI in seconds.

--verify-ssl
--v

true|false

If "true", verify SSL certificate when making   requests. Defaults to "true".

Info

Starting in CDAP 6.1.4, the option --uri is deprecated. Use --link option instead.

...

  • The command cli render as <table-renderer> (from the General commands) sets how table data is rendered. Valid options are either alt (the default) or csv. Because the alt option might split a cell into multiple lines, you might need to use csv if you want to copy and paste the results into another application or include in a message.

    • With cli render as alt (the default), a command such as list apps will be output as:

      Code Block
      +================================+
      | app id      | description      |
      +=============+==================+
      | PurchaseApp | Some description |
      +=============+==================+
    • With cli render as csv, the same list apps will be output as:

      Code Block
      app id,description
      PurchaseApp,Some description
  • The command connect-link (from the General commands) allows you to connect to a CDAP instance.

  • The command use namespace (from the Namespace commands) allows you to set the namespace used with all subsequent commands. By default, all sessions start in the default namespace.