Skip to main content

modem_lan_dhcp_dhcp_static_addresses

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

Overview​

Namemodem_lan_dhcp_dhcp_static_addresses
TypeResource
Idovh.xdsl.modem_lan_dhcp_dhcp_static_addresses

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringName of the DHCP Static lease
task_idintegerID of the ongoing todo (NULL if none) (wire: taskId)
ip_addressstring (ipv4)IP address (e.g., 192.0.2.0) (example: 192.0.2.0) (wire: IPAddress)
mac_addressstringThe MAC address of the device (wire: MACAddress)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectmac_address, dhcp_name, lan_name, service_nameReturns the name, MAC address and reserved IP address of a static lease.
listselectdhcp_name, lan_name, service_namex_pagination_modeReturns the MAC addresses of the devices with a static lease on a DHCP server of the modem.
createinsertdhcp_name, lan_name, service_name, ip_address, mac_addressReserves an IP address for a device MAC address on a DHCP server of the modem. Returns the created lease.
updateupdatemac_address, dhcp_name, lan_name, service_nameChanges the name or the reserved IP address of a static lease.
deletedeletemac_address, dhcp_name, lan_name, service_nameRemoves the static lease from the DHCP server of the modem. Returns the task that performs the change.

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"}})
dhcp_namestringDhcp name (wire: dhcpName)
lan_namestringLan name (wire: lanName)
mac_addressstring macaddress (wire: MACAddress)
service_namestringService name (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​

Returns the name, MAC address and reserved IP address of a static lease.

SELECT
name,
task_id,
ip_address,
mac_address
FROM ovh.xdsl.modem_lan_dhcp_dhcp_static_addresses
WHERE mac_address = '{{ mac_address }}' -- required
AND dhcp_name = '{{ dhcp_name }}' -- required
AND lan_name = '{{ lan_name }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Reserves an IP address for a device MAC address on a DHCP server of the modem. Returns the created lease.

INSERT INTO ovh.xdsl.modem_lan_dhcp_dhcp_static_addresses (
ip_address,
mac_address,
name,
dhcp_name,
lan_name,
service_name
)
SELECT
'{{ ip_address }}' /* required */,
'{{ mac_address }}' /* required */,
'{{ name }}',
'{{ dhcp_name }}',
'{{ lan_name }}',
'{{ service_name }}'
RETURNING
name,
task_id,
ip_address,
mac_address
;

UPDATE examples​

Changes the name or the reserved IP address of a static lease.

UPDATE ovh.xdsl.modem_lan_dhcp_dhcp_static_addresses
SET
ip_address = '{{ ip_address }}',
name = '{{ name }}'
WHERE
mac_address = '{{ mac_address }}' --required
AND dhcp_name = '{{ dhcp_name }}' --required
AND lan_name = '{{ lan_name }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Removes the static lease from the DHCP server of the modem. Returns the task that performs the change.

DELETE FROM ovh.xdsl.modem_lan_dhcp_dhcp_static_addresses
WHERE mac_address = '{{ mac_address }}' --required
AND dhcp_name = '{{ dhcp_name }}' --required
AND lan_name = '{{ lan_name }}' --required
AND service_name = '{{ service_name }}' --required
;