docs: adds docs for register/deregister methods#202
Conversation
| """Register a data asset to Code Ocean and the DocDB metadata index.""" | ||
| """ | ||
| Register a data asset to Code Ocean and add its metadata to DocDB | ||
| given the metadata exists at the top level of the provided S3 location. |
There was a problem hiding this comment.
Given the de/registration endpoints are intended for admin, should we mention that it requires elevated AWS credentials?
There was a problem hiding this comment.
Although pretty much all endpoints other than the public READ ones require some sort of elevated permissions, so I'm also ok to leave it out. Up to you.
There was a problem hiding this comment.
I feel like that context would be great to clarify in the readthedocs somewhere, probably don't need it in every docstring
There was a problem hiding this comment.
Good idea- Maybe somewhere in the User Guide or Rest API examples? This section briefly mentions that you need AWS credentials for updating metadata, but maybe we can expand this: https://aind-data-access-api.readthedocs.io/en/latest/ExamplesDocDBRestApi.html#updating-metadata
| """Register a data asset to Code Ocean and the DocDB metadata index.""" | ||
| """ | ||
| Register a data asset to Code Ocean and add its metadata to DocDB | ||
| given the metadata exists at the top level of the provided S3 location. |
There was a problem hiding this comment.
I feel like that context would be great to clarify in the readthedocs somewhere, probably don't need it in every docstring
| The name of the result asset. | ||
| co_asset_id : str | ||
| The Code Ocean asset ID for the result. | ||
| co_computation_id : str |
There was a problem hiding this comment.
I'm curious what the computation ID is used for, doesn't seem necessary in addition to asset ID - and what happens if they don't match (asset is generated from a different computation ID)?
There was a problem hiding this comment.
The co_computation_id is used to download the metadata using Code Ocean's list_computation_results API. We do a sanity check that the co_asset_id exists and has provenance attributes that match the co_computation_id.
In retrospect maybe we could have done this with just s3_location and co_asset_id... I think this was originally due a mix of reasons: ease of using the Code Ocean API, access control, and confirming that it is in fact a result asset.
closes #201
Adds verbose docstrings for the register/deregister methods of the MetadataDbClient