Bulk Data Manager
To access Bulk Data management tasks, log into the system (see “Logging In” section). Then, from the Home page, click the
Tools
tab. The Tools page appears.
From the Tools page, click
Bulk Data Mgr
. The Bulk Data Page appears showing:
-
Upload Bulk Data
-
Create Sample Data
XML DTD
The following example shows the Document Type Definition (DTD) for the XML bulk upload:
<?xml version="1.0" encoding="utf-8"?> * BulkUpdload.dtd - dtd for bulk upload * July 2008, Config Engine * Copyright (c) 2005-2008, 2011 by cisco Systems, Inc. <!ELEMENT cns-bulk-upload (cns-element-data)> <!ATTLIST cns-bulk-upload stop-on-error (true | false) "false" version (2.0 | 3.0) "3.0" <!ELEMENT cns-element-data ( NSM-DATA | IMAGE-DATA)> <!ELEMENT NSM-DATA (cns-device-info*, cns-sub-device-info*, cns-application-info*, cns-group-info*)> op-type (add|edit|delete) #REQUIRED validate-data (true | false) "false" <!ELEMENT cns-device-info (cns-device-name, cns-extended-attr*, dev-image-information?, imgw-data?)> <!ELEMENT cns-device-name (#PCDATA)> <!ATTLIST cns-device-info dev-type (other | imgw | pix | asa) "other" <!ELEMENT cns-extended-attr (#PCDATA)> <!ATTLIST cns-extended-attr <!ELEMENT dev-image-information (image-id, activation-template?, dev-image-info*)> <!ELEMENT image-id (#PCDATA)> <!ELEMENT activation-template (#PCDATA)> <!ELEMENT dev-image-info (image-name, distribution)> <!ELEMENT image-name (#PCDATA)> <!ELEMENT distribution ( destination?, location)> overwrite (yes | no) "no" erase-flash (yes | no) "no" activate (true | false) "false" <!ELEMENT destination (#PCDATA)> <!ELEMENT location (#PCDATA)> <!ELEMENT imgw-data (gateway-id?, device-type?, simulation-agent*, hop-information*)> <!ELEMENT gateway-id (#PCDATA)> <!ELEMENT device-type (#PCDATA)> <!ELEMENT simulation-agent (#PCDATA)> <!ELEMENT hop-information (hop-type, ip-address?, port?, username?, password?)> <!ELEMENT hop-type (#PCDATA)> <!ELEMENT ip-address (#PCDATA)> <!ELEMENT port (#PCDATA)> <!ELEMENT username (#PCDATA)> <!ELEMENT password (#PCDATA)> <!ELEMENT cns-sub-device-info (cns-sub-device-name, sub-device-id, line-card-type, cns-extended-attr*, main-device-name?)> <!ELEMENT cns-sub-device-name (#PCDATA)> <!ELEMENT sub-device-id (#PCDATA)> <!ELEMENT line-card-type (#PCDATA)> <!ELEMENT main-device-name (#PCDATA)> <!ELEMENT cns-application-info (cns-application-name, cns-subject-mapping*)> <!ELEMENT cns-application-name (#PCDATA)> <!ELEMENT cns-subject-mapping (cns-original-subject, cns-pub-mapping*, cns-sub-mapping*, cns-pub-default, cns-sub-default)> <!ELEMENT cns-original-subject (#PCDATA)> <!ELEMENT cns-pub-mapping (#PCDATA)> <!ELEMENT cns-sub-mapping (#PCDATA)> <!ELEMENT cns-pub-default (#PCDATA)> <!ELEMENT cns-sub-default (#PCDATA)> <!ELEMENT cns-group-info (cns-group-name,cns-group-new-name?, cns-group-member*)> <!ELEMENT cns-group-name (#PCDATA)> <!ELEMENT cns-group-new-name (#PCDATA)> <!ELEMENT cns-group-member (#PCDATA)> <!ATTLIST cns-group-member <!-- Here starts the definition for Image-data--> <!ELEMENT IMAGE-DATA (image+)> op-type (add|edit|delete) #REQUIRED validate-data (true | false) "false" <!ELEMENT image (name, image-info)> <!ELEMENT name (#PCDATA)> <!ELEMENT image-info (img-name, img-chksum?, hdr-chksum?, software-version?, system-description?, file-byte-size?, platform-family-name?, img-location*)> image-type (IOS | pix-image | pdm | asa-image | asdm | other) "IOS" <!ELEMENT img-name (#PCDATA)> <!ELEMENT img-chksum (#PCDATA)> <!ELEMENT hdr-chksum (#PCDATA)> <!ELEMENT file-byte-size (#PCDATA)> <!ELEMENT system-description (#PCDATA)> <!ELEMENT platform-family-name (#PCDATA)> <!ELEMENT software-version (#PCDATA)> <!ELEMENT img-location (#PCDATA)>
Uploading Bulk Data
Step 1 From the Bulk Data main menu, click
Upload Bulk Data
.
The Upload Bulk Data parameters page appears (see Figure 16-1).
Figure 16-1 Upload Bulk Data Parameters
Step 2 If you know the filename of the data file you want to load, enter it in the
Filename
field, otherwise use the browse function.
Table 16-1
shows the valid values for this field.
Table 16-1 Valid Values for Upload Bulk Data
|
|
|
Filename
|
Name of the file containing the data to be uploaded.
|
a-z
A-Z
0-9
-(hyphen)
_ (under-score)
. (period)
|
Step 3 Use the drop-down arrow to select the Data Format:
Step 4 To clear this task, click
Reset
.
Step 5 To upload this data file, click
Upload
.
Command-Line Upload of Bulk Data
You can also upload the XML file to the directory using a command line utility as follows:
FTP the bulk upload XML file to the
$CISCO_CE_INSTALL_ROOT/CSCOdat/scripts
directory on the host system.
Step 6 Log into the box using Telnet.
Step 7 Go to:
$CISCO_CE_INSTALL_ROOT/CSCOdat/scripts
.
Step 8 Run the following command to invoke the bulk upload command line utility:
./upload.sh <
xml filename
>
For example: ./upload.sh my_bulk_data.xml
This uploads the data to the LDAP directory.
Using Data Converter Utility
There is a data converter utility that you can use to convert bulk upload data on a system with a release prior to 3.5. This will allow you to do a bulk upload of data to Cisco Configuration Engine.
You can find this utility in <
install base dir>
/ConfigEngine
/CSCOdat/XMLTransform
.
Creating Sample Data
Even though the DTD (see “XML DTD” section) outlines the structure of the input XML file, it does not convey the information about what values should be given for each tag. By looking at the sample data files in this section, you can get an idea of how the data should be arranged in the Bulk Upload XML file.
Step 1 From the Bulk Data main menu, click
Add Bulk Data
.
The Upload Bulk Data page appears (see Figure 16-2).
Figure 16-2 Create Sample Data Page
Step 2 Enter the prefix name for this sample in the
Prefix
field.
Table 16-2
shows valid values for these fields.
Table 16-2 Valid Values for Create Sample Data
|
|
|
Prefix
|
Prefix that is used to create the device/application/group objects.
|
a-z
A-Z
0-9
-(hyphen)
_ (under-score)
. (period)
|
Data Format
|
XML, CSV
|
From drop-down list
|
Sample Data Without image info
|
Creates application, group, device data without the image information for device.
|
From drop-down list
|
Sample Data With image info
|
Creates application, group, device data without the image information for device.
Also creates IMAGE object data.
|
From drop-down list
|
Sample IMAGE Data only
|
Creates only IMAGE object data
|
From drop-down list
|
Step 3 Select Sample Data.
Step 4 To create this sample, click
OK
.
NSM Data Without Image Info
The following example shows sample device data in XML format:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <!DOCTYPE cns-bulk-upload (View Source for full doctype...)> - <cns-bulk-upload stop-on-error="false" version="3.0"> - <NSM-DATA op-type="add" validate-data="false"> - <cns-device-info dev-type="other"> <cns-device-name>myDeviceDevice1</cns-device-name> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice1</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice1</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice1</image-id> - <cns-device-info dev-type="other"> <cns-device-name>myDeviceDevice2</cns-device-name> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="parent">/config/myDeviceGroup1</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice2</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice2</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice2</image-id> - <cns-device-info dev-type="pix"> <cns-device-name>myDeviceDevice3</cns-device-name> <cns-extended-attr name="ErrorAction">revert</cns-extended-attr> <cns-extended-attr name="AuthPassword">myDevicepwd</cns-extended-attr> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="parent">/config/myDeviceGroup2</cns-extended-attr> <cns-extended-attr name="ConfigAction">merge</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice3</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice3</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice3</image-id> - <cns-device-info dev-type="asa"> <cns-device-name>myDeviceDevice4</cns-device-name> <cns-extended-attr name="ErrorAction">revert</cns-extended-attr> <cns-extended-attr name="AuthPassword">myDevicepwd</cns-extended-attr> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="parent">/config/myDeviceGroup2/myDeviceSubGroup1</cns-extended-attr> <cns-extended-attr name="ConfigAction">merge</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice4</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice4</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice4</image-id> - <cns-device-info dev-type="imgw"> <cns-device-name>myDeviceDevice5</cns-device-name> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="parent">/config/myDeviceGroup2/myDeviceSubGroup2</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice5</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice5</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice5</image-id> <gateway-id>myDeviceIMGWGatewayID5</gateway-id> <device-type>IOS</device-type> <simulation-agent>IMAGEAGENT</simulation-agent> <simulation-agent>CONFIGAGENT</simulation-agent> <hop-type>IOS_LOGIN</hop-type> <ip-address>0.0.0.0</ip-address> <username>myDeviceusr5</username> <password>myDevicepwd5</password> <hop-type>IOS_EN</hop-type> <password>myDevicepasswd5</password> - <cns-device-info dev-type="imgw"> <cns-device-name>myDeviceDevice6</cns-device-name> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice6</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice6</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice6</image-id> <gateway-id>myDeviceIMGWGatewayID6</gateway-id> <device-type>IOS</device-type> <simulation-agent>IMAGEAGENT</simulation-agent> <simulation-agent>CONFIGAGENT</simulation-agent> <hop-type>IOS_LOGIN</hop-type> <ip-address>0.0.0.0</ip-address> <username>myDeviceusr6</username> <password>myDevicepwd6</password> <hop-type>IOS_EN</hop-type> <password>myDevicepasswd6</password> <cns-group-name>/config/myDeviceGroup1</cns-group-name> <cns-group-member type="GRP">myDeviceSubGroup1</cns-group-member> <cns-group-name>/config/myDeviceGroup2</cns-group-name> <cns-group-member type="GRP">myDeviceSubGroup1</cns-group-member> <cns-group-member type="GRP">myDeviceSubGroup2</cns-group-member>
NSM Data Sample With Image Info
The following example shows sample data with the image in XML format:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <!DOCTYPE cns-bulk-upload (View Source for full doctype...)> - <cns-bulk-upload stop-on-error="false" version="3.0"> - <NSM-DATA op-type="add" validate-data="false"> - <cns-device-info dev-type="other"> <cns-device-name>myDeviceDevice1</cns-device-name> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice1</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice1</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice1</image-id> <activation-template>DemoRouter.cfgtpl</activation-template> <image-name>myDeviceIMAGEObj1</image-name> - <distribution activate="false" erase-flash="no" overwrite="yes"> <destination>flash</destination> <location>tftp://test.com/c7200-js-mz1</location> - <cns-device-info dev-type="other"> <cns-device-name>myDeviceDevice2</cns-device-name> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="parent">/config/myDeviceGroup1</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice2</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice2</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice2</image-id> <activation-template>DemoRouter.cfgtpl</activation-template> <image-name>myDeviceIMAGEObj2</image-name> - <distribution activate="false" erase-flash="no" overwrite="yes"> <destination>flash</destination> <location>tftp://test.com/c7200-js-mz2</location> - <cns-device-info dev-type="pix"> <cns-device-name>myDeviceDevice3</cns-device-name> <cns-extended-attr name="ErrorAction">revert</cns-extended-attr> <cns-extended-attr name="AuthPassword">myDevicepwd</cns-extended-attr> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="parent">/config/myDeviceGroup2</cns-extended-attr> <cns-extended-attr name="ConfigAction">merge</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice3</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice3</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice3</image-id> <activation-template>DemoRouter.cfgtpl</activation-template> <image-name>myDeviceIMAGEObj3</image-name> - <distribution activate="false" erase-flash="no" overwrite="yes"> <destination>flash</destination> <location>tftp://test.com/c7200-js-mz3</location> - <cns-device-info dev-type="asa"> <cns-device-name>myDeviceDevice4</cns-device-name> <cns-extended-attr name="ErrorAction">revert</cns-extended-attr> <cns-extended-attr name="AuthPassword">myDevicepwd</cns-extended-attr> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="parent">/config/myDeviceGroup2/myDeviceSubGroup1</cns-extended-attr> <cns-extended-attr name="ConfigAction">merge</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice4</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice4</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice4</image-id> <activation-template>DemoRouter.cfgtpl</activation-template> <image-name>myDeviceIMAGEObj4</image-name> - <distribution activate="false" erase-flash="no" overwrite="yes"> <destination>flash</destination> <location>tftp://test.com/c7200-js-mz4</location> - <cns-device-info dev-type="imgw"> <cns-device-name>myDeviceDevice5</cns-device-name> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="parent">/config/myDeviceGroup2/myDeviceSubGroup2</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice5</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice5</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice5</image-id> <activation-template>DemoRouter.cfgtpl</activation-template> <image-name>myDeviceIMAGEObj5</image-name> - <distribution activate="false" erase-flash="no" overwrite="yes"> <destination>flash</destination> <location>tftp://test.com/c7200-js-mz5</location> <gateway-id>myDeviceIMGWGatewayID5</gateway-id> <device-type>IOS</device-type> <simulation-agent>IMAGEAGENT</simulation-agent> <simulation-agent>CONFIGAGENT</simulation-agent> <hop-type>IOS_LOGIN</hop-type> <ip-address>0.0.0.0</ip-address> <username>myDeviceusr5</username> <password>myDevicepwd5</password> <hop-type>IOS_EN</hop-type> <password>myDevicepasswd5</password> - <cns-device-info dev-type="imgw"> <cns-device-name>myDeviceDevice6</cns-device-name> <cns-extended-attr name="IOSconfigtemplate">DemoRouter.cfgtpl</cns-extended-attr> <cns-extended-attr name="IOSConfigID">myDeviceDevice6</cns-extended-attr> <cns-extended-attr name="IOSEventID">myDeviceDevice6</cns-extended-attr> - <dev-image-information> <image-id>myDeviceDevice6</image-id> <activation-template>DemoRouter.cfgtpl</activation-template> <image-name>myDeviceIMAGEObj6</image-name> - <distribution activate="false" erase-flash="no" overwrite="yes"> <destination>flash</destination> <location>tftp://test.com/c7200-js-mz6</location> <gateway-id>myDeviceIMGWGatewayID6</gateway-id> <device-type>IOS</device-type> <simulation-agent>IMAGEAGENT</simulation-agent> <simulation-agent>CONFIGAGENT</simulation-agent> <hop-type>IOS_LOGIN</hop-type> <ip-address>0.0.0.0</ip-address> <username>myDeviceusr6</username> <password>myDevicepwd6</password> <hop-type>IOS_EN</hop-type> <password>myDevicepasswd6</password> <cns-group-name>/config/myDeviceGroup1</cns-group-name> <cns-group-member type="GRP">myDeviceSubGroup1</cns-group-member> <cns-group-name>/config/myDeviceGroup2</cns-group-name> <cns-group-member type="GRP">myDeviceSubGroup1</cns-group-member> <cns-group-member type="GRP">myDeviceSubGroup2</cns-group-member>
NOTES
-
For Bulk Upload of NSM devices with Image Info, make sure that the image objects referenced in the
dev-image-info
element tag already exist.
-
The location given should be one of the multiple image locations specified with the image object.
-
If there are errors while adding the devices, please check the error file provided as a result of the Upload operation. There can be an exception given as CISException, which points to the CISDevice creation failed, which could have occurred if you had ignored the checklist. In this case, just recheck the information provided in the
dev-image-information
element tag. Correct the file and upload it again.
Image Sample Data
The following example shows image data sample:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <!DOCTYPE cns-bulk-upload (View Source for full doctype...)> - <cns-bulk-upload stop-on-error="false" version="3.0"> - <IMAGE-DATA op-type="add" validate-data="false"> <name>myDeviceIMAGEObj1</name> - <image-info image-type="IOS"> <img-name>c7200-js-mz1</img-name> <img-chksum>0x1256faf245</img-chksum> <software-version>12.2(8)T6</software-version> <system-description>Cisco Network Operating System</system-description> <file-byte-size>1040</file-byte-size> <platform-family-name>7200</platform-family-name> <img-location>tftp://test.com/c7200-js-mz1</img-location> <name>myDeviceIMAGEObj2</name> - <image-info image-type="IOS"> <img-name>c7200-js-mz2</img-name> <img-chksum>0x1256faf245</img-chksum> <software-version>12.2(8)T6</software-version> <system-description>Cisco Network Operating System</system-description> <file-byte-size>1040</file-byte-size> <platform-family-name>7200</platform-family-name> <img-location>tftp://test.com/c7200-js-mz2</img-location> <name>myDeviceIMAGEObj3</name> - <image-info image-type="pix-image"> <img-name>c7200-js-mz3</img-name> <img-chksum>0x1256faf245</img-chksum> <software-version>12.2(8)T6</software-version> <system-description>Cisco Network Operating System</system-description> <file-byte-size>1040</file-byte-size> <platform-family-name>7200</platform-family-name> <img-location>tftp://test.com/c7200-js-mz3</img-location> <name>myDeviceIMAGEObj4</name> - <image-info image-type="pdm"> <img-name>c7200-js-mz4</img-name> <img-chksum>0x1256faf245</img-chksum> <software-version>12.2(8)T6</software-version> <system-description>Cisco Network Operating System</system-description> <file-byte-size>1040</file-byte-size> <platform-family-name>7200</platform-family-name> <img-location>tftp://test.com/c7200-js-mz4</img-location> <name>myDeviceIMAGEObj5</name> - <image-info image-type="asa-image"> <img-name>c7200-js-mz5</img-name> <img-chksum>0x1256faf245</img-chksum> <software-version>12.2(8)T6</software-version> <system-description>Cisco Network Operating System</system-description> <file-byte-size>1040</file-byte-size> <platform-family-name>7200</platform-family-name> <img-location>tftp://test.com/c7200-js-mz5</img-location> <name>myDeviceIMAGEObj6</name> - <image-info image-type="asdm"> <img-name>c7200-js-mz6</img-name> <img-chksum>0x1256faf245</img-chksum> <software-version>12.2(8)T6</software-version> <system-description>Cisco Network Operating System</system-description> <file-byte-size>1040</file-byte-size> <platform-family-name>7200</platform-family-name> <img-location>tftp://test.com/c7200-js-mz6</img-location> <name>myDeviceIMAGEObj7</name> - <image-info image-type="IOS"> <img-name>c7200-js-mz7</img-name> <img-chksum>0x1256faf245</img-chksum> <software-version>12.2(8)T6</software-version> <system-description>Cisco Network Operating System</system-description> <file-byte-size>1040</file-byte-size> <platform-family-name>7200</platform-family-name> <img-location>tftp://test.com/c7200-js-mz7</img-location> <name>myDeviceIMAGEObj8</name> - <image-info image-type="IOS"> <img-name>c7200-js-mz8</img-name> <img-chksum>0x1256faf245</img-chksum> <software-version>12.2(8)T6</software-version> <system-description>Cisco Network Operating System</system-description> <file-byte-size>1040</file-byte-size> <platform-family-name>7200</platform-family-name> <img-location>tftp://test.com/c7200-js-mz8</img-location>