//native
type Linode = {
token: string;
};
/**
* Delete an IPv6 range
* Removes this IPv6 range from your account and disconnects the range from any assigned Linodes.
*/
export async function main(
auth: Linode,
apiVersion: "v4" | "v4beta",
range: string,
) {
const url = new URL(
`https://api.linode.com/${apiVersion}/networking/ipv6/ranges/${range}`,
);
const response = await fetch(url, {
method: "DELETE",
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