Closed Bug 689800 Opened 14 years ago Closed 10 years ago

inventory: be consistent and explicit about handling of sub-tables in API

Categories

(Infrastructure & Operations :: Infrastructure: Tools, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: dustin, Unassigned)

Details

I think there are two ways to go with this: 1. API uses ID's everywhere, and users are responsible for fetching the ID's in advance if they need them. In this case, we should probably have a download-the-whole-list command (e.g., GET /v2/allocations) to make caching easy. The downside is, if you choose to move some existing value into a sub-table later, you'll need to either fake it or change the API. 2. Denormalize the values for input and output, so the API specifies e.g., allocations by name. You've already noted a problem with system_rack, since it has a sub-sub-table, and doesn't have a unique name. I don't think we should try to hybridize things -- for example, if we try to "guess" whether an allocation is an ID or an allocation name, then we preclude allocation IDs that look like numbers. It probably *does* make sense to "denormalize" results returned to the user -- so, for example, a GET of a system should return both its allocation_id and allocation. If there are cases where there's a need to look things up by name, that should be handled explicitly in the API. Anyway, let's start by being consistent, and sand off the rough edges from there.
Is this still true ?
Assignee: nobody → infra
Component: Server Operations: Projects → Infrastructure: Tools
Product: mozilla.org → Infrastructure & Operations
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.