300-435 · Question #136
Drag and drop the code snippets from the bottom onto the boxes in the code to complete the attach_feature_template function that attaches a configuration template by using the vManage Configuration…
This question tests knowledge of the Cisco vManage Configuration API endpoint structure and HTTP payload construction for attaching a feature template to a device. It requires identifying the correct URL path segment, device status field, and Content-Type header value.
Question
def attach_feature_template(self):
mount_point = "template/device/ /attachfeature"
payload = {
"deviceTemplateList": [
{
"templateId": "41f6a440-c5cc-4cc6-9cal-af18e332a781",
"device": [
{
" ": " ", "complete",
"csv-deviceId":"7CSA-61CD2311-4775-650F-B538-4EC7BDFFD04C",
"csv-deviceIP":"10.10.1.1",
"csv-host-name":"dc-edge01",
"//system system-ip":"10.10.1.11",
"//system system-ip":"10.10.1.1",
"csv-templatedId":"41f6a440-c5cc-4cc6-9cal-af18e332a781",
"selected":"true"
}
]
}
],
"isEdited": False,
"isMasterEdited": False
}
headers = {"Content-Type": " "}
url = "https://%s/dataservice/%s/%s/self.vmanage_ip, mount_point)
payload = json.dumps(payload)
response = self.session.post(url=url,
data=payload,
headers=headers, verify=True)
return response
Available options: template, post, csv-status, attach, put, config, application/json.Exhibit
Explanation
This question tests knowledge of the Cisco vManage Configuration API endpoint structure and HTTP payload construction for attaching a feature template to a device. It requires identifying the correct URL path segment, device status field, and Content-Type header value.
Approach. The three blanks map to specific API requirements: (1) The mount_point blank is 'config' - the full endpoint is 'template/device/config/attachfeature', which is the vManage REST API path for attaching feature templates. (2) The device dictionary key blank is 'csv-status' with value 'complete' - this field signals the template attachment state; since the template is new and unmodified (isEdited: False, isMasterEdited: False), 'complete' is the correct status. (3) The Content-Type header value is 'application/json' - vManage API calls require JSON payloads with this MIME type. Options like 'attach', 'template', 'post', and 'put' are distractors: the HTTP method is already set by self.session.post(), and 'attach'/'template' are not valid path segments in this position.
Concept tested. Cisco vManage REST API - feature template attachment endpoint construction (URL path, device payload fields like csv-status, and HTTP headers for JSON-based API calls)
Reference. Cisco SD-WAN vManage Configuration API Guide - POST /dataservice/template/device/config/attachfeature
Topics
Community Discussion
No community discussion yet for this question.
