game_rules
Creates, updates, deletes, gets or lists a game_rules resource.
Overview​
| Name | game_rules |
| Type | Resource |
| Id | ovh.ip.game_rules |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | ID of the rule |
ports | object | Start and end points (inclusive) of a range |
protocol | string | Possible values for game rule protocol (arkSurvivalAscended, arkSurvivalEvolved, arkSurvivalEvolvedV311.78+, arma, counterStrike2, fiveM, gtaMultiTheftAutoSanAndreas, gtaSanAndreasMultiplayerMod, hl2Source, minecraftBedrockWithRacknetCookie, minecraftJava, minecraftPocketEdition, minecraftQuery, mumble, other, rust, teamspeak2, teamspeak3, trackmaniaShootmania, valheim) |
state | string | Current state of your rule (createRulePending, deleteRulePending, ok) |
Rule on ip:ports
| Name | Datatype | Description |
|---|---|---|
id | integer | ID of the rule |
ports | object | Start and end points (inclusive) of a range |
protocol | string | Possible values for game rule protocol (arkSurvivalAscended, arkSurvivalEvolved, arkSurvivalEvolvedV311.78+, arma, counterStrike2, fiveM, gtaMultiTheftAutoSanAndreas, gtaSanAndreasMultiplayerMod, hl2Source, minecraftBedrockWithRacknetCookie, minecraftJava, minecraftPocketEdition, minecraftQuery, mumble, other, rust, teamspeak2, teamspeak3, trackmaniaShootmania, valheim) |
state | string | Current state of your rule (createRulePending, deleteRulePending, ok) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, ip, ip_on_game | Get a protection rule. Returns the UDP port range, the protocol running behind it and the state of the protection rule. | |
list | select | ip, ip_on_game | x_pagination_mode | List protection rules. Returns the identifiers of the protection rules declared on the IP. Their number is limited by maxRules on the IP. |
create | insert | ip, ip_on_game, ports, protocol | 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. | |
delete | delete | id, ip, ip_on_game | Delete a protection rule. Deletes the protection rule from the IP, and returns the deleted rule with its state. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
id | integer | ID of the rule |
ip | string (ip-block) | |
ip_on_game | string (ipv4) | (wire: ipOnGame) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
Get a protection rule. Returns the UDP port range, the protocol running behind it and the state of the protection rule.
SELECT
id,
ports,
protocol,
state
FROM ovh.ip.game_rules
WHERE id = '{{ id }}' -- required
AND ip = '{{ ip }}' -- required
AND ip_on_game = '{{ ip_on_game }}' -- required
;
List protection rules. Returns the identifiers of the protection rules declared on the IP. Their number is limited by maxRules on the IP.
SELECT
id,
ports,
protocol,
state
FROM ovh.ip.game_rules
WHERE ip = '{{ ip }}' -- required
AND ip_on_game = '{{ ip_on_game }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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.
INSERT INTO ovh.ip.game_rules (
ports,
protocol,
ip,
ip_on_game
)
SELECT
'{{ ports }}' /* required */,
'{{ protocol }}' /* required */,
'{{ ip }}',
'{{ ip_on_game }}'
RETURNING
id,
ports,
protocol,
state
;
# Description fields are for documentation purposes
- name: game_rules
props:
- name: ip
value: "{{ ip }}"
description: Required parameter for the game_rules resource.
- name: ip_on_game
value: "{{ ip_on_game }}"
description: Required parameter for the game_rules resource.
- name: ports
description: |
The UDP port range to apply the rule on
value:
from: {{ from }}
to: {{ to }}
- name: protocol
value: "{{ protocol }}"
description: |
Possible values for game rule protocol
valid_values: ['arkSurvivalAscended', 'arkSurvivalEvolved', 'arkSurvivalEvolvedV311.78+', 'arma', 'counterStrike2', 'fiveM', 'gtaMultiTheftAutoSanAndreas', 'gtaSanAndreasMultiplayerMod', 'hl2Source', 'minecraftBedrockWithRacknetCookie', 'minecraftJava', 'minecraftPocketEdition', 'minecraftQuery', 'mumble', 'other', 'rust', 'teamspeak2', 'teamspeak3', 'trackmaniaShootmania', 'valheim']
DELETE examples​
- delete
Delete a protection rule. Deletes the protection rule from the IP, and returns the deleted rule with its state.
DELETE FROM ovh.ip.game_rules
WHERE id = '{{ id }}' --required
AND ip = '{{ ip }}' --required
AND ip_on_game = '{{ ip_on_game }}' --required
;