Skip to main content

game_rules

Creates, updates, deletes, gets or lists a game_rules resource.

Overview​

Namegame_rules
TypeResource
Idovh.ip.game_rules

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerID of the rule
portsobjectStart and end points (inclusive) of a range
protocolstringPossible 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)
statestringCurrent state of your rule (createRulePending, deleteRulePending, ok)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, ip, ip_on_gameGet a protection rule. Returns the UDP port range, the protocol running behind it and the state of the protection rule.
listselectip, ip_on_gamex_pagination_modeList protection rules. Returns the identifiers of the protection rules declared on the IP. Their number is limited by maxRules on the IP.
createinsertip, ip_on_game, ports, protocolCreate 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.
deletedeleteid, ip, ip_on_gameDelete 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.

NameDatatypeDescription
api_hoststringThe 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"}})
idintegerID of the rule
ipstring (ip-block)
ip_on_gamestring (ipv4) (wire: ipOnGame)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

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
;

INSERT examples​

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
;

DELETE examples​

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
;