Compute v2: flavor access list#507
Conversation
|
@jrperritt I have a question about the design of this kind of implementation: This implements a "List" as it returns a list of results. To conform with other lists, I used the whole pagination thing, but with a single page, given there's never going to be more than one page of results. SinglePage works well for this type of API call, and AllPages provides a nice shortcut, but it still seems a bit too much code for what it is: I could implement it this way: But using Am I thinking too much into this? Is it better to deal with the extra few lines in favor of conformity? |
f3c0da5 to
ffbb371
Compare
|
After mulling this over for a few days, I decided to not do the whole pagination thing. Happy to revert, though. This is ready for review. |
dklyle
left a comment
There was a problem hiding this comment.
This matches the API and LGTM.
jrperritt
left a comment
There was a problem hiding this comment.
After that doc change, LGTM
| } | ||
|
|
||
| // ListAccess retrieves details about tenant access to a flavor. Use | ||
| // ExtractAccess to convert its result into a FlavorAccess. |
|
If there is no |
|
Yeah, that's exactly what started the whole debate for me. The way I see it, List is used for actions that contain more than one of something. Get is usually done to retrieve one resource. But I could just be making this more difficult than it needs to be. |
|
Actually, nevermind. GetAccessInfo works. I'll redo. edit: To add thought to this decision: I feel that having List closely associated with paging is a better pattern to adhere to. |
|
Actually, I misread what you'd written originally. I thought you were saying the response will only ever be a single object (a slice of length at most 1), but maybe you were saying that a single-page response seems more like a If there can in fact be, say, hundreds of items coming back in the response, it does seem to me that |
Yes, exactly.
Yes, exactly again. To use a real-world context,
Right, exactly. So which direction? :) |
|
Because there is precedent in this package, I'd say |
|
@jrperritt ping when you have time. |
|
Sorry if I wasn't clear earlier: I think we should use pagination for this operation. That's what I meant by "there is precedence". |
|
ahh - OK, no problem. |
|
@jrperritt How's this? |
|
Thanks for your help on this! |
For #506