//native
type Render = {
apiKey: string
}
/**
* Update maintenance run
* Update the maintenance run with the provided ID.
Updates from this endpoint are asynchronous. To check your update's status, use the [Retrieve maintenance run](https://api-docs.render.com/reference/retrieve-maintenance) endpoint.
*/
export async function main(
auth: Render,
maintenanceRunParam: string,
body: { scheduledAt?: string }
) {
const url = new URL(`https://api.render.com/v1/maintenance/${maintenanceRunParam}`)
const response = await fetch(url, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + auth.apiKey
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 235 days ago