Create Cloud Run Functions Rename Objects When That Create.
importbase64fromgoogle.cloudimportstoragedefrename_gcs_object(event,context):# get information from event
bucket_name=event['bucket']file_name=event['name']# init client
storage_client=storage.Client()# set bucket name, obj name
bucket=storage_client.bucket(bucket_name)blob=bucket.blob(file_name)# rename obj without :
new_prefix=file_name.replace(":","")# rename obj
bucket.rename_blob(blob,new_prefix)
google-cloud-storage
Click Create
Verify
Go To Cloud Storage
Copy Object
The New Object Will Rename Automation
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (0)