telefonicaid / fiware-orion

Context Broker and CEF building block for context data management, providing NGSI interfaces.
https://fiware-orion.rtfd.io/
GNU Affero General Public License v3.0
211 stars 262 forks source link

Metadata management operations #2567

Open fgalan opened 7 years ago

fgalan commented 7 years ago

NGSIv2 should include operations to manage metadata in order to solve current limitations in the API, e.g. it is not possible to add a single attribute without updating the whole metadata object.

The operations will be very similar to the ones used to manage attributes:

  1. Retrieve attribute metadata: GET /v2/entities/E/attrs/<attr>/metadata
  2. Update or append attribute metadata: POST /v2/entities/E/attrs/<attr>/metadata (option: append)
  3. Update existing attribute metadata. PATCH /v2/entities/E/attrs/<attr>/metadata
  4. Replace all attribute metadata. PUT /v2/entities/E/attrs/<attr>/metadata
  5. Get metadata data. GET /v2/entities/E/attrs/<attr>/metadata/<metadata>
  6. Update metadata data. PUT /v2/entities/E/attrs/<attr>/metadata/<metadata>
  7. Remove a single metadata. DELETE /v2/entities/E/attrs/<attr>/metadata/<metadata>
  8. Get metadata value. GET /v2/entities/E/attrs/<attr>/metadata/<metadata>/value
  9. Set metadata value. PUT /v2/entities/E/attrs/<attr>/metadata/<metadata>/value.

The payload is not include for briefness, but it should be easy looking to the equivalent operation at attrs level.

jmcanterafonseca commented 7 years ago

looks good just wondering if we can simplify and save a few operations, for instance 8 and 9.

fgalan commented 7 years ago

Yes, probably 8 and 9 are the less interesing ones. Ops 1 to 7 should be priorized.

fgalan commented 6 years ago

The following question at SOF has to be edited (if stills opened) once this issue gets impemented: https://stackoverflow.com/questions/46810098/update-metadata

fgalan commented 5 years ago

Out of the scope of NGSIv2, althouth it is a good idea that could (potentially) be included in a later version of the API (v2.1) in a backward compatible way.

CC: @jmcanterafonseca