# Network › IP addresses › Game DDoS protection API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Network product's sections: https://developers.eu.ovhcloud.com/reference/network/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 7 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/game-ddos-protection/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/network/ip-addresses/game-ddos-protection.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/network/ip-addresses/game-ddos-protection.json?format=openapi3

## Operations

- `GET /ip/{ip}/game` — List IPs under protection
- `GET /ip/{ip}/game/{ipOnGame}` — Get an IP under protection
- `PUT /ip/{ip}/game/{ipOnGame}` — Update the firewall mode
- `GET /ip/{ip}/game/{ipOnGame}/rule` — List protection rules
- `POST /ip/{ip}/game/{ipOnGame}/rule` — Create a protection rule
- `GET /ip/{ip}/game/{ipOnGame}/rule/{id}` — Get a protection rule
- `DELETE /ip/{ip}/game/{ipOnGame}/rule/{id}` — Delete a protection rule

## List IPs under protection

`GET /1.0/ip/{ip}/game`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/game-ddos-protection/#get-ip-ip-game

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:game/get`

List IPs under protection. Returns a list of all IP addresses from a given IP block object that are protected by Game DDoS protection.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ipv4[] | successful operation |

```json
[
  "192.0.2.0"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/game" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/game")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/game");

print_r($result);
?>
```

## Get an IP under protection

`GET /1.0/ip/{ip}/game/{ipOnGame}`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/game-ddos-protection/#get-ip-ip-game-ipongame

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:game/get`

Get an IP under protection. Returns the firewall mode, the supported game protocols, the maximum number of rules and the state of the Game DDoS protection.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipOnGame` | path | ipv4 | yes | IPv4 address (e.g., 192.0.2.0) |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ip.GameMitigation | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `firewallModeEnabled` | boolean |  | Firewall mode : in UDP, only allow traffic matching your rules (as well as established traffic). If not enabled, traffic to ports not defined in your rules will be permited. TCP traffic is unaffected by this. |
| `ipOnGame` | ipv4 | read-only | IPv4 address (e.g., 192.0.2.0) |
| `maxRules` | integer | read-only | Maximum number of rules for this IP |
| `state` | ip.GameMitigationStateEnum | read-only | Possible values for udp mitigation rule state — one of `cleanRulesPending`, `firewallModeDisablePending`, `firewallModeEnablePending`, `ok` |
| `supportedProtocols` | ip.GameMitigationRuleProtocolEnum[] | read-only | List of protocols available on this IP |

```json
{
  "firewallModeEnabled": true,
  "ipOnGame": "192.0.2.0",
  "maxRules": 0,
  "state": "cleanRulesPending",
  "supportedProtocols": [
    "arkSurvivalAscended"
  ]
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/game/{ipOnGame}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/game/{ipOnGame}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/game/{ipOnGame}");

print_r($result);
?>
```

## Update the firewall mode

`PUT /1.0/ip/{ip}/game/{ipOnGame}`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/game-ddos-protection/#put-ip-ip-game-ipongame

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:game/edit`

Update the firewall mode. Enables or disables the firewall mode of the IP. When enabled, UDP traffic that matches no declared rule is dropped. TCP traffic is not affected.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipOnGame` | path | ipv4 | yes | IPv4 address (e.g., 192.0.2.0) |

### Request body (required)

Type: `ip.GameMitigation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `firewallModeEnabled` | boolean |  | Firewall mode : in UDP, only allow traffic matching your rules (as well as established traffic). If not enabled, traffic to ports not defined in your rules will be permited. TCP traffic is unaffected by this. |
| `ipOnGame` | ipv4 | read-only | IPv4 address (e.g., 192.0.2.0) |
| `maxRules` | integer | read-only | Maximum number of rules for this IP |
| `state` | ip.GameMitigationStateEnum | read-only | Possible values for udp mitigation rule state — one of `cleanRulesPending`, `firewallModeDisablePending`, `firewallModeEnablePending`, `ok` |
| `supportedProtocols` | ip.GameMitigationRuleProtocolEnum[] | read-only | List of protocols available on this IP |

```json
{
  "firewallModeEnabled": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/game/{ipOnGame}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: ip.GameMitigation
result = client.put("/ip/{ip}/game/{ipOnGame}",
	firewallModeEnabled = None, # Firewall mode : in UDP, only allow traffic matching your rules (as well as established traffic). If not enabled, traffic to ports not defined in your rules will be permited. TCP traffic is unaffected by this. (type: boolean)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: ip.GameMitigation
$result = $ovh->put("/ip/{ip}/game/{ipOnGame}", array(
	firewallModeEnabled => null, // Firewall mode : in UDP, only allow traffic matching your rules (as well as established traffic). If not enabled, traffic to ports not defined in your rules will be permited. TCP traffic is unaffected by this. (type: boolean)
));

print_r($result);
?>
```

## List protection rules

`GET /1.0/ip/{ip}/game/{ipOnGame}/rule`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/game-ddos-protection/#get-ip-ip-game-ipongame-rule

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:game/rule/get`

List protection rules. Returns the identifiers of the protection rules declared on the IP. Their number is limited by maxRules on the IP.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipOnGame` | path | ipv4 | yes | IPv4 address (e.g., 192.0.2.0) |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/game/{ipOnGame}/rule" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/game/{ipOnGame}/rule")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/game/{ipOnGame}/rule");

print_r($result);
?>
```

## Create a protection rule

`POST /1.0/ip/{ip}/game/{ipOnGame}/rule`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/game-ddos-protection/#post-ip-ip-game-ipongame-rule

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:game/rule/create`

Create a protection rule. Declares the Game DDoS protection rule: L7 protocol and UDP port range for a given IP address. Valid protocols are listed in supportedProtocols and the number of rules is limited by maxRules.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipOnGame` | path | ipv4 | yes | IPv4 address (e.g., 192.0.2.0) |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `ports` | complexType.Range_long | yes | The UDP port range to apply the rule on |
| `ports.from` | integer |  |  |
| `ports.to` | integer |  |  |
| `protocol` | ip.GameMitigationRuleProtocolEnum | yes | The protocol running behind the given port(s). See supportedProtocols on the IP to know which values are valid here — one of `arkSurvivalAscended`, `arkSurvivalEvolved`, `arkSurvivalEvolvedV311.78+`, `arma`, `counterStrike2`, `fiveM`, `gtaMultiTheftAutoSanAndreas`, `gtaSanAndreasMultiplayerMod`, `hl2Source`, `minecraftBedrockWithRacknetCookie`, `minecraftJava`, `minecraftPocketEdition`, … |

```json
{
  "ports": {
    "from": 0,
    "to": 0
  },
  "protocol": "arkSurvivalAscended"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ip.GameMitigationRule | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | read-only | ID of the rule |
| `ports` | complexType.Range_long | read-only | Start and end points (inclusive) of a range |
| `ports.from` | integer |  |  |
| `ports.to` | integer |  |  |
| `protocol` | ip.GameMitigationRuleProtocolEnum | read-only | Possible values for game rule protocol — one of `arkSurvivalAscended`, `arkSurvivalEvolved`, `arkSurvivalEvolvedV311.78+`, `arma`, `counterStrike2`, `fiveM`, `gtaMultiTheftAutoSanAndreas`, `gtaSanAndreasMultiplayerMod`, `hl2Source`, `minecraftBedrockWithRacknetCookie`, `minecraftJava`, `minecraftPocketEdition`, … |
| `state` | ip.GameMitigationRuleStateEnum | read-only | Current state of your rule — one of `createRulePending`, `deleteRulePending`, `ok` |

```json
{
  "id": 0,
  "ports": {
    "from": 0,
    "to": 0
  },
  "protocol": "arkSurvivalAscended",
  "state": "createRulePending"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/game/{ipOnGame}/rule" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/ip/{ip}/game/{ipOnGame}/rule",
	ports = None, # The UDP port range to apply the rule on (type: complexType.Range<long>)
	protocol = None, # The protocol running behind the given port(s). See supportedProtocols on the IP to know which values are valid here (type: ip.GameMitigationRuleProtocolEnum)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/ip/{ip}/game/{ipOnGame}/rule", array(
	ports => null, // The UDP port range to apply the rule on (type: complexType.Range<long>)
	protocol => null, // The protocol running behind the given port(s). See supportedProtocols on the IP to know which values are valid here (type: ip.GameMitigationRuleProtocolEnum)
));

print_r($result);
?>
```

## Get a protection rule

`GET /1.0/ip/{ip}/game/{ipOnGame}/rule/{id}`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/game-ddos-protection/#get-ip-ip-game-ipongame-rule-id

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:game/rule/get`

Get a protection rule. Returns the UDP port range, the protocol running behind it and the state of the protection rule.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | ID of the rule |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipOnGame` | path | ipv4 | yes | IPv4 address (e.g., 192.0.2.0) |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ip.GameMitigationRule | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | read-only | ID of the rule |
| `ports` | complexType.Range_long | read-only | Start and end points (inclusive) of a range |
| `ports.from` | integer |  |  |
| `ports.to` | integer |  |  |
| `protocol` | ip.GameMitigationRuleProtocolEnum | read-only | Possible values for game rule protocol — one of `arkSurvivalAscended`, `arkSurvivalEvolved`, `arkSurvivalEvolvedV311.78+`, `arma`, `counterStrike2`, `fiveM`, `gtaMultiTheftAutoSanAndreas`, `gtaSanAndreasMultiplayerMod`, `hl2Source`, `minecraftBedrockWithRacknetCookie`, `minecraftJava`, `minecraftPocketEdition`, … |
| `state` | ip.GameMitigationRuleStateEnum | read-only | Current state of your rule — one of `createRulePending`, `deleteRulePending`, `ok` |

```json
{
  "id": 0,
  "ports": {
    "from": 0,
    "to": 0
  },
  "protocol": "arkSurvivalAscended",
  "state": "createRulePending"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/game/{ipOnGame}/rule/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/game/{ipOnGame}/rule/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/game/{ipOnGame}/rule/{id}");

print_r($result);
?>
```

## Delete a protection rule

`DELETE /1.0/ip/{ip}/game/{ipOnGame}/rule/{id}`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/game-ddos-protection/#delete-ip-ip-game-ipongame-rule-id

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:game/rule/delete`

Delete a protection rule. Deletes the protection rule from the IP, and returns the deleted rule with its state.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | ID of the rule |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipOnGame` | path | ipv4 | yes | IPv4 address (e.g., 192.0.2.0) |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ip.GameMitigationRule | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | read-only | ID of the rule |
| `ports` | complexType.Range_long | read-only | Start and end points (inclusive) of a range |
| `ports.from` | integer |  |  |
| `ports.to` | integer |  |  |
| `protocol` | ip.GameMitigationRuleProtocolEnum | read-only | Possible values for game rule protocol — one of `arkSurvivalAscended`, `arkSurvivalEvolved`, `arkSurvivalEvolvedV311.78+`, `arma`, `counterStrike2`, `fiveM`, `gtaMultiTheftAutoSanAndreas`, `gtaSanAndreasMultiplayerMod`, `hl2Source`, `minecraftBedrockWithRacknetCookie`, `minecraftJava`, `minecraftPocketEdition`, … |
| `state` | ip.GameMitigationRuleStateEnum | read-only | Current state of your rule — one of `createRulePending`, `deleteRulePending`, `ok` |

```json
{
  "id": 0,
  "ports": {
    "from": 0,
    "to": 0
  },
  "protocol": "arkSurvivalAscended",
  "state": "createRulePending"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/game/{ipOnGame}/rule/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/ip/{ip}/game/{ipOnGame}/rule/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/ip/{ip}/game/{ipOnGame}/rule/{id}");

print_r($result);
?>
```
