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

Finalizing the error codes for the "scheduling" attributes #28

Open
YufengXin opened this issue Feb 8, 2025 · 5 comments
Open

Finalizing the error codes for the "scheduling" attributes #28

YufengXin opened this issue Feb 8, 2025 · 5 comments
Assignees

Comments

@YufengXin
Copy link

Based on what is discussed in the meeting about the scheduling attribute error code, I made changes in our request validator:

  1. 400: formatting issue, unreasonable starting_time (>ending_time), etc.
  2. 402: not supported for valid time except for only starting_time is now (<now+5 minutes)
  3. 411: N/A since the advanced scheduling function is not implemented. When implementation is in place, this error means the request scheduling is legit, but there is no available network resource to fulfill the request in the requested scheduling window.

Please confirm and let me know your opinion.

@gretelliz
Copy link
Contributor

@YufengXin, sounds good to me. In any case, could you provide an example for each code?

I will give you some examples to confirm that I have understood.

Code 201:

payload = {
            "name": "Test L2VPN creation with optional attributes",
            "endpoints": [
                {"port_id": "urn:sdx:port:ampath.net:Ampath3:50","vlan": "100"},
                {"port_id": "urn:sdx:port:tenet.ac.za:Tenet03:50","vlan": "100"}
            ],
            "scheduling": {
                "end_time": "2025-12-31T12:00:00Z"}
        }

Code 400:

payload = {
            "name": "Test L2VPN creation with optional attributes",
            "endpoints": [
                {"port_id": "urn:sdx:port:ampath.net:Ampath3:50","vlan": "100"},
                {"port_id": "urn:sdx:port:tenet.ac.za:Tenet03:50","vlan": "100"}
            ],
            "scheduling": {
                "end_time": "2023-12-31T12:00:00Z"}
        }

Code 402:

payload = {
            "name": "Test L2VPN creation with optional attributes",
            "endpoints": [
                {"port_id": "urn:sdx:port:ampath.net:Ampath3:50","vlan": "100"},
                {"port_id": "urn:sdx:port:tenet.ac.za:Tenet03:50","vlan": "100"}
            ],
            "scheduling": {
                "start_time": "2025-11-31",
                "end_time": "2025-12-31"}
        }

Code 201:

payload = {
            "name": "Test L2VPN creation with optional attributes",
            "endpoints": [
                {"port_id": "urn:sdx:port:ampath.net:Ampath3:50","vlan": "100"},
                {"port_id": "urn:sdx:port:tenet.ac.za:Tenet03:50","vlan": "100"}
            ],
            "scheduling": {
                "end_time": "2025-12-31"}
        }

Code 411?

@YufengXin
Copy link
Author

@gretelliz This is very nice. I'll look into them one by one to see if I have questions.

FYI My related unit tests are here in the datamodel repo:

  1. base connection parser test: https://github.com/atlanticwave-sdx/datamodel/blob/main/tests/test_connection_v2.py
  2. connection validator test: https://github.com/atlanticwave-sdx/datamodel/blob/main/tests/test_connection_validator.py

@jab1982
Copy link
Contributor

jab1982 commented Feb 12, 2025

@YufengXin , since qos_metrics and scheduling are not implemented, as discussed during the AHM, use return code 422:

422: Attribute not supported

@YufengXin
Copy link
Author

qos_metrics is implemented in sdx-controller.
advanced scheduling is not implemented.

@gretelliz
Copy link
Contributor

@YufengXin, hello.
Please, note that the code that should be returned is 422 instead of 402, since advanced scheduling is not implemented.

@gretelliz gretelliz reopened this Mar 3, 2025
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

No branches or pull requests

3 participants