**/.java-version
**/.openapi-generator
.openapi-generator-ignore
-yang-parser/src/main/resources/modules/*.yang
-yang-parser/src/test/resources/_orig-modules/ietf*.yang
-yang-parser/src/test/resources/_orig-modules/_3gpp*.yang
-yang-parser/src/test/resources/_orig-modules/iana*.yang
+yang-parser/yang-parser-jar/src/main/resources/modules/*.yang
+yang-parser/yang-parser-jar/src/test/resources/_orig-modules/ietf*.yang
+yang-parser/yang-parser-jar/src/test/resources/_orig-modules/_3gpp*.yang
+yang-parser/yang-parser-jar/src/test/resources/_orig-modules/iana*.yang
pgsql-schema-generator/src/test/resources/generate-defaults/import/*.yang
teiv/src/main/resources/models/import/*.yang
teiv/src/main/resources/v1/README.md
<!-- Set compiler Java version, MUST match the Dockerfile JDK version -->
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <!-- Versions of co-located functions to use-->
+ <!-- Versions of co-located functions to use -->
<version.yang-parser-jar>1.2.0-SNAPSHOT</version.yang-parser-jar> <!--use current master snapshot version -->
<!-- 3PP Versions -->
<version.jackson-databind-nullable>0.2.6</version.jackson-databind-nullable>
<configuration>
<licenseSets>
<licenseSet>
- <header>${project.parent.basedir}/license/copyright-2024.txt</header>
+ <header>${maven.multiModuleProjectDirectory}/license/copyright-2024.txt</header>
<validHeaders>
- <validHeader>${project.parent.basedir}/license/copyright-2024.txt</validHeader>
+ <validHeader>${maven.multiModuleProjectDirectory}/license/copyright-2024.txt</validHeader>
</validHeaders>
<excludes>
<exclude>**/*.html</exclude>
</licenseSet>
</licenseSets>
<headerDefinitions>
- <headerDefinition>${project.parent.basedir}/license/javaHeaderDefinition.xml</headerDefinition>
- <headerDefinition>${project.parent.basedir}/license/xmlHeaderDefinition.xml</headerDefinition>
+ <headerDefinition>${maven.multiModuleProjectDirectory}/license/javaHeaderDefinition.xml</headerDefinition>
+ <headerDefinition>${maven.multiModuleProjectDirectory}/license/xmlHeaderDefinition.xml</headerDefinition>
</headerDefinitions>
<mapping>
<java>JAVADOC_STYLE</java>
<exclude>target/**/*.json</exclude>
<exclude>build/**/*.json</exclude>
<!--generated -->
- <exclude>**/resources/v1/topology-exposure-inventory-openapi.json</exclude>
+ <exclude>**/resources/v1/topology-exposure-inventory-openapi.json</exclude>
</excludes>
<eclipseWtp>
<type>JSON</type>
</formats>
<java>
<eclipse>
- <file>${project.parent.basedir}/code_conventions.xml</file>
+ <file>${maven.multiModuleProjectDirectory}/code_conventions.xml</file>
</eclipse>
<toggleOffOn>
<off>spotless:off</off>
<removeUnusedImports />
<endWithNewline />
<licenseHeader>
- <file>${project.parent.basedir}/CopyrightSample.txt</file>
+ <file>${maven.multiModuleProjectDirectory}/CopyrightSample.txt</file>
</licenseHeader>
</java>
<groovy>
<include>**/*.groovy</include>
</includes>
<greclipse>
- <file>${project.parent.basedir}/code_conventions.xml</file>
+ <file>${maven.multiModuleProjectDirectory}/code_conventions.xml</file>
</greclipse>
<licenseHeader>
- <file>${project.parent.basedir}/CopyrightSample.txt</file>
+ <file>${maven.multiModuleProjectDirectory}/CopyrightSample.txt</file>
</licenseHeader>
<endWithNewline />
</groovy>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- spotless:off -->
+<!--
+ ============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=========================================================
+ -->
+<!-- spotless:on -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.oran.smo</groupId>
+ <artifactId>yang-parser</artifactId>
+ <version>0.2.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.oran.smo.yangtools.parser.simple.example</groupId>
+ <artifactId>parser-example</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <name>yang-parser-example</name>
+
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.diffplug.spotless</groupId>
+ <artifactId>spotless-maven-plugin</artifactId>
+ <version>${version.spotless-plugin}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.oran.smo.yangtools.parser</groupId>
+ <artifactId>yang-parser-jar</artifactId>
+ <version>${version.yang-parser-jar}</version>
+ </dependency>
+ </dependencies>
+
+</project>
--- /dev/null
+/*
+ * ============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=========================================================
+ */
+package org.oran.smo.yangtools.parser.simple.example;
+
+import org.oran.smo.yangtools.parser.ParserExecutionContext;
+import org.oran.smo.yangtools.parser.data.YangData;
+import org.oran.smo.yangtools.parser.data.parser.JsonParser;
+import org.oran.smo.yangtools.parser.data.parser.JsonParser.JsonValue;
+import org.oran.smo.yangtools.parser.input.FileBasedYangInput;
+
+import java.io.File;
+import java.io.IOException;
+
+public class JsonParserExample {
+
+ private static final String DIR = "yang-parser-example/src/main/resources/json/";
+
+ public static JsonValue parseJsonFile(ParserExecutionContext context) {
+ final File jsonFile = new File(DIR + "AntennaModule-response.json");
+ final FileBasedYangInput fileBasedYangInput = new FileBasedYangInput(jsonFile);
+ final YangData yangInstanceDataInput = new YangData(fileBasedYangInput);
+
+ try {
+ return new JsonParser(context, yangInstanceDataInput, fileBasedYangInput.getInputStream()).parse();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+}
--- /dev/null
+/*
+ * ============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=========================================================
+ */
+package org.oran.smo.yangtools.parser.simple.example;
+
+import org.oran.smo.yangtools.parser.ParserExecutionContext;
+import org.oran.smo.yangtools.parser.YangDeviceModel;
+import org.oran.smo.yangtools.parser.data.parser.JsonParser.JsonArray;
+import org.oran.smo.yangtools.parser.data.parser.JsonParser.JsonObject;
+import org.oran.smo.yangtools.parser.data.parser.JsonParser.JsonObjectMemberName;
+import org.oran.smo.yangtools.parser.data.parser.JsonParser.JsonValue;
+import org.oran.smo.yangtools.parser.data.parser.JsonWriter;
+import org.oran.smo.yangtools.parser.findings.FindingsManager;
+import org.oran.smo.yangtools.parser.findings.ModifyableFindingSeverityCalculator;
+import org.oran.smo.yangtools.parser.findings.ModuleAndFindingTypeAndSchemaNodePathFilterPredicate;
+import org.oran.smo.yangtools.parser.model.YangModel;
+import org.oran.smo.yangtools.parser.model.statements.ietf.IetfExtensionsClassSupplier;
+import org.oran.smo.yangtools.parser.model.statements.oran.OranExtensionsClassSupplier;
+import org.oran.smo.yangtools.parser.model.statements.threegpp.ThreeGppExtensionsClassSupplier;
+import org.oran.smo.yangtools.parser.model.statements.yang.YModule;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+public class Main {
+
+ private static YangDeviceModel yangDeviceModel;
+ private static ModifyableFindingSeverityCalculator severityCalculator;
+ private static FindingsManager findingsManager;
+ private static ParserExecutionContext context;
+
+ public static void main(String[] args) {
+
+ // Setup for yang parser.
+ // The parser execution context directs the behaviour of the parser. It is vital that the
+ // context is correctly setup.
+ setUp();
+
+ // using the yang-parser's jsonParser parse json output from TEIV response:
+ // GET http://localhost:31074/topology-inventory/v1alpha11/domains/EQUIPMENT/entity-types/AntennaModule/entities?targetFilter=/attributes
+ JsonObject parsedJsonObject = (JsonObject) JsonParserExample.parseJsonFile(context);
+ // get the "items" from the response
+ JsonArray items = (JsonArray) getJsonObjectMemberValue(parsedJsonObject, "items");
+ System.out.println("Response of all AntennaModules from TEIV:");
+ for (JsonValue item : items.getValues()) {
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try {
+ JsonValue value = getJsonObjectMemberValue((JsonObject) item, "o-ran-smo-teiv-equipment:AntennaModule");
+ // using the yang-parser's jsonWriter write the json to stream
+ JsonWriter.write(value, baos);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ // print the output to console
+ System.out.println(baos);
+ }
+
+ System.out.println("\n------------------------------------------------------------------");
+
+ // using the yang-parser's parseIntoYangModels
+ List<YangModel> yangModels = YangParserExample.parseYangModels(yangDeviceModel, context);
+ System.out.println("\nList of all entities/lists from o-ran-smo-teiv-ran model:");
+ Optional<YangModel> optionalRanModel = yangModels.stream().filter(yangModel -> "o-ran-smo-teiv-ran".equals(yangModel
+ .getModuleIdentity().getModuleName())).findFirst();
+ optionalRanModel.ifPresent(yangModel -> {
+ YModule yModule = yangModel.getYangModelRoot().getModule();
+ yModule.getLists().stream().forEach(yList -> {
+ System.out.println(yList.getListName());
+ });
+ });
+
+ }
+
+ private static JsonValue getJsonObjectMemberValue(final JsonObject jsonObject, final String memberName) {
+
+ final Set<Map.Entry<JsonObjectMemberName, JsonValue>> entrySet = jsonObject.getValuesByMember().entrySet();
+ for (final Map.Entry<JsonObjectMemberName, JsonValue> entry : entrySet) {
+
+ if (memberName.equals(entry.getKey().getMemberName())) {
+ return entry.getValue();
+ }
+ }
+
+ return null;
+ }
+
+ private static void setUp() {
+ yangDeviceModel = new YangDeviceModel("Yang Parser JAR Test Device Model");
+
+ severityCalculator = new ModifyableFindingSeverityCalculator();
+
+ findingsManager = new FindingsManager(severityCalculator);
+
+ // suppress all findings from ietf and iana
+ findingsManager.addFilterPredicate(ModuleAndFindingTypeAndSchemaNodePathFilterPredicate.fromString(
+ "ietf*,iana*;*;*"));
+
+ final ThreeGppExtensionsClassSupplier threeGppStatementFactory = new ThreeGppExtensionsClassSupplier();
+ final IetfExtensionsClassSupplier ietfStatementFactory = new IetfExtensionsClassSupplier();
+ final OranExtensionsClassSupplier oranStatementFactory = new OranExtensionsClassSupplier();
+
+ context = new ParserExecutionContext(findingsManager, Arrays.asList(threeGppStatementFactory, oranStatementFactory,
+ ietfStatementFactory));
+ context.setFailFast(false);
+ context.setSuppressFindingsOnUnusedSchemaNodes(true);
+ }
+
+}
--- /dev/null
+/*
+ * ============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=========================================================
+ */
+package org.oran.smo.yangtools.parser.simple.example;
+
+import org.oran.smo.yangtools.parser.ParserExecutionContext;
+import org.oran.smo.yangtools.parser.YangDeviceModel;
+import org.oran.smo.yangtools.parser.input.FileBasedYangInput;
+import org.oran.smo.yangtools.parser.model.ConformanceType;
+import org.oran.smo.yangtools.parser.model.YangModel;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+public class YangParserExample {
+
+ private static final String DIR = "yang-parser-example/src/main/resources/yang/";
+
+ public static List<YangModel> parseYangModels(YangDeviceModel yangDeviceModel, ParserExecutionContext context) {
+
+ List<String> yangImplementFiles = new ArrayList<>();
+ List<String> yangImportFiles = new ArrayList<>();
+
+ // these yang files are the versions as of 2025-01-29
+ // for the current versions of the yang files check teiv/src/main/resources/models
+ yangImplementFiles.add("2024-10-08-o-ran-smo-teiv-ran.yang");
+ yangImplementFiles.add("2024-05-24-o-ran-smo-teiv-common-yang-extensions.yang");
+ yangImplementFiles.add("2024-10-04-o-ran-smo-teiv-common-yang-types.yang");
+
+ final List<YangModel> yangModels = new ArrayList<>();
+
+ for (final String relativeFilePath : yangImplementFiles) {
+ yangModels.add(new YangModel(new FileBasedYangInput(new File(DIR + relativeFilePath)),
+ ConformanceType.IMPLEMENT));
+ }
+ for (final String relativeFilePath : yangImportFiles) {
+ yangModels.add(new YangModel(new FileBasedYangInput(new File(DIR + "import/" + relativeFilePath)),
+ ConformanceType.IMPORT));
+ }
+
+ yangDeviceModel.parseIntoYangModels(context, yangModels);
+
+ return yangModels;
+ }
+
+}
--- /dev/null
+{
+ "items": [
+ {
+ "o-ran-smo-teiv-equipment:AntennaModule": [
+ {
+ "attributes": {
+ "mechanicalAntennaTilt": 10,
+ "mechanicalAntennaBearing": 50,
+ "positionWithinSector": "Unknown",
+ "geo-location": "POINT Z (-73.007696 41.73297 3000)",
+ "verticalBeamWidth": null,
+ "totalTilt": 14,
+ "antennaModelNumber": "1",
+ "azimuth": null,
+ "antennaBeamWidth": [
+ 35,
+ 23,
+ 21
+ ],
+ "electricalAntennaTilt": 2,
+ "horizontalBeamWidth": null
+ },
+ "id": "urn:oran:smo:teiv:AntennaModule=1"
+ }
+ ]
+ },
+ {
+ "o-ran-smo-teiv-equipment:AntennaModule": [
+ {
+ "attributes": {
+ "mechanicalAntennaTilt": 12,
+ "mechanicalAntennaBearing": 45,
+ "positionWithinSector": "Unknown",
+ "geo-location": "POINT Z (-71.096454 43.75443 2500)",
+ "verticalBeamWidth": null,
+ "totalTilt": 15,
+ "antennaModelNumber": "2",
+ "azimuth": null,
+ "antennaBeamWidth": [
+ 45,
+ 32,
+ 21
+ ],
+ "electricalAntennaTilt": 1,
+ "horizontalBeamWidth": null
+ },
+ "id": "urn:oran:smo:teiv:AntennaModule=2"
+ }
+ ]
+ }
+ ],
+ "self": {
+ "href": "/domains/EQUIPMENT/entity-types/AntennaModule/entities?offset=0&limit=500&targetFilter=/attributes"
+ },
+ "first": {
+ "href": "/domains/EQUIPMENT/entity-types/AntennaModule/entities?offset=0&limit=500&targetFilter=/attributes"
+ },
+ "prev": {
+ "href": "/domains/EQUIPMENT/entity-types/AntennaModule/entities?offset=0&limit=500&targetFilter=/attributes"
+ },
+ "next": {
+ "href": "/domains/EQUIPMENT/entity-types/AntennaModule/entities?offset=0&limit=500&targetFilter=/attributes"
+ },
+ "last": {
+ "href": "/domains/EQUIPMENT/entity-types/AntennaModule/entities?offset=0&limit=500&targetFilter=/attributes"
+ },
+ "totalCount": 2
+}
--- /dev/null
+module o-ran-smo-teiv-common-yang-extensions {
+
+ yang-version 1.1;
+ namespace "urn:o-ran:smo-teiv-common-yang-extensions";
+ prefix or-teiv-yext;
+
+ organization "ORAN";
+ contact "The Authors";
+ description
+ "Topology and Inventory YANG extensions model
+
+ This model contains extensions to the YANG language that topology and
+ inventory models will use to define and annotate types and relationships.
+
+ 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";
+
+ revision "2024-05-24" {
+ description "Initial revision.";
+ or-teiv-yext:label 0.3.0;
+ }
+
+ extension biDirectionalTopologyRelationship {
+ description
+ "Defines a bi-directional relationship in the topology.
+
+ A bi-directional-association (BDA) is a relationship comprising of
+ an A-side and a B-side. The A-side is considered the originating
+ side of the relationship; the B-side is considered the terminating
+ side of the relationship. The order of A-side and B-side is of
+ importance and MUST NOT be changed once defined.
+
+ Both A-side and B-side are defined on a type, and are given a role.
+ A type may have multiple originating and/or terminating sides of a
+ relationship, all distinguished by role name.
+
+ The statement MUST only be a substatement of the 'module' statement.
+ Multiple 'bi-directional-topology-relationship' statements are
+ allowed per parent statement.
+
+ Substatements to the 'bi-directional-topology-relationship' define
+ the A-side and the B-side, respectively, and optionally properties
+ of the relationship. Data nodes of types 'leaf' and 'leaf-list' are
+ used for this purpose. One of the data nodes MUST be annotated with
+ the 'a-side' extension; another data node MUST be annotated with the
+ 'b-side' extension. Other data nodes define properties of the
+ relationship.
+
+ The argument is the name of the relationship. The relationship name
+ is scoped to the namespace of the declaring module and MUST be
+ unique within the scope.";
+
+ argument relationshipName;
+ }
+
+ extension aSide {
+ description
+ "Defines the A-side of a relationship.
+
+ The statement MUST only be a substatement of a 'leaf' or 'leaf-list'
+ statement, which itself must be a substatement of the
+ 'uni-directional-topology-relationship' statement.
+
+ The data type of the parent 'leaf' or 'leaf-list' MUST be
+ 'instance-identifier'. Constraints MAY be used as part of the parent
+ 'leaf' or 'leaf-list' to enforce cardinality.
+
+ The identifier of the parent 'leaf' or 'leaf-list' is used as name
+ of the role of the A-side of the relationship. The name of the role
+ is scoped to the type on which the A-side is defined and MUST be
+ unique within the scope.
+
+ While the parent 'leaf' or 'leaf-list' does not result in a property
+ of the relationship, it is RECOMMENDED to avoid using the name of an
+ existing type property as role name to avoid potential ambiguities
+ between properties of a type, and roles of a relationship on the
+ type.
+
+ The argument is the name of the type on which the A-side resides.
+ If the type is declared in another module, the type must be
+ prefixed, and a corresponding 'import' statement be used to declare
+ the prefix.";
+
+ argument aSideType;
+ }
+
+ extension bSide {
+ description
+ "Defines the B-side of a relationship.
+
+ The statement MUST only be a substatement of a 'leaf' or 'leaf-list'
+ statement, which itself must be a substatement of the
+ 'uni-directional-topology-relationship' statement.
+
+ The data type of the parent 'leaf' or 'leaf-list' MUST be
+ 'instance-identifier'. Constraints MAY be used as part of the parent
+ 'leaf' or 'leaf-list' to enforce cardinality.
+
+ The identifier of the parent 'leaf' or 'leaf-list' is used as name
+ of the role of the B-side of the relationship. The name of the role
+ is scoped to the type on which the B-side is defined and MUST be
+ unique within the scope.
+
+ While the parent 'leaf' or 'leaf-list' does not result in a property
+ of the relationship, it is RECOMMENDED to avoid using the name of an
+ existing type property as role name to avoid potential ambiguities
+ between properties of a type, and roles of a relationship on the
+ type.
+
+ The argument is the name of the type on which the B-side resides.
+ If the type is declared in another module, the type must be
+ prefixed, and a corresponding 'import' statement be used to declare
+ the prefix.";
+
+ argument bSideType;
+ }
+
+ extension domain {
+ description "Keyword used to carry domain information.";
+ argument domainName;
+ }
+
+ extension label {
+ description
+ "The label can be used to give modules and submodules a semantic
+ version, in addition to their revision.
+
+ The format of the label is 'x.y.z' - expressed as pattern, it is
+ [0-9]+\\.[0-9]+\\.[0-9]+
+
+ The statement MUST only be a substatement of the revision statement.
+ Zero or one revision label statements per parent statement are
+ allowed.
+
+ Revision labels MUST be unique amongst all revisions of a module or
+ submodule.";
+
+ argument semversion;
+ }
+}
\ No newline at end of file
--- /dev/null
+module o-ran-smo-teiv-common-yang-types {
+ yang-version 1.1;
+ namespace "urn:o-ran:smo-teiv-common-yang-types";
+ prefix or-teiv-types;
+
+ import o-ran-smo-teiv-common-yang-extensions { prefix or-teiv-yext; }
+
+ import _3gpp-common-yang-types { prefix types3gpp; }
+
+ organization "ORAN";
+ contact "The Authors";
+ description
+ "Topology and Inventory common types model
+
+ This model contains re-usable data types that topology and inventory models
+ will frequently use as part of types and relationships.
+
+ 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";
+
+ revision "2024-10-04" {
+ description "Added Origin_Entity_Mapping_Grp and Origin_Relationship_Mapping_Grp
+ for sourceIds and reliabilityIndicator to metadata.";
+ or-teiv-yext:label 0.4.0;
+ }
+
+ revision "2024-05-24" {
+ description "Initial revision.";
+ or-teiv-yext:label 0.3.0;
+ }
+
+ grouping Top_Grp_Type {
+ description "Grouping containing the key attribute common to all types.
+ All types MUST use this grouping.";
+
+ leaf id {
+ type string;
+ description "Unique identifier of topology entities. Represents the
+ Entity Instance Identifier.";
+ }
+ }
+
+ container decorators {
+ description
+ "This container serves as extension point for applications wishing
+ to define their own decorators. This is done via augmentations. They
+ can only be defined in name value pair.
+
+ This is a consumer data and can be attached to Topology Entity or
+ Topology Relation instance, outside of the declared Topology Entity
+ or Topology Relationship's attributes. This cannot be instantiated,
+ and it MUST NOT be augmented or deviated in any way, unless stated
+ otherwise.";
+ }
+
+ leaf-list classifiers {
+ description
+ "Consumer defined tags to topology entities and relationships.
+
+ This is a consumer data and can be attached to Topology Entity or
+ Topology Relation instance, outside of the declared Topology Entity
+ or Topology Relationship's attributes. This cannot be instantiated,
+ and it MUST NOT be augmented or deviated in any way, unless stated
+ otherwise.";
+
+ type identityref { base classifier; }
+ }
+
+ grouping Origin_Entity_Mapping_Grp {
+ description "Grouping to identify sourceIds on a topology entity.";
+
+ leaf-list sourceIds {
+
+ description
+ "An ordered list of identities that represent the set of native
+ source identifiers for participating entities.
+
+ This must be attached to the Topology Entity instance, outside of the
+ declared Topology Entity's attributes. This is exposed to the
+ consumers and can only be set by the responsible adapter. This
+ cannot be instantiated, and it MUST NOT be augmented or deviated
+ in any way, unless stated otherwise.";
+
+ type sourceId;
+ ordered-by user;
+ min-elements 1;
+ }
+ }
+
+ grouping Origin_Relationship_Mapping_Grp {
+ description "Grouping to identify sourceIds on a topology relationship.";
+
+ leaf-list sourceIds {
+
+ description
+ "An ordered list of identities that represent the set of native
+ source identifiers for participating entities in the relationship.
+
+ This must be attached to the Topology Relation instance, outside of the
+ declared Topology Relationship's attributes. This is exposed to the
+ consumers and can only be set by the responsible adapter. This
+ cannot be instantiated, and it MUST NOT be augmented or deviated in
+ any way, unless stated otherwise.";
+
+ type sourceId;
+ ordered-by user;
+ min-elements 2;
+ }
+ }
+
+ container metadata {
+ description
+ "This container serves as an extension point to define metadata. They
+ can only be defined in name value pairs.
+
+ This must be attached to the Topology Entity or Topology Relation instance,
+ outside of the declared Topology Entity or Topology Relationship's
+ attributes. This is exposed to the consumers and can only be set by
+ the responsible adapter. This cannot be instantiated, and it MUST NOT be
+ augmented or deviated in any way, unless stated otherwise.";
+
+ leaf reliabilityIndicator {
+ type enumeration {
+ enum OK {
+ description "The data is in alignment with the source of truth,
+ as far as Topology Exposure Handling is aware.";
+ value 0;
+ }
+ enum RESTORED {
+ description "The data was restored from backup and the responsible
+ adapters are checking to ensure the data is current.";
+ value 1;
+ }
+ enum ADVISED {
+ description "Entity implicitly created by Topology Exposure Handling and
+ potentially not aligned with the source of truth.";
+ value 2;
+ }
+ }
+ }
+ }
+
+ identity classifier {
+ description "The classifier is used as a base to provide all classifiers
+ with identity. ";
+ }
+
+ typedef sourceId {
+ description "An identity that represents a native identifier of a topology entity.";
+ type string;
+ }
+}
\ No newline at end of file
--- /dev/null
+module o-ran-smo-teiv-ran {
+ yang-version 1.1;
+ namespace "urn:o-ran:smo-teiv-ran";
+ prefix or-teiv-ran;
+
+ import o-ran-smo-teiv-common-yang-types {prefix or-teiv-types; }
+
+ import o-ran-smo-teiv-common-yang-extensions {prefix or-teiv-yext; }
+
+ import _3gpp-common-yang-types { prefix types3gpp; }
+
+ import ietf-geo-location {
+ prefix geo;
+ reference "RFC 9179: A YANG Grouping for Geographic Locations";
+ }
+
+ organization "ORAN";
+ contact "The Authors";
+ description
+ "RAN Logical topology model.
+
+ This model contains the topology entities and relations in the
+ RAN Logical domain, which represents the functional capability
+ of the deployed RAN that are relevant to rApps use cases.
+
+ 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";
+
+ revision "2024-10-08" {
+ description "Added range for azimuth attribute of Sector.";
+ or-teiv-yext:label 0.6.0;
+ }
+
+ revision "2024-10-04" {
+ description "Added groupings, Origin_Entity_Mapping_Grp or Origin_Relationship_Mapping_Grp
+ to the corresponding topology object.";
+ or-teiv-yext:label 0.5.0;
+ }
+
+ revision "2024-07-15" {
+ description "This revision aligns O-RAN Work Group 10 Stage 2 Specification (O-RAN.WG10.TE&IV-CIMI.0-R004.v02.00)";
+ or-teiv-yext:label 0.4.0;
+ }
+
+ revision "2024-05-24" {
+ description "Initial revision.";
+ or-teiv-yext:label 0.3.0;
+ }
+
+ or-teiv-yext:domain RAN;
+
+ list ORUFunction {
+ description "O-RAN Radio Unit (O-RU).
+
+ A logical node hosting Low-PHY layer and RF processing based on a
+ lower layer functional split. This is similar to 3GPP’s “TRP” or
+ “RRH” but more specific in including the Low-PHY layer (FFT/iFFT,
+ PRACH extraction). The O-RU terminates the Open Fronthaul interface
+ (also known as LLS interface) as well as Low-PHY functions of the
+ radio interface towards the UE. This is deployed as a PNF. The O-RU
+ terminates the Open Fronthaul M-Plane interface towards the O-DU
+ and SMO.
+
+ Note: In Topology, you can create, read, update, and delete
+ the O-RU object.";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Entity_Mapping_Grp;
+ key id;
+
+ container attributes {
+ leaf oruId {
+ description "Unique identifier for the O-RU within a ORUFunction";
+ type int64;
+ }
+ }
+ }
+
+ list NearRTRICFunction {
+ description "Near-Real-Time RAN Intelligent Controller (Near-RT RIC).
+
+ An O-RAN Network Function (NF) that enables near-real-time control
+ and optimization of RAN elements and resources via fine-grained
+ data collection and actions over E2 interface. It may include
+ AI/ML (Artificial Intelligence / Machine Learning) workflow
+ including model training, inference, and updates.
+
+ Note: In Topology, you can create, read, update, and delete
+ the Near-RT RIC object.";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Entity_Mapping_Grp;
+ key id;
+
+ container attributes {
+ leaf nearRtRicId {
+ description "Unique identifier for the Near-RT RIC within a NearRTRICFunction";
+ type int64;
+ }
+
+ container pLMNId {
+ description "PLMN identifier to be used as part of global RAN
+ node identity";
+ uses types3gpp:PLMNId;
+ }
+ }
+ }
+
+ list ODUFunction {
+ description "O-RAN Distributed Unit (O-DU).
+
+ The O-DU is an O-RAN NF in the O-RAN Architecture. An O-DU, combined
+ with one or more O-RU(s) connected to it, supports and is fully
+ compatible with the functions of a gNB-DU as defined by 3GPP TS 38.401.
+
+ The following is true for a O-DU:
+ Is connected to the O-CU-CP through the F1-C interface. Is
+ connected to the O-CU-UP through the F1-U interface. One O-DU is
+ connected to only one O-CU-CP. One O-DU can be connected to
+ multiple O-CU-UPs under the control of the same O-CU-CP.
+
+ Note: A gNB may consist of a O-CU-CP, multiple O-CU-UPs and
+ multiple O-DUs. O-DU is a concrete class that extends the NG-RAN
+ node object. In Topology, you can create, read, update, and delete
+ the gNB-DU object.";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Entity_Mapping_Grp;
+ key id;
+
+ container attributes {
+ container dUpLMNId {
+ description "PLMN identifier used as part of PM Events data";
+ uses types3gpp:PLMNId;
+ }
+
+ leaf gNBDUId {
+ description "Unique identifier for the DU within a gNodeB";
+ type int64;
+ }
+
+ leaf gNBId {
+ description "Identity of gNodeB within a PLMN";
+ type int64;
+ }
+
+ leaf gNBIdLength {
+ description "Length of gNBId bit string representation";
+ type int32;
+ }
+ }
+ }
+
+ list OCUCPFunction {
+ description "O-RAN Centralized Unit Control Plane (O-CU-CP)
+
+ This is a logical node hosting the Radio Resource Control (RRC) and
+ the control plane part of the Packet Data Convergence Protocol
+ (PDCP). The O-CU-CP terminates the E1 interface connected with
+ the O-CU-UP and the F1-C interface connected with the O-RAN
+ Distributed Unit (O-DU).
+
+ The following is true for a O-CU-CP:
+ Is connected to the O-DU through the F1-C interface. Is connected
+ to the O-CU-UP through the E1 interface. Only one O-CU-CP is
+ connected to one O-DU. Only one O-CU-CP is connected to one
+ O-CU-UP. One O-DU can be connected to multiple O-CU-UPs under
+ the control of the same O-CU-CP. One O-CU-UP can be connected to
+ multiple DUs under the control of the same O-CU-CP.
+
+ Note: A gNB may consist of a O-CU-CP, multiple O-CU-UPs and
+ multiple O-DUs. An O-CU-CP is a concrete class that extends the
+ NG-RAN node object. In Topology, you can create, read, update, and
+ delete the O-CU-CP object.";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Entity_Mapping_Grp;
+ key id;
+
+ container attributes {
+ leaf gNBCUName {
+ description "Name of gNodeB-CU";
+ type string;
+ }
+
+ leaf gNBId {
+ description "Identity of gNodeB within a PLMN";
+ type int64;
+ }
+
+ leaf gNBIdLength {
+ description "Length of gNBId bit string representation";
+ type int32;
+ }
+
+ container pLMNId {
+ description "PLMN identifier to be used as part of global RAN
+ node identity";
+ uses types3gpp:PLMNId;
+ }
+ }
+ }
+
+ list OCUUPFunction {
+ description "O-RAN Centralized Unit User Plane (O-CU-UP)
+
+ An O-CU-UP is a logical node hosting the User Plane part of the
+ Packet Data Convergence Protocol (PDCP) and the Service Data
+ Adaptation Protocol (SDAP). The O-CU-UP terminates the E1 interface
+ connected with the O-CU-CP and the F1-U interface connected with
+ the O-RAN Distributed Unit (O-DU).
+
+ The following is true for a O-CU-UP:
+ Is connected to the O-DU through the F1-U interface. Is connected
+ to the O-CU-CP through the E1 interface. One O-CU-UP is
+ connected to only one O-CU-CP. One O-DU can be connected to
+ multiple O-CU-UPs under the control of the same O-CU-CP. One
+ O-CU-UP can be connected to multiple DUs under the control of the
+ same O-CU-CP.
+
+ Note: A gNB may consist of an O-CU-CP, multiple O-CU-UPs and
+ multiple O-DUs. An O-CU-UP is a concrete class that extends the
+ NG-RAN node object. In Topology, you can create, read, update, and
+ delete the O-CU-UP object.";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Entity_Mapping_Grp;
+ key id;
+
+ container attributes {
+ leaf gNBId {
+ description "Identity of gNodeB within a PLMN";
+ type int64;
+ }
+
+ leaf gNBIdLength {
+ description "Length of gNBId bit string representation";
+ type int32;
+ }
+
+ list pLMNIdList {
+ description "List of PLMN identifier to be used as part of global RAN node identity";
+ uses types3gpp:PLMNId;
+ }
+ }
+ }
+
+ list NRCellCU {
+ description "Represents an NR Cell in gNodeB-CU.
+
+ 5G NR is a new radio access technology (RAT) developed by 3GPP for
+ the 5G (fifth generation) mobile network. It is designed to be the
+ global standard for the air interface of 5G networks.
+
+ 5G NR has synchronization signal that is known as Primary
+ Synchronization Signal (PSS) and Secondary Synchronization
+ Signal (SSS). These signals are specific to NR physical layer and
+ provide the following information required by UE for downlink
+ synchronization: PSS provides Radio Frame Boundary (Position of 1st
+ Symbol in a Radio frame) SSS provides Subframe Boundary (Position of
+ 1st Symbol in a Subframe) Physical Layer Cell ID (PCI) information
+ using both PSS and SSS.";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Entity_Mapping_Grp;
+ key id;
+
+ container attributes {
+ leaf cellLocalId {
+ description "Used together with gNodeB identifier to identify NR
+ cell in PLMN. Used together with gNBId to form NCI.";
+ type int32;
+ }
+
+ container plmnId {
+ description "PLMN ID for NR CGI. If empty,
+ GNBCUCPFunction::pLMNId is used for PLMN ID in NR CGI";
+ uses types3gpp:PLMNId;
+ }
+
+ leaf nCI {
+ description "NR Cell Identity";
+ type int64;
+ }
+
+ leaf nRTAC {
+ description "NR Tracking Area Code (TAC)";
+ type int32;
+ }
+ }
+ }
+
+ list NRCellDU {
+ description "Represents an NR Cell in gNodeB-DU.
+
+ 5G NR is a new radio access technology (RAT) developed by 3GPP for
+ the 5G (fifth generation) mobile network. It is designed to be the
+ global standard for the air interface of 5G networks.
+
+ 5G NR has synchronization signal that is known as Primary
+ Synchronization signal (PSS) and Secondary Synchronization signal
+ (SSS). These signals are specific to NR physical layer and provide
+ the following information required by UE for downlink
+ synchronization: PSS provides Radio Frame Boundary (Position of 1st
+ Symbol in a Radio frame) SSS provides Subframe Boundary (Position of
+ 1st Symbol in a Subframe) Physical Layer Cell ID (PCI) information
+ using both PSS and SSS.";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Entity_Mapping_Grp;
+ key id;
+
+ container attributes {
+ leaf cellLocalId {
+ description "Used together with gNodeB identifier to identify NR
+ cell in PLMN. Used together with gNBId to form NCI.";
+ type int32;
+ }
+
+ leaf nCI {
+ description "NR Cell Identity.";
+ type int64;
+ }
+
+ leaf nRPCI {
+ description "The Physical Cell Identity (PCI) of the NR cell.";
+ type int32;
+ }
+
+ leaf nRTAC {
+ description "NR Tracking Area Code (TAC).";
+ type int32;
+ }
+ }
+ }
+
+ list NRSectorCarrier {
+ description "The NR Sector Carrier object provides the attributes for
+ defining the logical characteristics of a carrier (cell) in a
+ sector. A sector is a coverage area associated with a base station
+ having its own antennas, radio ports, and control channels. The
+ concept of sectors was developed to improve co-channel interference
+ in cellular systems, and most wireless systems use three sector
+ cells.";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Entity_Mapping_Grp;
+ key id;
+
+ container attributes {
+ leaf arfcnDL {
+ description "NR Absolute Radio Frequency Channel Number
+ (NR-ARFCN) for downlink";
+ type int32;
+ }
+
+ leaf arfcnUL {
+ description "NR Absolute Radio frequency Channel Number
+ (NR-ARFCN) for uplink.";
+ type int32;
+ }
+
+ leaf frequencyDL {
+ description "RF Reference Frequency of downlink channel";
+ type int32;
+ }
+
+ leaf frequencyUL {
+ description "RF Reference Frequency of uplink channel";
+ type int32;
+ }
+
+ leaf bSChannelBwDL {
+ description "BS Channel bandwidth in MHz for downlink.";
+ type int32;
+ }
+ }
+ }
+
+ list AntennaCapability {
+ description "This MO serves as a mapping between the cell and the RBS
+ equipment used to provide coverage in a certain geographical area.
+ The MO also controls the maximum output power of the sector.";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Entity_Mapping_Grp;
+ key id;
+
+ container attributes {
+ leaf-list eUtranFqBands {
+ description "List of LTE frequency bands that associated
+ hardware supports";
+ type string;
+ }
+
+ leaf-list geranFqBands {
+ description "List of GERAN frequency bands that associated
+ hardware supports";
+ type string;
+ }
+
+ leaf-list nRFqBands {
+ description "List of NR frequency bands associated hardware
+ supports";
+ type string;
+ }
+ }
+ }
+
+ list Sector {
+ description "A group of co-located Cells that have a shared
+ coverage area.";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Entity_Mapping_Grp;
+ key id;
+
+ container attributes {
+ leaf sectorId {
+ description "Universally unique ID generated by the sector's
+ discovery mechanism.";
+ type uint64;
+ }
+
+ uses geo:geo-location;
+
+ leaf azimuth {
+ description "Average value of the azimuths of the cells
+ comprising the sector, determined during sector discovery.";
+ type decimal64{
+ fraction-digits 1;
+ range "0..360";
+ }
+ units "decimal degrees";
+ }
+ }
+ }
+
+
+ or-teiv-yext:biDirectionalTopologyRelationship ODUFUNCTION_PROVIDES_NRCELLDU { // 1 to 0..n
+
+ description
+ "The aSide of this relationship is an instance of the ODUFunction type.
+ The bSide of this relationship is an instance of the NRCellDU type.
+ The ODUFunction represents the DU component of a gNB that provides the NRCellDU.
+ A ODUFunction instance can provide many NRCellDUs.
+ An NRCellDU instance must be provided by an ODUFunction.
+ ";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Relationship_Mapping_Grp;
+ key id;
+
+ leaf-list provided-nrCellDu {
+ description "O-DU Function provides NR Cell-DU.";
+ or-teiv-yext:aSide ODUFunction;
+ type instance-identifier;
+ }
+
+ leaf provided-by-oduFunction {
+ description "NR Cell-DU provided by O-DU Function.";
+ or-teiv-yext:bSide NRCellDU;
+ type instance-identifier;
+ mandatory true;
+ }
+ }
+
+ or-teiv-yext:biDirectionalTopologyRelationship ODUFUNCTION_PROVIDES_NRSECTORCARRIER { // 1 to 0..n
+
+ description
+ "The aSide of this relationship is an instance of the ODUFunction type.
+ The bSide of this relationship is an instance of the NRSectorCarrier type.
+ The ODUFunction represents the DU component of a gNB that provides the NRSectorCarrier.
+ A ODUFunction instance can provide many NRSectorCarriers.
+ An NRSectorCarrier instance must be provided by an ODUFunction.
+ ";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Relationship_Mapping_Grp;
+ key id;
+
+ leaf-list provided-nrSectorCarrier {
+ description "O-DU Function provides NR Sector Carrier.";
+ or-teiv-yext:aSide ODUFunction;
+ type instance-identifier;
+ }
+
+ leaf provided-by-oduFunction {
+ description "NR Sector Carrier provided by O-DU Function.";
+ or-teiv-yext:bSide NRSectorCarrier;
+ type instance-identifier;
+ mandatory true;
+ }
+ }
+
+ or-teiv-yext:biDirectionalTopologyRelationship OCUCPFUNCTION_PROVIDES_NRCELLCU { // 1 to 0..n
+
+ description
+ "The aSide of this relationship is an instance of the OCUCPFunction type.
+ The bSide of this relationship is an instance of the NRCellCU type.
+ The OCUCPFunction represents the CU-CP component of a gNB that provides the NRCellCU.
+ A OCUCPFunction instance can provide many NRCellCU.
+ An NRCellCU instance must be provided by an OCUCPFunction.
+ ";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Relationship_Mapping_Grp;
+ key id;
+
+ leaf-list provided-nrCellCu {
+ description "O-CU-CP Function provides NR Cell-CU.";
+ or-teiv-yext:aSide OCUCPFunction;
+ type instance-identifier;
+ }
+
+ leaf provided-by-ocucpFunction {
+ description "NR Cell-CU provided by O-CU-CP Function.";
+ or-teiv-yext:bSide NRCellCU;
+ type instance-identifier;
+ mandatory true;
+ }
+ }
+
+ or-teiv-yext:biDirectionalTopologyRelationship NRCELLDU_USES_NRSECTORCARRIER { // 0..1 to 0..n
+
+ description
+ "The aSide of this relationship is an instance of the NRCellDU type.
+ The bSide of this relationship is an instance of the NRSectorCarrier type.
+ The NRCellDU represents the cell that uses the NRSectorCarrier.
+ An NRCellDU instance can use many NRSectorCarriers.
+ An NRSectorCarrier instance can only be used by one NRCellDU.
+ ";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Relationship_Mapping_Grp;
+ key id;
+
+ leaf-list used-nrSectorCarrier {
+ description "NR Cell-DU uses NR Sector Carrier.";
+ or-teiv-yext:aSide NRCellDU;
+ type instance-identifier;
+ }
+
+ leaf used-by-nrCellDu {
+ description "NR Sector Carrier used by NR Cell-DU.";
+ or-teiv-yext:bSide NRSectorCarrier;
+ type instance-identifier;
+ }
+ }
+
+ or-teiv-yext:biDirectionalTopologyRelationship NRSECTORCARRIER_USES_ANTENNACAPABILITY { // 0..n to 0..1
+
+ description
+ "The aSide of this relationship is an instance of the NRSectorCarrier type.
+ The bSide of this relationship is an instance of the AntennaCapability type.
+ The NRSectorCarrier represents the carrier that uses the AntennaCapability.
+ An NRSectorCarrier instance can use only one AntennaCapability.
+ An AntennaCapability instance can be used by many NRSectorCarriers.
+ ";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Relationship_Mapping_Grp;
+ key id;
+
+ leaf used-antennaCapability {
+ description "NR Sector Carrier uses Antenna Capability.";
+ or-teiv-yext:aSide NRSectorCarrier;
+ type instance-identifier;
+ }
+
+ leaf-list used-by-nrSectorCarrier {
+ description "Antenna Capability used by NR Sector Carrier.";
+ or-teiv-yext:bSide AntennaCapability;
+ type instance-identifier;
+ }
+ }
+
+ or-teiv-yext:biDirectionalTopologyRelationship SECTOR_GROUPS_NRCELLDU { // 0..1 to 0..n
+
+ description
+ "The aSide of this relationship is an instance of the Sector type.
+ The bSide of this relationship is an instance of the NRCellDU type.
+ The Sector represents the geographical area that groups the NRCellDUs.
+ A Sector instance can group many NRCellDUs.
+ An NRCellDU instance can only be grouped by one Sector.
+ ";
+
+ uses or-teiv-types:Top_Grp_Type;
+ uses or-teiv-types:Origin_Relationship_Mapping_Grp;
+ key id;
+
+ leaf-list grouped-nrCellDu {
+ description "Sector groups NR Cell-DU.";
+ or-teiv-yext:aSide Sector;
+ type instance-identifier;
+ }
+
+ leaf grouped-by-sector {
+ description "NR Cell-DU grouped by Sector.";
+ or-teiv-yext:bSide NRCellDU;
+ type instance-identifier;
+ }
+ }
+}
\ No newline at end of file
<version>0.2.0-SNAPSHOT</version>
</parent>
- <groupId>org.oran.smo.yangtools.parser</groupId>
- <artifactId>yang-parser-jar</artifactId>
- <name>Yang Parser</name>
- <version>1.2.0-SNAPSHOT</version>
- <packaging>jar</packaging>
+ <groupId>org.oran.smo</groupId>
+ <artifactId>yang-parser</artifactId>
+ <version>0.2.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+
+ <modules>
+ <module>yang-parser-jar</module>
+ <module>parser-example</module>
+ </modules>
<properties>
- <maven.javadoc.skip>true</maven.javadoc.skip>
- <sonar.tests>src/test/java</sonar.tests>
- <sonar.sources>pom.xml,src/main/java</sonar.sources>
- <sonar.exclusions>**/*.java</sonar.exclusions>
- <!-- External Yang model destination location -->
- <src.modules>${project.basedir}/src/main/resources/modules/</src.modules>
- <src.test.orig.modules>${project.basedir}/src/test/resources/_orig-modules/</src.test.orig.modules>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>3.0.0-M3</version>
- <configuration>
- <useFile>false</useFile>
- <includes>
- <include>**/*Test.java</include>
- </includes>
- <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
- </configuration>
- </plugin>
- <plugin>
- <groupId>com.mycila</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <version>${version.license-maven-plugin}</version>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>com.diffplug.spotless</groupId>
- <artifactId>spotless-maven-plugin</artifactId>
- <version>${version.spotless-plugin}</version>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>${version.antrun-maven-plugin}</version>
- <executions>
- <execution>
- <id>download-src-external-yang-models</id>
- <phase>initialize</phase>
- <configuration>
- <target>
- <mkdir dir="${src.modules}" />
- <resources id="src-ietf-yang-downloads">
- <url
- url="${source.ietfcatalog}ietf-yang-library@2019-01-04.yang" />
- <url
- url="${source.ietfcatalog}ietf-datastores@2018-02-14.yang" />
- <url
- url="${source.ietfcatalog}ietf-inet-types@2019-11-04.yang" />
- <url
- url="${source.ietfcatalog}ietf-yang-types@2019-11-04.yang" />
- </resources>
- <get dest="${src.modules}" skipexisting="true">
- <resources refid="src-ietf-yang-downloads" />
- <mapper type="regexp" from="^.*/([^/@]+)@([^/]+)$"
- to="\1-\2" />
- </get>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>download-test-external-yang-models</id>
- <phase>generate-test-sources</phase>
- <configuration>
- <target>
- <get
- src="${source.3gpp.Rel18_SA98}_3gpp-common-yang-extensions.yang"
- dest="${src.test.orig.modules}_3gpp-common-yang-extensions-2022-10-20.yang"
- skipexisting="true" />
- <get
- src="${source.3gpp.Rel17_SA91}_3gpp-common-yang-extensions.yang"
- dest="${src.test.orig.modules}_3gpp-common-yang-extensions-2019-06-23.yang"
- skipexisting="true" />
-
- <resources id="orig-ietf-yang-downloads">
- <!-- spotless:off -->
- <url url="${source.ietfcatalog}iana-crypt-hash@2014-08-06.yang"/>
- <url url="${source.ietfcatalog}ietf-crypto-types@2019-11-20.yang" />
- <url url="${source.ietfcatalog}ietf-datastores@2018-02-14.yang"/>
- <url url="${source.ietfcatalog}ietf-inet-types@2019-11-04.yang"/>
- <url url="${source.ietfcatalog}ietf-interfaces@2018-02-20.yang"/>
- <url url="${source.ietfcatalog}ietf-ip@2018-02-22.yang"/>
- <url url="${source.ietfcatalog}ietf-keystore@2019-11-20.yang"/>
- <url url="${source.ietfcatalog}ietf-netconf-acm@2018-02-14.yang"/>
- <url url="${source.ietfcatalog}ietf-netconf-client@2019-11-20.yang"/>
- <url url="${source.ietfcatalog}ietf-netconf-monitoring@2010-10-04.yang"/>
- <url url="${source.ietfcatalog}ietf-netconf-notifications@2012-02-06.yang"/>
- <url url="${source.ietfcatalog}ietf-netconf-server@2018-09-20.yang"/>
- <url url="${source.ietfcatalog}ietf-netconf-with-defaults@2011-06-01.yang"/>
- <url url="${source.ietfcatalog}ietf-netconf@2011-06-01.yang"/>
- <url url="${source.ietfcatalog}ietf-network-instance@2019-01-21.yang"/>
- <url url="${source.ietfcatalog}ietf-origin@2018-02-14.yang"/>
- <url url="${source.ietfcatalog}ietf-restconf-monitoring@2017-01-26.yang"/>
- <url url="${source.ietfcatalog}ietf-restconf@2017-01-26.yang"/>
- <url url="${source.ietfcatalog}ietf-ssh-client@2019-11-20.yang"/>
- <url url="${source.ietfcatalog}ietf-ssh-common@2019-11-20.yang"/>
- <url url="${source.ietfcatalog}ietf-ssh-server@2019-11-20.yang"/>
- <url url="${source.ietfcatalog}ietf-subscribed-notifications@2019-05-06.yang"/>
- <url url="${source.ietfcatalog}ietf-system@2014-08-06.yang"/>
- <url url="${source.ietfcatalog}ietf-tcp-client@2019-10-18.yang"/>
- <url url="${source.ietfcatalog}ietf-tcp-common@2019-10-18.yang"/>
- <url url="${source.ietfcatalog}ietf-tcp-server@2019-10-18.yang"/>
- <url url="${source.ietfcatalog}ietf-tls-client@2019-11-20.yang"/>
- <url url="${source.ietfcatalog}ietf-tls-common@2019-11-20.yang"/>
- <url url="${source.ietfcatalog}ietf-tls-server@2019-11-20.yang"/>
- <url url="${source.ietfcatalog}ietf-trust-anchors@2019-04-29.yang"/>
- <url url="${source.ietfcatalog}ietf-truststore@2019-11-20.yang"/>
- <url url="${source.ietfcatalog}ietf-x509-cert-to-name@2014-12-10.yang"/>
- <url url="${source.ietfcatalog}ietf-yang-library@2019-01-04.yang"/>
- <url url="${source.ietfcatalog}ietf-yang-metadata@2016-08-05.yang"/>
- <url url="${source.ietfcatalog}ietf-yang-patch@2017-02-22.yang"/>
- <url url="${source.ietfcatalog}ietf-yang-push@2019-05-21.yang"/>
- <url url="${source.ietfcatalog}ietf-yang-schema-mount@2019-01-14.yang"/>
- <url url="${source.ietfcatalog}ietf-yang-types@2010-09-24.yang"/>
- <url url="${source.ietfcatalog}ietf-yang-types@2019-11-04.yang"/>
- <!-- spotless:on -->
- </resources>
- <get dest="${src.test.orig.modules}" skipexisting="true">
- <resources refid="orig-ietf-yang-downloads" />
- <mapper type="regexp" from="^.*/([^/@]+)@([^/]+)$"
- to="\1-\2" />
- </get>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>${version.jacoco-maven.plugin}</version>
- <configuration>
- <append>true</append>
- </configuration>
- <executions>
- <execution>
- <id>jacoco-check</id>
- <goals>
- <goal>check</goal>
- </goals>
- <phase>test</phase>
- <configuration>
- <rules>
- <rule implementation="org.jacoco.maven.RuleConfiguration">
- <element>BUNDLE</element>
- <limits>
- <limit implementation="org.jacoco.report.check.Limit">
- <counter>INSTRUCTION</counter>
- <value>COVEREDRATIO</value>
- <minimum>${jacoco-maven-plugin.coveredratio.minimum}</minimum>
- </limit>
- </limits>
- </rule>
- </rules>
- </configuration>
- </execution>
- <execution>
- <id>prepare-unit-tests</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- </execution>
- <execution>
- <id>report</id>
- <phase>verify</phase>
- <goals>
- <goal>report</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- spotless:off -->
+<!--
+ ============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=========================================================
+ -->
+<!-- spotless:on -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.oran.smo</groupId>
+ <artifactId>yang-parser</artifactId>
+ <version>0.2.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.oran.smo.yangtools.parser</groupId>
+ <artifactId>yang-parser-jar</artifactId>
+ <name>Yang Parser</name>
+ <version>1.2.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <properties>
+ <maven.javadoc.skip>true</maven.javadoc.skip>
+ <sonar.tests>src/test/java</sonar.tests>
+ <sonar.sources>pom.xml,src/main/java</sonar.sources>
+ <sonar.exclusions>**/*.java</sonar.exclusions>
+ <!-- External Yang model destination location -->
+ <src.modules>${project.basedir}/src/main/resources/modules/</src.modules>
+ <src.test.orig.modules>${project.basedir}/src/test/resources/_orig-modules/</src.test.orig.modules>
+ </properties>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>3.0.0-M3</version>
+ <configuration>
+ <useFile>false</useFile>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <testSourceDirectory>src/test/java</testSourceDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.mycila</groupId>
+ <artifactId>license-maven-plugin</artifactId>
+ <version>${version.license-maven-plugin}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.diffplug.spotless</groupId>
+ <artifactId>spotless-maven-plugin</artifactId>
+ <version>${version.spotless-plugin}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>${version.antrun-maven-plugin}</version>
+ <executions>
+ <execution>
+ <id>download-src-external-yang-models</id>
+ <phase>initialize</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${src.modules}" />
+ <resources id="src-ietf-yang-downloads">
+ <url
+ url="${source.ietfcatalog}ietf-yang-library@2019-01-04.yang" />
+ <url
+ url="${source.ietfcatalog}ietf-datastores@2018-02-14.yang" />
+ <url
+ url="${source.ietfcatalog}ietf-inet-types@2019-11-04.yang" />
+ <url
+ url="${source.ietfcatalog}ietf-yang-types@2019-11-04.yang" />
+ </resources>
+ <get dest="${src.modules}" skipexisting="true">
+ <resources refid="src-ietf-yang-downloads" />
+ <mapper type="regexp" from="^.*/([^/@]+)@([^/]+)$"
+ to="\1-\2" />
+ </get>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>download-test-external-yang-models</id>
+ <phase>generate-test-sources</phase>
+ <configuration>
+ <target>
+ <get
+ src="${source.3gpp.Rel18_SA98}_3gpp-common-yang-extensions.yang"
+ dest="${src.test.orig.modules}_3gpp-common-yang-extensions-2022-10-20.yang"
+ skipexisting="true" />
+ <get
+ src="${source.3gpp.Rel17_SA91}_3gpp-common-yang-extensions.yang"
+ dest="${src.test.orig.modules}_3gpp-common-yang-extensions-2019-06-23.yang"
+ skipexisting="true" />
+
+ <resources id="orig-ietf-yang-downloads">
+ <!-- spotless:off -->
+ <url url="${source.ietfcatalog}iana-crypt-hash@2014-08-06.yang"/>
+ <url url="${source.ietfcatalog}ietf-crypto-types@2019-11-20.yang" />
+ <url url="${source.ietfcatalog}ietf-datastores@2018-02-14.yang"/>
+ <url url="${source.ietfcatalog}ietf-inet-types@2019-11-04.yang"/>
+ <url url="${source.ietfcatalog}ietf-interfaces@2018-02-20.yang"/>
+ <url url="${source.ietfcatalog}ietf-ip@2018-02-22.yang"/>
+ <url url="${source.ietfcatalog}ietf-keystore@2019-11-20.yang"/>
+ <url url="${source.ietfcatalog}ietf-netconf-acm@2018-02-14.yang"/>
+ <url url="${source.ietfcatalog}ietf-netconf-client@2019-11-20.yang"/>
+ <url url="${source.ietfcatalog}ietf-netconf-monitoring@2010-10-04.yang"/>
+ <url url="${source.ietfcatalog}ietf-netconf-notifications@2012-02-06.yang"/>
+ <url url="${source.ietfcatalog}ietf-netconf-server@2018-09-20.yang"/>
+ <url url="${source.ietfcatalog}ietf-netconf-with-defaults@2011-06-01.yang"/>
+ <url url="${source.ietfcatalog}ietf-netconf@2011-06-01.yang"/>
+ <url url="${source.ietfcatalog}ietf-network-instance@2019-01-21.yang"/>
+ <url url="${source.ietfcatalog}ietf-origin@2018-02-14.yang"/>
+ <url url="${source.ietfcatalog}ietf-restconf-monitoring@2017-01-26.yang"/>
+ <url url="${source.ietfcatalog}ietf-restconf@2017-01-26.yang"/>
+ <url url="${source.ietfcatalog}ietf-ssh-client@2019-11-20.yang"/>
+ <url url="${source.ietfcatalog}ietf-ssh-common@2019-11-20.yang"/>
+ <url url="${source.ietfcatalog}ietf-ssh-server@2019-11-20.yang"/>
+ <url url="${source.ietfcatalog}ietf-subscribed-notifications@2019-05-06.yang"/>
+ <url url="${source.ietfcatalog}ietf-system@2014-08-06.yang"/>
+ <url url="${source.ietfcatalog}ietf-tcp-client@2019-10-18.yang"/>
+ <url url="${source.ietfcatalog}ietf-tcp-common@2019-10-18.yang"/>
+ <url url="${source.ietfcatalog}ietf-tcp-server@2019-10-18.yang"/>
+ <url url="${source.ietfcatalog}ietf-tls-client@2019-11-20.yang"/>
+ <url url="${source.ietfcatalog}ietf-tls-common@2019-11-20.yang"/>
+ <url url="${source.ietfcatalog}ietf-tls-server@2019-11-20.yang"/>
+ <url url="${source.ietfcatalog}ietf-trust-anchors@2019-04-29.yang"/>
+ <url url="${source.ietfcatalog}ietf-truststore@2019-11-20.yang"/>
+ <url url="${source.ietfcatalog}ietf-x509-cert-to-name@2014-12-10.yang"/>
+ <url url="${source.ietfcatalog}ietf-yang-library@2019-01-04.yang"/>
+ <url url="${source.ietfcatalog}ietf-yang-metadata@2016-08-05.yang"/>
+ <url url="${source.ietfcatalog}ietf-yang-patch@2017-02-22.yang"/>
+ <url url="${source.ietfcatalog}ietf-yang-push@2019-05-21.yang"/>
+ <url url="${source.ietfcatalog}ietf-yang-schema-mount@2019-01-14.yang"/>
+ <url url="${source.ietfcatalog}ietf-yang-types@2010-09-24.yang"/>
+ <url url="${source.ietfcatalog}ietf-yang-types@2019-11-04.yang"/>
+ <!-- spotless:on -->
+ </resources>
+ <get dest="${src.test.orig.modules}" skipexisting="true">
+ <resources refid="orig-ietf-yang-downloads" />
+ <mapper type="regexp" from="^.*/([^/@]+)@([^/]+)$"
+ to="\1-\2" />
+ </get>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>${version.jacoco-maven.plugin}</version>
+ <configuration>
+ <append>true</append>
+ </configuration>
+ <executions>
+ <execution>
+ <id>jacoco-check</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <phase>test</phase>
+ <configuration>
+ <rules>
+ <rule implementation="org.jacoco.maven.RuleConfiguration">
+ <element>BUNDLE</element>
+ <limits>
+ <limit implementation="org.jacoco.report.check.Limit">
+ <counter>INSTRUCTION</counter>
+ <value>COVEREDRATIO</value>
+ <minimum>${jacoco-maven-plugin.coveredratio.minimum}</minimum>
+ </limit>
+ </limits>
+ </rule>
+ </rules>
+ </configuration>
+ </execution>
+ <execution>
+ <id>prepare-unit-tests</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>report</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>