GET /hardware_product ought to only return the fields: id, sku, name, alias, generation_name, created, updated -- for the purpose of facilitating searches, or population of selection menus etc (fetching the entire table can be expensive as the 'specification' column especially can be huge, and this table might get big)
new endpoint PUT /hardware_product/:id_or_sku/specification -- the 'path' query parameter in the URI represents a json pointer to the exact properties being set in the json blob (so the entire document does not need to be passed). for example:
PUT /hardware_product/600-0042-001/specification?path=/disk_size/SEAGATE_8000 payload: 8192 -> stores the integer 8192 in the specification field to so the document contains {"disk_size":{"SEAGATE_8000": 8192 } } (other fields in the json are left untouched)
PUT /hardware_product/600-0042-001/specification?path=/disk_size payload: {"SEAGATE_8000": 8192, "_default": 64 } -- stores that json object at the "disk_size" property, overwriting all other properties under /disk_size
DELETE /hardware_product/:id_or_sku/specification -- as the PUT endpoint above, takes a json pointer in the URI, to indicate which property should be deleted
Needed for https://github.com/joyent/conch-ui/issues/213
GET /hardware_product
ought to only return the fields: id, sku, name, alias, generation_name, created, updated -- for the purpose of facilitating searches, or population of selection menus etc (fetching the entire table can be expensive as the 'specification' column especially can be huge, and this table might get big)new endpoint
PUT /hardware_product/:id_or_sku/specification
-- the 'path' query parameter in the URI represents a json pointer to the exact properties being set in the json blob (so the entire document does not need to be passed). for example:PUT /hardware_product/600-0042-001/specification?path=/disk_size/SEAGATE_8000
payload:8192
-> stores the integer8192
in the specification field to so the document contains{"disk_size":{"SEAGATE_8000": 8192 } }
(other fields in the json are left untouched)PUT /hardware_product/600-0042-001/specification?path=/disk_size
payload:{"SEAGATE_8000": 8192, "_default": 64 }
-- stores that json object at the "disk_size" property, overwriting all other properties under/disk_size
DELETE /hardware_product/:id_or_sku/specification
-- as the PUT endpoint above, takes a json pointer in the URI, to indicate which property should be deleted