0

Edit a project deployment rule

by
Published Oct 17, 2025

Edit a project deployment rule

Script qovery Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Edit a project deployment rule
4
 * Edit a project deployment rule
5
 */
6
export async function main(
7
	auth: RT.Qovery,
8
	projectId: string,
9
	deploymentRuleId: string,
10
	body: Body
11
) {
12
	const url = new URL(
13
		`https://api.qovery.com/project/${projectId}/deploymentRule/${deploymentRuleId}`
14
	)
15

16
	const response = await fetch(url, {
17
		method: 'PUT',
18
		headers: {
19
			'Content-Type': 'application/json',
20
			Authorization: 'Token ' + auth.apiKey
21
		},
22
		body: JSON.stringify(body)
23
	})
24
	if (!response.ok) {
25
		const text = await response.text()
26
		throw new Error(`${response.status} ${text}`)
27
	}
28
	return await response.json()
29
}
30

31
/* eslint-disable */
32
/**
33
 * This file was automatically generated by json-schema-to-typescript.
34
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
35
 * and run json-schema-to-typescript to regenerate this file.
36
 */
37

38
export interface Body {
39
	/**
40
	 * name is case insensitive
41
	 */
42
	name: string
43
	description?: string
44
	mode: 'DEVELOPMENT' | 'PREVIEW' | 'PRODUCTION' | 'STAGING'
45
	cluster_id: string
46
	auto_stop?: boolean
47
	timezone: string
48
	start_time: string
49
	stop_time: string
50
	weekdays: ('MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY')[]
51
	/**
52
	 * wildcard pattern composed of '?' and/or '*' used to target new created environments
53
	 */
54
	wildcard: string
55
	[k: string]: unknown
56
}
57