0

Unassign a placement group

by
Published Oct 17, 2025

Remove one or more compute instances from your placement group. > --- - __CLI__. ``` linode-cli placement unassign-linode 528 \ --linode 123 456 ``` [Learn more...](https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-the-linode-cli) - __OAuth scopes__. ``` linodes:read_write ``` [Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)

Script linode Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Linode = {
3
  token: string;
4
};
5
/**
6
 * Unassign a placement group
7
 * Remove one or more compute instances from your placement group.
8

9

10
>
11

12
---
13

14

15
- __CLI__.
16

17
    ```
18
    linode-cli placement unassign-linode 528 \
19
  --linode 123 456
20
    ```
21

22
    [Learn more...](https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-the-linode-cli)
23

24
- __OAuth scopes__.
25

26
    ```
27
    linodes:read_write
28
    ```
29

30
    [Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)
31
 */
32
export async function main(
33
  auth: Linode,
34
  apiVersion: "v4" | "v4beta",
35
  groupId: string,
36
  body: { linodes?: number[] },
37
) {
38
  const url = new URL(
39
    `https://api.linode.com/${apiVersion}/placement/groups/${groupId}/unassign`,
40
  );
41

42
  const response = await fetch(url, {
43
    method: "POST",
44
    headers: {
45
      "Content-Type": "application/json",
46
      Authorization: "Bearer " + auth.token,
47
    },
48
    body: JSON.stringify(body),
49
  });
50
  if (!response.ok) {
51
    const text = await response.text();
52
    throw new Error(`${response.status} ${text}`);
53
  }
54
  return await response.json();
55
}
56