Skip to main content

whitelists

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

Overview​

Namewhitelists
TypeResource
Idovh.hosting_private_database.whitelists

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringCustom name for your allowed IP
task_idintegerThe id of the task working on this object (wire: taskId)
creation_datestring (date-time)Creation date of this allowed IP (wire: creationDate)
ipstring (ipv4-block)The IP allowed to access your Web Cloud Database (example: 192.0.2.0/24)
last_updatestring (date-time)The last update date of this allowed IP (wire: lastUpdate)
servicebooleanAuthorize this IP to access service port
sftpbooleanAuthorize this IP to access sftp port
statusstringAllowed IP status (created, creating, deleting, updating)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectip, service_nameReturns the name and status of the allowed IP, and whether it can access the service port and the SFTP port.
listselectservice_nameip, service, sftp, x_pagination_modeReturns the IPs and IP blocks allowed to access the service.
createinsertservice_name, ipAllows an IP or IP block to access the service port, the SFTP port, or both. Returns a task to follow the change.
updateupdateip, service_nameUpdates the name of the allowed IP and its access to the service port and the SFTP port.
deletedeleteip, service_nameRemoves the IP from the allowed list, so it can no longer access the service.

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"}})
ipstring (ipv4-block)Ip
service_namestringService name (wire: serviceName)
ipstringFilter the value of ip property (contains or equals)
servicebooleanFilter the value of service property
sftpbooleanFilter the value of sftp property
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​

Returns the name and status of the allowed IP, and whether it can access the service port and the SFTP port.

SELECT
name,
task_id,
creation_date,
ip,
last_update,
service,
sftp,
status
FROM ovh.hosting_private_database.whitelists
WHERE ip = '{{ ip }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Allows an IP or IP block to access the service port, the SFTP port, or both. Returns a task to follow the change.

INSERT INTO ovh.hosting_private_database.whitelists (
ip,
name,
service,
sftp,
service_name
)
SELECT
'{{ ip }}' /* required */,
'{{ name }}',
{{ service }},
{{ sftp }},
'{{ service_name }}'
RETURNING
id,
dump_id,
database_name,
user_name,
done_date,
function,
last_update,
start_date,
status
;

UPDATE examples​

Updates the name of the allowed IP and its access to the service port and the SFTP port.

UPDATE ovh.hosting_private_database.whitelists
SET
name = '{{ name }}',
service = {{ service }},
sftp = {{ sftp }}
WHERE
ip = '{{ ip }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Removes the IP from the allowed list, so it can no longer access the service.

DELETE FROM ovh.hosting_private_database.whitelists
WHERE ip = '{{ ip }}' --required
AND service_name = '{{ service_name }}' --required
;