From 5363b2782d906a6c6067eb840392f959ed4dfe4b Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 18 Jul 2017 20:23:07 -0400 Subject: [CCSDK-6] Populate seed code Add seed code for sli/adaptors repository Update code to use org.onap.ccsdk.sli.core Change-Id: I477c7a24f2cc1fed8fb0975fe9f33733411c27f9 Signed-off-by: Dan Timoney --- .../spring/resource-assignment-context.xml | 296 +++++++++++++++++++++ .../spring/resource-assignment-osgi-context.xml | 39 +++ .../main/resources/resource-allocator.properties | 26 ++ .../main/resources/sql/001_resource_rule_ddl.sql | 32 +++ .../main/resources/sql/002_max_port_speed_ddl.sql | 29 ++ .../resources/sql/003_max_server_speed_ddl.sql | 28 ++ 6 files changed, 450 insertions(+) create mode 100644 resource-assignment/provider/src/main/resources/META-INF/spring/resource-assignment-context.xml create mode 100644 resource-assignment/provider/src/main/resources/META-INF/spring/resource-assignment-osgi-context.xml create mode 100644 resource-assignment/provider/src/main/resources/resource-allocator.properties create mode 100644 resource-assignment/provider/src/main/resources/sql/001_resource_rule_ddl.sql create mode 100644 resource-assignment/provider/src/main/resources/sql/002_max_port_speed_ddl.sql create mode 100644 resource-assignment/provider/src/main/resources/sql/003_max_server_speed_ddl.sql (limited to 'resource-assignment/provider/src/main/resources') diff --git a/resource-assignment/provider/src/main/resources/META-INF/spring/resource-assignment-context.xml b/resource-assignment/provider/src/main/resources/META-INF/spring/resource-assignment-context.xml new file mode 100644 index 000000000..b123944d3 --- /dev/null +++ b/resource-assignment/provider/src/main/resources/META-INF/spring/resource-assignment-context.xml @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resource-assignment/provider/src/main/resources/META-INF/spring/resource-assignment-osgi-context.xml b/resource-assignment/provider/src/main/resources/META-INF/spring/resource-assignment-osgi-context.xml new file mode 100644 index 000000000..bec30ce11 --- /dev/null +++ b/resource-assignment/provider/src/main/resources/META-INF/spring/resource-assignment-osgi-context.xml @@ -0,0 +1,39 @@ + + + + + + + + javax.sql.DataSource + org.openecomp.sdnc.sli.resource.dblib.DbLibService + + + + + + diff --git a/resource-assignment/provider/src/main/resources/resource-allocator.properties b/resource-assignment/provider/src/main/resources/resource-allocator.properties new file mode 100644 index 000000000..1a2cf0c78 --- /dev/null +++ b/resource-assignment/provider/src/main/resources/resource-allocator.properties @@ -0,0 +1,26 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 ONAP 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========================================================= +### + +org.openecomp.sdnc.sli.dbtype = jdbc +org.openecomp.sdnc.sli.jdbc.url = jdbc:mysql://dbhost:3306/sdnctl +org.openecomp.sdnc.sli.jdbc.database = sdnctl +org.openecomp.sdnc.sli.jdbc.user = sdnctl +org.openecomp.sdnc.sli.jdbc.password = gamma diff --git a/resource-assignment/provider/src/main/resources/sql/001_resource_rule_ddl.sql b/resource-assignment/provider/src/main/resources/sql/001_resource_rule_ddl.sql new file mode 100644 index 000000000..ea60c62dc --- /dev/null +++ b/resource-assignment/provider/src/main/resources/sql/001_resource_rule_ddl.sql @@ -0,0 +1,32 @@ +--- +-- ============LICENSE_START======================================================= +-- openECOMP : SDN-C +-- ================================================================================ +-- Copyright (C) 2017 ONAP 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========================================================= +--- + +CREATE TABLE resource_rule ( + resource_rule_id SERIAL PRIMARY KEY, + resource_name VARCHAR(50) NOT NULL, + end_point_position VARCHAR(50) NOT NULL, + service_expression VARCHAR(2000) NOT NULL, + equipment_level VARCHAR(50) NOT NULL, + equipment_expression VARCHAR(2000) NOT NULL, + allocation_expression VARCHAR(2000) NOT NULL, + soft_limit_expression VARCHAR(2000) NOT NULL, + hard_limit_expression VARCHAR(2000) NOT NULL +); diff --git a/resource-assignment/provider/src/main/resources/sql/002_max_port_speed_ddl.sql b/resource-assignment/provider/src/main/resources/sql/002_max_port_speed_ddl.sql new file mode 100644 index 000000000..2aa66ac80 --- /dev/null +++ b/resource-assignment/provider/src/main/resources/sql/002_max_port_speed_ddl.sql @@ -0,0 +1,29 @@ +--- +-- ============LICENSE_START======================================================= +-- openECOMP : SDN-C +-- ================================================================================ +-- Copyright (C) 2017 ONAP 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========================================================= +--- + +CREATE TABLE max_port_speed ( + max_port_speed_id SERIAL PRIMARY KEY, + image_file_name VARCHAR(50) NOT NULL, + end_point_position VARCHAR(50) NOT NULL, + interface_name VARCHAR(100) NOT NULL, + max_speed BIGINT NOT NULL, + unit VARCHAR(10) NOT NULL +); diff --git a/resource-assignment/provider/src/main/resources/sql/003_max_server_speed_ddl.sql b/resource-assignment/provider/src/main/resources/sql/003_max_server_speed_ddl.sql new file mode 100644 index 000000000..671117e7d --- /dev/null +++ b/resource-assignment/provider/src/main/resources/sql/003_max_server_speed_ddl.sql @@ -0,0 +1,28 @@ +--- +-- ============LICENSE_START======================================================= +-- openECOMP : SDN-C +-- ================================================================================ +-- Copyright (C) 2017 ONAP 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========================================================= +--- + +CREATE TABLE max_server_speed ( + max_server_speed_id SERIAL PRIMARY KEY, + server_model VARCHAR(50) NOT NULL, + evc_count SMALLINT NOT NULL, + max_speed BIGINT NOT NULL, + unit VARCHAR(10) NOT NULL +); -- cgit 1.2.3-korg