<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SDWAN VManager Moving a device to an existing Template in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230409#M8663</link>
    <description>&lt;P&gt;Ouch, that's not ideal! I will reserve the sandbox and have another look.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Nov 2024 07:31:21 GMT</pubDate>
    <dc:creator>Torbjørn</dc:creator>
    <dc:date>2024-11-29T07:31:21Z</dc:date>
    <item>
      <title>SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5224542#M8645</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;I need assistance with the Vmanager API, I need to reattach a device that in CLI mode to an existing template. I have used multiple API calls such as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://vmanage-ip-address/dataservice/template/device/config/attachfeature" target="_blank" rel="noopener nofollow noreferrer"&gt;https://vmanage-ip-address/dataservice/template/device/config/attachfeature&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and /attachcli. These calls are being processed by the vmanager but is not moving the device to said template. Can anyone assist with the proper process or calls needed to reattach a device to an existing template?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 19:12:27 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5224542#M8645</guid>
      <dc:creator>wolfcaptain2002</dc:creator>
      <dc:date>2024-11-14T19:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5224543#M8646</link>
      <description>&lt;P&gt;If possible, can someone provide the API calls needed/script example to reattach a device to a template.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 19:13:49 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5224543#M8646</guid>
      <dc:creator>wolfcaptain2002</dc:creator>
      <dc:date>2024-11-14T19:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5224758#M8647</link>
      <description>&lt;P&gt;/dataservice/template/device/config/attachfeature is the correct endpoint and should work. What response are you getting, and what is the result of the "attach action"? If you can post vManage version, example requests and/or code it would help a lot in assisting you with this.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 11:04:51 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5224758#M8647</guid>
      <dc:creator>Torbjørn</dc:creator>
      <dc:date>2024-11-15T11:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5224825#M8648</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1486812"&gt;@wolfcaptain2002&lt;/a&gt;&amp;nbsp;can you share the code, do you get any error messages in the UI?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 10:42:22 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5224825#M8648</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-11-15T10:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5226103#M8649</link>
      <description>&lt;P&gt;Hello, sorry for the late reply; I did not see the email response. My code may be messy since I'm only testing to see if it works, but here are the code snippets, as requested. I used the examples provided on the SDWAN API Documentation. I have received no errors, just a status response.&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;Attach_Template&lt;/SPAN&gt;(Template_ID):&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;    URL = &lt;SPAN&gt;f'https://&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;vmanage&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;/dataservice/template/device/config/attachcli'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    headers = {&lt;BR /&gt;        &lt;SPAN&gt;'Content-Type'&lt;/SPAN&gt;: &lt;SPAN&gt;'application/json'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;'X-XSRF-TOKEN'&lt;/SPAN&gt;: &lt;SPAN&gt;f'&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;Token&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;'Cookie'&lt;/SPAN&gt;: &lt;SPAN&gt;f'JSESSIONID=&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;Cookie&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;&lt;BR /&gt;    data = {&lt;SPAN&gt;"deviceTemplateList"&lt;/SPAN&gt;:[&lt;BR /&gt;  {&lt;BR /&gt;    &lt;SPAN&gt;"templateId"&lt;/SPAN&gt;:&lt;SPAN&gt;f"&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;Template_ID&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;"cliType"&lt;/SPAN&gt;: &lt;SPAN&gt;"device"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;"device"&lt;/SPAN&gt;:[&lt;BR /&gt;    {&lt;BR /&gt;      &lt;SPAN&gt;"csv-status"&lt;/SPAN&gt;:&lt;SPAN&gt;f"&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;INPUT_VARS[&lt;SPAN&gt;'data'&lt;/SPAN&gt;][&lt;SPAN&gt;0&lt;/SPAN&gt;][&lt;SPAN&gt;'csv-status'&lt;/SPAN&gt;]&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;"csv-deviceId"&lt;/SPAN&gt;:&lt;SPAN&gt;f"&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;INPUT_VARS[&lt;SPAN&gt;'data'&lt;/SPAN&gt;][&lt;SPAN&gt;0&lt;/SPAN&gt;][&lt;SPAN&gt;'csv-deviceId'&lt;/SPAN&gt;]&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;"csv-deviceIP"&lt;/SPAN&gt;:&lt;SPAN&gt;f"&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;INPUT_VARS[&lt;SPAN&gt;'data'&lt;/SPAN&gt;][&lt;SPAN&gt;0&lt;/SPAN&gt;][&lt;SPAN&gt;'csv-deviceIP'&lt;/SPAN&gt;]&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;"csv-host-name"&lt;/SPAN&gt;:&lt;SPAN&gt;f"&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;INPUT_VARS[&lt;SPAN&gt;'data'&lt;/SPAN&gt;][&lt;SPAN&gt;0&lt;/SPAN&gt;][&lt;SPAN&gt;'csv-host-name'&lt;/SPAN&gt;]&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;"//system/host-name"&lt;/SPAN&gt;:&lt;SPAN&gt;f"&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;INPUT_VARS[&lt;SPAN&gt;'data'&lt;/SPAN&gt;][&lt;SPAN&gt;0&lt;/SPAN&gt;][&lt;SPAN&gt;'//system/host-name'&lt;/SPAN&gt;]&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;"//system/system-ip"&lt;/SPAN&gt;:&lt;SPAN&gt;f"&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;INPUT_VARS[&lt;SPAN&gt;'data'&lt;/SPAN&gt;][&lt;SPAN&gt;0&lt;/SPAN&gt;][&lt;SPAN&gt;'//system/system-ip'&lt;/SPAN&gt;]&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;"//system/site-id"&lt;/SPAN&gt;:&lt;SPAN&gt;f"&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;INPUT_VARS[&lt;SPAN&gt;'data'&lt;/SPAN&gt;][&lt;SPAN&gt;0&lt;/SPAN&gt;][&lt;SPAN&gt;'//system/site-id'&lt;/SPAN&gt;]&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;"csv-templateId"&lt;/SPAN&gt;:&lt;SPAN&gt;"41f6a440-c5cc-4cc6-9ca1-af18e332a781"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;"selected"&lt;/SPAN&gt;:&lt;SPAN&gt;"true"&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;    ]&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;"isEdited"&lt;/SPAN&gt;:&lt;SPAN&gt;'false'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;"isMasterEdited"&lt;/SPAN&gt;:&lt;SPAN&gt;'false'&lt;BR /&gt;&lt;/SPAN&gt;       }&lt;BR /&gt;          ]&lt;BR /&gt;            }&lt;BR /&gt;&lt;BR /&gt;    response = requests.post(URL&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;=headers&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;verify&lt;/SPAN&gt;=&lt;SPAN&gt;False,&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;=json.dumps(data))&lt;BR /&gt;    response = json.loads(response.text)&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(response)&lt;BR /&gt;&lt;BR /&gt;    Monitor_URL = &lt;SPAN&gt;f'https://&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;vmanage&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;/dataservice/device/action/status/&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;response[&lt;SPAN&gt;"id"&lt;/SPAN&gt;]&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;BR /&gt;&lt;/SPAN&gt;    Monitor_Response = requests.get(Monitor_URL&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;=headers&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;verify&lt;/SPAN&gt;=&lt;SPAN&gt;False&lt;/SPAN&gt;)&lt;BR /&gt;    Monitor_Response = json.loads(Monitor_Response.text)&lt;BR /&gt;&lt;BR /&gt;    Feature_URL = &lt;SPAN&gt;f'https://&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;vmanage&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;/dataservice/template/device/config/attachfeature'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    FEATURE_response = requests.post(Feature_URL&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;=headers&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;verify&lt;/SPAN&gt;=&lt;SPAN&gt;False,&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;=json.dumps(data))&lt;BR /&gt;    FEATURE_response = json.loads(FEATURE_response.text)&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(FEATURE_response)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2024 23:07:51 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5226103#M8649</guid>
      <dc:creator>wolfcaptain2002</dc:creator>
      <dc:date>2024-11-18T23:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5226259#M8650</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1486812"&gt;@wolfcaptain2002&lt;/a&gt;&amp;nbsp;try this version, it has some of the things removed to make this simple and it follow the API document. Let me know if you see any difference in behavior. Also, could you share what response you get from this too.&lt;/P&gt;
&lt;P&gt;I would expect to see 'failed' in the UI if this wasnt correct.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;def attach_template(template_id, device_id):
    URL = f'https://{vmanage}/dataservice/template/device/config/attachcli'
    
    headers = {
        'Content-Type': 'application/json',
        'X-XSRF-TOKEN': f'{Token}',
        'Cookie': f'JSESSIONID={Cookie}'
    }
    
    # Simplified data structure matching API documentation
    data = {
        "deviceTemplateList": [{
            "templateId": template_id,
            "device": [{
                "csv-status": "complete",
                "csv-deviceId": device_id,
                "csv-deviceIP": "-",
                "csv-host-name": "-",
                "csv-templateId": template_id
            }],
            "isEdited": False
        }]
    }
    
    # Make the attachment request
    response = requests.post(URL, headers=headers, verify=False, data=json.dumps(data))
    response_data = response.json()
    print("Attachment response:", response_data)
    
    if 'id' in response_data:
        # Monitor the task status
        monitor_url = f'https://{vmanage}/dataservice/device/action/status/{response_data["id"]}'
        for _ in range(30):  # Check status for up to 5 minutes
            monitor_response = requests.get(monitor_url, headers=headers, verify=False)
            status = monitor_response.json()
            print("Status:", status)
            
            if status.get('status') == 'Success':
                return True
            elif status.get('status') in ['Failure', 'Failed']:
                print("Failed:", status.get('message', 'No error message'))
                return False
                
            time.sleep(10)
    
    return False&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2024 10:21:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5226259#M8650</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-11-19T10:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229201#M8651</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/352839"&gt;@bigevilbeard&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you for the code snippet. I have also used the structure mentioned in the API Documentation before. Sorry for the long delay in responses here is the output that you wanted and sadly the template is still not attaching. Looks like it is just repeating.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 06:22:36 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229201#M8651</guid>
      <dc:creator>wolfcaptain2002</dc:creator>
      <dc:date>2024-11-27T06:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229485#M8652</link>
      <description>&lt;P&gt;Interesting. Your&amp;nbsp;&lt;SPAN&gt;logs indicate a failure in the configuration push process, despite the validation being successful and it seems&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;template passes the test, that suggests the issue is not with the template.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;The null entry &amp;nbsp;is interesting but does show much I would expect something here maybe showing an error.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 10:00:08 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229485#M8652</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-11-27T10:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229697#M8653</link>
      <description>&lt;P&gt;The environment I’m using is the Sandbox I wonder if this is the reason… could be a bug?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 16:46:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229697#M8653</guid>
      <dc:creator>wolfcaptain2002</dc:creator>
      <dc:date>2024-11-27T16:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229705#M8654</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1486812"&gt;@wolfcaptain2002&lt;/a&gt;&amp;nbsp;can you share your entire script and template, would like to try this - Please correct me here, you have downloaded template from one of the devices and are attempting to upload this to another device and this is on the reservation sandbox?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 16:56:29 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229705#M8654</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-11-27T16:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229739#M8655</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/352839"&gt;@bigevilbeard&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Currently all the script does is detaching and trying to re-attach a template I have not edited the template on a configuration stand point. The Sandbox that I'm using SD-WAN 20.12. I will provide the template configurations here shortly. Thank you for your help so far.&lt;/P&gt;&lt;P&gt;Template ID =&amp;nbsp;2c30ea87-42d8-40b4-b2ae-5ba8c33005ce&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 17:38:50 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229739#M8655</guid>
      <dc:creator>wolfcaptain2002</dc:creator>
      <dc:date>2024-11-27T17:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229850#M8656</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/352839"&gt;@bigevilbeard&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;This is the full script that im using you can find the template and the feature templates in the &lt;A href="https://devnetsandbox.cisco.com/DevNet/blueprints/sd-wan-20-12/sd-wan-20-12" target="_blank"&gt;Cisco SD-WAN 20.12 Sandbox&lt;/A&gt; Im looking forward to your response.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 01:22:01 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5229850#M8656</guid>
      <dc:creator>wolfcaptain2002</dc:creator>
      <dc:date>2024-11-28T01:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230014#M8657</link>
      <description>&lt;P&gt;Thanks, i will reserve the sandbox and give this a try&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 10:19:20 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230014#M8657</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-11-28T10:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230192#M8658</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1486812"&gt;@wolfcaptain2002&lt;/a&gt;&amp;nbsp;i spent a few hours on this, and even with the whole csv template in json this fails, the UI does not show why. I am looking to see if i can use a log/tail on the cli to see why, it is very odd. I captured the raw json via developer tools attached as working.text file.&lt;/P&gt;
&lt;P&gt;The python code will output the entire steps and re-try after 10 seconds, max attempts is 30. I am checking with a few folks on this as it is very odd indeed.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 17:09:27 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230192#M8658</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-11-28T17:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230293#M8660</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1486812"&gt;@wolfcaptain2002&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/352839"&gt;@bigevilbeard&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached a working version of the script. The issue was that this required the use of the /attachfeature endpoint instead of the /attachcli endpoint as this is a feature template based device template. What I find weird is that this didn't throw a 400 error, it got through validation and that there were no useful error messages in the UI. The only useful log entry I was able to find is the following line in the&amp;nbsp;vmanage-server-deviceconfig-template.log file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;28-Nov-2024 23:20:59,697 UTC ERROR [] [] [TemplateRollbackManager] (Process device action - Push CLI Template Configuration) || ConfigTemplateType is null. Returning without finalizing..&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 00:19:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230293#M8660</guid>
      <dc:creator>Torbjørn</dc:creator>
      <dc:date>2024-11-29T00:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230318#M8661</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/964504"&gt;@Torbjørn&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you for providing this answer, I do see the "/attachfeature" call is working a lot more smoothly. Once it runs through the checks it gives me the error.&lt;/P&gt;&lt;P&gt;Failed to update configuration - com.viptela.vmanage.server.deviceconfig.template.TemplateException: com.viptela.vmanage.server.deviceconfig.template.TemplateException: java.lang.NullPointerException']&lt;/P&gt;&lt;P&gt;Nullpointer mentions it cant find a variable if im not mistaken.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 07:04:36 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230318#M8661</guid>
      <dc:creator>wolfcaptain2002</dc:creator>
      <dc:date>2024-11-29T07:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230404#M8662</link>
      <description>&lt;P&gt;You are correct. The device template already has feature templates attached and we are just reattaching the device template. The SD-WAN manager requires that you use separate endpoints when handling feature template based device templates(/attachfeature) and cli based device templates(/attachcli).&lt;/P&gt;&lt;P&gt;If want to alter the feature template based device template(attach/remove feature templates you have to use the&amp;nbsp;&lt;SPAN&gt;/template/device/feature endpoint instead.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 07:22:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230404#M8662</guid>
      <dc:creator>Torbjørn</dc:creator>
      <dc:date>2024-11-29T07:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230409#M8663</link>
      <description>&lt;P&gt;Ouch, that's not ideal! I will reserve the sandbox and have another look.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 07:31:21 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230409#M8663</guid>
      <dc:creator>Torbjørn</dc:creator>
      <dc:date>2024-11-29T07:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230411#M8664</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/964504"&gt;@Torbjørn&lt;/a&gt;&amp;nbsp; I appreciate your help. All I want is to reattach the feature template back onto a device. Here is function I was using. Thank you again!&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;attach_template&lt;/SPAN&gt;(&lt;SPAN&gt;template_id&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;device_id&lt;/SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;    URL = &lt;SPAN&gt;f'https://&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;vmanage&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;/dataservice/template/device/config/attachfeature'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    headers = {&lt;BR /&gt;        &lt;SPAN&gt;'Content-Type'&lt;/SPAN&gt;: &lt;SPAN&gt;'application/json'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;'X-XSRF-TOKEN'&lt;/SPAN&gt;: &lt;SPAN&gt;f'&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;Token&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;'Cookie'&lt;/SPAN&gt;: &lt;SPAN&gt;f'JSESSIONID=&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;Cookie&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;# Simplified data structure matching API documentation&lt;BR /&gt;&lt;/SPAN&gt;    data = {&lt;BR /&gt;        &lt;SPAN&gt;"deviceTemplateList"&lt;/SPAN&gt;: [&lt;BR /&gt;            {&lt;BR /&gt;                &lt;SPAN&gt;"templateId"&lt;/SPAN&gt;: &lt;SPAN&gt;"c9ef3b34-a096-4744-9e37-866276deb2a0"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                &lt;SPAN&gt;"device"&lt;/SPAN&gt;: [&lt;BR /&gt;                    {&lt;BR /&gt;                        &lt;SPAN&gt;"csv-status"&lt;/SPAN&gt;: &lt;SPAN&gt;"complete"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                        &lt;SPAN&gt;"csv-deviceId"&lt;/SPAN&gt;: &lt;SPAN&gt;"C8K-C9DF615F-ABE7-1573-2BB1-288797F1B78B"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                        &lt;SPAN&gt;"csv-deviceIP"&lt;/SPAN&gt;: &lt;SPAN&gt;"10.10.1.17"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                        &lt;SPAN&gt;"csv-host-name"&lt;/SPAN&gt;: &lt;SPAN&gt;"Site3-cEdge01"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                        &lt;SPAN&gt;"//system/host-name"&lt;/SPAN&gt;: &lt;SPAN&gt;"Site3-cEdge01"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                        &lt;SPAN&gt;"//system/system-ip"&lt;/SPAN&gt;: &lt;SPAN&gt;"10.10.1.17"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                        &lt;SPAN&gt;"//system/site-id"&lt;/SPAN&gt;: &lt;SPAN&gt;"1003"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                        &lt;SPAN&gt;"csv-templateId"&lt;/SPAN&gt;: &lt;SPAN&gt;"c9ef3b34-a096-4744-9e37-866276deb2a0"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                        &lt;SPAN&gt;"selected"&lt;/SPAN&gt;: &lt;SPAN&gt;"true"&lt;BR /&gt;&lt;/SPAN&gt;                    }&lt;BR /&gt;                ]&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                &lt;SPAN&gt;"isEdited"&lt;/SPAN&gt;: &lt;SPAN&gt;False,&lt;BR /&gt;&lt;/SPAN&gt;                &lt;SPAN&gt;"isMasterEdited"&lt;/SPAN&gt;: &lt;SPAN&gt;False&lt;BR /&gt;&lt;/SPAN&gt;            }&lt;BR /&gt;        ]&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;# Make the attachment request&lt;BR /&gt;&lt;/SPAN&gt;    response = requests.post(URL&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;=headers&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;verify&lt;/SPAN&gt;=&lt;SPAN&gt;False, &lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;=json.dumps(data))&lt;BR /&gt;    response_data = response.json()&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Attachment response:"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;response_data)&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;&lt;SPAN&gt;'id' &lt;/SPAN&gt;&lt;SPAN&gt;in &lt;/SPAN&gt;response_data:&lt;BR /&gt;        &lt;SPAN&gt;# Monitor the task status&lt;BR /&gt;&lt;/SPAN&gt;        monitor_url = &lt;SPAN&gt;f'https://&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;vmanage&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;/dataservice/device/action/status/&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;response_data[&lt;SPAN&gt;"id"&lt;/SPAN&gt;]&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;for &lt;/SPAN&gt;_ &lt;SPAN&gt;in &lt;/SPAN&gt;&lt;SPAN&gt;range&lt;/SPAN&gt;(&lt;SPAN&gt;30&lt;/SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;  &lt;SPAN&gt;# Check status for up to 5 minutes&lt;BR /&gt;&lt;/SPAN&gt;            monitor_response = requests.get(monitor_url&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;=headers&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;verify&lt;/SPAN&gt;=&lt;SPAN&gt;False&lt;/SPAN&gt;)&lt;BR /&gt;            status = monitor_response.json()&lt;BR /&gt;            &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Status:"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;status)&lt;BR /&gt;&lt;BR /&gt;            &lt;SPAN&gt;if &lt;/SPAN&gt;status.get(&lt;SPAN&gt;'status'&lt;/SPAN&gt;) == &lt;SPAN&gt;'Success'&lt;/SPAN&gt;:&lt;BR /&gt;                &lt;SPAN&gt;return True&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;            elif &lt;/SPAN&gt;status.get(&lt;SPAN&gt;'status'&lt;/SPAN&gt;) &lt;SPAN&gt;in &lt;/SPAN&gt;[&lt;SPAN&gt;'Failure'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Failed'&lt;/SPAN&gt;]:&lt;BR /&gt;                &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Failed:"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;status.get(&lt;SPAN&gt;'message'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'No error message'&lt;/SPAN&gt;))&lt;BR /&gt;                &lt;SPAN&gt;return False&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;            time.sleep(&lt;SPAN&gt;10&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;return False&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Nov 2024 07:38:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230411#M8664</guid>
      <dc:creator>wolfcaptain2002</dc:creator>
      <dc:date>2024-11-29T07:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: SDWAN VManager Moving a device to an existing Template</title>
      <link>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230467#M8665</link>
      <description>&lt;P&gt;No problem!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to ensure that we are on the same page: a feature template is a small template describing configuration of a given feature. A device template is what you apply to a network device and can either be a CLI based device template or a feature template based device template. The latter consists of a collection of feature templates that makes up a full device config and is what this API endpoint handles.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a new version of your function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def attach_template(template_id, device_id, token, cookie ):
    url = f'https://10.10.20.90/dataservice/template/device/config/attachfeature'

    headers = {
        'Content-Type': 'application/json',
        'X-XSRF-TOKEN': token,
        'Cookie': f"JSESSIONID={cookie}"
    }

    data = {
        "deviceTemplateList": [{
            "templateId": template_id,
            "device": [
                {
                    "selected": "true",
                    "csv-deviceId": "C8K-C9DF615F-ABE7-1573-2BB1-288797F1B78B",
                    "csv-deviceIP": "10.10.1.18",
                    "csv-host-name": "Site3-cEdge02",
                    "/1/vpn-instance/ip/route/vpn_1_ip_route/prefix": "TEMPLATE_IGNORE",
                    "/1/vpn-instance/ip/route/vpn_1_ip_route/next-hop/vpn_1_next_hop_ip_address/address": "TEMPLATE_IGNORE",
                    "/1/vpn_1_if_name/interface/if-name": "GigabitEthernet3",
                    "/1/vpn_1_if_name/interface/description": "port.site3-sw01",
                    "/1/vpn_1_if_name/interface/ip/address": "10.10.25.1/24",
                    "/512/vpn-instance/ip/route/0.0.0.0/0/next-hop/vpn_512_next_hop_ip_address/address": "10.10.20.254",
                    "/512/vpn_512_if_name/interface/if-name": "GigabitEthernet1",
                    "/512/vpn_512_if_name/interface/description": "port.sbx-mgmt",
                    "/512/vpn_512_if_name/interface/ip/address": "10.10.10.1/24",
                    "/0/vpn-instance/ip/route/0.0.0.0/0/next-hop/vpn_0_mpls_next_hop_ip_add/address": "10.10.23.49",
                    "/0/vpn-instance/ip/route/0.0.0.0/0/next-hop/vpn_0_internet_next_hop_ip_add/address": "10.10.23.49",
                    "/0/vpn_0_internet_int_name/interface/if-name": "GigabitEthernet2",
                    "/0/vpn_0_internet_int_name/interface/description": "internet-link",
                    "/0/vpn_0_internet_int_name/interface/ip/address": "10.10.23.50/30",
                    "//system/host-name": "Site3-cEdge02",
                    "//system/system-ip": "10.10.1.18",
                    "//system/site-id": "1003"
                }
            ],
            "isEdited": False,
            "isMasterEdited": False
        }]
    }

    response = requests.post(url, headers=headers, verify=False, data=json.dumps(data))
    response_data = response.json()
    print("Attachment response:", response_data)

    if 'id' in response_data:
        # Monitor the task status
        monitor_url = f'https://10.10.20.90/dataservice/device/action/status/{response_data["id"]}'
        for _ in range(30):
            monitor_response = requests.get(monitor_url, headers=headers, verify=False)
            status = monitor_response.json()
            print("Status:", status)

            if status["summary"]["status"] == 'done':
                return True
            elif status["summary"]["status"] in ['Failure', 'Failed']:
                print("Failed:", status.get('message', 'No error message'))
                return False

            time.sleep(10)

    return False&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A few changes I've made:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Device IP, ID and hostname all refer to cEdge02 as this previously was a mix of cEdge02 and cEdge01 values&lt;/LI&gt;&lt;LI&gt;All required parameters have now been set, I copied the ones in&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/352839"&gt;@bigevilbeard&lt;/a&gt;s script.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;I corrected the value used for verification of status to ["summary"]["status"].&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is functionally the same as the previous script but simplified for demonstration purposes. I would look at the previous script to see a better example of how this could be implemented.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this works for you.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 09:52:32 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/sdwan-vmanager-moving-a-device-to-an-existing-template/m-p/5230467#M8665</guid>
      <dc:creator>Torbjørn</dc:creator>
      <dc:date>2024-11-29T09:52:32Z</dc:date>
    </item>
  </channel>
</rss>

