fullctl / ixctl

Apache License 2.0
2 stars 4 forks source link

Refactor URL structure and REST api views #32

Closed vegu closed 3 years ago

vegu commented 3 years ago

For ix-specific operations we want to determine the target exchange from the url path, similarly to how we do it for the organization.

This has implications for how REST api paths are routed:

and so on ...

ix is a value that can be configure per exchange and defaults to an url friendly version of the exchange name. I

Need to add a slug field to the InternetExchange model, serializer and expose an UI element for updating it (PUT to /api/{org}/ix/{ix.id}/)

egfrank commented 3 years ago

Okay we have an initial PR for this, if you're able to pull and test that would be great!

https://github.com/fullctl/ixctl/pull/35

egfrank commented 3 years ago

@vegu , what do we want to do about the URLs for Network, RouteserverConfig, and PermissionRequest ? Right now I kept them the same but let me know if you'd like me to change that formatting.

The URLConf as of now is:

admin/
^login/(?P<backend>[^/]+)/$ [name='begin']
^complete/(?P<backend>[^/]+)/$ [name='complete']
^disconnect/(?P<backend>[^/]+)/$ [name='disconnect']
^disconnect/(?P<backend>[^/]+)/(?P<association_id>\d+)/$ [name='disconnect_individual']
api/account/
autocomplete/pdb/ix [name='pdb ix autocomplete']
autocomplete/pdb/org [name='pdb org autocomplete']
login/ [name='login']
logout/ [name='logout']
apidocs/swagger [name='swagger']
apidocs/redoc [name='redoc']
api/ ix/<str:org_tag>/ [name='ix-list']
api/ ix/<str:org_tag>/import_peeringdb [name='ix-import-peeringdb']
api/ ix/<str:org_tag>/<str:ix_tag>/ [name='ix-detail']
api/ member/<str:org_tag>/<str:ix_tag>/ [name='member-list']
api/ member/<str:org_tag>/<str:ix_tag>/<int:member_id> [name='member-detail']
api/ routeserver/<str:org_tag>/<str:ix_tag>/ [name='routeserver-list']
api/ routeserver/<str:org_tag>/<str:ix_tag>/<int:rs_id> [name='routeserver-detail']
api/ <str:org_tag>/ ^rsconf/(?P<name>[^\/]+)/$ [name='rsconf-detail']
api/ <str:org_tag>/ ^rsconf/(?P<name>[^\/]+)\.(?P<format>[a-z0-9]+)/?$ [name='rsconf-detail']
api/ <str:org_tag>/ ^rsconf/(?P<name>[^\/]+)/plain/$ [name='rsconf-plain']
api/ <str:org_tag>/ ^rsconf/(?P<name>[^\/]+)/plain\.(?P<format>[a-z0-9]+)/?$ [name='rsconf-plain']
api/ <str:org_tag>/ ^net/$ [name='net-list']
api/ <str:org_tag>/ ^net\.(?P<format>[a-z0-9]+)/?$ [name='net-list']
api/ <str:org_tag>/ ^net/presence/(?P<asn>[\d]+)/$ [name='net-presence']
api/ <str:org_tag>/ ^net/presence/(?P<asn>[\d]+)\.(?P<format>[a-z0-9]+)/?$ [name='net-presence']
api/ <str:org_tag>/ ^permreq/$ [name='permreq-list']
api/ <str:org_tag>/ ^permreq\.(?P<format>[a-z0-9]+)/?$ [name='permreq-list']
api/ <str:org_tag>/ ^$ [name='api-root']
api/ <str:org_tag>/ ^\.(?P<format>[a-z0-9]+)/?$ [name='api-root']
<str:org_tag>/export/ixf/<slug:urlkey> [name='ixf export']
<str:org_tag>/ [name='ixctl-home']
egfrank commented 3 years ago

This is almost done, I need to do a pass back through the frontend to confirm that all the buttons / URLs still work.

Note, that there were some fullctl changes that are necessary to test this branch: https://github.com/fullctl/fullctl/pull/2