跳转到: 导航, 搜索

Neutron/sdnapi

L3VPN 信息模型

概述

UML 模型

元素描述

L3 VPN 模型包含多个 VPN 实例。

L3VPN 实例

====UML 模型====]

L3VPN 实例属性

属性 类型 必需 CRUD 默认值 约束 注意
instanceName 字符串 Yes CRD 不适用 Maxlength = 64 Pattern = ([^?]*) L3VPN 实例名称
serviceType String enum CRUD full-mesh full-mesh 或 hub-spoke 拓扑类型
afType String enum CRUD ipv4uni ipv4uni 或 ipv6uni 地址族类型:IPv4 或 IPv6
acIf Id 字符串 Yes CRD 不适用 Length= 1~63 接入接口 ID
acIfAddr 字符串 CRUD 不适用 Length = 0~255 接入接口地址,IPv4 或 IPv6
acIfMask Unsigned byte CRUD 不适用 0 ~ 128 IP 地址掩码长度
role String enum CRUD edge-if edge-if 或 center-if center-if 仅在 hub-spoke 模式下可用;center-if 是 hub 节点中的接口
userName 字符串 CRUD 不适用 Maxlength = 64 Pattern = ([^?]*) 此接入接口的用户名
userPassword 字符串 CRUD 不适用 Maxlength = 64 Pattern = ([^?]*) 接入接口的用户密码
phyNodeId 字符串 CRUD 不适用 Maxlength = 64 Pattern = ([^?]*) 物理节点 ID
phyAcIf 字符串 CRUD 不适用 Maxlength = 64 Pattern = ([^?]*) 物理接入接口
protocolType String enum CRUD ospf bgp、ospf 或 isis 协议类型
protocolId Unsigned int CRUD 0 不适用 仅当协议是 IGP 时有效;它可以是 AS 编号
remoteAsNumber 字符串 CRUD 不适用 Length = 1 ~ 11 仅当协议是 BGP 时有效
remotePeerAddr 字符串 CRUD 不适用 Length = 0~255 仅当协议是 BGP 时有效

L3VPN API 示例

Restful API

L3VPN 实例

POST

POST URI/netl3vpn/l3vpninstances

<l3vpninstances>
  <l3vpninstance>
    <instancename>vpninstance1</instancename>
    <servicetype>full-mesh</servicetype>
    <aftype>ipv4uni</aftype>
    <acifs>
      <acif>
        <acifid>vpninstance1:port1</acifid>
        <acifaddr>20.1.1.1</acifaddr>
        <acifmask>24</acifmask>
        <role>edge-if</role>
        <username>user1</username>
        <userpassword>userpass</userpassword>
        <phynodeid>Node1</phynodeid>
        <phyacif>Node1:Ethernet0/0/1</phyacif>
        <protocol>
          <protocoltype>ospf</protocoltype>
          <igpattr>
            <protocolid>1000</protocolid>
          </igpattr>
        </protocol>
      </acif>
      <acif>
        ……
      </acif>
    </acifs>
  </l3vpninstance>
  <l3vpninstance>
    ……
  </l3vpninstance>
</l3vpninstances>
GET
  • 获取所有实例

GET URI/netl3vpn/l3vpninstances. 无 HTTP 消息体。

  • 获取单个 VPN 实例

GET URI/netl3vpn/l3vpninstances/{instancename}. 无 HTTP 消息体。

  • 一次获取一个或多个 VPN 实例

GET URI/netl3vpn/l3vpninstances

<l3vpninstances>
  <l3vpninstance>
    <instancename>vpninstance1</instancename>
  </l3vpninstance>
  <l3vpninstance>
    ……
  </l3vpninstance>
</l3vpninstances>
  • 响应
<l3vpninstances>
  <l3vpninstance>
    <instancename>vpninstance1</instancename>
    <servicetype>full-mesh</servicetype>
    <aftype>ipv4uni</aftype>
    <acifs>
      <acif>
        <acifid>vpninstance1:port1</acifid>
        <acifaddr>20.1.1.1</acifaddr>
        <acifmask>24</acifmask>
        <role>edge-if</role>
        <username>user1</username>
        <userpassword>userpass</userpassword>
        <phynodeid>Node1</phynodeid>
        <phyacif>Node1:Ethernet0/0/1</phyacif>
        <protocol>
          <protocoltype>ospf</protocoltype>
          <igpattr>
            <protocolid>1000</protocolid>
          </igpattr>
        </protocol>
      </acif>
      <acif>
        ……
      </acif>
    </acifs>
  </l3vpninstance>
  <l3vpninstance>
    ……
  </l3vpninstance>
</l3vpninstances>
PUT

PUT URI/netl3vpn/l3vpninstances

<l3vpninstances>
  <l3vpninstance>
    <instancename>vpninstance1</instancename>
    <servicetype>full-mesh</servicetype>
    <aftype>ipv4uni</aftype>
    <acifs>
      <acif>
        <acifid>vpninstance1:port1</acifid>
        <acifaddr>20.1.1.1</acifaddr>
        <acifmask>24</acifmask>
        <role>edge-if</role>
        <username>user1</username>
        <userpassword>userpass</userpassword>
        <phynodeid>Node1</phynodeid>
        <phyacif>Node1:Ethernet0/0/1</phyacif>
        <protocol>
          <protocoltype>ospf</protocoltype>
          <igpattr>
            <protocolid>1000</protocolid>
          </igpattr>
        </protocol>
      </acif>
      <acif>
        ……
      </acif>
    </acifs>
  </l3vpninstance>
  <l3vpninstance>
    ……
  </l3vpninstance>
</l3vpninstances>
DELETE
  • 删除单个 VPN 实例

DELETE URI/netl3vpn/l3vpninstances/{instancename}. 无 HTTP 消息体。

  • 删除一个或多个实例

DELETE URI/netl3vpn/l3vpninstances

<l3vpninstances>
  <l3vpninstance>
    <instancename>vpninstance1</instancename>
  </l3vpninstance>
  <l3vpninstance>
    ……
  </l3vpninstance>
</l3vpninstances>

接入接口

POST

POST URI/netl3vpn/l3vpninstances/{instancename}/acifs

<acifs>
  <acif>
    <acifid>vpninstance1:port1</acifid>
    <acifaddr>20.1.1.1</acifaddr>
    <acifmask>24</acifmask>
    <role>edge-if</role>
    <username>user1</username>
    <userpassword>userpass</userpassword>
    <phynodeid>Node1</phynodeid>
    <phyacif>Node1:Ethernet0/0/1</phyacif>
    <protocol>
      <protocoltype>ospf</protocoltype>
      <igpattr>
        <protocolid>1000</protocolid>
      </igpattr>
    </protocol>
  </acif>
  <acif>
    ……
  </acif>
</acifs>
GET
  • 获取单个接入接口

GET URI/netl3vpn/l3vpninstances/{instancename}/acifs/{acifid}. 无 HTTP 消息体。

  • 获取一个或多个接入接口

GET URI/netl3vpn/l3vpninstances/{instancename}/acifs

<acifs>
  <acif>
    <acifid>vpninstance1:port1</acifid>
  </acif>
  <acif>
    ……
  </acif>
</acifs>
  • 响应
<acifs>
  <acif>
    <acifid>vpninstance1:port1</acifid>
    <acifaddr>20.1.1.1</acifaddr>
    <acifmask>24</acifmask>
    <role>edge-if</role>
    <username>user1</username>
    <userpassword>userpass</userpassword>
    <phynodeid>Node1</phynodeid>
    <phyacif>Node1:Ethernet0/0/1</phyacif>
    <protocol>
      <protocoltype>ospf</protocoltype>
      <igpattr>
        <protocolid>1000</protocolid>
      </igpattr>
    </protocol>
  </acif>
  <acif>
    ……
  </acif>
</acifs>
PUT

PUT URI/netl3vpn/l3vpninstances/{instancename}/acifs

<acifs>
  <acif>
    <acifid>vpninstance1:port1</acifid>
    <acifaddr>20.1.1.1</acifaddr>
    <acifmask>24</acifmask>
    <role>edge-if</role>
    <username>user1</username>
    <userpassword>userpass</userpassword>
    <phynodeid>Node1</phynodeid>
    <phyacif>Node1:Ethernet0/0/1</phyacif>
    <protocol>
      <protocoltype>ospf</protocoltype>
      <igpattr>
        <protocolid>1000</protocolid>
      </igpattr>
    </protocol>
  </acif>
  <acif>
    ……
  </acif>
</acifs>
DELETE
  • 删除单个接入接口

DELETE URI/netl3vpn/l3vpninstances/{instancename}/acifs/{acifid}. 无 HTTP 消息体。

  • 删除一个或多个接入接口

DELETE URI/netl3vpn/l3vpninstances/{instancename}/acifs

<acifs>
  <acif>
    <acifid>vpninstance1:port1</acifid>
  </acif>
  <acif>
    ……
  </acif>
</acifs>

L2VPN 信息模型

概述

UML 模型

元素描述

L2VPN 模型包含多个 VPN 实例。

L2VPN 实例属性

属性 类型 必需 CRUD 默认值 约束 注意
instanceName Stringe Yes CRD 不适用 Maxlength = 32 Pattern = ([^?]*) L2VPN 实例名称
instanceOperStatus String enum R 不适用 Up 或 down 实例运行状态
instanceType String enum CRU 2PE 2PE 或 3PE 实例类型

L2VPN PW 属性

属性 类型 必需 CRUD 默认值 约束 注意
pwRole String enum Yes CR primary primary 或 backup 或 bypass PW 角色
pwOperStatus Unsigned byte R 不适用 Up 或 down PW 运行状态

L2VPN PW CX 属性

属性 类型 必需 CRUD 默认值 约束 注意
FPID 字符串 Yes CRD 不适用 Length = 0~255 前向点 ID
ForwardPeerID 字符串 CRD 不适用 Length = 0~255 前向对等体
ForwardInLabel 字符串 CRD 不适用 17~2^20 前向入标签
ForwardOutLabel 字符串 CRD 不适用 17~2^20 前向出标签
backwardPeerID 字符串 CRD 不适用 Length = 0~255 后向对等体
BackwardInLabel 字符串 CRD 不适用 17~2^20 后向入标签
BackwardOutLabel 字符串 CRD 不适用 17~2^20 后向出标签
TunnelId 字符串 CRUD 不适用 Length = 0~32 PW 的隧道

L2VPN AC 属性

属性 类型 必需 CRUD 默认值 约束 注意
FPID Stringe Yes CRD 不适用 Length = 0~255 前向点 ID
Interface 字符串 Yes CRD 不适用 Length = 0~32 接入 L2VPN 的接口

L2VPN API 示例

Restful API

L2VPN 实例

POST

POST URI/netL2VPN/vpws/netL2VPNinstances

<netL2vpnInstances>
  <netL2vpnInstance>
    <instancename>vpninstance1</instancename>
    <instanceType>2PE</instanceType>
    <pws>
      <pw>
        <pwRole>primary</pwRole>
        <cxs>
          <cx>
            <FPID>1.1.1.1</FPID>
            <backwardPeerID>2.2.2.2</backwardPeerID>
                <BackwardInLabel>1024</BackwardInLabel>
                <BackwardOutLabel>1025</BackwardOutLabel>
            <FPID>2.2.2.2</FPID>
            <forwardPeerID>1.1.1.1</forwardPeerID>
               <forwardInLabel>1025</forwardInLabel>
               <forwardOutLabel>1024</forwardOutLabel>
          </cx>
        </cxs>
      </pw>
          </pws>
           <acs>
      <ac>
          <FPID>1.1.1.1</FPID>
          <Interface> Ethernet0/0/1</Interface>
      </ac>
          </acs>
  </L2VPNinstance>
  <L2VPNinstance>
    ……
  </L2VPNinstance>
</L2VPNinstances>
GET
  • 获取所有实例

GET URI/netL2vpn/vpws/nstL2vpnInstances. 无 HTTP 消息体。

  • 获取单个 VPN 实例

GET URI/netL2vpn/vpws/nstL2vpnInstances /{instancename}. 无 HTTP 消息体。

  • 一次获取一个或多个 VPN 实例

GET URI/netL2VPN/L2VPNinstances

<netL2vpnInstances>
  <netL2vpnInstance>
    <instancename>vpninstance1</instancename>
  </netL2vpnInstance>
  <netL2vpnInstance>
    ……
  </netL2vpnInstance>
</netL2vpnInstances>
  • 响应
<netL2vpnInstances>
  <netL2vpnInstance>
    <instancename>vpninstance1</instancename>
        <instanceType>2PE</instanceType>
        <instanceOperStatus>up</instanceOperStatus>
    <pws>
      <pw>
        <pwRole>primary</pwRole>
            <pwOperStatus>up</pwOperStatus>
        <cxs>
          <cx>
            <FPID>1.1.1.1</FPID>
            <backwardPeerID>2.2.2.2</backwardPeerID>
                <BackwardInLabel>1024</BackwardInLabel>
                <BackwardOutLabel>1025</BackwardOutLabel>
            <FPID>2.2.2.2</FPID>
            <forwardPeerID>1.1.1.1</forwardPeerID>
                <forwardInLabel>1025</forwardInLabel>
                <forwardOutLabel>1024</forwardOutLabel>
          </cx>
        </cxs>
      </pw>
        </pws>
        <acs>
      <ac>
        <FPID>1.1.1.1</FPID>
        <Interface>Ethernet0/0/1</Interface>
      </ac>
        </acs>
  </L2VPNinstance>
  <L2VPNinstance>
    ……
  </L2VPNinstance>
</L2VPNinstances>
DELETE
  • 删除单个 VPN 实例

DELETE URI/netL2vpn/vpws/netL2vpnInstances/{instancename} 无 HTTP 消息体。

  • 删除一个或多个实例

DELETE URI/netL2vpn/vpws/netL2vpnInstances/

<netL2vpnInstances>
  <netL2vpnInstance>
    <netL2vpnInstance>vpninstance1</netL2vpnInstance>
  </netL2vpnInstance>
  <netL2vpnInstance>
    ……
  </netL2vpnInstance>
</netL2vpnInstances>

AC

POST

POST URI/netL2VPN/vpws/netL2vpnInstances/{instancename}/acs/ac

<netL2vpnInstances>
  <netL2vpnInstance>
    <instancename>vpninstance1</instancename>
        <acs>
      <ac>
        <FPID>1.1.1.1</FPID>
            <Interface>Ethernet0/0/1</Interface>
      </ac>
      <ac>
         ……
      </ac>
        </acs>
</netL2vpnInstance>
</netL2vpnInstances>
GET
  • 获取单个接入接口

GET URI/netL2VPN/vpws/netL2vpnInstances/{instancename}/acs/ac. 无 HTTP 消息体。

  • 获取一个或多个接入接口

GET URI/netL2VPN/L2VPNinstances/{instancename}/acifs

<acifs>
  <acif>
    <acifid>vpninstance1:port1</acifid>
  </acif>
  <acif>
    ……
  </acif>
</acifs>
  • 响应
<acifs>
  <acif>
    <acifid>vpninstance1:port1</acifid>
    <acifaddr>20.1.1.1</acifaddr>
    <acifmask>24</acifmask>
    <role>edge-if</role>
    <username>user1</username>
    <userpassword>userpass</userpassword>
    <phynodeid>Node1</phynodeid>
    <phyacif>Node1:Ethernet0/0/1</phyacif>
    <protocol>
      <protocoltype>ospf</protocoltype>
      <igpattr>
        <protocolid>1000</protocolid>
      </igpattr>
    </protocol>
  </acif>
  <acif>
    ……
  </acif>
</acifs>
PUT

PUT URI/netL2VPN/L2VPNinstances/{instancename}/acifs

<acifs>
  <acif>
    <acifid>vpninstance1:port1</acifid>
    <acifaddr>20.1.1.1</acifaddr>
    <acifmask>24</acifmask>
    <role>edge-if</role>
    <username>user1</username>
    <userpassword>userpass</userpassword>
    <phynodeid>Node1</phynodeid>
    <phyacif>Node1:Ethernet0/0/1</phyacif>
    <protocol>
      <protocoltype>ospf</protocoltype>
      <igpattr>
        <protocolid>1000</protocolid>
      </igpattr>
    </protocol>
  </acif>
  <acif>
    ……
  </acif>
</acifs>
DELETE
  • 删除单个接入接口

DELETE URI/netL2VPN/L2VPNinstances/{instancename}/acifs/{acifid}. 无 HTTP 消息体。

  • 删除一个或多个接入接口

DELETE URI/netL2VPN/L2VPNinstances/{instancename}/acifs

<acifs>
  <acif>
    <acifid>vpninstance1:port1</acifid>
  </acif>
  <acif>
    ……
  </acif>
</acifs>