Skip to main content

access_restriction_backup_codes

Creates, updates, deletes, gets or lists an access_restriction_backup_codes resource.

Overview​

Nameaccess_restriction_backup_codes
TypeResource
Idovh.me.access_restriction_backup_codes

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
creation_datestring (date-time)Creation date (wire: creationDate)
last_used_datestring (date-time)Last used date (wire: lastUsedDate)
remainingintegerNumber of remaining codes
statusstringStatus of this account (disabled, enabled, needCodeValidation, needEmailValidation)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectGet this object properties
createinsertAdd a SOTP access restriction
deletedeleteDelete this Two-Factor
disableexeccodeDisable this SOTP account
enableexeccodeEnable this SOTP account
validateexeccodeValidate your SOTP account

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"}})

SELECT examples​

Get this object properties

SELECT
creation_date,
last_used_date,
remaining,
status
FROM ovh.me.access_restriction_backup_codes
;

INSERT examples​

Add a SOTP access restriction

INSERT INTO ovh.me.access_restriction_backup_codes (
api_host
)
SELECT
'{{ api_host }}'
RETURNING
codes
;

DELETE examples​

Delete this Two-Factor

DELETE FROM ovh.me.access_restriction_backup_codes
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Disable this SOTP account

EXEC ovh.me.access_restriction_backup_codes.disable
@@json=
'{
"code": "{{ code }}"
}'
;