Put Object Meta Data

Using the following SDK method, you can add meta details for a particular object stored in a bucket in Stratus. The Object reference used in the below code snippet is the component instance.

Info: To use this SDK method, you need intialize it with Admin scope. You can learn more about this requirement from this section

The meta details will be passed as JSON key value pairs. For example, {“meta_key” : “meta_value”}

    
copy
res = object_ins.put_meta({'author': 'Amelia Burrows'}) print(res)
Note:
  • Using this method to pass new meta details without adding the existent details will delete the existing details and only put the new details. To avoid this, pass the new meta details along with the existing meta details.

  • You can use alphanumeric, underscores, or whitespace characters, as well as hyphens, to write your metadata. No other special character is allowed other than the once mentioned.

  • You can fetch the metadata of an object using the HEAD request method. In the response, the metadata will be listed in the key ‘x-user-meta’.

  • The maximum size limit of characters allowed for the overall metadata is 2047 characters. The character count used to determine the size limit also includes the colon “:” special character used to define the key value pair.

Example Response

    
copy
{ "message": "Metadata added successfully" }

Last Updated 2025-05-30 16:54:59 +0530 +0530