1 | |
2 | |
3 | * Create a helm repository |
4 | * |
5 | */ |
6 | export async function main(auth: RT.Qovery, organizationId: string, body: Body) { |
7 | const url = new URL(`https://api.qovery.com/organization/${organizationId}/helmRepository`) |
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 | name: string |
33 | |
34 | * The type of your helm repository |
35 | */ |
36 | kind: |
37 | | 'HTTPS' |
38 | | 'OCI_ECR' |
39 | | 'OCI_SCALEWAY_CR' |
40 | | 'OCI_DOCKER_HUB' |
41 | | 'OCI_PUBLIC_ECR' |
42 | | 'OCI_GENERIC_CR' |
43 | | 'OCI_GITHUB_CR' |
44 | | 'OCI_GITLAB_CR' |
45 | description?: string |
46 | |
47 | * URL of the helm chart repository: |
48 | * * For `OCI`: it must start by oci:// |
49 | * * For `HTTPS`: it must be start by https:// |
50 | * |
51 | */ |
52 | url?: string |
53 | |
54 | * Bypass tls certificate verification when connecting to repository |
55 | */ |
56 | skip_tls_verification: boolean |
57 | config: { |
58 | |
59 | * Required if the repository is private |
60 | */ |
61 | username?: string |
62 | |
63 | * Required if the repository is private |
64 | */ |
65 | password?: string |
66 | |
67 | * Required if kind is `ECR` or `PUBLIC_ECR` |
68 | */ |
69 | access_key_id?: string |
70 | |
71 | * Required if kind is `ECR` or `PUBLIC_ECR` |
72 | */ |
73 | secret_access_key?: string |
74 | |
75 | * Required if kind is `ECR` or `SCALEWAY_CR` |
76 | */ |
77 | region?: string |
78 | |
79 | * Required if kind is `SCALEWAY_CR` |
80 | */ |
81 | scaleway_access_key?: string |
82 | |
83 | * Required if kind is `SCALEWAY_CR` |
84 | */ |
85 | scaleway_secret_key?: string |
86 | |
87 | * Required if kind is `SCALEWAY_CR` |
88 | */ |
89 | scaleway_project_id?: string |
90 | |
91 | * Required if kind is `AZURE_CR`. |
92 | */ |
93 | azure_tenant_id?: string |
94 | |
95 | * Required if kind is `AZURE_CR`. |
96 | */ |
97 | azure_subscription_id?: string |
98 | [k: string]: unknown |
99 | } |
100 | [k: string]: unknown |
101 | } |
102 |
|