instance_interfaces
Creates, updates, deletes, gets or lists an instance_interfaces resource.
Overview​
| Name | instance_interfaces |
| Type | Resource |
| Id | ovh.cloud.instance_interfaces |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string | Interface unique identifier |
network_id | string | Network id (wire: networkId) |
fixed_ips | array | List of ips of the interface (wire: fixedIps) |
mac_address | string | Mac address (wire: macAddress) |
state | string | Openstack state |
type | string | Network type |
Interface
| Name | Datatype | Description |
|---|---|---|
id | string | Interface unique identifier |
network_id | string | Network id (wire: networkId) |
fixed_ips | array | List of ips of the interface (wire: fixedIps) |
mac_address | string | Mac address (wire: macAddress) |
state | string | Openstack state |
type | string | Network type |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | instance_id, interface_id, service_name | Get interface | |
list | select | instance_id, service_name | Get interfaces | |
create | insert | instance_id, service_name, network_id | Create interface on an instance and attached it to a network | |
delete | delete | instance_id, interface_id, service_name | Delete 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.
| 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"}}) |
instance_id | string | Instance ID (wire: instanceId) |
interface_id | string | Interface ID (wire: interfaceId) |
service_name | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
SELECT examples​
- get
- list
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
;
Get interfaces
SELECT
id,
network_id,
fixed_ips,
mac_address,
state,
type
FROM ovh.cloud.instance_interfaces
WHERE instance_id = '{{ instance_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: instance_interfaces
props:
- name: instance_id
value: "{{ instance_id }}"
description: Required parameter for the instance_interfaces resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the instance_interfaces resource.
- name: ip
value: "{{ ip }}"
description: |
Static ip (Can only be defined for private networks)
- name: network_id
value: "{{ network_id }}"
description: |
Network id
DELETE examples​
- delete
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
;