From 7893d08db0ef3fd29d64c9be759325fa18cc21fa Mon Sep 17 00:00:00 2001 From: sb5356 Date: Tue, 15 May 2018 11:58:17 -0400 Subject: [CCSDK-245] RA: Refactor RA to make it generic Resource allocator is cleaned up and refactored so it does not contain any service specific logic. Issue-ID: CCSDK-245 Change-Id: Ib948eb813020fbe7dc779148e412de1e074b300b Signed-off-by: sb5356 --- .../provider/src/test/resources/homing-req.json | 46 ----- .../provider/src/test/resources/param.txt | 44 ----- .../provider/src/test/resources/sql/data.sql | 66 +++++++ .../src/test/resources/svc-topology-req.json | 195 ------------------ .../provider/src/test/resources/test-context.xml | 217 ++++----------------- 5 files changed, 101 insertions(+), 467 deletions(-) delete mode 100644 resource-assignment/provider/src/test/resources/homing-req.json delete mode 100755 resource-assignment/provider/src/test/resources/param.txt delete mode 100644 resource-assignment/provider/src/test/resources/svc-topology-req.json (limited to 'resource-assignment/provider/src/test/resources') diff --git a/resource-assignment/provider/src/test/resources/homing-req.json b/resource-assignment/provider/src/test/resources/homing-req.json deleted file mode 100644 index 1f061eca..00000000 --- a/resource-assignment/provider/src/test/resources/homing-req.json +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : 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========================================================= - */ - -{ - "input":{ - "sdnc-homing-header":{ - "svc-request-id":"omx-123", - "svc-action":"homing" - }, - "request-information":{ - "request-id":"mso-1234", - "request-action":"GetAicNodesRequest", - "source":"OMX", - "list-length":1 - }, - "homing-request-information":{ - "service-type":"SDN-ETHERNET-INTERNET", - "global-customer-id":"custid-123", - "customer-location":{ - "lata":332 - } - }, - "homing-other-information":{ - "bandwidth-value":150, - "bandwidth-units":"Mbps" - } - } -} diff --git a/resource-assignment/provider/src/test/resources/param.txt b/resource-assignment/provider/src/test/resources/param.txt deleted file mode 100755 index a20ac909..00000000 --- a/resource-assignment/provider/src/test/resources/param.txt +++ /dev/null @@ -1,44 +0,0 @@ -isAvailable: - Input in ctx: - tmp.resource-allocator.aic-site-id - tmp.resource-allocator.speed - tmp.resource-allocator.speed-unit - Output in ctx: - tmp.resource-allocator.max-available-speed - tmp.resource-allocator.speed-unit - Return: - SUCCESS – capacity available - NOT_FOUND – capacity not available - Error message in: error-message, error-code - FAILURE – the check has failed (data error, code defect, etc) - Error message in: error-message, error-code - -Reserve: - Input in ctx: - tmp.resource-allocator.aic-site-id - tmp.resource-allocator.speed - tmp.resource-allocator.speed-unit - tmp.resource-allocator.service-instance-id - tmp.resource-allocator.request-type { New, Change } - Output in ctx: - tmp.resource-allocator-output.max-available-speed - tmp.resource-allocator-output.speed-unit - Return: - SUCCESS – capacity available - NOT_FOUND – capacity not available - Error message in: error-message, error-code - FAILURE – the check has failed (data error, code defect, etc) - Error message in: error-message, error-code - -Release: - Input in ctx: - tmp.resource-allocator.service-instance-id - tmp.resource-allocator.request-type { Activate, Cancel, Disconnect } - Return: - SUCCESS – capacity available - FAILURE – the check has failed (data error, code defect, etc) - Error message in: error-message, error-code - - -Plugin name: org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator -Resource: NetworkCapacity diff --git a/resource-assignment/provider/src/test/resources/sql/data.sql b/resource-assignment/provider/src/test/resources/sql/data.sql index 5fd4c757..681a9c45 100644 --- a/resource-assignment/provider/src/test/resources/sql/data.sql +++ b/resource-assignment/provider/src/test/resources/sql/data.sql @@ -118,3 +118,69 @@ INSERT INTO PARAMETERS (name, value, category, memo) VALUES ('homing.pserver.sparing.ratio', '1:1', 'homing', 'Ratio of primary to backup servers within any of the AIC sites. Used in RA to calculate the max allowed bw in an AIC site.'); +INSERT INTO RESOURCE_RULE ( + resource_name, service_model, end_point_position, service_expression, equipment_level, equipment_expression, + allocation_expression, soft_limit_expression, hard_limit_expression) +VALUES ( + 'PortBandwidth', 'ADIG', 'VPE', 'true', 'Port', 'true', + 'service-speed-mbps', 'service-speed-mbps', 'service-speed-mbps'); + +INSERT INTO RESOURCE_RULE ( + resource_name, service_model, end_point_position, service_expression, equipment_level, equipment_expression, + allocation_expression, soft_limit_expression, hard_limit_expression) +VALUES ( + 'Bandwidth', 'ADIG', 'VPE', 'true', 'VNF', 'vnf-type = "VPE"', + 'service-speed-mbps', '0.5 * max-vpe-bandwidth-mbps', '0.9 * max-vpe-bandwidth-mbps'); + + +INSERT INTO RESOURCE_RULE ( + resource_name, service_model, end_point_position, service_expression, equipment_level, equipment_expression, + allocation_expression, soft_limit_expression, hard_limit_expression) +VALUES ( + 'Bandwidth', 'ADIG', 'VPE', 'true', 'AffinityLink', 'true', + 'service-speed-mbps', '9999999999', '9999999999'); + +INSERT INTO RESOURCE_RULE ( + resource_name, service_model, end_point_position, service_expression, equipment_level, equipment_expression, + allocation_expression, soft_limit_expression, hard_limit_expression) +VALUES ( + 'Connection', 'ADIG', 'VPE', 'true', 'VNF', 'true', + '1', '200', '200'); + +INSERT INTO RANGE_RULE ( + range_name, service_model, end_point_position, equipment_level, min_value, + max_value) +VALUES ( + 'cust-vlan-id', 'ADIG', 'VPE', 'VNF', '2', '1000'); + +INSERT INTO RANGE_RULE ( + range_name, service_model, end_point_position, equipment_level, min_value, + max_value) +VALUES ( + 'vlan-id-inner', 'ADIG', 'VPE', 'VNF', '1002', '2000'); + + +INSERT INTO RANGE_RULE ( + range_name, service_model, end_point_position, equipment_level, min_value, + max_value) +VALUES ( + 'vlan-id-outer', 'MY-SERV-MODEL', 'VPE-Cust', 'Site', '2', '1000'); + +INSERT INTO RANGE_RULE ( + range_name, service_model, end_point_position, equipment_level, min_value, + max_value) +VALUES ( + 'vlan-id-filter', 'MY-SERV-MODEL', 'VPE-Core1', 'Site', '1002', '2000'); + +INSERT INTO RANGE_RULE ( + range_name, service_model, end_point_position, equipment_level, min_value, + max_value) +VALUES ( + 'vlan-id-filter', 'MY-SERV-MODEL', 'VPE-Core2', 'Site', '1002', '2000'); + +INSERT INTO RANGE_RULE ( + range_name, service_model, end_point_position, equipment_level, min_value, + max_value) +VALUES ( + 'vlan-id-filter', 'MY-SERV-MODEL', 'VPE-Core3', 'Site', '400', '600'); + \ No newline at end of file diff --git a/resource-assignment/provider/src/test/resources/svc-topology-req.json b/resource-assignment/provider/src/test/resources/svc-topology-req.json deleted file mode 100644 index ab8afb66..00000000 --- a/resource-assignment/provider/src/test/resources/svc-topology-req.json +++ /dev/null @@ -1,195 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : 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========================================================= - */ - -{ - "input":{ - "sdnc-request-header":{ - "svc-request-id":"omx-123", - "svc-action":"assign" - }, - "sdnc-topology-additional-data":{ - "svc-vnf-type":"vce" - }, - "request-information":{ - "request-id":"mso-1234", - "request-action":"Layer3ServiceActivateRequest", - "source":"OMX" - }, - "service-information":{ - "service-type":"SDN-ETHERNET-INTERNET", - "service-instance-id":"service-instance-123", - "subscriber-name":"ssb-subscriber" - }, - "l2-homing-information":{ - "evc-name":"EVC-123", - "topology":"PointToPoint", - "preferred-aic-clli":"ATLNGATL001" - } - "internet-evc-access-information":{ - "internet-evc-speed-value":"150", - "internet-evc-speed-units":"Mbps", - "ip-version":"v6" - } - "vr-lan":{ - "routing-protocol":"none", - { - "v6-vr-lan-prefix":"string", - "v6-public-lan-prefixes":{ - "t-provided-v6-lan-public-prefixes":[ - { - "v6-lan-public-prefix-length":"integer", - "v6-lan-public-prefix":"string", - "request-index":"integer" - } - ] - }, - "v6-vr-lan-prefix-length":"integer", - "v4-vr-lan-prefix-length":"integer", - "firewall-lite":{ - "v6-firewall-packet-filters":[ - { - "v6-firewall-prefix-length":"integer", - "udp-port-list":[ - { - "port-number":"integer" - } - ], - "tcp-port-list":[ - { - "port-number":"integer" - } - ], - "v6-firewall-prefix":"string" - } - ], - "v4-firewall-packet-filters":[ - { - "v4-firewall-prefix-length":"integer", - "udp-port-list":[ - { - "port-number":"integer" - } - ], - "tcp-port-list":[ - { - "port-number":"integer" - } - ], - "v4-firewall-prefix":"string" - } - ] - }, - "v6-vce-wan-address":"string", - "v4-public-lan-prefixes":{ - "t-provided-v4-lan-public-prefixes":[ - { - "v4-lan-public-prefix":"string", - "v4-lan-public-prefix-length":"integer", - "request-index":"integer" - } - ] - }, - "pat":{ - "v4-pat-default-pool-prefix-length":"integer", - "v4-pat-pools":[ - { - "v4-pat-pool-next-hop-address":"string", - "v4-pat-pool-prefix-length":"integer", - "v4-pat-pool-prefix":"string" - } - ], - "v4-pat-default-pool-prefix":"string" - }, - "v4-vce-loopback-address":"string", - "v4-vr-lan-prefix":"string", - "dhcp":{ - "v4-dhcp-pools":[ - { - "v4-dhcp-relay-next-hop-address":"string", - "excluded-v4-addresses":[ - { - "excluded-v4-address":"string" - } - ], - "v4-dhcp-pool-prefix":"string", - "v4-dhcp-relay-gateway-address":"string", - "v4-dhcp-pool-prefix-length":"integer" - } - ], - "excluded-v4-dhcp-addresses-from-default-pool":[ - { - "excluded-v4-address":"string" - } - ], - "v6-dhcp-pools":[ - { - "v6-dhcp-relay-gateway-address":"string", - "excluded-v6-addresses":[ - { - "excluded-v6-address":"string" - } - ], - "v6-dhcp-pool-prefix-length":"integer", - "v6-dhcp-relay-next-hop-address":"string", - "v6-dhcp-pool-prefix":"string" - } - ], - "v6-dhcp-default-pool-prefix":"string", - "v6-dhcp-default-pool-prefix-length":"integer", - "v4-dhcp-default-pool-prefix":"string", - "excluded-v6-dhcp-addresses-from-default-pool":[ - { - "excluded-v6-address":"string" - } - ], - "v4-dhcp-default-pool-prefix-length":"integer" - }, - "nat":{ - "v4-nat-mapping-entries":[ - { - "v4-nat-external":"string", - "v4-nat-next-hop-address":"string", - "v4-nat-internal":"string" - } - ] - }, - "static-routes":{ - "v6-static-routes":[ - { - "v6-static-route-prefix-length":"integer", - "v6-next-hop-address":"string", - "v6-static-route-prefix":"string" - } - ], - "v4-static-routes":[ - { - "v4-static-route-prefix-length":"integer", - "v4-static-route-prefix":"string", - "v4-next-hop-address":"string" - } - ] - } - } - - } - - } -} diff --git a/resource-assignment/provider/src/test/resources/test-context.xml b/resource-assignment/provider/src/test/resources/test-context.xml index c3b09a1f..32b54e9e 100644 --- a/resource-assignment/provider/src/test/resources/test-context.xml +++ b/resource-assignment/provider/src/test/resources/test-context.xml @@ -4,7 +4,7 @@ openECOMP : SDN-C ================================================================================ Copyright (C) 2017 AT&T Intellectual Property. All rights - reserved. + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,22 +20,23 @@ ============LICENSE_END========================================================= --> - + http://www.springframework.org/schema/beans/spring-beans-3.1.xsd + http://www.springframework.org/schema/jdbc + http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-3.1.xsd + "> - + - + @@ -45,10 +46,18 @@ - + + + + + + + + + @@ -57,17 +66,10 @@ - - - - - - - + - - + @@ -76,7 +78,7 @@ - + @@ -99,35 +101,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -137,161 +114,37 @@ - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + - + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - -- cgit 1.2.3-korg