Skip to main content

two_fa_whitelists

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

Overview​

Nametwo_fa_whitelists
TypeResource
Idovh.dedicated_cloud.two_fa_whitelists

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerId of the trusted IP
cidr_netmaskintegerIP netmask (CIDR notation) of the remote service (wire: cidrNetmask)
descriptionstringDescription of the trusted IP
ipstring (ipv4)IP address of the remote service (example: 192.0.2.0)
statestringState of the whitelist (enabled, enabling, error, migrating, removed, removing)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, service_nameGet a 2FA whitelisted network. Returns the IP address, netmask, description and state of the exempted network.
listselectservice_namex_pagination_modeList 2FA whitelisted networks. Returns the IDs of the networks exempted from two-factor authentication.
createinsertservice_name, description, ipCreate a 2FA whitelisted network. Exempts an IP address or network from two-factor authentication. Returns a task to track progress.
deletedeleteid, service_nameDelete a 2FA whitelisted network
change_propertiesexecid, serviceNameUpdate a 2FA whitelisted network

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 trusted IP
serviceNamestringDomain of the service
service_namestringDomain of the service (wire: serviceName)
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 2FA whitelisted network. Returns the IP address, netmask, description and state of the exempted network.

SELECT
id,
cidr_netmask,
description,
ip,
state
FROM ovh.dedicated_cloud.two_fa_whitelists
WHERE id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create a 2FA whitelisted network. Exempts an IP address or network from two-factor authentication. Returns a task to track progress.

INSERT INTO ovh.dedicated_cloud.two_fa_whitelists (
description,
ip,
service_name
)
SELECT
'{{ description }}' /* required */,
'{{ ip }}' /* required */,
'{{ service_name }}'
RETURNING
name,
datacenter_id,
filer_id,
host_id,
network_access_id,
order_id,
parent_task_id,
task_id,
user_id,
vlan_id,
created_by,
created_from,
description,
end_date,
execution_date,
last_modification_date,
maintenance_date_from,
maintenance_date_to,
network,
progress,
state,
type
;

DELETE examples​

Delete a 2FA whitelisted network

DELETE FROM ovh.dedicated_cloud.two_fa_whitelists
WHERE id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Update a 2FA whitelisted network

EXEC ovh.dedicated_cloud.two_fa_whitelists.change_properties
@id='{{ id }}' --required,
@serviceName='{{ serviceName }}' --required
@@json=
'{
"description": "{{ description }}"
}'
;