Class: Google::Apis::RunV1::ContainerPort

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

Overview

ContainerPort represents a network port in a single container.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ContainerPort

Returns a new instance of ContainerPort.



654
655
656
# File 'lib/google/apis/run_v1/classes.rb', line 654

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

Instance Attribute Details

#container_portFixnum

Port number the container listens on. If present, this must be a valid port number, 0 < x < 65536. If not present, it will default to port 8080. For more information, see https://cloud.google.com/run/docs/container-contract#port Corresponds to the JSON property containerPort

Returns:

  • (Fixnum)


641
642
643
# File 'lib/google/apis/run_v1/classes.rb', line 641

def container_port
  @container_port
end

#nameString

If specified, used to specify which protocol to use. Allowed values are "http1" and "h2c". Corresponds to the JSON property name

Returns:

  • (String)


647
648
649
# File 'lib/google/apis/run_v1/classes.rb', line 647

def name
  @name
end

#protocolString

Protocol for port. Must be "TCP". Defaults to "TCP". Corresponds to the JSON property protocol

Returns:

  • (String)


652
653
654
# File 'lib/google/apis/run_v1/classes.rb', line 652

def protocol
  @protocol
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



659
660
661
662
663
# File 'lib/google/apis/run_v1/classes.rb', line 659

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