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

Partially modify firewall rules

Update the properties of the specified firewall rule.

patch
Authorizations
AuthorizationstringRequired

You will need to base64 encode the string containing your credentials.

Note:

  • Basic Authentication is supported only when 2-Factor Authentication is not configured.
  • Users with 2-Factor Authentication activated must generate new 2FA-secured tokens in the DCD using [Token Manager](https://docs.ionos.com/cloud/set-up-ionos-cloud/management/identity-access-management/token-manager). These tokens do not inherit the 2FA-secured property by default.
  • Token deletion is only possible using the Token Manager.
Separate your username and password with a colon, i.e., username:password and send it as 'Authorization' request header. More details: https://en.wikipedia.org/wiki/Basic_access_authentication
Path parameters
datacenterIdstringRequired

The unique ID of the data center.

serverIdstringRequired

The unique ID of the server.

nicIdstringRequired

The unique ID of the NIC.

firewallruleIdstringRequired

The unique ID of the firewall rule.

Query parameters
prettybooleanOptional

Controls whether the response is pretty-printed (with indentations and new lines).

Default: true
depthinteger · int32 · max: 10Optional

Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on

Default: 0
Header parameters
X-Contract-Numberinteger · int32Optional

Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Body
namestringOptional

The name of the resource.

Example: My resource
protocolstring · enumRequired

The protocol for the rule. Property cannot be modified after it is created (disallowed in update requests).

Example: TCPPossible values:
sourceMacstring · nullableOptional

Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows traffic from any MAC address.

Example: 00:0a:95:9d:68:16
ipVersionstring · enum · nullableOptional

The IP version for this rule. If sourceIp or targetIp are specified, you can omit this value - the IP version will then be deduced from the IP address(es) used; if you specify it anyway, it must match the specified IP address(es). If neither sourceIp nor targetIp are specified, this rule allows traffic only for the specified IP version. If neither sourceIp, targetIp nor ipVersion are specified, this rule will only allow IPv4 traffic.

Example: IPv4Possible values:
sourceIpstring · nullableOptional

Only traffic originating from the respective IP address (or CIDR block) is allowed. Value null allows traffic from any IP address (according to the selected ipVersion).

Example: 22.231.113.64
targetIpstring · nullableOptional

If the target NIC has multiple IP addresses, only the traffic directed to the respective IP address (or CIDR block) of the NIC is allowed. Value null allows traffic to any target IP address (according to the selected ipVersion).

Example: 22.231.113.64
icmpCodeinteger · int32 · max: 254 · nullableOptional

Defines the allowed code (from 0 to 254) if protocol ICMP or ICMPv6 is chosen. Value null allows all codes.

Example: 0
icmpTypeinteger · int32 · max: 254 · nullableOptional

Defines the allowed type (from 0 to 254) if the protocol ICMP or ICMPv6 is chosen. Value null allows all types.

Example: 8
portRangeStartinteger · int32 · min: 1 · max: 65535Optional

Defines the start range of the allowed port (from 1 to 65535) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd value null to allow all ports.

Example: 8
portRangeEndinteger · int32 · min: 1 · max: 65535Optional

Defines the end range of the allowed port (from 1 to 65535) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.

Example: 8
typestring · enumOptional

The type of the firewall rule. If not specified, the default INGRESS value is used.

Example: INGRESSPossible values:
Responses
202

Successful operation

application/json
patch/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}
PATCH /cloudapi/v6/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId} HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 223

{
  "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?