Delete Node

Scenario Overview

Delete the bulk of nodes from Crossworks, Either all nodes would be deleted or none.

Prerequisites

Before running this example, ensure to obtain access token. Refer 'Getting Started' section.

Create Node

Run the script _delete_node from the example directory.

cd cnc-dlm-api-examples;./delete_node.sh

Script Details

#!/bin/bash
. ./cnc-api-common.sh

delete_node() {
    # assume cnc jwt is obtained prior to invoking this method by executing get-cnc-jwt.sh script
    # read from jwt file and export it as AUTH_TOKEN_HDR
     export_jwt

    # STEP 1 :  User to update input json with details of job to be created in the file CNC_API_INPUT
    # STEP 2 :  trigger delete node API
    # STEP 3 :  store the output in CNC_API_OUTPUT file

    CNC_DLM_API=$CNC_DLM_API_CTX/nodes
    CNC_API_INPUT="@$PRJ/input/delete_node.json"	 
    CNC_API_OUTPUT="$PRJ/output/delete_node.json"
    http_delete $CNC_DLM_API $CNC_API_OUTPUT $CNC_API_INPUT 
    
}
delete_node