//native
type Render = {
apiKey: string
}
/**
* Unlink service
* Unlink a particular service from a particular environment group.
The service will lose access to the environment variables and secret files in the group.
*/
export async function main(auth: Render, envGroupId: string, serviceId: string) {
const url = new URL(`https://api.render.com/v1/env-groups/${envGroupId}/services/${serviceId}`)
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