Skip to main content

virtual_macs

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

Overview​

Namevirtual_macs
TypeResource
Idovh.dedicated_server.virtual_macs

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
mac_addressstringVirtual MAC address in 00:00:00:00:00:00 format (wire: macAddress)
typestringVirtual MAC address type (ovh, vmware)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectmac_address, service_nameGet a virtual MAC. Returns the virtual MAC address, in 00:00:00:00:00:00 format, and its type: ovh or vmware.
listselectservice_namex_pagination_modeList virtual MACs. Returns the virtual MAC addresses of the server. Each virtual MAC is associated with one or more IP addresses.
createinsertservice_name, ip_address, type, virtual_machine_nameCreate a virtual MAC. Creates a virtual MAC address of type ovh or vmware and links it to an IP address. The virtualMachineName parameter is a friendly name for the virtual machine behind this IP. Returns a task.

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"}})
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 a virtual MAC. Returns the virtual MAC address, in 00:00:00:00:00:00 format, and its type: ovh or vmware.

SELECT
mac_address,
type
FROM ovh.dedicated_server.virtual_macs
WHERE mac_address = '{{ mac_address }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create a virtual MAC. Creates a virtual MAC address of type ovh or vmware and links it to an IP address. The virtualMachineName parameter is a friendly name for the virtual machine behind this IP. Returns a task.

INSERT INTO ovh.dedicated_server.virtual_macs (
ip_address,
type,
virtual_machine_name,
service_name
)
SELECT
'{{ ip_address }}' /* required */,
'{{ type }}' /* required */,
'{{ virtual_machine_name }}' /* required */,
'{{ 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
;