Compute V1 Client - Class NetworkInterface (1.5.0)

Reference documentation and code samples for the Compute V1 Client class NetworkInterface.

A network interface resource attached to an instance.

Generated from protobuf message google.cloud.compute.v1.NetworkInterface

Methods

__construct

Constructor.

Parameters
Name
Description
data
array

Optional. Data for populating the Message object.

↳ access_configs
array< Google\Cloud\Compute\V1\AccessConfig >

An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access.

↳ alias_ip_ranges
array< Google\Cloud\Compute\V1\AliasIpRange >

An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks.

↳ fingerprint
string

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 the NetworkInterface. The request will fail with error 400 Bad Request if the fingerprint is not provided, or 412 Precondition Failed if the fingerprint is out of date.

↳ internal_ipv6_prefix_length
int

The prefix length of the primary internal IPv6 range.

↳ ipv6_access_configs
array< Google\Cloud\Compute\V1\AccessConfig >

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.

↳ ipv6_access_type
string

[Output Only] One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet. This field is always inherited from its subnetwork. Valid only if stackType is IPV4_IPV6. Check the Ipv6AccessType enum for the list of possible values.

↳ ipv6_address
string

An IPv6 internal network address for this network interface.

↳ kind
string

[Output Only] Type of the resource. Always compute#networkInterface for network interfaces.

↳ name
string

[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 and 7. The default interface value is nic0.

↳ network
string

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

↳ network_i_p
string

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.

↳ nic_type
string

The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet. Check the NicType enum for the list of possible values.

↳ queue_count
int

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.

↳ stack_type
string

The stack type for this network interface to identify whether the IPv6 feature is enabled or not. If not specified, IPV4_ONLY will be used. This field can be both set at instance creation and update network interface operations. Check the StackType enum for the list of possible values.

↳ subnetwork
string

The URL of the Subnetwork resource for this instance. If the network resource is in legacy 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

getAccessConfigs

An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access.

Generated from protobuf field repeated .google.cloud.compute.v1.AccessConfig access_configs = 111058326;

Returns
Type
Description
Google\Protobuf\Internal\RepeatedField

setAccessConfigs

An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access.

Generated from protobuf field repeated .google.cloud.compute.v1.AccessConfig access_configs = 111058326;

Parameter
Name
Description
Returns
Type
Description
$this

getAliasIpRanges

An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks.

Generated from protobuf field repeated .google.cloud.compute.v1.AliasIpRange alias_ip_ranges = 165085631;

Returns
Type
Description
Google\Protobuf\Internal\RepeatedField

setAliasIpRanges

An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks.

Generated from protobuf field repeated .google.cloud.compute.v1.AliasIpRange alias_ip_ranges = 165085631;

Parameter
Name
Description
Returns
Type
Description
$this

getFingerprint

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 the NetworkInterface. The request will fail with error 400 Bad Request if the fingerprint is not provided, or 412 Precondition Failed if the fingerprint is out of date.

Generated from protobuf field optional string fingerprint = 234678500;

Returns
Type
Description
string

hasFingerprint

clearFingerprint

setFingerprint

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 the NetworkInterface. The request will fail with error 400 Bad Request if the fingerprint is not provided, or 412 Precondition Failed if the fingerprint is out of date.

Generated from protobuf field optional string fingerprint = 234678500;

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getInternalIpv6PrefixLength

The prefix length of the primary internal IPv6 range.

Generated from protobuf field optional int32 internal_ipv6_prefix_length = 203833757;

Returns
Type
Description
int

hasInternalIpv6PrefixLength

clearInternalIpv6PrefixLength

setInternalIpv6PrefixLength

The prefix length of the primary internal IPv6 range.

Generated from protobuf field optional int32 internal_ipv6_prefix_length = 203833757;

Parameter
Name
Description
var
int
Returns
Type
Description
$this

getIpv6AccessConfigs

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.

Generated from protobuf field repeated .google.cloud.compute.v1.AccessConfig ipv6_access_configs = 483472110;

Returns
Type
Description
Google\Protobuf\Internal\RepeatedField

setIpv6AccessConfigs

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.

Generated from protobuf field repeated .google.cloud.compute.v1.AccessConfig ipv6_access_configs = 483472110;

Parameter
Name
Description
Returns
Type
Description
$this

getIpv6AccessType

[Output Only] One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet. This field is always inherited from its subnetwork. Valid only if stackType is IPV4_IPV6.

Check the Ipv6AccessType enum for the list of possible values.

Generated from protobuf field optional string ipv6_access_type = 504658653;

Returns
Type
Description
string

hasIpv6AccessType

clearIpv6AccessType

setIpv6AccessType

[Output Only] One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet. This field is always inherited from its subnetwork. Valid only if stackType is IPV4_IPV6.

Check the Ipv6AccessType enum for the list of possible values.

Generated from protobuf field optional string ipv6_access_type = 504658653;

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getIpv6Address

An IPv6 internal network address for this network interface.

Generated from protobuf field optional string ipv6_address = 341563804;

Returns
Type
Description
string

hasIpv6Address

clearIpv6Address

setIpv6Address

An IPv6 internal network address for this network interface.

Generated from protobuf field optional string ipv6_address = 341563804;

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getKind

[Output Only] Type of the resource. Always compute#networkInterface for network interfaces.

Generated from protobuf field optional string kind = 3292052;

Returns
Type
Description
string

hasKind

clearKind

setKind

[Output Only] Type of the resource. Always compute#networkInterface for network interfaces.

Generated from protobuf field optional string kind = 3292052;

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getName

[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 and 7. The default interface value is nic0.

Generated from protobuf field optional string name = 3373707;

Returns
Type
Description
string

hasName

clearName

setName

[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 and 7. The default interface value is nic0.

Generated from protobuf field optional string name = 3373707;

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getNetwork

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

Generated from protobuf field optional string network = 232872494;

Returns
Type
Description
string

hasNetwork

clearNetwork

setNetwork

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

Generated from protobuf field optional string network = 232872494;

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getNetworkIP

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.

Generated from protobuf field optional string network_i_p = 207181961;

Returns
Type
Description
string

hasNetworkIP

clearNetworkIP

setNetworkIP

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.

Generated from protobuf field optional string network_i_p = 207181961;

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getNicType

The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet.

Check the NicType enum for the list of possible values.

Generated from protobuf field optional string nic_type = 59810577;

Returns
Type
Description
string

hasNicType

clearNicType

setNicType

The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet.

Check the NicType enum for the list of possible values.

Generated from protobuf field optional string nic_type = 59810577;

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getQueueCount

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.

Generated from protobuf field optional int32 queue_count = 503708769;

Returns
Type
Description
int

hasQueueCount

clearQueueCount

setQueueCount

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.

Generated from protobuf field optional int32 queue_count = 503708769;

Parameter
Name
Description
var
int
Returns
Type
Description
$this

getStackType

The stack type for this network interface to identify whether the IPv6 feature is enabled or not. If not specified, IPV4_ONLY will be used. This field can be both set at instance creation and update network interface operations.

Check the StackType enum for the list of possible values.

Generated from protobuf field optional string stack_type = 425908881;

Returns
Type
Description
string

hasStackType

clearStackType

setStackType

The stack type for this network interface to identify whether the IPv6 feature is enabled or not. If not specified, IPV4_ONLY will be used. This field can be both set at instance creation and update network interface operations.

Check the StackType enum for the list of possible values.

Generated from protobuf field optional string stack_type = 425908881;

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getSubnetwork

The URL of the Subnetwork resource for this instance. If the network resource is in legacy 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

Generated from protobuf field optional string subnetwork = 307827694;

Returns
Type
Description
string

hasSubnetwork

clearSubnetwork

setSubnetwork

The URL of the Subnetwork resource for this instance. If the network resource is in legacy 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

Generated from protobuf field optional string subnetwork = 307827694;

Parameter
Name
Description
var
string
Returns
Type
Description
$this
Design a Mobile Site
View Site in Mobile | Classic
Share by: