trying to delete metadata on an object in a google cloud bucket.
the docs only so an example when using the json api, in which is says to send metadata-key:null.
I have tried this using python below, but all this does is replace metadata-data with "null" as a string instead of deleting it.
how do you actually delete metadata using the api/gsutil
i have tried gsutil setmeta also, its easy to edit the metadata, but i cant seem to delete it..
https://cloud.google.com/storage/docs/viewing-editing-metadata
import os f
from google.cloud import storage
bucket_name = "bucket-name"
blob_name = "blobname"
def set_blob_metadata(bucket_name, blob_name):
storage_client = storage.Client()
bucket = storage_client.bucket(bucket_name)
blob = bucket.get_blob(blob_name)
metadata = {'x-goog-meta-key':"null"}
blob.metadata = metadata
blob.patch()
print("The metadata for the blob {} is {}".format(blob.name, blob.metadata))
set_blob_metadata(bucket_name, blob_name)