Closed hoanhan101 closed 4 years ago
I don't think this response is appropriate specially the way Network-api is going to consume.From yesterday's talk during Marco's office hours we require organization(tenant), interface, device info.If this way response will be provided through virtual_circuit api response then it will increase overhead while consuming.
@jinaloo7 @marcoceppi I think A Virtual Circuit should only know about its associated VLANs but nothing more. Trying to do many things at one and include organization/tenant, interface, device info in the response is outside of scope for this implementation. Also, this above information is only meaningful to Vapor internals and can be handled internally. Since the goal of this plugin to provide a clean, single-purpose, pluggable interface after all.
Follow up from #34, we realize that the missing
id
is the unique identifier of Virtual-Circuit-to-VLAN (VCVLAN) connections. The previous implementation overrodeid
to return the nested VLAN objects and hence broke the Swagger specs. This PR fixes the issue by reserving thatid
key and usevlan
key for querying VLAN objects instead.This PR also removes the
depth
level so that only VLAN id and VCVLAN connection id will be returned - for a couple of reasons:depth
here might not be the best way to do it actually.So now, the response instead of looking like this:
will look like this:
The POST body for creating a Virtual Circuit with VLANs data instead of looking like this:
will look like this:
where
vlan
is used instead of reservedid
key.