virtual_macs
Creates, updates, deletes, gets or lists a virtual_macs resource.
Overview​
| Name | virtual_macs |
| Type | Resource |
| Id | ovh.dedicated_server.virtual_macs |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
mac_address | string | Virtual MAC address in 00:00:00:00:00:00 format (wire: macAddress) |
type | string | Virtual MAC address type (ovh, vmware) |
A virtual MAC address associated to one or more IPs
| Name | Datatype | Description |
|---|---|---|
mac_address | string | Virtual MAC address in 00:00:00:00:00:00 format (wire: macAddress) |
type | string | Virtual MAC address type (ovh, vmware) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | mac_address, service_name | Get a virtual MAC. Returns the virtual MAC address, in 00:00:00:00:00:00 format, and its type: ovh or vmware. | |
list | select | service_name | x_pagination_mode | List virtual MACs. Returns the virtual MAC addresses of the server. Each virtual MAC is associated with one or more IP addresses. |
create | insert | service_name, ip_address, type, virtual_machine_name | 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. |
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"}}) |
mac_address | string | Virtual MAC address in 00:00:00:00:00:00 format (wire: macAddress) |
service_name | string | The internal name of your dedicated server (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
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
;
List virtual MACs. Returns the virtual MAC addresses of the server. Each virtual MAC is associated with one or more IP addresses.
SELECT
mac_address,
type
FROM ovh.dedicated_server.virtual_macs
WHERE service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: virtual_macs
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the virtual_macs resource.
- name: ip_address
value: "{{ ip_address }}"
description: |
IPv4 address (e.g., 192.0.2.0)
- name: type
value: "{{ type }}"
description: |
vmac address type
valid_values: ['ovh', 'vmware']
- name: virtual_machine_name
value: "{{ virtual_machine_name }}"
description: |
Friendly name of your Virtual Machine behind this IP/MAC