Class: Google::Apis::ComputeV1::NamedPort

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

Overview

The named port. For example: <"http", 80>.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ NamedPort

Returns a new instance of NamedPort.



34238
34239
34240
# File 'lib/google/apis/compute_v1/classes.rb', line 34238

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

Instance Attribute Details

#nameString

The name for this named port. The name must be 1-63 characters long, and comply withRFC1035. Corresponds to the JSON property name

Returns:

  • (String)


34231
34232
34233
# File 'lib/google/apis/compute_v1/classes.rb', line 34231

def name
  @name
end

#portFixnum

The port number, which can be a value between 1 and 65535. Corresponds to the JSON property port

Returns:

  • (Fixnum)


34236
34237
34238
# File 'lib/google/apis/compute_v1/classes.rb', line 34236

def port
  @port
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



34243
34244
34245
34246
# File 'lib/google/apis/compute_v1/classes.rb', line 34243

def update!(**args)
  @name = args[:name] if args.key?(:name)
  @port = args[:port] if args.key?(:port)
end