Skip to main content

template_modems

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

Overview​

Nametemplate_modems
TypeResource
Idovh.xdsl.template_modems

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringName of the Modem Template
capabilitiesstringParameters capabilities. Lists what can be applied from this template
creation_datestring (date-time)Template creation date (wire: creationDate)
dhcparrayList of DHCP for this template (wire: DHCP)
dmz_ipstring (ipv4)IP Address of the DMZ (example: 192.0.2.0) (wire: dmzIP)
lanarrayList of LAN for this template (wire: LAN)
mtu_sizeintegerSize of the Maximum Transmission Unit on the modem's interfaces (1432, 1456, 1492) (wire: mtuSize)
parameters_to_ignoreobjectDo not apply these parameters from template. You can use parametersCapabilities to know availability (wire: parametersToIgnore)
port_mappingarrayList of PortMapping for this template (wire: portMapping)
wlanarrayList of WLAN for this template (wire: WLAN)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectnameReturns the LAN, DHCP, WLAN, port mapping, DMZ and MTU settings of a modem template, and the parameters to ignore when it is applied.
listselectx_pagination_modeReturns the names of the modem templates of the account.
createinsertname, service_nameCreates a template from the modem configuration of an access. Returns the created template.
updateupdatenameChanges the parameters to ignore when the template is applied to a modem.
deletedeletenameDeletes the modem template and all its settings.

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"}})
namestringName
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 LAN, DHCP, WLAN, port mapping, DMZ and MTU settings of a modem template, and the parameters to ignore when it is applied.

SELECT
name,
capabilities,
creation_date,
dhcp,
dmz_ip,
lan,
mtu_size,
parameters_to_ignore,
port_mapping,
wlan
FROM ovh.xdsl.template_modems
WHERE name = '{{ name }}' -- required
;

INSERT examples​

Creates a template from the modem configuration of an access. Returns the created template.

INSERT INTO ovh.xdsl.template_modems (
name,
service_name
)
SELECT
'{{ name }}' /* required */,
'{{ service_name }}' /* required */
RETURNING
name,
capabilities,
creation_date,
dhcp,
dmz_ip,
lan,
mtu_size,
parameters_to_ignore,
port_mapping,
wlan
;

UPDATE examples​

Changes the parameters to ignore when the template is applied to a modem.

UPDATE ovh.xdsl.template_modems
SET
parameters_to_ignore = '{{ parameters_to_ignore }}'
WHERE
name = '{{ name }}' --required;

DELETE examples​

Deletes the modem template and all its settings.

DELETE FROM ovh.xdsl.template_modems
WHERE name = '{{ name }}' --required
;