Commit f94a76b2 authored by Zamir Martins Filho's avatar Zamir Martins Filho

Rename internal API endpoint

From ...modules/cilium/network_alert to
...modules/cilium_alert so it matches with
the logic among modules within gitlab agentk
parent a5fb595d
......@@ -459,11 +459,11 @@ Cluster.
| `alert` | Hash | yes | Alerts detail. Currently same format as [3rd party alert](../operations/incident_management/alert_integrations.md#customize-the-alert-payload-outside-of-gitlab). |
```plaintext
POST internal/kubernetes/modules/cilium/network_alert
POST internal/kubernetes/modules/cilium_alert
```
Example Request:
```shell
curl --request POST --header "Gitlab-Kas-Api-Request: <JWT token>" --header "Authorization: Bearer <agent token>" --header "Content-Type: application/json" --data '"{\"alert\":{\"title\":\"minimal\",\"message\":\"network problem\",\"evalMatches\":[{\"value\":1,\"metric\":\"Count\",\"tags\":{}}]}}"' "http://localhost:3000/api/v4/internal/kubernetes/modules/cilium/network_alert"
curl --request POST --header "Gitlab-Kas-Api-Request: <JWT token>" --header "Authorization: Bearer <agent token>" --header "Content-Type: application/json" --data '"{\"alert\":{\"title\":\"minimal\",\"message\":\"network problem\",\"evalMatches\":[{\"value\":1,\"metric\":\"Count\",\"tags\":{}}]}}"' "http://localhost:3000/api/v4/internal/kubernetes/modules/cilium_alert"
```
---
title: Rename internal api endpoint in order align it with the new logic shared among
agentk modules.
merge_request: 50703
author:
type: changed
......@@ -9,7 +9,7 @@ module EE
namespace 'kubernetes' do
before { check_agent_token }
namespace 'modules/cilium/network_alert' do
namespace 'modules/cilium_alert' do
desc 'POST network alerts' do
detail 'Creates network alert'
end
......@@ -25,7 +25,7 @@ module EE
forbidden! unless project.feature_available?(:cilium_alerts)
result = ::AlertManagement::NetworkAlertService.new(agent.project, params[:alert]).execute
result = ::AlertManagement::NetworkAlertService.new(project, params[:alert]).execute
status result.http_status
end
......
......@@ -51,9 +51,9 @@ RSpec.describe API::Internal::Kubernetes do
end
end
describe 'POST /internal/kubernetes/modules/cilium/network_alert' do
describe 'POST /internal/kubernetes/modules/cilium_alert' do
def send_request(headers: {}, params: {})
post api('/internal/kubernetes/modules/cilium/network_alert'), params: params, headers: headers.reverse_merge(jwt_auth_headers)
post api('/internal/kubernetes/modules/cilium_alert'), params: params, headers: headers.reverse_merge(jwt_auth_headers)
end
include_examples 'authorization'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment