QuestionQ90

VerifiedDevice-Level Network Automation

Drag and drop the code below into the missing boxes to find the status of a template deployment to a device. Not all code is shown, and not every option is used.

Drag & Drop
import requests, json


url = f"{BASE_URL}/dna/intent/api/v1/
template-programmer"

headers = {

    'x-auth-token': 'eyJhbGc ... yJoN8',

    'Content-Type': 'application/json',

}


response = requests.request('',
        url, headers=headers)

if response.status_code == 200:

    print(f"Status: {response.json()['']}")
else:

    print("ERROR: Error retrieving template deploy status")
Explanation

Cisco Catalyst Center’s Template Programmer API exposes deployment status at GET /template-programmer/template/deploy/status/{deploymentId}. Its successful response includes the status property, which is the value printed by the script.

Community Discussion

No comments yet. Be the first to start the discussion!