QuestionQ80
VerifiedController-Based Network AutomationDrag the code snippets onto the boxes in the code to complete the attach_feature_template function, which attaches a configuration template by using the vManage Configuration API. The template is new and has not been modified. Not every option is used.
Drag & Drop
def attach_feature_template(self): mount_point = "template/device//attachfeature" payload = { "deviceTemplateList":[ { "templateId":"41f6a440-c5cc-4cc6-9ca1-af18e332a781", "device":[ { "":"complete", "csv-deviceId":"CSR-61CD2335-4775-650F-8538-4EC7BDFFD04C", "csv-deviceIP":"10.10.1.11", "csv-host-name":"dc-cedge01", "//system/host-name":"dc-cedge01", "//system/system-ip":"10.10.1.11", "//system/site-id":"100", "csv-templateId":"41f6a440-c5cc-4cc6-9ca1-af18e332a781", "selected":"true" } ], "isEdited": False, "isMasterEdited":False } ] } headers={"Content-Type": ""} url = "https://%s/dataservice/%s"%(self.vmanage_ip, mount_point) payload = json.dumps(payload) response = self.session(self.vmanage_ip).(url=url, data=payload, headers=headers, verify=True) return response
Community Discussion