Reusable allow lists (AWS security group model) for servers with the network firewall add-on. Up to 5 groups per server, evaluated after Gyro rules and your advanced ordered rules; with groups and no advanced rules inbound traffic is denied by default. Rules count against the server's rule allowance. A change that could cut SSH/RDP access runs as a 5 minute trial: confirm it.
Full replace (inbound + outbound), max 60 rules. Applied to every attached server. If the change removes or narrows SSH (22) / RDP (3389) access for any source on an attached server, or cuts the calling address, it runs as a 5 minute trial (trial: true, trial_seconds_left) - the same rule as the panel, CLI and Terraform: confirm with POST .../confirm, otherwise the previous rules return. A server's rules (own + all attached groups) must fit its allowance (422 err_sg_quota).
Parameters
Field
in
Type
Description
sgrequired
path
string
Request body
Field
Type
Description
rulesrequired
array<SecurityGroupRule>
Responses
200
Group (trial, corrections) — data: SecurityGroup
401
Missing, invalid or revoked key
404
Not found — also returned for objects owned by someone else
422
Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)
# resource gyro_server_security_groups: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_security_groups
# Attach both groups to a server (order = evaluation order, max 5). Without gyro_firewall rules, inbound traffic
# that no group allows is denied.
resource "gyro_server_security_groups" "web1" {
server_id = 1234
security_group_ids = [gyro_security_group.web.id, gyro_security_group.admin.id]
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups", {
method: "GET",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
Set the exact list of attached groupsScope: cloud_writesetServerSecurityGroupsOpenAPI for this operation
Attaches / detaches in one change (order = evaluation order, max 5). Answers 422 err_busy while the previous change of the server is being applied: retry after a few seconds.
Parameters
Field
in
Type
Description
idrequired
path
integer
Server id (= service id in the client area)
Request body
Field
Type
Description
security_groupsrequired
array<string>
Responses
200
Attached groups — data: ServerSecurityGroups
401
Missing, invalid or revoked key
404
Not found — also returned for objects owned by someone else
409
firewall_not_enabled
422
Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)
gyro security-group server set 12345 --help # all flags
# resource gyro_server_security_groups: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_security_groups
# Attach both groups to a server (order = evaluation order, max 5). Without gyro_firewall rules, inbound traffic
# that no group allows is denied.
resource "gyro_server_security_groups" "web1" {
server_id = 1234
security_group_ids = [gyro_security_group.web.id, gyro_security_group.admin.id]
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.put("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups", headers=h, json={"security_groups": ["string"]}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
Not found — also returned for objects owned by someone else
409
firewall_not_enabled
422
Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)
Examples
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups/1' \
-H "Authorization: Bearer $GYRO_TOKEN"
gyro security-group attach 12345
# resource gyro_server_security_groups: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_security_groups
# Attach both groups to a server (order = evaluation order, max 5). Without gyro_firewall rules, inbound traffic
# that no group allows is denied.
resource "gyro_server_security_groups" "web1" {
server_id = 1234
security_group_ids = [gyro_security_group.web.id, gyro_security_group.admin.id]
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups/1", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups/1", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
# resource gyro_server_security_groups: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_security_groups
# Attach both groups to a server (order = evaluation order, max 5). Without gyro_firewall rules, inbound traffic
# that no group allows is denied.
resource "gyro_server_security_groups" "web1" {
server_id = 1234
security_group_ids = [gyro_security_group.web.id, gyro_security_group.admin.id]
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups/1", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups/1", {
method: "DELETE",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
Esc
No results. Try an endpoint path (/cloud/servers), an operation (createServer) or an error code (limit_exceeded).