Class: CemAcpt::Platform::Gcp::NetworkInterface
- Inherits:
-
Object
- Object
- CemAcpt::Platform::Gcp::NetworkInterface
- Includes:
- Helper
- Defined in:
- lib/cem_acpt/platform/gcp/compute.rb
Overview
This class represents a GCP VM network interface
Instance Attribute Summary collapse
-
#subnetwork ⇒ Object
readonly
Returns the value of attribute subnetwork.
-
#tier ⇒ Object
readonly
Returns the value of attribute tier.
Instance Method Summary collapse
- #cmd_flag ⇒ Object
-
#initialize(tier: 'STANDARD', subnetwork: 'default') ⇒ NetworkInterface
constructor
A new instance of NetworkInterface.
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
#subnetwork ⇒ Object (readonly)
Returns the value of attribute subnetwork.
115 116 117 |
# File 'lib/cem_acpt/platform/gcp/compute.rb', line 115 def subnetwork @subnetwork end |
#tier ⇒ Object (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_flag ⇒ Object
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 |