Attach Device Templates

To attach device templates:

  1. Generate Device Input Variables.
  2. Preview Device Configuration.
  3. Attach Device Template:
    1. CLI Template
    2. Feature Template

Generate Device Input Variables

Generate device input variables for a CLI or feature template.

POST https://{vmanage-ip-address}/dataservice/template/device/config/input

Content-Type: application/json

Request body schema:

Value Description
templateId Device template identifier
deviceIds List of device UUIDs
isEdited The value true indicates a modification to an existing CLI or feature template. The value false indicates that this is a new template.
isMasterEdited The value true indicates a modification to a device template that is created from feature templates. The value false indicates that the device template that is created from feature templates has not been modified.

Example:

{
  "templateId":"41f6a440-c5cc-4cc6-9ca1-af18e332a781",  
  "deviceIds":
    [                    
      "5e5f45e7-3062-44b2-b6f6-40c682149e05"
    ],
  "isEdited":false,        
  "isMasterEdited":false              
  }
}

Response body:

The response contains the device input variables.

{
  "data" : [
    {
      "csv-status" : in_complete,
      "csv-deviceId" : 5e5f45e7-3062-44b2-b6f6-40c682149e05,
      "csv-deviceIP" : 172.16.255.11,
      "csv-host-name" : vm1,
      "//system/host-name" : vm1,
      "//system/system-ip" : 172.16.255.11,
      "//system/site-id" : 100
    }
  ]
}

Preview Device Configuration

Preview the device configuration based on a CLI or feature template.

POST https://{vmanage-ip-address}/dataservice/template/device/config/config

Content-Type: application/json

Request body schema:

Value Description
templateId Device template identifier
device Device-specific values to push to the device in the template.
isEdited The value true indicates a modification to an existing CLI or feature template. The value false indicates that this is a new template.
isMasterEdited The value true indicates a modification to a device template created from feature templates. The value false indicates that the device template that is created from feature templates has not been modified.

Example:

{
  "templateId":"8668f0e7-af11-42e6-8ced-d90ea92e0e28",
  "device":{
    "csv-status":"complete",
    "csv-deviceId":"932f70dd-5815-4712-b9ed-3d34a238f2ca",
    "csv-deviceIP":"172.16.255.21",
    "csv-host-name":"vm11",
    "csv-templateId":"8668f0e7-af11-42e6-8ced-d90ea92e0e28"
  },
  "isEdited":false,
  "isMasterEdited":false
}

Response body:

The response contains the configuration:

system
host-name         vm11
gps-location latitude 35.0
gps-location longitude -78.0
system-ip         172.16.255.21
site-id           100
organization-name "vIPtela Inc Regression"
clock timezone America/Los_Angeles
vbond 10.0.12.26
aaa
  auth-order local radius tacacs
  usergroup basic
    task system read write
    task interface read write
  !

Attach Device Template

Attaching a device template puts the device into Cisco Catalyst SD-WAN Manager mode.

CLI Template

Attach a configuration template made from CLI templates. It is a two-step process:

  1. Issue the POST call to initiate the attach action.

POST https://{vmanage-ip-address}/dataservice/template/device/config/attachcli

Content-Type: application/json

Request body schema:

Value Description
templateId Device template identifier
device Device-specific values to push to the device in the template.
isEdited The value true indicates a modification to an existing CLI or feature template. The value false indicates that this is a new template.
isMasterEdited The value true indicates a modification to a device template created from feature templates. The value false indicates that the device template that is created from feature templates has not been modified.

Example:

{
  "deviceTemplateList":[
  {
    "templateId":"41f6a440-c5cc-4cc6-9ca1-af18e332a781",       
    "device":[
    {
      "csv-status":"complete",
      "csv-deviceId":"5e5f45e7-3062-44b2-b6f6-40c682149e05",
      "csv-deviceIP":"172.16.255.11",
      "csv-host-name":"vm1",
      "//system/host-name":"vm1",
      "//system/system-ip":"172.16.255.11",
      "//system/site-id":"100",
      "csv-templateId":"41f6a440-c5cc-4cc6-9ca1-af18e332a781",
      "selected":"true"
    }
    ],
    "isEdited":false,
    "isMasterEdited":false
  }
  ]
}

Response body:

The response contains the process ID for the template attach action:

{"id":"push_file_template_configuration-01232017T154359940"}
  1. Issue a monitor device action status call with the process ID to display the status of the attach action.

GET https://vmanage-ip-address/dataservice/device/action/status/push_file_template_configuration-01232017T154359940

The second response object retrieves the detailed action status.

Feature Template

Attach a configuration template made from feature templates. It is a two-step process:

  1. Issue the POST call to initiate the attach action.

https://vmanage-ip-address/dataservice/template/device/config/attachfeature

Content-Type: application/json

Request body schema:

Value Description
templateId Device template identifier
device Device-specific values to push to the device in the template.
isEdited The value true indicates a modification to an existing CLI or feature template. The value false indicates that this is a new template.
isMasterEdited The value true indicates a modification to a device template created from feature templates. The value false indicates that the device template that is created from feature templates has not been modified.

Example:

{
  "deviceTemplateList":[
  {
    "templateId":"41f6a440-c5cc-4cc6-9ca1-af18e332a781",
    "device":[                              
    {
      "csv-status":"complete",
      "csv-deviceId":"5e5f45e7-3062-44b2-b6f6-40c682149e05",
      "csv-deviceIP":"172.16.255.11",
      "csv-host-name":"vm1",
      "//system/host-name":"vm1",
      "//system/system-ip":"172.16.255.11",
      "//system/site-id":"100",
      "csv-templateId":"41f6a440-c5cc-4cc6-9ca1-af18e332a781",
      "selected":"true"
    }
    ],
    "isEdited":false,     
    "isMasterEdited":false  
  }
  ]
}

Response body:

The response contains the process ID for the template attach action:

{"id":"push_feature_template_configuration-01232017T154359940"}
  1. Issue a monitor device action status call with the process ID to display the status of the attach action.

https://vmanage-ip-address/dataservice/device/action/status/push_feature_template_configuration-01232017T154359940

The second response object retrieves the detailed action status.

Detach Device Templates

Detaching a device template puts the device into CLI mode and involves a two-step process.

  1. Issue the POST call to initiate the action.

POST https://{vmanage-ip-address}/dataservice/template/config/device/mode/cli

Content-Type: application/json

Request body schema:

Value Description
devices List of devices by device IP address or device identifier

Example:

{
  "deviceType":"vedge",
  "devices":[  
    {
    "deviceId":"932f70dd-5815-4712-b9ed-3d34a238f2ca",
    "deviceIP":"172.16.255.21"
    }
  ]
}

Response body:

The response contains the process ID for the action:

{"id":"device_config_mode_cli-01242017T020647984"}
  1. Issue a monitor device action status call with the process ID to display the status of the action:

https://vmanage-ip-address/dataservice/device/action/status/device_config_mode_cli-01242017T020647984