instances_network_interface
Creates, updates, deletes, gets or lists an instances_network_interface resource.
Overview
| Name | instances_network_interface |
| Type | Resource |
| Id | google.compute.instances_network_interface |
Fields
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
add_network_interface | insert | project, zone, instance | requestId | Adds one dynamic network interface to an active instance. |
delete_network_interface | delete | project, zone, instance, networkInterfaceName | requestId | Deletes one dynamic network interface from an active instance. InstancesDeleteNetworkInterfaceRequest indicates: - instance from which to delete, using project+zone+resource_id fields; - dynamic network interface to be deleted, using network_interface_name field; |
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 |
|---|---|---|
instance | string | |
networkInterfaceName | string | |
project | string | |
zone | string | |
requestId | string |
INSERT examples
- add_network_interface
- Manifest
Adds one dynamic network interface to an active instance.
INSERT INTO google.compute.instances_network_interface (
data__ipv6Address,
data__parentNicName,
data__fingerprint,
data__igmpQuery,
data__serviceClassId,
data__subnetwork,
data__network,
data__stackType,
data__accessConfigs,
data__networkAttachment,
data__queueCount,
data__name,
data__networkIP,
data__vlan,
data__internalIpv6PrefixLength,
data__nicType,
data__aliasIpRanges,
data__ipv6AccessConfigs,
data__aliasIpv6Ranges,
data__enableVpcScopedDns,
project,
zone,
instance,
requestId
)
SELECT
'{{ ipv6Address }}',
'{{ parentNicName }}',
'{{ fingerprint }}',
'{{ igmpQuery }}',
'{{ serviceClassId }}',
'{{ subnetwork }}',
'{{ network }}',
'{{ stackType }}',
'{{ accessConfigs }}',
'{{ networkAttachment }}',
{{ queueCount }},
'{{ name }}',
'{{ networkIP }}',
{{ vlan }},
{{ internalIpv6PrefixLength }},
'{{ nicType }}',
'{{ aliasIpRanges }}',
'{{ ipv6AccessConfigs }}',
'{{ aliasIpv6Ranges }}',
{{ enableVpcScopedDns }},
'{{ project }}',
'{{ zone }}',
'{{ instance }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;
# Description fields are for documentation purposes
- name: instances_network_interface
props:
- name: project
value: "{{ project }}"
description: Required parameter for the instances_network_interface resource.
- name: zone
value: "{{ zone }}"
description: Required parameter for the instances_network_interface resource.
- name: instance
value: "{{ instance }}"
description: Required parameter for the instances_network_interface resource.
- name: ipv6Address
value: "{{ ipv6Address }}"
description: |
An IPv6 internal network address for this network interface. To
use a static internal IP address, it must be unused and in the same region
as the instance's zone. If not specified, Google Cloud will automatically
assign an internal IPv6 address from the instance's subnetwork.
- name: parentNicName
value: "{{ parentNicName }}"
description: |
Name of the parent network interface of a dynamic network interface.
- name: fingerprint
value: "{{ fingerprint }}"
description: |
Fingerprint hash of contents stored in this network interface.
This field will be ignored when inserting an Instance or
adding a NetworkInterface. An up-to-date
fingerprint must be provided in order to update theNetworkInterface. The request will fail with error400 Bad Request if the fingerprint is not provided, or412 Precondition Failed if the fingerprint is out of date.
- name: igmpQuery
value: "{{ igmpQuery }}"
description: |
Indicate whether igmp query is enabled on the network interface
or not. If enabled, also indicates the version of IGMP supported.
valid_values: ['IGMP_QUERY_DISABLED', 'IGMP_QUERY_V2']
- name: serviceClassId
value: "{{ serviceClassId }}"
description: |
Optional. Producer Service's Service class Id for the region of this network
interface. Can only be used with network_attachment. It is not possible to
use on its own however, network_attachment can be used without
service_class_id.
- name: subnetwork
value: "{{ subnetwork }}"
description: |
The URL of the Subnetwork resource for this instance. If the network
resource is inlegacy
mode, do not specify this field. If the network is in auto subnet
mode, specifying the subnetwork is optional. If the network is in custom
subnet mode, specifying the subnetwork is required. If you specify this
field, you can specify the subnetwork as a full or partial URL. For
example, the following are all valid URLs:
- https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
- regions/region/subnetworks/subnetwork
- name: network
value: "{{ network }}"
description: |
URL of the VPC network resource for this instance. When creating an
instance, if neither the network nor the subnetwork is specified, the
default network global/networks/default is used. If the
selected project doesn't have the default network, you must specify a
network or subnet. If the network is not specified but the subnetwork is
specified, the network is inferred.
If you specify this property, you can specify the network as
a full or partial URL. For example, the following are all valid URLs:
- https://www.googleapis.com/compute/v1/projects/project/global/networks/network
- projects/project/global/networks/network
- global/networks/default
- name: stackType
value: "{{ stackType }}"
description: |
The stack type for this network interface. To assign only IPv4 addresses,
use IPV4_ONLY. To assign both IPv4 and IPv6 addresses, useIPV4_IPV6. If not specified, IPV4_ONLY is used.
This field can be both set at instance creation and update network
interface operations.
valid_values: ['IPV4_IPV6', 'IPV4_ONLY', 'IPV6_ONLY']
- name: accessConfigs
description: |
An array of configurations for this interface. Currently, only one access
config, ONE_TO_ONE_NAT, is supported. If there are noaccessConfigs specified, then this instance will have
no external internet access.
value:
- publicPtrDomainName: "{{ publicPtrDomainName }}"
natIP: "{{ natIP }}"
setPublicPtr: {{ setPublicPtr }}
networkTier: "{{ networkTier }}"
kind: "{{ kind }}"
externalIpv6PrefixLength: {{ externalIpv6PrefixLength }}
securityPolicy: "{{ securityPolicy }}"
name: "{{ name }}"
externalIpv6: "{{ externalIpv6 }}"
type: "{{ type }}"
- name: networkAttachment
value: "{{ networkAttachment }}"
description: |
The URL of the network attachment that this interface should connect
to in the following format:
projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}.
- name: queueCount
value: {{ queueCount }}
description: |
The networking queue count that's specified by users for the network
interface. Both Rx and Tx queues will be set to this number. It'll be empty
if not specified by the users.
- name: name
value: "{{ name }}"
description: |
[Output Only] The name of the network interface, which is generated by the
server. For a VM, the network interface uses the nicN naming
format. Where N is a value between 0 and7. The default interface value is nic0.
- name: networkIP
value: "{{ networkIP }}"
description: |
An IPv4 internal IP address to assign to the instance for this network
interface. If not specified by the user, an unused internal IP is
assigned by the system.
- name: vlan
value: {{ vlan }}
description: |
VLAN tag of a dynamic network interface, must be an integer in the range
from 2 to 255 inclusively.
- name: internalIpv6PrefixLength
value: {{ internalIpv6PrefixLength }}
description: |
The prefix length of the primary internal IPv6 range.
- name: nicType
value: "{{ nicType }}"
description: |
The type of vNIC to be used on this interface. This may be gVNIC or
VirtioNet.
valid_values: ['GVNIC', 'IDPF', 'IRDMA', 'MRDMA', 'UNSPECIFIED_NIC_TYPE', 'VIRTIO_NET']
- name: aliasIpRanges
description: |
An array of alias IP ranges for this network interface.
You can only specify this field for network interfaces in VPC networks.
value:
- ipCidrRange: "{{ ipCidrRange }}"
subnetworkRangeName: "{{ subnetworkRangeName }}"
- name: ipv6AccessConfigs
description: |
An array of IPv6 access configurations for this interface. Currently, only
one IPv6 access config, DIRECT_IPV6, is supported. If there
is no ipv6AccessConfig specified, then this instance will
have no external IPv6 Internet access.
value:
- publicPtrDomainName: "{{ publicPtrDomainName }}"
natIP: "{{ natIP }}"
setPublicPtr: {{ setPublicPtr }}
networkTier: "{{ networkTier }}"
kind: "{{ kind }}"
externalIpv6PrefixLength: {{ externalIpv6PrefixLength }}
securityPolicy: "{{ securityPolicy }}"
name: "{{ name }}"
externalIpv6: "{{ externalIpv6 }}"
type: "{{ type }}"
- name: aliasIpv6Ranges
description: |
An array of alias IPv6 ranges for this network interface.
You can only specify this field for network interfaces in VPC networks.
value:
- ipCidrRange: "{{ ipCidrRange }}"
subnetworkRangeName: "{{ subnetworkRangeName }}"
- name: enableVpcScopedDns
value: {{ enableVpcScopedDns }}
description: |
Optional. If true, DNS resolution will be enabled over this interface. Only valid
with network_attachment.
- name: requestId
value: "{{ requestId }}"
DELETE examples
- delete_network_interface
Deletes one dynamic network interface from an active instance.
InstancesDeleteNetworkInterfaceRequest indicates:
- instance from which to delete, using project+zone+resource_id fields;
- dynamic network interface to be deleted, using network_interface_name
field;
DELETE FROM google.compute.instances_network_interface
WHERE project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND instance = '{{ instance }}' --required
AND networkInterfaceName = '{{ networkInterfaceName }}' --required
AND requestId = '{{ requestId }}'
;