Skip to main content

virtual_mac_virtual_addresses

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

Overview​

Namevirtual_mac_virtual_addresses
TypeResource
Idovh.dedicated_server.virtual_mac_virtual_addresses

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
virtual_machine_namestringFriendly name of your Virtual Machine behind this IP/MAC (wire: virtualMachineName)
ip_addressstring (ipv4)IP address (example: 192.0.2.0) (wire: ipAddress)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectip_address, mac_address, service_nameGet an IP of a virtual MAC. Returns an IPv4 address associated with the virtual MAC and the friendly name of the virtual machine behind it.
listselectmac_address, service_namex_pagination_modeList IPs of a virtual MAC. Returns the IPv4 addresses associated with the virtual MAC. A virtual MAC can be associated with one or more IPs.
createinsertmac_address, service_name, ip_address, virtual_machine_nameAdd an IP to a virtual MAC. Associates an IPv4 address with the virtual MAC, with a friendly name for the virtual machine behind it. Returns a task.
deletedeleteip_address, mac_address, service_nameRemove an IP from a virtual MAC. Removes the IPv4 address from the virtual MAC and returns a task. Removing the last linked IP also deletes the virtual MAC.

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"}})
ip_addressstring (ipv4)IP address (wire: ipAddress)
mac_addressstringVirtual MAC address in 00:00:00:00:00:00 format (wire: macAddress)
service_namestringThe internal name of your dedicated server (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​

Get an IP of a virtual MAC. Returns an IPv4 address associated with the virtual MAC and the friendly name of the virtual machine behind it.

SELECT
virtual_machine_name,
ip_address
FROM ovh.dedicated_server.virtual_mac_virtual_addresses
WHERE ip_address = '{{ ip_address }}' -- required
AND mac_address = '{{ mac_address }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Add an IP to a virtual MAC. Associates an IPv4 address with the virtual MAC, with a friendly name for the virtual machine behind it. Returns a task.

INSERT INTO ovh.dedicated_server.virtual_mac_virtual_addresses (
ip_address,
virtual_machine_name,
mac_address,
service_name
)
SELECT
'{{ ip_address }}' /* required */,
'{{ virtual_machine_name }}' /* required */,
'{{ mac_address }}',
'{{ service_name }}'
RETURNING
planned_intervention_id,
task_id,
change_uuid,
comment,
done_date,
function,
last_update,
need_schedule,
note,
start_date,
status,
tags,
ticket_reference
;

DELETE examples​

Remove an IP from a virtual MAC. Removes the IPv4 address from the virtual MAC and returns a task. Removing the last linked IP also deletes the virtual MAC.

DELETE FROM ovh.dedicated_server.virtual_mac_virtual_addresses
WHERE ip_address = '{{ ip_address }}' --required
AND mac_address = '{{ mac_address }}' --required
AND service_name = '{{ service_name }}' --required
;