Skip to main content
Viptela is now part of Cisco.
Support
Product Documentation
Viptela Documentation

Device Templates

API calls for managing device templates:

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.

URL: https://vmanage-ip-address/dataservice/template/device/config/input

Method: POST

Request Parameters

Name Required Description Parameter Type Data Type
deviceTemplateJSON Yes Parameters for generate device input variables action Body
See Request Body Schema Table below
String

Request Content Type: application/json

Request Body Schema

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

Example Request and Response

Issue the POST call to generate the device input variables:

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

The response contains the device input variables. You can edit the values of the variables for which the parameter editable has the value true:

{
  "header" : 
    {
      "generatedOn" : 1474929919880,
      "columns" : [
        {
          "property" : csv-status,
          "title" : Status,
          "toolTip" : Input status,
          "hideable" : false,
          "dataType" : string,
          "editable" : false,
          "isDisplay" : true,
          "isLeftPinned" : true,
          "minWidth" : 30,
          "width" : 30,
          "display" : icon,
          "iconProperty" : csv-status,
          "icon" : [
        {
          "key" : complete,
          "value" : images/template_complete.png
        },
        {
          "key" : in_complete,
          "value" : images/template_in_complete.png
        }
      ]
    },
    {
      "property" : csv-deviceId,
      "title" : Chassis Number,
      "toolTip" : UUID: csv-deviceId,
      "hideable" : false,
      "dataType" : string,
      "editable" : false,
      "isDisplay" : true,
      "isLeftPinned" : true,
      "objectType" : object,
      "width" : 280
    },
    {
      "property" : csv-deviceIP,
      "title" : System IP,
      "toolTip" : Device IP: csv-deviceIP,
      "hideable" : false,
      "dataType" : string,
      "editable" : false,
      "isDisplay" : true,
      "isLeftPinned" : true,
      "objectType" : object,
      "width" : 100
    },
    {
      "property" : csv-host-name,
      "title" : Hostname,
      "toolTip" : Host name: csv-host-name,
      "hideable" : false,
      "dataType" : string,
      "editable" : false,
      "isDisplay" : true,
      "isLeftPinned" : true,
      "objectType" : object,
      "width" : 180
    },
    {
      "property" : //system/host-name,
      "title" : Hostname,
      "toolTip" : Set the hostname: //system/host-name,
      "hideable" : false,
      "dataType" : string,
      "editable" : true,
      "isDisplay" : true,
      "isLeftPinned" : false,
      "objectType" : object,
      "width" : 100
    },
    {
      "property" : //system/system-ip,
      "title" : System IP,
      "toolTip" : Set the system IP address: //system/system-ip,
      "hideable" : false,
      "dataType" : string,
      "editable" : true,
      "isDisplay" : true,
      "isLeftPinned" : false,
      "objectType" : object,
      "width" : 100
    },
    {
      "property" : //system/site-id,
      "title" : Site ID,
      "toolTip" : Set the site identifier: //system/site-id,
      "hideable" : false,
      "dataType" : number,
      "editable" : true,
      "isDisplay" : true,
      "isLeftPinned" : false,
      "objectType" : object,
      "width" : 100
    }
  ],
  "templateVariableCount" : 3,
  "fields" : {
    }
  },
  "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.

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

Method: POST

Request Parameters

Name Required Description Parameter Type Data Type
deviceTemplateJSON Yes Parameters for generate device input variables action Body
See Request Body Schema Table, below, for details
String

Request Content Type: application/json

Request Body Schema

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

Example Request and Response

Issue the POST call to preview the configuration:

{
  "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
}

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 vManage mode.

CLI Template

Attach a configuration template made from CLI templates.

URL: https://vmanage-ip-address/dataservice/template/device/config/attachcli

Method: POST

Request Parameters

Name Required Description Parameter Type Data Type
deviceTemplateJSON Yes Parameters for attach template action Body
See Request Body Schema Table, below, for details
String

Request Content Type: application/json

Request Body Schema

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

Attaching a CLI template is a two-step process:

  1. Issue the POST call to initiate the attach action:
{
  "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 
  }
  ]
}

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:
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.

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

Method: POST

Request Parameters

Name Required Description Parameter Type Data Type
deviceTemplateJSON Yes Parameters for attach template action Body
See Request Body Schema Table, below, for details
String

Request Content Type: application/json

Request Body Schema

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

Attaching a feature template is a two-step process:

  1. Issue the POST call to initiate the attach action:
{
  "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  
  }
  ]
}

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.

URL: https://vmanage-ip-address/dataservice/template/config/device/mode/cli

Method: POST

Request Parameters

Name Required Description Parameter Type Data Type
deviceTemplateJSON Yes Parameters for switch devices to CLI mode action Body
See Request Body Schema Table, below, for details
String

Request Content Type: application/json

Request Body Schema

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

Example Request and Response

Detaching a device template is a two-step process:

  1. Issue the POST call to initiate the action:
{
  "deviceType":"vedge",
  "devices":[  
    {
    "deviceId":"932f70dd-5815-4712-b9ed-3d34a238f2ca",
    "deviceIP":"172.16.255.21"
    }
  ]
}

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

The second response object retrieves the detailed action status.

Additional Information

Using the vManage REST API

  • Was this article helpful?