Import Static Endpoints Hosts via XML file

Aruba Employee

This article talks about the following.

1:Exporting a sample XML file of Endpoint.
2: Use this sample file to create a new XML file from a CSV file.
3: Import this file to CPPM and add endpoints.

 

Environment : This Article is written  for CPPM 6.X.X and greater.

 

 

We can download a sample XML file for Endpoints as below.

Navigate to "Configuration » Identity » Endpoints" and select an entry to export it as XML.

 

rtaImage (6).png

 

After selecting the record, hit ""Export". This will export the details in an XML file.

 

rtaImage (7).png

 

 

Open this file in any text editor. We may prefer to use Notepad++ which can be downloaded from "http://notepad-plus-plus.org/"


The file would be similar to below snippet.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsContents xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
  <TipsHeader exportTime="Tue Oct 01 00:44:06 IST 2013" version="6.2"/>
  <Endpoints>
    <Endpoint macAddress="d0b33f83a715" status="Known"/>
      <EndpointTags tagName="Username" tagValue="air"/>
    </Endpoint>
  </Endpoints>
  <TagDictionaries>
    <TagDictionary allowMultiple="false" mandatory="false" dataType="String" attributeName="Username" entityName="Endpoint"/>
  </TagDictionaries>
</TipsContents>


The string in bold contains the following information.


<Endpoint macAddress="d0b33f83a715" status="Known"/>

           ~ This contains the MAC address of the device.


<EndpointTags tagName="Username" tagValue="air"/>

            ~ This contains the Username mapped to this MAC.


<TagDictionary allowMultiple="false" mandatory="false" dataType="String" attributeName="Username" entityName="Endpoint"/>

              ~This states that multiple MAC address mapping to this Username is not allowed and Username is the Attribute of this Entry.

 

Say we have a CSV file which contains list of MAC and Usernames and we want to create an XML file based on this list.


MAC_Address User_Name
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM
AA:BB:CCSmiley Very HappyD:EE:FF CPPM


Create a new CSV file as below.


Value 1 MAC of device Value 2 Value 3 Blank_space Value  4 User_name Value 5
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:FF " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM "/>


We can use this sample and populate the "MAC of device" and "User_name" fields. The remaining fields must remain exactly same for all entries.

After making the necessary modification, we would get a sample file as below.


Value 1 MAC of device Value 2 Value 3 Blank_space Value  4 User_name Value 5
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:F0 " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM0 "/>
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:F1 " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM1 "/>
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:F2 " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM2 "/>
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:F3 " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM3 "/>
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:F4 " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM4 "/>
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:F5 " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM5 "/>
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:F6 " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM6 "/>
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:F7 " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM7 "/>
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:F8 " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM8 "/>
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:F9 " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM9 "/>
<Endpoint macAddress=" AA:BB:CCSmiley Very HappyD:EE:FF " status="Known"/>    <EndpointTags tagName="Username" tagValue=" CPPM10 "/>

 

Once we have this file, we will copy-paste the entries on Notepad++. below is a sample of it.


<Endpoint macAddress="    AA:BB:CCSmiley Very HappyD:EE:F0    "    status="Known"/>        <EndpointTags tagName="Username" tagValue="    CPPM0    "/>
<Endpoint macAddress="    AA:BB:CCSmiley Very HappyD:EE:F1    "    status="Known"/>        <EndpointTags tagName="Username" tagValue="    CPPM1    "/>
<Endpoint macAddress="    AA:BB:CCSmiley Very HappyD:EE:F2    "    status="Known"/>        <EndpointTags tagName="Username" tagValue="    CPPM2    "/>
<Endpoint macAddress="    AA:BB:CCSmiley Very HappyD:EE:F3    "    status="Known"/>        <EndpointTags tagName="Username" tagValue="    CPPM3    "/>
<Endpoint macAddress="    AA:BB:CCSmiley Very HappyD:EE:F4    "    status="Known"/>        <EndpointTags tagName="Username" tagValue="    CPPM4    "/>
<Endpoint macAddress="    AA:BB:CCSmiley Very HappyD:EE:F5    "    status="Known"/>        <EndpointTags tagName="Username" tagValue="    CPPM5    "/>
<Endpoint macAddress="    AA:BB:CCSmiley Very HappyD:EE:F6    "    status="Known"/>        <EndpointTags tagName="Username" tagValue="    CPPM6    "/>
<Endpoint macAddress="    AA:BB:CCSmiley Very HappyD:EE:F7    "    status="Known"/>        <EndpointTags tagName="Username" tagValue="    CPPM7    "/>
<Endpoint macAddress="    AA:BB:CCSmiley Very HappyD:EE:F8    "    status="Known"/>        <EndpointTags tagName="Username" tagValue="    CPPM8    "/>
<Endpoint macAddress="    AA:BB:CCSmiley Very HappyD:EE:F9    "    status="Known"/>        <EndpointTags tagName="Username" tagValue="    CPPM9    "/>
<Endpoint macAddress="    AA:BB:CCSmiley Very HappyD:EE:FF    "    status="Known"/>        <EndpointTags tagName="Username" tagValue=" CPPM10 "/> 

 

The above smaple contains two configuration items in a single line, It's suggested to move them in different lines.

 

On Notepad++ we can edit this using the find and replace utility  as shown below.

 

rtaImage (8).png


After this, we would need to "</Endpoint>" after every two lines in the list. We can achieve this via Notepad++

 

rtaImage (9).png


Once done the sample file would be as below.


<Endpoint macAddress="aa:bb:cc:dd:ee:f1" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM1"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f2" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM2"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f3" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM3"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f4" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM4"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f5" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM5"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f6" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM6"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f7" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM7"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f8" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM8"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f9" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM9"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:ff" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM10"/>
 </Endpoint>

 

Once we have this sample file, we create a new XML file by adding the lines in bold below.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsContents xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
  <TipsHeader exportTime="Tue Oct 01 00:44:06 IST 2013" version="6.2"/>
  <Endpoints>

 

<Endpoint macAddress="aa:bb:cc:dd:ee:f1" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM1"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f2" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM2"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f3" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM3"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f4" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM4"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f5" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM5"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f6" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM6"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f7" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM7"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f8" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM8"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:f9" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM9"/>
 </Endpoint>
<Endpoint macAddress="aa:bb:cc:dd:ee:ff" status="Known">       
 <EndpointTags tagName="Username" tagValue="CPPM10"/>
 </Endpoint>
  </Endpoints>
  <TagDictionaries>
    <TagDictionary allowMultiple="false" mandatory="false" dataType="String" attributeName="Username" entityName="Endpoint"/>
  </TagDictionaries>
</TipsContents>


After editing the file, save it as .XML and we can use this file to import the endpoints list.

Navigate to "Configuration » Identity » Endpoints" and click on "Import Endpoints"

 

rtaImage (10).png

 

Once we inport, the list will be updated as below.

 

rtaImage (11).png

 

Version history
Revision #:
2 of 2
Last update:
‎07-14-2014 09:20 AM
Updated by:
 
Labels (1)
Contributors
Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: