1 | |
2 | |
3 | * Specify cluster cloud provider info and credentials |
4 | * |
5 | */ |
6 | export async function main(auth: RT.Qovery, organizationId: string, clusterId: string, body: Body) { |
7 | const url = new URL( |
8 | `https://api.qovery.com/organization/${organizationId}/cluster/${clusterId}/cloudProviderInfo` |
9 | ) |
10 |
|
11 | const response = await fetch(url, { |
12 | method: 'POST', |
13 | headers: { |
14 | 'Content-Type': 'application/json', |
15 | Authorization: 'Token ' + auth.apiKey |
16 | }, |
17 | body: JSON.stringify(body) |
18 | }) |
19 | if (!response.ok) { |
20 | const text = await response.text() |
21 | throw new Error(`${response.status} ${text}`) |
22 | } |
23 | return await response.json() |
24 | } |
25 |
|
26 | |
27 | |
28 | * This file was automatically generated by json-schema-to-typescript. |
29 | * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, |
30 | * and run json-schema-to-typescript to regenerate this file. |
31 | */ |
32 |
|
33 | export interface Body { |
34 | cloud_provider?: 'AWS' | 'SCW' | 'GCP' | 'ON_PREMISE' | 'AZURE' |
35 | credentials?: { |
36 | id?: string |
37 | name?: string |
38 | [k: string]: unknown |
39 | } |
40 | region?: string |
41 | [k: string]: unknown |
42 | } |
43 |
|