|
Use case - I have a set of jobs in a workflow, they write data into a bucket. That data is relevant for the string of jobs, and then it isn't needed anymore. I'd like to use the bucket as a scratch pad for the length of the operation, but then want to ensure it's empty before I use it again. Is there a quick way to empty a bucket, either fully or in part? I saw there's an API method to delete individual files, but I didn't come across anything more bulk. |
Replies: 1 comment 2 replies
|
Ah, what a great feature request! I'll try to get that into the next release (should be next week). Thanks! I'll add a new API called Note that in order to call the API from within a job, you'll need an API key. After creating it and assigning privileges (it'll need the edit_buckets priv), you can store the key in a secret vault, and assign it to the event, so it'll show up as an environment variable (e.g. Example invocation from shell: curl -fsSL -H "X-API-Key: ${XYOPS_API_KEY}" "${JOB_BASE_URL}/api/app/empty_bucket/v1?id=${YOUR_BUCKET_ID}&files=1&data=1" |
Ah, what a great feature request! I'll try to get that into the next release (should be next week). Thanks!
I'll add a new API called
empty_bucketwhich will clear it out of data and/or files, but leave the bucket itself intact.Note that in order to call the API from within a job, you'll need an API key. After creating it and assigning privileges (it'll need the edit_buckets priv), you can store the key in a secret vault, and assign it to the event, so it'll show up as an environment variable (e.g.
XYOPS_API_KEY). Also, the full URL to the current xyOps conductor server is always available inside each job as theJOB_BASE_URLenv var.Example invocation from shell:
curl -fsSL -H "X-API-Key: