modem_lan_dhcp_dhcp_static_addresses
Creates, updates, deletes, gets or lists a modem_lan_dhcp_dhcp_static_addresses resource.
Overview​
| Name | modem_lan_dhcp_dhcp_static_addresses |
| Type | Resource |
| Id | ovh.xdsl.modem_lan_dhcp_dhcp_static_addresses |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the DHCP Static lease |
task_id | integer | ID of the ongoing todo (NULL if none) (wire: taskId) |
ip_address | string (ipv4) | IP address (e.g., 192.0.2.0) (example: 192.0.2.0) (wire: IPAddress) |
mac_address | string | The MAC address of the device (wire: MACAddress) |
DHCP Static Address
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the DHCP Static lease |
task_id | integer | ID of the ongoing todo (NULL if none) (wire: taskId) |
ip_address | string (ipv4) | IP address (e.g., 192.0.2.0) (example: 192.0.2.0) (wire: IPAddress) |
mac_address | string | The MAC address of the device (wire: MACAddress) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | mac_address, dhcp_name, lan_name, service_name | Returns the name, MAC address and reserved IP address of a static lease. | |
list | select | dhcp_name, lan_name, service_name | x_pagination_mode | Returns the MAC addresses of the devices with a static lease on a DHCP server of the modem. |
create | insert | dhcp_name, lan_name, service_name, ip_address, mac_address | Reserves an IP address for a device MAC address on a DHCP server of the modem. Returns the created lease. | |
update | update | mac_address, dhcp_name, lan_name, service_name | Changes the name or the reserved IP address of a static lease. | |
delete | delete | mac_address, dhcp_name, lan_name, service_name | Removes 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.
| 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"}}) |
dhcp_name | string | Dhcp name (wire: dhcpName) |
lan_name | string | Lan name (wire: lanName) |
mac_address | string | macaddress (wire: MACAddress) |
service_name | string | Service name (wire: serviceName) |
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
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
;
Returns the MAC addresses of the devices with a static lease on a DHCP server of the modem.
SELECT
name,
task_id,
ip_address,
mac_address
FROM ovh.xdsl.modem_lan_dhcp_dhcp_static_addresses
WHERE dhcp_name = '{{ dhcp_name }}' -- required
AND lan_name = '{{ lan_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: modem_lan_dhcp_dhcp_static_addresses
props:
- name: dhcp_name
value: "{{ dhcp_name }}"
description: Required parameter for the modem_lan_dhcp_dhcp_static_addresses resource.
- name: lan_name
value: "{{ lan_name }}"
description: Required parameter for the modem_lan_dhcp_dhcp_static_addresses resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the modem_lan_dhcp_dhcp_static_addresses resource.
- name: ip_address
value: "{{ ip_address }}"
description: |
IP address (e.g., 192.0.2.0)
- name: mac_address
value: "{{ mac_address }}"
description: |
The MAC address of the device
- name: name
value: "{{ name }}"
description: |
Name of the DHCP static lease
UPDATE examples​
- update
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​
- delete
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
;