1 | |
2 | |
3 | * Create a variable override |
4 | * - Allows you to override a variable that has a higher scope. |
5 | */ |
6 | export async function main(auth: RT.Qovery, variableId: string, body: Body) { |
7 | const url = new URL(`https://api.qovery.com/variable/${variableId}/override`) |
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 | |
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 | * the value to be used as Override of the targeted environment variable. |
34 | */ |
35 | value: string |
36 | override_scope: |
37 | | 'APPLICATION' |
38 | | 'BUILT_IN' |
39 | | 'ENVIRONMENT' |
40 | | 'PROJECT' |
41 | | 'CONTAINER' |
42 | | 'JOB' |
43 | | 'HELM' |
44 | | 'TERRAFORM' |
45 | |
46 | * the id of the variable that is aliased. |
47 | */ |
48 | override_parent_id: string |
49 | |
50 | * optional variable description (255 characters maximum) |
51 | */ |
52 | description?: string |
53 | enable_interpolation_in_file?: boolean |
54 | [k: string]: unknown |
55 | } |
56 |
|