//native
type Render = {
apiKey: string
}
/**
* Delete environment
* Delete the environment with the provided ID, along with all resources that belong to it.
**This operation is irreversible.** All services and other resources belonging to the environment will be deleted.
*/
export async function main(auth: Render, environmentId: string) {
const url = new URL(`https://api.render.com/v1/environments/${environmentId}`)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'Bearer ' + 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