Query Provider
Scenario Overview
Retrieves a list of providers. This api returns KEY fields, host-name, providertype, lock state, liveness state, connectionprotocollist, ipaddress, port and deviceidformat. Various filters can be applied to retrieve specific sets of providers 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 RobotProviderGetReq as input, in which the user can specify the limit(page size), next_from, filters(RobotProviderData) and sort_by (Not supported in this version, default sorting is done using uuid in ascending order).
Prerequisites
Before running this example, ensure to obtain access token. Refer 'Getting Started' section.
Query Provider
Run the script _query_provider from the example directory.
cd cnc-dlm-api-examples;./query_provider.sh
Script Details
#!/bin/bash
. ./cnc-api-common.sh
query_provider() {
# 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 provider API
# STEP 3 : store the output in CNC_API_OUTPUT file
CNC_DLM_API=$CNC_DLM_API_CTX/providers/query
CNC_API_INPUT="@$PRJ/input/query_provider.json"
CNC_API_OUTPUT="$PRJ/output/query_provider.json"
http_post $CNC_DLM_API $CNC_API_INPUT $CNC_API_OUTPUT
}
query_provider