whitelists
Creates, updates, deletes, gets or lists a whitelists resource.
Overview​
| Name | whitelists |
| Type | Resource |
| Id | ovh.hosting_private_database.whitelists |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
name | string | Custom name for your allowed IP |
task_id | integer | The id of the task working on this object (wire: taskId) |
creation_date | string (date-time) | Creation date of this allowed IP (wire: creationDate) |
ip | string (ipv4-block) | The IP allowed to access your Web Cloud Database (example: 192.0.2.0/24) |
last_update | string (date-time) | The last update date of this allowed IP (wire: lastUpdate) |
service | boolean | Authorize this IP to access service port |
sftp | boolean | Authorize this IP to access sftp port |
status | string | Allowed IP status (created, creating, deleting, updating) |
Allowed IP
| Name | Datatype | Description |
|---|---|---|
name | string | Custom name for your allowed IP |
task_id | integer | The id of the task working on this object (wire: taskId) |
creation_date | string (date-time) | Creation date of this allowed IP (wire: creationDate) |
ip | string (ipv4-block) | The IP allowed to access your Web Cloud Database (example: 192.0.2.0/24) |
last_update | string (date-time) | The last update date of this allowed IP (wire: lastUpdate) |
service | boolean | Authorize this IP to access service port |
sftp | boolean | Authorize this IP to access sftp port |
status | string | Allowed IP status (created, creating, deleting, updating) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | ip, service_name | Returns the name and status of the allowed IP, and whether it can access the service port and the SFTP port. | |
list | select | service_name | ip, service, sftp, x_pagination_mode | Returns the IPs and IP blocks allowed to access the service. |
create | insert | service_name, ip | Allows an IP or IP block to access the service port, the SFTP port, or both. Returns a task to follow the change. | |
update | update | ip, service_name | Updates the name of the allowed IP and its access to the service port and the SFTP port. | |
delete | delete | ip, service_name | Removes 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.
| 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"}}) |
ip | string (ipv4-block) | Ip |
service_name | string | Service name (wire: serviceName) |
ip | string | Filter the value of ip property (contains or equals) |
service | boolean | Filter the value of service property |
sftp | boolean | Filter the value of sftp property |
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
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
;
Returns the IPs and IP blocks allowed to access the service.
SELECT
name,
task_id,
creation_date,
ip,
last_update,
service,
sftp,
status
FROM ovh.hosting_private_database.whitelists
WHERE service_name = '{{ service_name }}' -- required
AND ip = '{{ ip }}'
AND service = '{{ service }}'
AND sftp = '{{ sftp }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: whitelists
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the whitelists resource.
- name: ip
value: "{{ ip }}"
description: |
The IP allowed to access your Web Cloud Database
- name: name
value: "{{ name }}"
description: |
Custom name for your allowed IP
- name: service
value: {{ service }}
description: |
Authorize this IP to access service port
- name: sftp
value: {{ sftp }}
description: |
Authorize this IP to access sftp port
UPDATE examples​
- update
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​
- delete
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
;