Class: Google::Apis::ComputeV1::NetworkInterface

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/compute_v1/classes.rb,
generated/google/apis/compute_v1/representations.rb,
generated/google/apis/compute_v1/representations.rb

Overview

A network interface resource attached to an instance.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ NetworkInterface

Returns a new instance of NetworkInterface



9593
9594
9595
# File 'generated/google/apis/compute_v1/classes.rb', line 9593

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#access_configsArray<Google::Apis::ComputeV1::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. Corresponds to the JSON property accessConfigs



9537
9538
9539
# File 'generated/google/apis/compute_v1/classes.rb', line 9537

def access_configs
  @access_configs
end

#alias_ip_rangesArray<Google::Apis::ComputeV1::AliasIpRange>

An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks. Corresponds to the JSON property aliasIpRanges



9543
9544
9545
# File 'generated/google/apis/compute_v1/classes.rb', line 9543

def alias_ip_ranges
  @alias_ip_ranges
end

#kindString

[Output Only] Type of the resource. Always compute#networkInterface for network interfaces. Corresponds to the JSON property kind

Returns:

  • (String)


9549
9550
9551
# File 'generated/google/apis/compute_v1/classes.rb', line 9549

def kind
  @kind
end

#nameString

[Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc. Corresponds to the JSON property name

Returns:

  • (String)


9555
9556
9557
# File 'generated/google/apis/compute_v1/classes.rb', line 9555

def name
  @name
end

#networkString

URL of the 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 network is not specified but the subnetwork is specified, the network is inferred. This field is optional when creating a firewall rule. If not specified when creating a firewall rule, the default network global/networks/default is used. If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:

Returns:

  • (String)


9571
9572
9573
# File 'generated/google/apis/compute_v1/classes.rb', line 9571

def network
  @network
end

#network_ipString

An IPv4 internal network 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. Corresponds to the JSON property networkIP

Returns:

  • (String)


9578
9579
9580
# File 'generated/google/apis/compute_v1/classes.rb', line 9578

def network_ip
  @network_ip
end

#subnetworkString

The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not provide this property. If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. If you specify this property, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs:

Returns:

  • (String)


9591
9592
9593
# File 'generated/google/apis/compute_v1/classes.rb', line 9591

def subnetwork
  @subnetwork
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



9598
9599
9600
9601
9602
9603
9604
9605
9606
# File 'generated/google/apis/compute_v1/classes.rb', line 9598

def update!(**args)
  @access_configs = args[:access_configs] if args.key?(:access_configs)
  @alias_ip_ranges = args[:alias_ip_ranges] if args.key?(:alias_ip_ranges)
  @kind = args[:kind] if args.key?(:kind)
  @name = args[:name] if args.key?(:name)
  @network = args[:network] if args.key?(:network)
  @network_ip = args[:network_ip] if args.key?(:network_ip)
  @subnetwork = args[:subnetwork] if args.key?(:subnetwork)
end