Nominode Task Updates via CLI

Nominode Task Updates via CLI

Below, we will discuss retrieving, updating, creating and deleting a Task using the Nominode SDK.  Command line interaction with Tasks and other components is a cornerstone for integrating your Nominode with source control systems and continuous delivery pipelines.

Prerequisites

Python 3.7.4 (or newer)

Nom Nom Data Nominode SDK 0.3.1 (or newer)

Nom Nom Data Account and Nominode Server

Install the Prerequisites

To create code that updates your Nominode from a command line, you will need to install Python 3.7.4 and the Nom Nom Data Nominode SDK.  MacOS, Windows and Linux are all supported operating systems for your development environment.

1.  Install Python.  The exact steps to install and configure Python will differ based your operating system.  Detailed instructions for all platforms can be found here:

2.  Create a new Python virtual environment.  This will ensure there are no version requirement conflicts with the libraries installed by our SDK.  You can use any method that you prefer to create the virtual environment.  If you don't have a preferred method, you can use the venv command in Python 3.x.  Detailed instructions for all platforms can be found here:

For example, in a bash shell on Linux, you can run these commands:
python3 -m venv nomnomdata
source nomnomdata/bin/activate
3.  Install the Nom Nom Data Nominode SDK.  Run this command in you Linux shell, MacOS terminal window or a Command Prompt:
pip install nomnomdata-nominode
                  

Retrieve a Nominode Task in JSON Format

1.  Login in to a Nom Nom Data account that has access to the Nominode with the Task that you want to retrieve:
nnd login
You can also set environment variables named NND_USERNAME and NND_PASSWORD to avoid using the interactive login command in this step.  This approach is recommended if you are interacting with the Nominode via an automation script.

2.  Run the nominode task get command with the URL that you use to access your Nominode in a browser, the Project ID where your Task exists and the Task ID for your Task:
nnd nominode task get -n <Nominode URL> -pu <Project ID> -tu <Task ID>
The -n switch is used to specify the URL for your Nominode.  For example, http://yourserver.yourdomain.com

The -pu switch is used to specify the Project ID that your Task exists under.  More details about how to determine a Project's ID can be found in the Locating a UUID knowledge base article.  The default project's UUID is 00000-00000.

The -tu switch is used to specify the Task ID associated with the task that you want to retrieve.  More details about how to determine a Task's ID can be found in the Locating a UUID knowledge base article.

Full command line example:
nnd nominode task get -n http://yourserver.yourdomain.com -pu 00000-00000 -tu 84DLY-KK1LU
Example command output:
{ "code": 200, "status": "Success", "message": null, "results": { "actions": null, "alias": "Hello Test", "concurrency": 1, "created": "2020-12-01T18:43:14+00:00", "description": null, "engine_uuid": "HELLO-WORLD-SUPPORT", "last_execution": { "created": "2020-12-01T18:43:20+00:00", "executor_type": "legacy", "has_result": null, "message": "Completed: Successful execution", "progress": 0, "status": { "description": "Successfully executed task.", "execution_state": "Completed", "id": "99" }, "updated": "2020-12-01T18:43:42+00:00", "uuid": "16068482006D3C3C5F7ADF4AF5B93E8343A5C6CC48" }, "last_execution_uuid": "16068482006D3C3C5F7ADF4AF5B93E8343A5C6CC48", "last_successful_execution_uuid": "16068482006D3C3C5F7ADF4AF5B93E8343A5C6CC48", "notify": null, "options": { "channel": "stable" }, "parameters": { "action_name": "hello_world", "alias": "Hello Test", "name": "Test", "repeat": 3 }, "project_uuid": "00000-00000", "status": null, "updated": "2020-12-01T18:43:42+00:00", "uuid": "84DLY-KK1LU", "versions": [{ "transaction_id": 15, "uuid": "84DLY-KK1LU" }] } }

Update a Nominode Task using JSON Formatted Text

1.  Login in to a Nom Nom Data account that has access to the Nominode with the Task that you want to retrieve:
nnd login
You can also set environment variables named NND_USERNAME and NND_PASSWORD to avoid using the interactive login command in this step.  This approach is recommended if you are interacting with the Nominode via an automation script.

2.  Run the nominode task update command with the URL that you use to access your Nominode in a browser, JSON text representing your updated Task or a path to a text file containing JSON text representing your updated Task:
nnd nominode task update -n <Nominode URL> -s '<JSON formatted text>'
Or :
nnd nominode task update -n <Nominode URL> -f <text file path>

The -n switch is used to specify the URL for your Nominode.  For example, http://yourserver.yourdomain.com

The -s switch is used to specify the JSON text representation of the portion of your Task with updated information.  For example:
{ "parameters": {"repeat": 5}, "project_uuid": "00000-00000", "uuid": "84DLY-KK1LU" }
The -f switch is used to specify a file path to a text file containing the full JSON text representation of your Task with updated information.

Full command line example:
nnd nominode task update -n http://yourserver.yourdomain.com -f yourtask.json
Example command output:
{ "code": 202, "status": "Success", "message": null, "results": { "actions": null, "alias": "Hello Test", "concurrency": 1, "created": "2020-12-01T18:43:14+00:00", "description": null, "engine_uuid": "HELLO-WORLD-SUPPORT", "last_execution": { "created": "2020-12-01T18:43:20+00:00", "executor_type": "legacy", "has_result": null, "message": "Completed: Successful execution", "progress": 0, "status": { "description": "Successfully executed task.", "execution_state": "Completed", "id": "99" }, "updated": "2020-12-01T18:43:42+00:00", "uuid": "16068482006D3C3C5F7ADF4AF5B93E8343A5C6CC48" }, "last_execution_uuid": "16068482006D3C3C5F7ADF4AF5B93E8343A5C6CC48", "last_successful_execution_uuid": "16068482006D3C3C5F7ADF4AF5B93E8343A5C6CC48", "notify": null, "options": { "channel": "stable" }, "parameters": { "action_name": "hello_world", "alias": "Hello Test", "name": "Test", "repeat": 5 }, "project_uuid": "00000-00000", "status": null, "updated": "2020-12-01T20:11:57+00:00", "uuid": "84DLY-KK1LU", "versions": [{ "transaction_id": 15, "uuid": "84DLY-KK1LU" }, { "transaction_id": 16, "uuid": "84DLY-KK1LU" }] } }

Create a Nominode Task using JSON Formatted Text

1.  Login in to a Nom Nom Data account that has access to the Nominode with the Task that you want to retrieve:
nnd login
You can also set environment variables named NND_USERNAME and NND_PASSWORD to avoid using the interactive login command in this step.  This approach is recommended if you are interacting with the Nominode via an automation script.

2.  Run the nominode task create command with the URL that you use to access your Nominode in a browser, JSON text representing your new Task or a path to a text file containing JSON text representing your new Task:
nnd nominode task create -n <Nominode URL> -s '<JSON formatted text>'
Or :
nnd nominode task create -n <Nominode URL> -f <text file path>

The -n switch is used to specify the URL for your Nominode.  For example, http://yourserver.yourdomain.com

The -s switch is used to specify the full JSON text representation of your new Task with updated information.  For example:
{ "alias": "Hello Test", "engine_uuid": "HELLO-WORLD-SUPPORT", "options": {"channel": "stable"}, "parameters": { "action_name": "hello_world", "alias": "Hello Test", "name": "Test", "repeat": 3 }, "project_uuid": "00000-00000", "uuid": "AAAAA-AAAAA" }
The -f switch is used to specify a file path to a text file containing the full JSON text representation of your Task with updated information.

Full command line example:
nnd nominode task create -n http://yourserver.yourdomain.com -f yourtask.json
Example command output:
{ "code": 202, "status": "Success", "message": "", "results": { "actions": null, "alias": "Hello Test", "concurrency": 1, "created": "2020-12-01T22:37:40+00:00", "description": null, "engine_uuid": "HELLO-WORLD-SUPPORT", "last_execution": null, "last_execution_uuid": null, "last_successful_execution_uuid": null, "notify": null, "options": {"channel": "stable"}, "parameters": { "action_name": "hello_world", "alias": "Hello Test", "name": "Test", "repeat": 3 }, "project_uuid": "00000-00000", "status": null, "updated": "2020-12-01T22:37:40+00:00", "uuid": "AAAAA-AAAAA", "versions": [{ "transaction_id": 18, "uuid": "AAAAA-AAAAA" }] } }

Delete a Nominode Task

1.  Login in to a Nom Nom Data account that has access to the Nominode with the Task that you want to retrieve:
nnd login
You can also set environment variables named NND_USERNAME and NND_PASSWORD to avoid using the interactive login command in this step.  This approach is recommended if you are interacting with the Nominode via an automation script.

2.  Run the nominode task delete command with the URL that you use to access your Nominode in a browser, the Project ID where your Task exists and the Task ID for your Task:
nnd nominode task delete -n <Nominode URL> -pu <Project ID> -tu <Task ID>
The -n switch is used to specify the URL for your Nominode.  For example, http://yourserver.yourdomain.com

The -pu switch is used to specify the Project ID that your Task exists under.  More details about how to determine a Project's ID can be found in the Locating a UUID knowledge base article.  The default project's UUID is 00000-00000.

The -tu switch is used to specify the Task ID associated with the task that you want to delete.  More details about how to determine a Task's ID can be found in the Locating a UUID knowledge base article.

Full command line example:
nnd nominode task delete -n http://yourserver.yourdomain.com -pu 00000-00000 -tu AAAAA-AAAAA
Example command output:
{ "code": 202, "status": "Success", "message": "Task identified by uuid: AAAAA-AAAAA successfully deleted", "results": [] }

    • Related Articles

    • Nominode Installation and Configuration

      Installing a Nominode 1.  Create a Nom Nom Data account at https://auth.nomnomdata.com/sign-up                   ​ 2.  If the Nominode will be used by multiple people in your organization, setup the organization ...
    • Nominode Permissions Overview

      In the Permissions section of your Nominode, you can control what actions each user of your Nominode can perform.  Detailed instructions for how to modify permissions can be found in the Managing Permissions on a Nominode support document A Project ...
    • Managing Tasks on a Nominode

      Tasks allow you to schedule and automate the execution of the functions within the Nom Nom Apps on your Nominode. Creating a Task Click on Tasks near the top of the left hand navigation menu of your Nominode. Set the Select Project field at the top ...
    • Managing Sequences on a Nominode

      Sequences are used to schedule one or more Tasks to execute at specific times on a recurring basis.  Sequences are also used allow one Task to begin execution after another Task completes its execution, rather than at a specific time. Creating a ...
    • Managing Dashboards on a Nominode

      Dashboards are highly configurable interfaces to display visual information from one or more Tasks in a single location. Creating a Dashboard Click on Dashboards in the middle of the left hand navigation menu of your Nominode. Use the Project Select ...