ADR: Supporting data block modification through Storage PATCH API call
Supporting data block modification Storage PATCH API call
Status
-
Proposed -
Trialing -
Under review -
Approved -
Retired
Context & Scope
Only record tags, legal tags and ACLs can up updated through PATCH API in storage service. The PATCH API cannot be used to update the data block in the record/s. For updating data block, PUT API needs to be used.
Tradeoff Analysis
Updating an individual attribute inside data block needs two calls currently, one to GET the record and then PUT call to update the record content with new attribute value. Providing PATCH API to update attributes in data block will support doing this operation in just one call to OSDU storage.
Decision
We can update PATCH API to support modifications in data blocks. The API will continue to follow the rfc6902 standard.
Currently the PATCH API supports modifications in record tags, legal tags and ACLs only. It supports 3 operations namely add, replace and remove.
The same operations would be supported for data block.
-
In "add" operation, specified property from the request would be appended with values provided in "value" field.
-
In "replace" operation, specified property from the request would be fully replaced by values provided in "value" field.
-
In "remove" operation, values provided in "value" field would be removed for specified property from the request.
Users specify the complete path to the property they want to update in "path" field, i.e. "/acl/viewers" indicates the values for metadata acl viewers would be updated.
Similarly "/data/TechnicalAssuranceID" would indicate that TechnicalAssuranceID attribute from the data block would be updated.
"/data/CurrentOperatorID" would indicate that CurrentOperatorID attribute from the data block would be updated.
"/data/EXtensionProperties/Attribute1" would indicate that Attribute1 from the ExtensionProperties inside data block would be updated.
"/data/SpatialLocation/SpatialGeometryTypeID" would indicate that SpatialGeometryTypeID from the SpatialLocation inside data block would be updated.
Version of the record would be incremented in case of data block update through PATCH API to maintain consistent behavior with PUT API.
Consequences
- PATCH API behavior will be updated.
- Storage service documentation needs to be updated.