Class: CemAcpt::Platform::Gcp::NetworkInterface

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/cem_acpt/platform/gcp/compute.rb

Overview

This class represents a GCP VM network interface

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#add_cmd, #cmd, #cmd_flag_vars?

Constructor Details

#initialize(tier: 'STANDARD', subnetwork: 'default') ⇒ NetworkInterface

Returns a new instance of NetworkInterface.



117
118
119
120
# File 'lib/cem_acpt/platform/gcp/compute.rb', line 117

def initialize(tier: 'STANDARD', subnetwork: 'default')
  @tier = tier.upcase
  @subnetwork = subnetwork
end

Instance Attribute Details

#subnetworkObject (readonly)

Returns the value of attribute subnetwork.



115
116
117
# File 'lib/cem_acpt/platform/gcp/compute.rb', line 115

def subnetwork
  @subnetwork
end

#tierObject (readonly)

Returns the value of attribute tier.



115
116
117
# File 'lib/cem_acpt/platform/gcp/compute.rb', line 115

def tier
  @tier
end

Instance Method Details

#cmd_flagObject



122
123
124
# File 'lib/cem_acpt/platform/gcp/compute.rb', line 122

def cmd_flag
  "--network-interface=network-tier=#{tier},subnet=#{subnetwork}" if cmd_flag_vars?(tier, subnetwork)
end