Query Node
Scenario Overview
Retrieves a list of nodes. This api returns complete inventory data for each node. Various filters can be applied to retrieve specific sets of nodes by specifying one or more fields to match. User can filter on combinations of supported fields. The exceptions and details of the filter structure are listed below. This api takes RobotNodeGetReq as input, in which the user can specify the limit(page size), and Filter input.
Prerequisites
Before running this example, ensure to obtain access token. Refer 'Getting Started' section.
Query Node
Run the script _query_node from the example directory.
cd cnc-dlm-api-examples;./query_node.sh
Script Details
#!/bin/bash
. ./cnc-api-common.sh
query_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 query node API
# STEP 3 : store the output in CNC_API_OUTPUT file
CNC_DLM_API=$CNC_DLM_API_CTX/nodes/query
CNC_API_INPUT="@$PRJ/input/query_node.json"
CNC_API_OUTPUT="$PRJ/output/query_node.json"
http_post $CNC_DLM_API $CNC_API_INPUT $CNC_API_OUTPUT
}
query_node