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

Update not accepting request format #347

Open
SColson82 opened this issue Oct 30, 2024 · 2 comments
Open

Update not accepting request format #347

SColson82 opened this issue Oct 30, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@SColson82
Copy link

Starting from:
url = "http://67.17.206.205:8080/SDX-Controller"
original payload:
client_name = "Test SDX SC24 L2VPN"
client_endpoints = [
{"port_id": "urn:sdx:port:ampath.net:Ampath2:50", "vlan": "306"},
{"port_id": "urn:sdx:port:tenet.ac.za:Tenet02:50", "vlan": "306"},
]
{'service_id': '720db03e-7a8d-4eaf-8089-04e9bbaa6249'}

I sent the following request to update the l2vpn using the above service_id:
client.update_l2vpn(service_id='720db03e-7a8d-4eaf-8089-04e9bbaa6249', name="new l2vpn")

And received back a 400 response: Failed to update L2VPN. Status code: 400: Request does not have a valid JSON or body is incomplete/incorrect

My understanding is that the user should be able to send the update request using the existing service_id along with any user defined attributes (name, endpoints, description, notifications, scheduling, qos_metrics) - plus the additional option to update the state - that the user wishes to modify. So, I am understanding that if all I wish to modify is the name, the above query should be acceptable.

@YufengXin YufengXin added the enhancement New feature or request label Oct 30, 2024
@congwang09
Copy link
Contributor

congwang09 commented Oct 30, 2024

This is not supported yet. We need to carefully design this, if we want to simply replace a single field.

Currently if you want to update, use the PATCH API, send the service_id as query param, a new full request as the request body.

@YufengXin
Copy link
Collaborator

@SColson82 Thx for the clearly written issue. What you observed is a correct response of the current version:
(1) The required fields in the patch and original requests are the same: specifically "endpoints" is required.
(2) Any changes to the format need to be coordinated with Meican.
(3) Technically, the requests are generated by software, not manually, based on pre-defined templates. So if Meican wants to change its template. We can change accordingly.

Basically, what you suggested makes sense. Please raise it with Meican developers to reach a consensus and let us know, then we can change the parser behavior of SDX-Controller accordingly.

For now, I am tagging this issue "Enhancement", a feature request to be discussed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants