0

Delete services

by
Published Oct 17, 2025

Delete selected services

Script qovery Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Delete services
4
 * Delete selected services
5
 */
6
export async function main(auth: RT.Qovery, environmentId: string, body: Body) {
7
	const url = new URL(`https://api.qovery.com/environment/${environmentId}/service/delete`)
8

9
	const response = await fetch(url, {
10
		method: 'POST',
11
		headers: {
12
			'Content-Type': 'application/json',
13
			Authorization: 'Token ' + auth.apiKey
14
		},
15
		body: JSON.stringify(body)
16
	})
17
	if (!response.ok) {
18
		const text = await response.text()
19
		throw new Error(`${response.status} ${text}`)
20
	}
21
	return await response.text()
22
}
23

24
/* eslint-disable */
25
/**
26
 * This file was automatically generated by json-schema-to-typescript.
27
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
28
 * and run json-schema-to-typescript to regenerate this file.
29
 */
30

31
export interface Body {
32
	application_ids?: string[]
33
	container_ids?: string[]
34
	database_ids?: string[]
35
	job_ids?: string[]
36
	helm_ids?: string[]
37
	terraform_ids?: string[]
38
	[k: string]: unknown
39
}
40