Fetch SSH keys

Scenario Overview

Invoke a request from DLM to NSO device to perform a Fetch SSH keys

Prerequisites

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

Retrieve Device Package

Run the script fetch_ssh_keys from the example directory.

cd cnc-nso-api-examples;./fetch_ssh_keys.sh

Script Details

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

fetch_ssh_keys() {
    # 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 NSO Fetch SSH keys API
    # STEP 3 :  store the output in CNC_API_OUTPUT file

    CNC_DLM_NSO_API=$CNC_DLM_NSO_API_CTX/nso/fetch-ssh-keys
    CNC_API_INPUT="@$PRJ/input/fetch_ssh_keys.json"	 
    CNC_API_OUTPUT="$PRJ/output/fetch_ssh_keys.json"
    http_post $CNC_DLM_NSO_API $CNC_API_INPUT $CNC_API_OUTPUT
    
}
fetch_ssh_keys