Search code examples
streamsets

Streamsets version from CLI


I'm currently writing code that locally installs streamsets extensions via a CLI. One of the checks I want to write is to ensure that the extension works for the streamsets version that's installed locally.

When I try to query the version from the CLI this is what I run into.

:) streamsets --version

Invalid sub-command

streamsets <SUB_COMMAND> [<SUB_COMMAND_ARGUMENTS>]

  Sub-commands:

    dc: Starts the Data Collector

    create-dc: Creates new instance of Data Collector

    cli: Data Collector CLI

    jks-cs: Java Keystore Credential Store

    stagelibs: Data Collector Stage library installer

    show-vault-id: Shows the user-id to authorize in Vault

    setup-mapr: Enables the MapR stage library for the detected
                MapR installation.
:( streamsets cli --version
Found unexpected parameters: [--version]
) streamsets dc --version

Invalid option(s)

streamsets dc <OPTIONS>

  Options:
    -verbose          : prints out Data Collector detailed environment settings
    -exec             : starts Data Collector JVM within the same process of the script
    -skipenvsourcing  : skips the sourcing of the libexec/sdc-env.sh file

How do I figure out what version of streamsets is installed other than traversing the file system and finding the VERSION file?


Solution

  • You can get a Data Collector's info, including the version, with the CLI's ping command:

    $ streamsets cli -U http://localhost:18630 ping
    {
      "info" : {
        "built.date" : "2018-06-13T23:02Z",
        "version" : "3.4.0-SNAPSHOT",
        "built.repo.sha" : "9f803ed0f5167bbb91af2493b20c9a20b566106f",
        "source.md5.checksum" : "1d59dbb2281a974f4b192a28efe7624c",
        "built.by" : "pat"
      },
      "version" : "3.4.0-SNAPSHOT",
      "builtDate" : "2018-06-13T23:02Z",
      "builtBy" : "pat",
      "builtRepoSha" : "9f803ed0f5167bbb91af2493b20c9a20b566106f",
      "sourceMd5Checksum" : "1d59dbb2281a974f4b192a28efe7624c"
    }
    

    system info is a synonym for ping

    This isn't (yet) documented. I'll open a doc Jira to do so.