Attach security group to server
POST
/api/v1/server/{server_id}/security-group/{id}
const url = 'https://console.cloudlogics.com/api/v1/server/30035038-738f-46b0-82b0-a634261b1bf4/security-group/8f14e45f-ceea-467a-9f2c-1b1d3a5e77c2';const options = {method: 'POST', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://console.cloudlogics.com/api/v1/server/30035038-738f-46b0-82b0-a634261b1bf4/security-group/8f14e45f-ceea-467a-9f2c-1b1d3a5e77c2 \ --header 'Authorization: <Authorization>'Attach a security group to a running server. Access is granted to system admins, the VM owner, project owner, or project_admin of the VM’s project — no need to switch projects first.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”server_id
required
string
Server ID
id
required
string
Security group ID
Responses
Section titled “Responses”The group is attached. Note the last path segment is the group’s UUID, not its name.
Media typeapplication/json
A plain acknowledgement. The message text is the whole payload.
object
data
string
Example
{ "data": "security group attached successfully"}Invalid ID
Media typeapplication/json
object
data
error
object
code
integer
message
string
page
object
next
string
prev
string
total_size
integer
Examplegenerated
{ "data": "example", "error": { "code": 1, "message": "example" }, "page": { "next": "example", "prev": "example", "total_size": 1 }}Forbidden — caller cannot mutate this VM
Media typeapplication/json
object
data
error
object
code
integer
message
string
page
object
next
string
prev
string
total_size
integer
Examplegenerated
{ "data": "example", "error": { "code": 1, "message": "example" }, "page": { "next": "example", "prev": "example", "total_size": 1 }}Internal server error
Media typeapplication/json
object
data
error
object
code
integer
message
string
page
object
next
string
prev
string
total_size
integer
Examplegenerated
{ "data": "example", "error": { "code": 1, "message": "example" }, "page": { "next": "example", "prev": "example", "total_size": 1 }}