/*-
* ============LICENSE_START=======================================================
- * openECOMP : SDN-C
+ * ONAP : SDN-C
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
"routing-protocols": {
"routing-protocol": [
{
- "type": "huawei-ac-net-l3vpn-svc:static",
+ "type": ${prop.l3vpn.ac1_protocol},
"static": {
"cascaded-lan-prefixes": [
{
"ipv4-lan-prefixes": [
{
- "ip-prefix": ${prop.l3vpn.sna1-route},
- "next-hop": ${prop.l3vpn.sna1-route}
+ "ip-prefix": ${prop.l3vpn.sna1-route.ip-prefix},
+ "next-hop": ${prop.l3vpn.sna1-route.next-hop}
}
]
}
]
}
+ "bgp": {
+ "peers": [
+ {
+ "peer-ip": ${prop.l3vpn.peer1-ip},
+ "remote-as": ${prop.l3vpn.ac1_protocol_bgp_as}
+ }
+ ]
+ }
+ }
}
]
},
"routing-protocols": {
"routing-protocol": [
{
- "type": "huawei-ac-net-l3vpn-svc:static",
+ "type": ${prop.l3vpn.ac2_protocol},
"static": {
"cascaded-lan-prefixes": [
{
"ipv4-lan-prefixes": [
{
- "ip-prefix": ${prop.l3vpn.sna2-route},
- "next-hop": ${prop.l3vpn.sna2-route}
+ "ip-prefix": ${prop.l3vpn.sna2-route.ip-prefix},
+ "next-hop": ${prop.l3vpn.sna2-route.next-hop}
}
]
}
]
}
+ "bgp": {
+ "peers": [
+ {
+ "peer-ip": ${prop.l3vpn.peer2-ip},
+ "remote-as": ${prop.l3vpn.ac2_protocol_bgp_as}
+ }
+ ]
+ }
}
]
},
/*-
* ============LICENSE_START=======================================================
- * openECOMP : SDN-C
+ * ONAP : SDN-C
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
*/
{
- "vpn-id": ${prop.l3vpn.name},
- "customer-name": "huawei",
- "vpn-service-topology": ${prop.l3vpn.topology},
- "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way"
+ "vpn-service": [
+ {
+ "vpn-id": ${prop.l3vpn.name,
+ "customer-name": "huawei",
+ "vpn-service-topology": ${prop.l3vpn.topology,
+ "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way"
+ }
+ ]
}
-
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : SDN-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+{
+ "vrf-attribute": [
+ {
+ "vrf-attribute-id": ${prop.l3vpn.vrf1-id},
+ "ne-id": ${prop.l3vpn.pe1_id},
+ "vpn-policy-id": ${prop.l3vpn.vpn-policy1-id}
+ },
+ {
+ "vrf-attribute-id": ${prop.l3vpn.vrf2-id},
+ "ne-id": ${prop.l3vpn.pe2_id},
+ "vpn-policy-id": ${prop.l3vpn.vpn-policy2-id}
+ }
+ ]
+}
import java.util.HashMap;
import java.util.Map;
+
import org.junit.Test;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b");
ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1");
ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2");
- ctx.setAttribute("prop.l3vpn.sna1-route", "192.168.1.4/24");
+ ctx.setAttribute("prop.l3vpn.ac1_protocol", "static");
+ ctx.setAttribute("prop.l3vpn.sna1-route.ip-prefix", "192.168.1.1/24");
+ ctx.setAttribute("prop.l3vpn.sna1-route.next-hop", "192.168.1.4");
ctx.setAttribute("prop.l3vpn.site2_name", "10000000-0000-0000-0000-000000000005");
ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006");
ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c");
ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.5");
ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5");
- ctx.setAttribute("prop.l3vpn.sna2-route", "192.168.1.8/24");
+ ctx.setAttribute("prop.l3vpn.ac2_protocol", "bgp");
+ ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.5");
+ ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200");
Map<String, String> p = new HashMap<String, String>();
p.put("templateFileName", "src/test/resources/l3smsitetemplate.json");
rcn.sendRequest(p, ctx);
}
+ @Test
+ public void testVrfJsonTemplate() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+ ctx.setAttribute("prop.l3vpn.vrf1-id", "10000000-0000-0000-0000-000000000007");
+ ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003");
+ ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e");
+ ctx.setAttribute("prop.l3vpn.vrf2-id", "10000000-0000-0000-0000-000000000009");
+ ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006");
+ ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a");
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("templateFileName", "src/test/resources/l3smvrftemplate.json");
+ p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vrf-attributes");
+ p.put("restapiUser", "admin");
+ p.put("restapiPassword", "admin123");
+ p.put("format", "json");
+ p.put("httpMethod", "post");
+ p.put("responsePrefix", "restapi-result");
+ p.put("skipSending", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
+
@Test
public void testL2DciTemplate() throws SvcLogicException {
SvcLogicContext ctx = new SvcLogicContext();
/*-
* ============LICENSE_START=======================================================
- * openECOMP : SDN-C
+ * ONAP : SDN-C
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
"routing-protocols": {
"routing-protocol": [
{
- "type": "huawei-ac-net-l3vpn-svc:static",
+ "type": ${prop.l3vpn.ac1_protocol},
"static": {
"cascaded-lan-prefixes": [
{
"ipv4-lan-prefixes": [
{
- "ip-prefix": ${prop.l3vpn.sna1-route},
- "next-hop": ${prop.l3vpn.sna1-route}
+ "ip-prefix": ${prop.l3vpn.sna1-route.ip-prefix},
+ "next-hop": ${prop.l3vpn.sna1-route.next-hop}
}
]
}
]
}
+ "bgp": {
+ "peers": [
+ {
+ "peer-ip": ${prop.l3vpn.peer1-ip},
+ "remote-as": ${prop.l3vpn.ac1_protocol_bgp_as}
+ }
+ ]
+ }
+ }
}
]
},
"routing-protocols": {
"routing-protocol": [
{
- "type": "huawei-ac-net-l3vpn-svc:static",
+ "type": ${prop.l3vpn.ac2_protocol},
"static": {
"cascaded-lan-prefixes": [
{
"ipv4-lan-prefixes": [
{
- "ip-prefix": ${prop.l3vpn.sna2-route},
- "next-hop": ${prop.l3vpn.sna2-route}
+ "ip-prefix": ${prop.l3vpn.sna2-route.ip-prefix},
+ "next-hop": ${prop.l3vpn.sna2-route.next-hop}
}
]
}
]
}
+ "bgp": {
+ "peers": [
+ {
+ "peer-ip": ${prop.l3vpn.peer2-ip},
+ "remote-as": ${prop.l3vpn.ac2_protocol_bgp_as}
+ }
+ ]
+ }
}
]
},
/*-
* ============LICENSE_START=======================================================
- * openECOMP : SDN-C
+ * ONAP : SDN-C
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
*/
{
- "vpn-id": ${prop.l3vpn.name},
- "customer-name": "huawei",
- "vpn-service-topology": ${prop.l3vpn.topology},
- "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way"
+ "vpn-service": [
+ {
+ "vpn-id": ${prop.l3vpn.name,
+ "customer-name": "huawei",
+ "vpn-service-topology": ${prop.l3vpn.topology,
+ "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way"
+ }
+ ]
}
-
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : SDN-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+{
+ "vrf-attribute": [
+ {
+ "vrf-attribute-id": ${prop.l3vpn.vrf1-id},
+ "ne-id": ${prop.l3vpn.pe1_id},
+ "vpn-policy-id": ${prop.l3vpn.vpn-policy1-id}
+ },
+ {
+ "vrf-attribute-id": ${prop.l3vpn.vrf2-id},
+ "ne-id": ${prop.l3vpn.pe2_id},
+ "vpn-policy-id": ${prop.l3vpn.vpn-policy2-id}
+ }
+ ]
+}