mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Synthetics] Change test now trigger route from GET to POST (#177093)
## Summary This route should not be a `GET`. The processing initiated from this route causes persisted data and resource usage, not mere data retrieval. ## Testing ```bash # on `main`, this is the route curl -X GET http://localhost:5601/internal/synthetics/service/monitors/trigger/{monitorId} -u {user}:{pass} # on this branch, the route above returns a 404 and you must request like: curl -X POST http://localhost:5601/internal/synthetics/service/monitors/trigger/{monitorId} -u {user}:{pass} -H "kbn-xsrf: true" ```
This commit is contained in:
parent
4bf3e77238
commit
d37909ca07
3 changed files with 4 additions and 4 deletions
|
@ -16,7 +16,7 @@ export const triggerTestNowMonitor = async ({
|
|||
configId: string;
|
||||
name: string;
|
||||
}): Promise<TestNowResponse | undefined> => {
|
||||
return await apiService.get(SYNTHETICS_API_URLS.TRIGGER_MONITOR + `/${configId}`);
|
||||
return await apiService.post(SYNTHETICS_API_URLS.TRIGGER_MONITOR + `/${configId}`);
|
||||
};
|
||||
|
||||
export const runOnceMonitor = async ({
|
||||
|
|
|
@ -16,7 +16,7 @@ import { SYNTHETICS_API_URLS } from '../../../common/constants';
|
|||
import { normalizeSecrets } from '../../synthetics_service/utils/secrets';
|
||||
|
||||
export const testNowMonitorRoute: SyntheticsRestApiRouteFactory<TestNowResponse> = () => ({
|
||||
method: 'GET',
|
||||
method: 'POST',
|
||||
path: SYNTHETICS_API_URLS.TRIGGER_MONITOR + '/{monitorId}',
|
||||
validate: {
|
||||
params: schema.object({
|
||||
|
|
|
@ -38,7 +38,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
const resp = await monitorTestService.addMonitor(newMonitor);
|
||||
|
||||
const res = await supertest
|
||||
.get(SYNTHETICS_API_URLS.TRIGGER_MONITOR + `/${resp.id}`)
|
||||
.post(SYNTHETICS_API_URLS.TRIGGER_MONITOR + `/${resp.id}`)
|
||||
.set('kbn-xsrf', 'true')
|
||||
.expect(200);
|
||||
|
||||
|
@ -79,7 +79,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
.expect(200);
|
||||
|
||||
const res = await supertest
|
||||
.get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.TRIGGER_MONITOR}/${resp.body.id}`)
|
||||
.post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.TRIGGER_MONITOR}/${resp.body.id}`)
|
||||
.set('kbn-xsrf', 'true')
|
||||
.expect(200);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue