Add delete endpoint for Alert metric images
What does this MR do and why?
This introduces a Delete API for Alert Management Metric Images.
Previous MRs:
Delete images
Curl
curl --location --request DELETE 'http://gdk.test:3000/api/v4/projects/6/alert_management_alerts/12/metric_images/2' \
--header 'PRIVATE-TOKEN: glpat-DEpkrRZUMVgm6ixjRGCr' \
--form 'url="http://gitlab.com"'
Response
<204 response>
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
How to set up and validate locally
First create an alert:
- Navigate to
Settings > Monitor > Alerts > Current integrations
- Create & enable a new
HTTP Endpoint
alert integration if none exist - For an existing integration, click
> Send test alert
to trigger a test with a sample payload, like this one:{"title":"Triggering a test alert to associate with an incident"}
Then, create a metric image:
file = Rack::Test::UploadedFile.new('spec/fixtures/rails_sample.jpg', 'image/jpg')
alert = AlertManagement::Alert.last
alert.metric_images.create(file: file, url: 'http://www.gitlab.com', url_text: 'Example metric')
Then call the API using the example above.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #340852 (closed)
Edited by Sean Arnold