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