//native
type Linode = {
token: string;
};
/**
* Resume a MySQL Managed Database
* Resume a suspended MySQL Managed Database from your account. This resumes billing for the cluster.
- The user needs `read_write` [user grant](https://techdocs.akamai.com/linode-api/reference/get-user-grants) access to the database.
- The database's status needs to be `suspended`.
>
---
- __OAuth scopes__.
```
databases:read_write
```
[Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)
*/
export async function main(auth: Linode, apiVersion: "v4", instanceId: string) {
const url = new URL(
`https://api.linode.com/${apiVersion}/databases/mysql/instances/${instanceId}/resume`,
);
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago