Class: DockerEngine::Models::Service::Endpoint::Port

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/docker_engine/models/service.rb

Defined Under Namespace

Modules: Protocol, PublishMode

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(name: nil, protocol: nil, published_port: nil, publish_mode: nil, target_port: nil) ⇒ Object

Some parameter documentations has been truncated, see DockerEngine::Models::Service::Endpoint::Port for more details.

Parameters:



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/docker_engine/models/service.rb', line 120

class Port < DockerEngine::Internal::Type::BaseModel
  # @!attribute name
  #
  #   @return [String, nil]
  optional :name, String, api_name: :Name

  # @!attribute protocol
  #
  #   @return [Symbol, DockerEngine::Models::Service::Endpoint::Port::Protocol, nil]
  optional :protocol,
           enum: -> {
             DockerEngine::Service::Endpoint::Port::Protocol
           },
           api_name: :Protocol

  # @!attribute published_port
  #   The port on the swarm hosts.
  #
  #   @return [Integer, nil]
  optional :published_port, Integer, api_name: :PublishedPort

  # @!attribute publish_mode
  #   The mode in which port is published.
  #
  #   <p><br /></p>
  #
  #   - "ingress" makes the target port accessible on every node, regardless of
  #     whether there is a task for the service running on that node or not.
  #   - "host" bypasses the routing mesh and publish the port directly on the swarm
  #     node where that service is running.
  #
  #   @return [Symbol, DockerEngine::Models::Service::Endpoint::Port::PublishMode, nil]
  optional :publish_mode,
           enum: -> { DockerEngine::Service::Endpoint::Port::PublishMode },
           api_name: :PublishMode

  # @!attribute target_port
  #   The port inside the container.
  #
  #   @return [Integer, nil]
  optional :target_port, Integer, api_name: :TargetPort

  # @!method initialize(name: nil, protocol: nil, published_port: nil, publish_mode: nil, target_port: nil)
  #   Some parameter documentations has been truncated, see
  #   {DockerEngine::Models::Service::Endpoint::Port} for more details.
  #
  #   @param name [String]
  #
  #   @param protocol [Symbol, DockerEngine::Models::Service::Endpoint::Port::Protocol]
  #
  #   @param published_port [Integer] The port on the swarm hosts.
  #
  #   @param publish_mode [Symbol, DockerEngine::Models::Service::Endpoint::Port::PublishMode] The mode in which port is published.
  #
  #   @param target_port [Integer] The port inside the container.

  # @see DockerEngine::Models::Service::Endpoint::Port#protocol
  module Protocol
    extend DockerEngine::Internal::Type::Enum

    TCP = :tcp
    UDP = :udp
    SCTP = :sctp

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # The mode in which port is published.
  #
  # <p><br /></p>
  #
  # - "ingress" makes the target port accessible on every node, regardless of
  #   whether there is a task for the service running on that node or not.
  # - "host" bypasses the routing mesh and publish the port directly on the swarm
  #   node where that service is running.
  #
  # @see DockerEngine::Models::Service::Endpoint::Port#publish_mode
  module PublishMode
    extend DockerEngine::Internal::Type::Enum

    INGRESS = :ingress
    HOST = :host

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#name ⇒ String?

Returns:

  • (String, nil)


124
# File 'lib/docker_engine/models/service.rb', line 124

optional :name, String, api_name: :Name

#protocol ⇒ Symbol, ...



129
130
131
132
133
# File 'lib/docker_engine/models/service.rb', line 129

optional :protocol,
enum: -> {
  DockerEngine::Service::Endpoint::Port::Protocol
},
api_name: :Protocol

#publish_mode ⇒ Symbol, ...

The mode in which port is published.


  • "ingress" makes the target port accessible on every node, regardless of whether there is a task for the service running on that node or not.
  • "host" bypasses the routing mesh and publish the port directly on the swarm node where that service is running.


152
153
154
# File 'lib/docker_engine/models/service.rb', line 152

optional :publish_mode,
enum: -> { DockerEngine::Service::Endpoint::Port::PublishMode },
api_name: :PublishMode

#published_port ⇒ Integer?

The port on the swarm hosts.

Returns:

  • (Integer, nil)


139
# File 'lib/docker_engine/models/service.rb', line 139

optional :published_port, Integer, api_name: :PublishedPort

#target_port ⇒ Integer?

The port inside the container.

Returns:

  • (Integer, nil)


160
# File 'lib/docker_engine/models/service.rb', line 160

optional :target_port, Integer, api_name: :TargetPort

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/docker_engine/models/service.rb', line 184