Skip to main content

instance_interfaces

Creates, updates, deletes, gets or lists an instance_interfaces resource.

Overview​

Nameinstance_interfaces
TypeResource
Idovh.cloud.instance_interfaces

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstringInterface unique identifier
network_idstringNetwork id (wire: networkId)
fixed_ipsarrayList of ips of the interface (wire: fixedIps)
mac_addressstringMac address (wire: macAddress)
statestringOpenstack state
typestringNetwork type

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectinstance_id, interface_id, service_nameGet interface
listselectinstance_id, service_nameGet interfaces
createinsertinstance_id, service_name, network_idCreate interface on an instance and attached it to a network
deletedeleteinstance_id, interface_id, service_nameDelete an interface

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"}})
instance_idstringInstance ID (wire: instanceId)
interface_idstringInterface ID (wire: interfaceId)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.

SELECT examples​

Get interface

SELECT
id,
network_id,
fixed_ips,
mac_address,
state,
type
FROM ovh.cloud.instance_interfaces
WHERE instance_id = '{{ instance_id }}' -- required
AND interface_id = '{{ interface_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Create interface on an instance and attached it to a network

INSERT INTO ovh.cloud.instance_interfaces (
ip,
network_id,
instance_id,
service_name
)
SELECT
'{{ ip }}',
'{{ network_id }}' /* required */,
'{{ instance_id }}',
'{{ service_name }}'
RETURNING
id,
network_id,
fixed_ips,
mac_address,
state,
type
;

DELETE examples​

Delete an interface

DELETE FROM ovh.cloud.instance_interfaces
WHERE instance_id = '{{ instance_id }}' --required
AND interface_id = '{{ interface_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;