Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement PUT for inventory UPF #278

Merged

Conversation

patriciareinoso
Copy link
Contributor

@patriciareinoso patriciareinoso commented Jan 8, 2025

Description

This PR implements the edition of UPFs

  • Create an index over hostname for UPFs to guarantee unique hostnames in DB
  • Modify POST operation to remove the target from path: now hostname and port are specified in the body of the request.
  • We cannot create 2 UPFs with the same hostname.
  • Add PUT operation:
    • If the UPF hostname does not exist it is created.
    • If the UPF hostname exists, it is modified.
  • Add validation over PORT

Given that we can create a NS containing a UPF before or after the creation of a UPF object, the PUT and the POST UPF operations are propagated to the NS containing it.

Edition of UPF is propagated to Network slices containing a UPF with the given name using a PATCH operation to modify only the UPF field.

We use transactions to ensure that both DB updates are successfully executed or reverted.

The POST and PUT handlers do not use the config channel -> reduce complexity.

@patriciareinoso patriciareinoso marked this pull request as ready for review January 8, 2025 16:47
@patriciareinoso patriciareinoso marked this pull request as draft January 9, 2025 13:00
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
@patriciareinoso patriciareinoso marked this pull request as ready for review January 27, 2025 16:00
configapi/api_inventory.go Outdated Show resolved Hide resolved
configapi/api_inventory.go Show resolved Hide resolved
configapi/api_inventory.go Show resolved Hide resolved
@gatici
Copy link
Contributor

gatici commented Jan 28, 2025

Looks good. A minor comments are added.

Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
@ghislainbourgeois ghislainbourgeois self-requested a review January 28, 2025 18:43
@ghislainbourgeois ghislainbourgeois merged commit 15b63f7 into omec-project:main Jan 28, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants