feat: add Webconsole NFConfig API and models#69
feat: add Webconsole NFConfig API and models#69gab-arrobo merged 20 commits intoomec-project:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds a new polling-based NFConfig API under the webconsole path, including OpenAPI definitions, generated Go server stubs, and model types.
- Introduces
webconsole/webconsole-api.yamlwith five GET endpoints and component schemas. - Adds generated Gin router (
routers.go) and default handler stubs (api_default.go). - Creates individual model files (e.g.
model_*.go) matching the OpenAPI components. - Updates
go.modto includegin-gonic/ginand related dependencies.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| webconsole/webconsole-api.yaml | Defines new NFConfig endpoints and associated schemas |
| webconsole/routers.go | Configures Gin routes for each /nfconfig/* endpoint |
| webconsole/api_default.go | Provides placeholder handler implementations returning JSON OK |
| webconsole/model_*.go | Auto-generated model structs for each OpenAPI component |
| go.mod | Adds github.com/gin-gonic/gin and pruned dependencies |
Comments suppressed due to low confidence (2)
webconsole/api_default.go:26
- This handler is a stub; add unit tests to verify routing, status codes, and correct JSON payloads for each endpoint.
func (api *DefaultAPI) NfconfigAccessMobilityGet(c *gin.Context) {
go.mod:7
- The
go.modlists many indirect dependencies; rungo mod tidyto prune unused modules and keep the dependency graph clean.
github.com/gin-gonic/gin v1.10.1
There was a problem hiding this comment.
I see this is generated using openapi which is useful. But I see a couple of issues:
- The routes and handling methods belong in the webconsole, they should not be in this repo. It adds the gin dependency which I do not think is necessary here.
- There is duplication in types that already exist in the model package. Does it mean that the NFs will use the
webconsoletype during polling but then, what type should they use to store the configuration ? (I would say the SBI one?).
Should they then do conversions to get to the SBI types? (I think that if we align the json tags we can unmarshal in the types inmodelseasily)
If MCC is not the defined. which is not great either. Go does not help us much with mandatory fields. But I think that we need to remove the omitempty in case of mandatory to at least make it evident when we read the type. WDYT? I think we need and add |
|
I thought that you also had to create an API but I do not see in the files that were generated. I only see |
Hello Gabriel,
|
|
ghislainbourgeois
left a comment
There was a problem hiding this comment.
LGTM, I will let @gab-arrobo approve first before merging as he had comments.
|
@gatici, please rebase your PR |
|
It seems a bit redundant that we need to have the |
|
@gatici, |
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
b5648ae to
09664ac
Compare
Signed-off-by: gatici <gulsum.atici@canonical.com>
|
Hello Gabriel, . |
Signed-off-by: gatici <gulsum.atici@canonical.com>
gab-arrobo
left a comment
There was a problem hiding this comment.
client and nfConfigModels (models) look good to me. However, I do not quite understand how you are planning to use the server because by default the server does nothing. That is, when its API gets called, it always returns status OK and an empty array. Is this what you were trying to achieve? or what am I overlooking?
P.S. Sorry for the delay reviewing this PR (last week I was on a business trip and this week, I took a few days off
Hello Gabriel, The function looks like this in the server implementation. It is difficult to reflect this change in the Openapi repository. One option is removing server side and another is just keeping them as empty as a reference . What is your opinion on this ? |
My preference is to just remove the |
@gatici, . |
Signed-off-by: gatici <gulsum.atici@canonical.com>
Hello @gab-arrobo, I removed the server side and consolidated models and client in the same folder. |
gab-arrobo
left a comment
There was a problem hiding this comment.
Do you need to create a major, minor or patch release (i.e., change the VERSION file)?
Signed-off-by: Arrobo, Gabriel <gabriel.arrobo@intel.com>
Signed-off-by: Arrobo, Gabriel <gabriel.arrobo@intel.com>
Hi @gulsum, |
5G SD-Core configuration system is being replaced with a new polling based design. Webconsole implements polling server using HTTPs and exposes new endpoints. This PR inserts new config APIs and model definitions to Openapi repository under webconsole path as they are different from existing SBI API's. Webconsole NFConfig API and models will be used by all NFs and webconsole during NFConfig polling server and client implementations.