//native
/**
* Delete a secret from an container
* - To delete a secret you must have the project user permission
- You can't delete a BUILT_IN secret
- If you delete a secret having override or alias, the associated override/alias will be deleted as well
*/
export async function main(auth: RT.Qovery, containerId: string, secretId: string) {
const url = new URL(`https://api.qovery.com/container/${containerId}/secret/${secretId}`)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'Token ' + auth.apiKey
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 235 days ago