I'm starting to convince myself that we should, in a new microversion:
- Make GET /allocations/{nonexistent-consumer} do the sane thing, which is error 404.
- Make real REST endpoints for consumers.
- GET /consumers/{uuid} responds 404 if no such consumer, or 200 with payload containing proj, user, gen.
- PUT /consumers/{uuid} to create (or modify, but we could disallow that - can you change a consumer's proj/user?). Payload contains proj, user, gen.
- How do you delete a consumer? DELETE is probably okay, even though it doesn't allow you to specify the generation. It'll bounce 409 if the consumer has allocations. This is akin to DELETEing a provider - we don't bother with generations there either.
- Require the consumer to be created before it can be allocated. No more of this implicit creation BS. (Older microversions would still do this, of course.)
- No implicit deletion of consumers either. (Ditto.) A consumer with zero allocations is a consumer with zero allocations.
I'm starting to convince myself that we should, in a new microversion:
- Make GET /allocations/ {nonexistent- consumer} do the sane thing, which is error 404.
- Make real REST endpoints for consumers.
- GET /consumers/{uuid} responds 404 if no such consumer, or 200 with payload containing proj, user, gen.
- PUT /consumers/{uuid} to create (or modify, but we could disallow that - can you change a consumer's proj/user?). Payload contains proj, user, gen.
- How do you delete a consumer? DELETE is probably okay, even though it doesn't allow you to specify the generation. It'll bounce 409 if the consumer has allocations. This is akin to DELETEing a provider - we don't bother with generations there either.
- Require the consumer to be created before it can be allocated. No more of this implicit creation BS. (Older microversions would still do this, of course.)
- No implicit deletion of consumers either. (Ditto.) A consumer with zero allocations is a consumer with zero allocations.