Skip to content

Commit

Permalink
TEIV: Add groups and geo location
Browse files Browse the repository at this point in the history
* Updated yang models:
  - entities and relationships can now have groups
  - updated most relationship descriptions
  - added attributes to AntennaModule
  - added dUpLMNId to ODUFunction
  - updated Sector azimuth to decimal degrees
  - added an ANTENNAMODULE_SERVES_NRCELLDU relationship
* Added auditing to teiv
* Refactoring of teiv
* Updated pgsql-schema-generator to generate groups
  - can run as both a jar and through the IDE
* Updated exposure.Dockerfile to work with groups
* Updated cloud event example

Issue-ID: SMO-168
Issue-ID: SMO-169
Change-Id: I316c5766862cd0ff3e3275e81058090cbf092fe8
Signed-off-by: JvD_Ericsson <[email protected]>
  • Loading branch information
JvD-Ericsson committed Dec 3, 2024
1 parent 4b19403 commit 1ca7e0a
Show file tree
Hide file tree
Showing 393 changed files with 40,313 additions and 10,624 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
--
-- ============LICENSE_START=======================================================
-- Copyright (C) 2024 Ericsson
-- Modifications Copyright (C) 2024 OpenInfra Foundation Europe
-- ================================================================================
-- 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.
--
-- SPDX-License-Identifier: Apache-2.0
-- ============LICENSE_END=========================================================
--

BEGIN;

CREATE SCHEMA IF NOT EXISTS ties_groups;
ALTER SCHEMA ties_groups OWNER TO topology_exposure_user;
SET default_tablespace = '';
SET default_table_access_method = heap;

SET ROLE 'topology_exposure_user';

-- Function to create CONSTRAINT only if it does not exists
CREATE OR REPLACE FUNCTION ties_groups.create_constraint_if_not_exists (
t_name TEXT, c_name TEXT, constraint_sql TEXT
)
RETURNS void AS
$$
BEGIN
IF NOT EXISTS (SELECT constraint_name FROM information_schema.table_constraints WHERE table_schema = 'ties_groups' AND table_name = t_name AND constraint_name = c_name) THEN
EXECUTE constraint_sql;
END IF;
END;
$$ language 'plpgsql';

CREATE TABLE IF NOT EXISTS ties_groups."groups" (
"id" VARCHAR(150) PRIMARY KEY,
"name" VARCHAR(150) NOT NULL,
"type" VARCHAR(50) NOT NULL
);

CREATE TABLE IF NOT EXISTS ties_groups."static_groups" (
"id" VARCHAR(150),
"topology_type" TEXT NOT NULL,
"provided_members_ids" TEXT[] NOT NULL,
PRIMARY KEY ("id", "topology_type"),
FOREIGN KEY ("id") REFERENCES ties_groups."groups" ("id") ON DELETE CASCADE
);

CREATE TABLE IF NOT EXISTS ties_groups."dynamic_groups" (
"id" VARCHAR(150) PRIMARY KEY,
"criteria" JSONB NOT NULL,
FOREIGN KEY ("id") REFERENCES ties_groups."groups" ("id") ON DELETE CASCADE
);

SELECT ties_groups.create_constraint_if_not_exists(
'groups',
'CHECK_groups_type',
'ALTER TABLE ties_groups."groups" ADD CONSTRAINT "CHECK_groups_type" CHECK ("type" IN (''static'', ''dynamic''))'
);

COMMIT;
132 changes: 110 additions & 22 deletions docker-compose/cloudEventProducer/events/cloudEventExampleMerge.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,134 +236,222 @@ ce_specversion:::1.0,ce_id:::a30e63c9-d29e-46ff-b99a-b63ed83fd237,ce_source:::dm
{
"id": "urn:oran:smo:teiv:MANAGEDELEMENT_MANAGES_ODUFUNCTION=1",
"aSide": "urn:3gpp:dn:ManagedElement=NR01",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1",
"sourceIds": [
"source1",
"source2"
]
}
],
"o-ran-smo-teiv-ran:ODUFUNCTION_PROVIDES_NRSECTORCARRIER": [
{
"id": "urn:oran:smo:teiv:ODUFUNCTION_PROVIDES_NRSECTORCARRIER=1",
"aSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=1"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=1",
"sourceIds": [
"source1",
"source2"
]
},
{
"id": "urn:oran:smo:teiv:ODUFUNCTION_PROVIDES_NRSECTORCARRIER=2",
"aSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=2"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=2",
"sourceIds": [
"source1",
"source2"
]
},
{
"id": "urn:oran:smo:teiv:ODUFUNCTION_PROVIDES_NRSECTORCARRIER=3",
"aSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=3"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=3",
"sourceIds": [
"source1",
"source2"
]
}
],
"o-ran-smo-teiv-ran:ODUFUNCTION_PROVIDES_NRCELLDU": [
{
"id": "urn:oran:smo:teiv:ODUFUNCTION_PROVIDES_NRCELLDU=1",
"aSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRCellDU=1"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRCellDU=1",
"sourceIds": [
"source1",
"source2"
]
},
{
"id": "urn:oran:smo:teiv:ODUFUNCTION_PROVIDES_NRCELLDU=2",
"aSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRCellDU=2"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRCellDU=2",
"sourceIds": [
"source1",
"source2"
]
}
],
"o-ran-smo-teiv-ran:NRCELLDU_USES_NRSECTORCARRIER": [
{
"id": "urn:oran:smo:teiv:NRCELLDU_USES_NRSECTORCARRIER=1",
"aSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRCellDU=1",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=1"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=1",
"sourceIds": [
"source1",
"source2"
]
},
{
"id": "urn:oran:smo:teiv:NRCELLDU_USES_NRSECTORCARRIER=2",
"aSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRCellDU=2",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=2"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=2",
"sourceIds": [
"source1",
"source2"
]
},
{
"id": "urn:oran:smo:teiv:NRCELLDU_USES_NRSECTORCARRIER=3",
"aSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRCellDU=2",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=3"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=3",
"sourceIds": [
"source1",
"source2"
]
}
],
"o-ran-smo-teiv-ran:NRSECTORCARRIER_USES_ANTENNACAPABILITY": [
{
"id": "urn:oran:smo:teiv:NRSECTORCARRIER_USES_ANTENNACAPABILITY=1",
"aSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=1",
"bSide": "urn:oran:smo:teiv:AntennaCapability=1"
"bSide": "urn:oran:smo:teiv:AntennaCapability=1",
"sourceIds": [
"source1",
"source2"
]
},
{
"id": "urn:oran:smo:teiv:NRSECTORCARRIER_USES_ANTENNACAPABILITY=2",
"aSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=2",
"bSide": "urn:oran:smo:teiv:AntennaCapability=2"
"bSide": "urn:oran:smo:teiv:AntennaCapability=2",
"sourceIds": [
"source1",
"source2"
]
},
{
"id": "urn:oran:smo:teiv:NRSECTORCARRIER_USES_ANTENNACAPABILITY=3",
"aSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRSectorCarrier=3",
"bSide": "urn:oran:smo:teiv:AntennaCapability=2"
"bSide": "urn:oran:smo:teiv:AntennaCapability=2",
"sourceIds": [
"source1",
"source2"
]
}
],
"o-ran-smo-teiv-rel-equipment-ran:ANTENNAMODULE_SERVES_ANTENNACAPABILITY": [
{
"id": "urn:oran:smo:teiv:ANTENNAMODULE_SERVES_ANTENNACAPABILITY=1",
"aSide": "urn:oran:smo:teiv:AntennaModule=1",
"bSide": "urn:oran:smo:teiv:AntennaCapability=1"
"bSide": "urn:oran:smo:teiv:AntennaCapability=1",
"sourceIds": [
"source1",
"source2"
]
},
{
"id": "urn:oran:smo:teiv:ANTENNAMODULE_SERVES_ANTENNACAPABILITY=2",
"aSide": "urn:oran:smo:teiv:AntennaModule=2",
"bSide": "urn:oran:smo:teiv:AntennaCapability=2"
"bSide": "urn:oran:smo:teiv:AntennaCapability=2",
"sourceIds": [
"source1",
"source2"
]
}
],
"o-ran-smo-teiv-equipment:ANTENNAMODULE_INSTALLED_AT_SITE": [
{
"id": "urn:oran:smo:teiv:ANTENNAMODULE_INSTALLED_AT_SITE=1",
"aSide": "urn:oran:smo:teiv:AntennaModule=1",
"bSide": "urn:oran:smo:teiv:Site=1"
"bSide": "urn:oran:smo:teiv:Site=1",
"sourceIds": [
"source1",
"source2"
]
},
{
"id": "urn:oran:smo:teiv:ANTENNAMODULE_INSTALLED_AT_SITE=2",
"aSide": "urn:oran:smo:teiv:AntennaModule=2",
"bSide": "urn:oran:smo:teiv:Site=2"
"bSide": "urn:oran:smo:teiv:Site=2",
"sourceIds": [
"source1",
"source2"
]
}
],
"o-ran-smo-teiv-ran:SECTOR_GROUPS_NRCELLDU": [
{
"id": "urn:oran:smo:teiv:SECTOR_GROUPS_NRCELLDU=1",
"aSide": "urn:oran:smo:teiv:Sector=1",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRCellDU=1"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRCellDU=1",
"sourceIds": [
"source1",
"source2"
]
},
{
"id": "urn:oran:smo:teiv:SECTOR_GROUPS_NRCELLDU=2",
"aSide": "urn:oran:smo:teiv:Sector=2",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRCellDU=2"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1,NRCellDU=2",
"sourceIds": [
"source1",
"source2"
]
}
],
"o-ran-smo-teiv-rel-oam-cloud:NFDEPLOYMENT_SERVES_MANAGEDELEMENT": [
{
"id": "urn:oran:smo:teiv:NFDEPLOYMENT_SERVES_MANAGEDELEMENT=1",
"aSide": "urn:oran:smo:teiv:NFDeployment:1",
"bSide": "urn:3gpp:dn:ManagedElement=NR01"
"bSide": "urn:3gpp:dn:ManagedElement=NR01",
"sourceIds": [
"source1",
"source2"
]
}
],
"o-ran-smo-teiv-rel-oam-cloud:MANAGEDELEMENT_DEPLOYED_AS_CLOUDIFIEDNF": [
{
"id": "urn:o-ran:smo-teiv-rel-oam-cloud:1",
"aSide": "urn:3gpp:dn:ManagedElement=NR01",
"bSide": "urn:oran:smo:teiv:CloudifiedNF:1"
"bSide": "urn:oran:smo:teiv:CloudifiedNF:1",
"sourceIds": [
"source1",
"source2"
]
}
],
"o-ran-smo-teiv-cloud:CLOUDIFIEDNF_COMPRISES_NFDEPLOYMENT": [
{
"id": "urn:o-ran:smo-teiv-cloud:1",
"aSide": "urn:oran:smo:teiv:CloudifiedNF:1",
"bSide": "urn:oran:smo:teiv:NFDeployment:1"
"bSide": "urn:oran:smo:teiv:NFDeployment:1",
"sourceIds": [
"source1",
"source2"
]
}
],
"o-ran-smo-teiv-rel-cloud-ran:NFDEPLOYMENT_SERVES_ODUFUNCTION": [
{
"id": "urn:o-ran:smo-teiv-rel-cloud-ran:1",
"aSide": "urn:oran:smo:teiv:NFDeployment:1",
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1"
"bSide": "urn:3gpp:dn:ManagedElement=NR01,ODUFunction=1",
"sourceIds": [
"source1",
"source2"
]
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion docker-compose/copySqlSchemaFromPgsqlGenerator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ REPLACEMENT2="'topology_exposure_user'"
declare -A FILES
FILES=( ["00_init-oran-smo-teiv-data.sql"]="01_init-teiv-exposure-data.sql"
["01_init-oran-smo-teiv-model.sql"]="00_init-teiv-exposure-model.sql"
["02_init-oran-smo-teiv-consumer-data.sql"]="02_init-teiv-exposure-consumer-data.sql")
["02_init-oran-smo-teiv-consumer-data.sql"]="02_init-teiv-exposure-consumer-data.sql"
["03_init-oran-smo-teiv-groups.sql"]="03_init-teiv-exposure-groups.sql")

mkdir -p "$TARGET_DIR"

Expand Down
Loading

0 comments on commit 1ca7e0a

Please sign in to comment.