access_restriction_sms
Creates, updates, deletes, gets or lists an access_restriction_sms resource.
Overview​
| Name | access_restriction_sms |
| Type | Resource |
| Id | ovh.me.access_restriction_sms |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | The Id of the restriction |
creation_date | string (date-time) | Creation date (wire: creationDate) |
description | string | Description of this phone |
last_used_date | string (date-time) | Last used date (wire: lastUsedDate) |
phone_number | string | Associated phone number (wire: phoneNumber) |
status | string | Status of this account (disabled, enabled, needCodeValidation, needEmailValidation) |
Sms Two-Factor Authentication
| Name | Datatype | Description |
|---|---|---|
id | integer | The Id of the restriction |
creation_date | string (date-time) | Creation date (wire: creationDate) |
description | string | Description of this phone |
last_used_date | string (date-time) | Last used date (wire: lastUsedDate) |
phone_number | string | Associated phone number (wire: phoneNumber) |
status | string | Status of this account (disabled, enabled, needCodeValidation, needEmailValidation) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id | Get this object properties | |
list | select | x_pagination_mode | List of Sms accounts | |
create | insert | phone | Add a SMS access restriction | |
update | update | id | Alter this object properties | |
delete | delete | id | Delete this Two-Factor | |
disable | exec | id, code | Disable this SMS account | |
enable | exec | id, code | Enable this SMS account | |
send_code | exec | id | Send a SMS to this account | |
validate | exec | id, code | Validate your SMS 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.
| 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"}}) |
id | integer | The Id of the restriction |
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
Get this object properties
SELECT
id,
creation_date,
description,
last_used_date,
phone_number,
status
FROM ovh.me.access_restriction_sms
WHERE id = '{{ id }}' -- required
;
List of Sms accounts
SELECT
id,
creation_date,
description,
last_used_date,
phone_number,
status
FROM ovh.me.access_restriction_sms
WHERE x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Add a SMS access restriction
INSERT INTO ovh.me.access_restriction_sms (
phone
)
SELECT
'{{ phone }}' /* required */
RETURNING
id,
remaining_try
;
# Description fields are for documentation purposes
- name: access_restriction_sms
props:
- name: phone
value: "{{ phone }}"
description: |
Cell phone number to register
UPDATE examples​
- update
Alter this object properties
UPDATE ovh.me.access_restriction_sms
SET
description = '{{ description }}'
WHERE
id = '{{ id }}' --required;
DELETE examples​
- delete
Delete this Two-Factor
DELETE FROM ovh.me.access_restriction_sms
WHERE id = '{{ id }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- disable
- enable
- send_code
- validate
Disable this SMS account
EXEC ovh.me.access_restriction_sms.disable
@id='{{ id }}' --required
@@json=
'{
"code": "{{ code }}"
}'
;
Enable this SMS account
EXEC ovh.me.access_restriction_sms.enable
@id='{{ id }}' --required
@@json=
'{
"code": "{{ code }}"
}'
;
Send a SMS to this account
EXEC ovh.me.access_restriction_sms.send_code
@id='{{ id }}' --required
;
Validate your SMS account
EXEC ovh.me.access_restriction_sms.validate
@id='{{ id }}' --required
@@json=
'{
"code": "{{ code }}"
}'
;