You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Methods

Remember to execute the queue in order to apply this methods to the physical device.

GetInterfacesNames

This method returns all the interface names.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/chassis/interfaces 
Method

GET

 
ReturnInterfaces names listAll the interfaces names in a list
Return body example

Following example shows interface names list returned with 12 elements.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<interfaces>
 <interface>fe-0/3/3.1</interface>
    <interface>fe-0/3/3.2</interface>
    <interface>sp-1/0/0.0</interface>
    <interface>lt-1/1/0.0</interface>
    <interface>lt-1/1/0.1</interface>
    <interface>fe-2/0/1.0</interface>
    <interface>ge-2/0/2.0</interface>
    <interface>lo0.0</interface>
    <interface>gr-1/1/0.1</interface>
    <interface>gr-1/1/0.2</interface>
    <interface>gr-1/1/0.3</interface>
    <interface>gr-1/1/0.0</interface>
</interfaces>

GetInterfaceInfo

This method returns information of the given interface name.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/chassis/interfaces/info?ifaceName={interfaceName} 
Method

GET

 
ReturnInterfaceInfoInterface information for the given interface name
Return body example

Following example shows interface information for the subinterface with name fe-0/3/3.1.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<interfaceInfo>
 <name>fe-0/3/3.1</name>
 <vlan>1</vlan>
 <state>OK</state>
 <description>Test description</description>
</interfaceInfo>

UpPhysicalInterface

This method enables a physical interface which is down.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/chassis/interfaces/status/up?ifaceName={interfaceName} 
Method

PUT

 
Query ParameterInterface nameInterface name we want to enable. Only physical interfaces are allowed.
Return- 

DownPhysicalInterface

This method disables a physical interface, marking it as being down, but without removing its configuration.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/chassis/interfaces/status/down?ifaceName={interfaceName} 
Method

PUT

 
Query ParameterInterface nameInterface name we want to disable. Only physical interfaces are allowed.
Return- 
CreateSubInterface

This method creates a subinterface from an existing physical interface.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/chassis/interfaces 
Method

POST

 
Body ParameterInterfaceInfoInterfaceInfo containing the name of the physical interface and the port number used to create the subinterface. It can contain more information like interface description, VLAN ID or Peer Unit depending on the type of interface to be created.
Return- 
Body Example

Following example would create interface fe-0/2/1.2, that means a new subinterface in interface fe-0/2/1 with port number 2, and VLAN ID 2.

<?xml version="1.0" encoding="UTF-8"?>
<interfaceInfo>
    <name>fe-0/2/1.2</name>
    <vlan>2</vlan>
    <description>Interface description</description>
</interfaceInfo>

DeleteSubInterface

This method removes an existing subinterface from a physical interface.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/chassis/interfaces?ifaceName={interfaceName} 
Method

DELETE

 
Query ParameterInterface nameInterface name we want to delete.
Return- 
SetEncapsulation

This method configures the type of encapsulation to use in given interface. Supported are: no encapsulation and TaggedEthenetEncapsulation.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/chassis/setEncapsulation 
Method

POST

 
Body ParameterSetEncapsulationRequestRequest containing the LogicalPort representing the interface and the ProtocolIFType containing the type of encapsulation to use. TaggedEthernetEncapsulation  ProtocolIFType "LAYER_2_VLAN_USING_802_1Q" as encapsulation type.
Return- 
Body Example

Following example would set TaggedEthernetEncapsulation to interface fe-0/3/3.

<?xml version="1.0" encoding="UTF-8"?>
<setEncapsulationRequest>
   <encapsulation>LAYER_2_VLAN_USING_802_1Q</encapsulation>
   <iface>
      <name>fe-0/3/3</name>
   </iface>
</setEncapsulationRequest>

CreateLogicalRouter

LogicalRouters and PhysicalRouters are seen as independents devices in OpenNaaS. Once you create a logical router, you must register a protocolContext in its protocolSessionManager and start it before starting using it.

The CreateLogicalRouter method will instantiate a new logical router device inside the physical one.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/chassis/createLogicalRouter 
Method

POST

 
Body ParameterComputerSystemComputerSystem representing the new logical router to be created. Optionally it can include the name of the interfaces to be added to this logical router.
Return- 
Body Example

Following example would create a new logical router called "logicalrouter1" with the fe-0/3/3.1 interface.

<?xml version="1.0" encoding="UTF-8"?>
<computerSystem>
   <toAssociations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="component">
      <to xsi:type="enabledLogicalElement">
         <name>fe-0/3/3</name>
         <portNumber>1</portNumber>
      </to>
   </toAssociations>
   <name>logicalrouter1</name>
</computerSystem>

 

AddInterfacesToLogicalRouter

This method will add interfaces to an existing logical router. Be aware that the list of interfaces to be added should not exist in another logical router of the physical one.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/chassis/addInterfacesToLogicalRouter 
Method

POST

 
Body ParameterAddInterfacesToLogicalRouterRequestRequest containing the ComputerSystem representing the logical router, and a list of LogicalPorts to be added to it.
Return- 
Body Example

Following request would add interface fe-0/3/3.2 and fe-0/3/3.3 to logicalrouter1.

<?xml version="1.0" encoding="UTF-8"?>
<addInterfacesToLogicalRouterRequest>
   <interfaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ethernetPort">
      <name>fe-0/3/3</name>
      <portNumber>2</portNumber>
   </interfaces>
   <interfaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ethernetPort">
      <name>fe-0/3/3</name>
      <portNumber>3</portNumber>
   </interfaces>
   <logicalRouter>
      <elementName>logicalrouter1</elementName>
      <name>logicalrouter1</name>
   </logicalRouter>
</addInterfacesToLogicalRouterRequest>

RemoveInterfacesFromLogicalRouter

This method will remove existing interfaces from a specific logical router. Its configuration will be passed to the physical router.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/chassis/removeInterfacesFromLogicalRouter 
Method

POST

 
Body ParameterRemoveInterfacesFromLogicalRouterRequestRequest containing the ComputerSystem representing the logical router, and a list of LogicalPorts to be removed from it.
Return- 
Body Example

Following request would remove interface fe-0/3/3.2 from logicalrouter1.

<?xml version="1.0" encoding="UTF-8"?>
<removeInterfacesFromLogicalRouterRequest>
   <interfaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ethernetPort">
      <name>fe-0/3/3</name>
      <portNumber>2</portNumber>
   </interfaces>
   <logicalRouter>
      <elementName>logicalrouter1</elementName>
      <name>logicalrouter1</name>
   </logicalRouter>
</removeInterfacesFromLogicalRouterRequest>

 

DeleteLogicalRouter

This method will remove an existing logical router from the physical one.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/chassis/deleteLogicalRouter 
Method

POST

 
Body ParameterComputerSystemComputerSystem representing the new logical router to be removed.
Return- 
Body Example

Following example would remove the logical router called "logicalrouter1" from the existing logical router of our physical router.

<?xml version="1.0" encoding="UTF-8"?>
<computerSystem>
   <name>logicalrouter1</name>
</computerSystem>
  • No labels