0

Create an organization annotations group

by
Published Oct 17, 2025

Create an organization annotations group

Script qovery Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Create an organization annotations group
4
 * Create an organization annotations group
5
 */
6
export async function main(auth: RT.Qovery, organizationId: string, body: Body) {
7
	const url = new URL(`https://api.qovery.com/organization/${organizationId}/annotationsGroups`)
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.json()
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
	/**
33
	 * name of the annotations group
34
	 */
35
	name: string
36
	annotations: {
37
		key: string
38
		value: string
39
		[k: string]: unknown
40
	}[]
41
	scopes: (
42
		| 'DEPLOYMENTS'
43
		| 'STATEFUL_SETS'
44
		| 'SERVICES'
45
		| 'INGRESS'
46
		| 'HPA'
47
		| 'PODS'
48
		| 'SECRETS'
49
		| 'JOBS'
50
		| 'CRON_JOBS'
51
	)[]
52
	[k: string]: unknown
53
}
54