--- /dev/null
+.vscode
+.idea/
+.tox
+docs/_build/
+.project
+.settings
+.pydevproject
\ No newline at end of file
This product is a Go implementation of the CAPIF Core function, based on the 3GPP CAPIF interfaces.
-## Run
+## Generation of API code
+
+The CAPIF APIs are generated from the OpenAPI specification provided by 3GPP. The `generate.sh` script downloads the
+specifications from 3GPP, fixes them and then generates the APIs. It also generates the mocks needed for unit testing.
+
+To fix the specifications there are three tools:
+- `commoncollector`, collects type definitions from peripheral specifications to keep down the number of dependencies to
+ other specifications. The types to collect are listed in the `definitions.txt`file.
+- `enumfixer`, fixes enumeration definitions so they can be properly generated.
+- `specificationfixer`, fixes flaws in the specifications so they can be properly generated. All fixes are hard coded.
+
+## Build and test
-To run the Core Function run the following commands from the top of the repo:
+To generate mocks manually, run the following command:
+
+ go generate ./...
+
+To build the application, run the following command:
go build
- ./capifcore [-port <port (default 8080)>]
\ No newline at end of file
+
+To run the unit tests for the application, run the following command:
+
+ go test ./...
+
+The application can also be built as a Docker image, by using the following command:
+
+ docker build . -t capifcore
+
+## Run
+
+To run the Core Function from the command line, run the following commands from this folder.
+
+ ./capifcore [-port <port (default 8080)>]
+
set -eux
echo "--> build-capifcore-ubuntu.sh"
+
# go installs tools like go-acc to $HOME/go/bin
# ubuntu minion path lacks go
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
go version
+cd capifcore/
# install the go coverage tool helper
go get -v github.com/ory/go-acc
echo "Cleanup"
rm -rf specs
+
+echo "Generating mocks."
+go generate ./...
\ No newline at end of file
+++ /dev/null
-# -
-# ========================LICENSE_START=================================
-# O-RAN-SC
-# %%
-# Copyright (C) 2022: Nordix Foundation
-# %%
-# 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===================================
-#
-
-output:
- internal/aefsecurityapi/aefsecurityapi-client.gen.go
-package: aefsecurityapi
-generate:
- - server
-import-mapping:
- TS29571_CommonData.yaml: internal/common29571
+++ /dev/null
-# -
-# ========================LICENSE_START=================================
-# O-RAN-SC
-# %%
-# Copyright (C) 2022: Nordix Foundation
-# %%
-# 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===================================
-#
-
-output:
- internal/auditingapi/auditingapi-client.gen.go
-package: auditingapi
-generate:
- - client
-import-mapping:
- TS29122_CommonData.yaml: internal/common29122
- TS29571_CommonData.yaml: internal/common29571
- TS29222_CAPIF_Publish_Service_API.yaml: internal/publishserviceapi
- TS29222_CAPIF_Logging_API_Invocation_API.yaml: internal/loggingapi
\ No newline at end of file
+++ /dev/null
-# -
-# ========================LICENSE_START=================================
-# O-RAN-SC
-# %%
-# Copyright (C) 2022: Nordix Foundation
-# %%
-# 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===================================
-#
-
-output:
- internal/discoverserviceapi/discoverserviceapi-client.gen.go
-package: discoverserviceapi
-generate:
- - client
-import-mapping:
- TS29122_CommonData.yaml: internal/common29122
- TS29571_CommonData.yaml: internal/common29571
- TS29222_CAPIF_Publish_Service_API.yaml: internal/publishserviceapi
\ No newline at end of file
+++ /dev/null
-# -
-# ========================LICENSE_START=================================
-# O-RAN-SC
-# %%
-# Copyright (C) 2022: Nordix Foundation
-# %%
-# 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===================================
-#
-
-output:
- internal/eventsapi/eventsapi-client.gen.go
-package: eventsapi
-generate:
- - client
\ No newline at end of file
+++ /dev/null
-# -
-# ========================LICENSE_START=================================
-# O-RAN-SC
-# %%
-# Copyright (C) 2022: Nordix Foundation
-# %%
-# 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===================================
-#
-
-output:
- internal/invokermanagementapi/invokermanagementapi-client.gen.go
-package: invokermanagementapi
-generate:
- - client
-import-mapping:
- TS29122_CommonData.yaml: internal/common29122
- TS29571_CommonData.yaml: internal/common29571
- TS29222_CAPIF_Publish_Service_API.yaml: internal/publishserviceapi
\ No newline at end of file
+++ /dev/null
-# -
-# ========================LICENSE_START=================================
-# O-RAN-SC
-# %%
-# Copyright (C) 2022: Nordix Foundation
-# %%
-# 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===================================
-#
-
-output:
- internal/loggingapi/loggingapi-client.gen.go
-package: loggingapi
-generate:
- - client
\ No newline at end of file
+++ /dev/null
-# -
-# ========================LICENSE_START=================================
-# O-RAN-SC
-# %%
-# Copyright (C) 2022: Nordix Foundation
-# %%
-# 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===================================
-#
-
-output:
- internal/providermanagementapi/providermanagementapi-client.gen.go
-package: providermanagementapi
-generate:
- - client
-import-mapping:
- TS29122_CommonData.yaml: internal/common29122
- TS29571_CommonData.yaml: internal/common29571
\ No newline at end of file
+++ /dev/null
-# -
-# ========================LICENSE_START=================================
-# O-RAN-SC
-# %%
-# Copyright (C) 2022: Nordix Foundation
-# %%
-# 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===================================
-#
-
-output:
- internal/publishserviceapi/publishserviceapi-client.gen.go
-package: publishserviceapi
-generate:
- - client
-import-mapping:
- TS29122_CommonData.yaml: internal/common29122
- TS29571_CommonData.yaml: internal/common29571
- CommonData.yaml: internal/common
\ No newline at end of file
+++ /dev/null
-# -
-# ========================LICENSE_START=================================
-# O-RAN-SC
-# %%
-# Copyright (C) 2022: Nordix Foundation
-# %%
-# 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===================================
-#
-
-output:
- internal/routinginfoapi/routinginfoapi-client.gen.go
-package: routinginfoapi
-generate:
- - client
-import-mapping:
- TS29122_CommonData.yaml: internal/common29122
- TS29571_CommonData.yaml: internal/common29571
- TS29222_CAPIF_Publish_Service_API.yaml: internal/publishserviceapi
\ No newline at end of file
+++ /dev/null
-# -
-# ========================LICENSE_START=================================
-# O-RAN-SC
-# %%
-# Copyright (C) 2022: Nordix Foundation
-# %%
-# 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===================================
-#
-
-output:
- internal/securityapi/securityapi-client.gen.go
-package: securityapi
-generate:
- - client
-import-mapping:
- TS29122_CommonData.yaml: internal/common29122
- TS29571_CommonData.yaml: internal/common29571
- TS29222_CAPIF_Publish_Service_API.yaml: internal/publishserviceapi
\ No newline at end of file
--- /dev/null
+# ============LICENSE_START===============================================
+# Copyright (C) 2022 Nordix Foundation. 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=================================================
+#
+
+from docs_conf.conf import *
+
+#branch configuration
+
+branch = 'latest'
+
+linkcheck_ignore = [
+ 'http://localhost.*',
+ 'http://127.0.0.1.*',
+ 'https://gerrit.o-ran-sc.org.*',
+]
+
+extensions = ['sphinx.ext.intersphinx',]
+
+#intershpinx mapping with other projects
+intersphinx_mapping = {}
+
+intersphinx_mapping['nonrtric'] = ('https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric/en/%s' % branch, None)
--- /dev/null
+---
+project_cfg: oran
+project: nonrtric-plt-sme
--- /dev/null
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+.. Copyright (C) 2022 Nordix
+
+Developer Guide
+===============
+
+This document provides a quick start for developers of the Non-RT RIC Service Management and Exposure.
+
+Additional developer guides are available on the `O-RAN SC NONRTRIC Developer wiki <https://wiki.o-ran-sc.org/display/RICNR/Release+F>`_.
+
+To build and run the CAPIF Core implementation, see the README.md file in the "capifcore" folder.
--- /dev/null
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+.. Copyright (C) 2022 Nordix
+
+Non-RT RIC Service Management and Exposure (SME)
+================================================
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Contents:
+
+ ./overview.rst
+ ./developer-guide.rst
+ ./release-notes.rst
--- /dev/null
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+.. Copyright (C) 2022 Nordix
+
+Overview
+~~~~~~~~
+
+Within Service Management and Exposure the CAPIF Core product is developed. It resides in the "capifcore" folder.
+
+
+This product is a part of :doc:`NONRTRIC <nonrtric:index>`.
--- /dev/null
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2022 Nordix
+
+=============
+Release-Notes
+=============
+
+
+This document provides the release notes for the Non-RT RIC CAPIF Core.
+
+Version history Service Management and Exposure
+===============================================
+
++------------+----------+------------------+-----------------+
+| **Date** | **Ver.** | **Author** | **Comment** |
+| | | | |
++------------+----------+------------------+-----------------+
+| 2022-??-?? | 1.0.0 | Henrik Andersson | G Release |
+| | | | Initial version |
++------------+----------+------------------+-----------------+
+
+Release Data
+============
+
+G Release
+---------
++-----------------------------+---------------------------------------------------+
+| **Project** | Non-RT RIC CAPIF Core |
+| | |
++-----------------------------+---------------------------------------------------+
+| **Repo/commit-ID** | nonrtric/plt/sme/???????? |
+| | |
++-----------------------------+---------------------------------------------------+
--- /dev/null
+tox
+Sphinx
+doc8
+docutils
+setuptools
+six
+sphinx_rtd_theme
+sphinxcontrib-needs
+sphinx_bootstrap_theme
+lfdocs-conf
\ No newline at end of file
--- /dev/null
+# ==================================================================================
+# Copyright (c) 2022 Nordix
+#
+# 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.
+# ==================================================================================
+
+# documentation only
+[tox]
+minversion = 2.0
+envlist =
+ docs,
+ docs-linkcheck,
+skipsdist = true
+
+[testenv:docs]
+basepython = python3
+deps = -r{toxinidir}/docs/requirements-docs.txt
+
+commands =
+ sphinx-build -W -b html -n -d {envtmpdir}/docs/doctrees ./docs/ {toxinidir}/docs/_build/html
+ echo "Generated docs available in {toxinidir}/docs/_build/html"
+whitelist_externals = echo
+
+[testenv:docs-linkcheck]
+basepython = python3
+deps = -r{toxinidir}/docs/requirements-docs.txt
+commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck