guardian / grid

The Guardian’s image management system
https://www.theguardian.com/info/developer-blog/2015/aug/12/open-sourcing-grid-image-service
Apache License 2.0
1.44k stars 120 forks source link

API to delete single usage #4120

Closed andrew-nowak closed 1 year ago

andrew-nowak commented 1 year ago

What does this change?

Adds an API endpoint to usages service allowing deletion of a single, specified media usage.

curl <auth> -XDELETE https://{mediaUsageUrl}/usages/media/{gridId}/{usageId}

How should a reviewer test this change?

Find an image with a specific usage which you object to. call the endpoint as above - is the usage gone for good? (yes) Has deleting that usage deleted all other usages (no)

How can success be measured?

We can clean up incorrect usages without disturbing correct ones,

Who should look at this?

Tested? Documented?

andrew-nowak commented 1 year ago

I've added a unit test for the elasticsearch client's new "delete single usage" method. There's currently no automated tests in the usage project; I won't be adding any as part of this PR

prout-bot commented 1 year ago

Seen on auth, usage, image-loader, metadata-editor, thrall, leases, cropper, collections, media-api, kahuna (merged by @andrew-nowak 10 minutes and 47 seconds ago) Please check your changes!