For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create Firewall rule to a Security Group

Create one firewall rule and attach it to the existing security group

post
Authorizations
AuthorizationstringRequired

Please provide header value as 'Bearer ' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.

Path parameters
datacenterIdstringRequired

The unique ID of the data center

securityGroupIdstringRequired

The unique ID of the security group.

Body
idstringRead-onlyOptional

The resource's unique identifier.

Example: 15f67991-0f51-4efc-a8ad-ef1fb31a480c
typestring · enumOptionalPossible values:
hrefstring · uriRead-onlyOptional

URL to the object representation (absolute path).

Example: <RESOURCE-URI>
Responses
200

Successful operation

application/json
post/datacenters/{datacenterId}/securitygroups/{securityGroupId}/rules
POST /cloudapi/v6/datacenters/{datacenterId}/securitygroups/{securityGroupId}/rules HTTP/1.1
Host: api.ionos.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 275

{
  "type": "firewall-rule",
  "metadata": {},
  "properties": {
    "name": "My resource",
    "protocol": "TCP",
    "sourceMac": "00:0a:95:9d:68:16",
    "ipVersion": "IPv4",
    "sourceIp": "22.231.113.64",
    "targetIp": "22.231.113.64",
    "icmpCode": 0,
    "icmpType": 8,
    "portRangeStart": 8,
    "portRangeEnd": 8,
    "type": "INGRESS"
  }
}
{
  "id": "15f67991-0f51-4efc-a8ad-ef1fb31a480c",
  "type": "firewall-rule",
  "href": "<RESOURCE-URI>",
  "metadata": {
    "etag": "45480eb3fbfc31f1d916c1eaa4abdcc3",
    "createdDate": "2015-12-04T14:34:09.809Z",
    "createdBy": "user@example.com",
    "createdByUserId": "user@example.com",
    "lastModifiedDate": "2015-12-04T14:34:09.809Z",
    "lastModifiedBy": "user@example.com",
    "lastModifiedByUserId": "63cef532-26fe-4a64-a4e0-de7c8a506c90",
    "state": "AVAILABLE"
  },
  "properties": {
    "name": "My resource",
    "protocol": "TCP",
    "sourceMac": "00:0a:95:9d:68:16",
    "ipVersion": "IPv4",
    "sourceIp": "22.231.113.64",
    "targetIp": "22.231.113.64",
    "icmpCode": 0,
    "icmpType": 8,
    "portRangeStart": 8,
    "portRangeEnd": 8,
    "type": "INGRESS"
  }
}

Last updated

Was this helpful?