CCI-MOC / hil

Hardware Isolation Layer, formerly Hardware as a Service
Apache License 2.0
24 stars 54 forks source link

network_create call is needlessly confusing #463

Open zenhack opened 9 years ago

zenhack commented 9 years ago

The way it is now (with mandatory creator access & id fields, and sentinals for certain values) is an artifact of the fact that we used to use formdata for the API, and of the fact that the CLI can't do structured data or optional arguments. The latter is something we need to fix (and it's actually completely unusable with the recent refactoring changes). We should also simplify this call. Right now you end up passing:

{"creator": "myproj", "access": "myproj", "net_id": ""}

Here's one idea for how to make this a little better (just to get the discussion going, not necessarily attached to this):

Going through each of the use cases described in docs/networks.md:

The "kindof useless, but legal" use case in that document is non longer possible, but I don't think that's a problem.

@gsilvis, thoughts?

gsilvis commented 9 years ago

If we can use structured JSON, I don't see any good reason to change the fields we have. Just getting rid of the sentinel values should be sufficient, I'd say. (Remember that we want to have access lists too at some point, potentially.)

zenhack commented 9 years ago

Quoting George Silvis, III (2015-07-28 17:31:47)

If we can use structured JSON, I don't see any good reason to change the fields we have. Just getting rid of the sentinel values should be sufficient, I'd say. (Remember that we want to have access lists too at some point, potentially.)

Good call --- we could just turn "access" into a list down the line.

-Ian

naved001 commented 7 years ago

@zenhack is this still an issue? we now have network_create_simple() which simplifies some stuff. And did #455 address this issue?

zenhack commented 7 years ago

This is still valid. IIRC network_create_simple existed at the time as well, but it's a band-aid over an underlying ugly api. #455 is orthoginal to this.