1 | |
2 | |
3 | * Edit a set of Scaleway credentials |
4 | * |
5 | */ |
6 | export async function main( |
7 | auth: RT.Qovery, |
8 | organizationId: string, |
9 | credentialsId: string, |
10 | body: Body |
11 | ) { |
12 | const url = new URL( |
13 | `https://api.qovery.com/organization/${organizationId}/scaleway/credentials/${credentialsId}` |
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 | scaleway_access_key: string |
41 | scaleway_secret_key: string |
42 | scaleway_project_id: string |
43 | scaleway_organization_id: string |
44 | [k: string]: unknown |
45 | } |
46 |
|