Security groups

Update security group

This method updates a security group.

A security group refers to a set of rules that determine what network traffic is allowed to enter or leave a particular compute instance. It acts as a virtual firewall, controlling inbound and outbound traffic based on predefined rules.

Security groups operate based on predefined rules that allow traffic based on specified criteria, such as source IP address, destination IP address, port number, and protocol.

When editing a security group, you can add and delete the inbound and outbound rules. You can only define rules that allow traffic, not deny it. All traffic is denied except for explicitly allowed traffic.

Security groups control TCP, UDP and ICMP protocols, or all the selected protocols at once.

Both IPv4 and IPv6 addresses are supported in the 'ipRange' field.

All traffic in the selected protocol is allowed if the IP range in a rule is set to 0.0.0.0/0.

put/v1/security-groups/{securityGroupId}

Request

  • Base URL
    https://api.emma.ms/external
  • Auth
    HTTP bearer

Path parameters

securityGroupIdinteger required

ID of the security group

Request body

namestring required

Name of the security group

Example request

{
  "name": "new_default",
  "rules": [
    {
      "direction": "INBOUND",
      "protocol": "TCP",
      "ports": "1-30321",
      "ipRange": "0.0.0.0/0"
    }
  ]
}

Response

Successful operation

idinteger

Security group id

namestring

Security group name

createdByIdinteger

ID of the user who created the security group

createdByNamestring

Name of the user who created the security group

modifiedByIdinteger

ID of the user who last edited the security group

modifiedByNamestring

Name of the user who last edited the security group

createdAtstring

Date and time of the security group's creation

modifiedAtstring

Date and time of the security group's last update

synchronizationStatus'SYNCHRONIZED' | 'DESYNCHRONIZED' | 'SYNCHRONIZING'

Synchronization status of the security group. When you make changes in the rules the changes are propagated to the respective provider’s security groups. While this is happening the security groups have the status Synchronizing. After it is done the status changes to Synchronized. When another VM is added to the security group it will not be synchronized at first with the other VMs, therefore the status will be Desynchronized.

recomposingStatus'RECOMPOSED' | 'RECOMPOSING'

Recomposing status of the security group. When a new Virtual machine is added to the Security group it starts a synchronization process. During this process the Security group will have a Recomposing status.

lastModificationErrorDescriptionstring

Text of the error when the Security group was last edited

Example response

{
  "id": 5,
  "name": "default",
  "createdById": 123,
  "createdByName": "Jack Rur",
  "modifiedById": 123,
  "modifiedByName": "Jack Rur",
  "createdAt": "2023-08-31T09:26:19.347+00:00",
  "modifiedAt": "2023-08-31T09:26:19.347+00:00",
  "lastModificationErrorDescription": "Unable to update security group",
  "rules": [
    {
      "type": "Custom TCP",
      "policy": "ALLOW",
      "direction": "INBOUND",
      "protocol": "TCP",
      "ports": "30321",
      "ipRange": "0.0.0.0/0",
      "isMutable": true
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.