docker-engine-ruby 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/docker_engine_ruby/models/config_list_response.rb +1 -1
  5. data/lib/docker_engine_ruby/models/config_object.rb +77 -0
  6. data/lib/docker_engine_ruby/models/config_spec.rb +68 -0
  7. data/lib/docker_engine_ruby/models/image_list_response.rb +1 -1
  8. data/lib/docker_engine_ruby/models/image_summary.rb +638 -0
  9. data/lib/docker_engine_ruby/models/info.rb +3 -3
  10. data/lib/docker_engine_ruby/models/network_create_response.rb +27 -0
  11. data/lib/docker_engine_ruby/models/network_list_response.rb +1 -1
  12. data/lib/docker_engine_ruby/models/network_summary.rb +260 -0
  13. data/lib/docker_engine_ruby/models/node.rb +3 -3
  14. data/lib/docker_engine_ruby/models/node_spec.rb +67 -0
  15. data/lib/docker_engine_ruby/models/secret.rb +3 -3
  16. data/lib/docker_engine_ruby/models/secret_spec.rb +99 -0
  17. data/lib/docker_engine_ruby/models/service.rb +3 -3
  18. data/lib/docker_engine_ruby/models/service_create_response.rb +32 -0
  19. data/lib/docker_engine_ruby/models/{spec.rb → service_spec.rb} +73 -67
  20. data/lib/docker_engine_ruby/models/service_update_response.rb +17 -0
  21. data/lib/docker_engine_ruby/models/swarm.rb +3 -3
  22. data/lib/docker_engine_ruby/models/swarm_init_params.rb +3 -3
  23. data/lib/docker_engine_ruby/models/swarm_spec.rb +270 -0
  24. data/lib/docker_engine_ruby/models/task.rb +3 -3
  25. data/lib/docker_engine_ruby/models/task_spec.rb +1439 -0
  26. data/lib/docker_engine_ruby/models.rb +23 -1
  27. data/lib/docker_engine_ruby/resources/configs.rb +6 -6
  28. data/lib/docker_engine_ruby/resources/images.rb +2 -2
  29. data/lib/docker_engine_ruby/resources/networks.rb +4 -4
  30. data/lib/docker_engine_ruby/resources/nodes.rb +1 -1
  31. data/lib/docker_engine_ruby/resources/secrets.rb +2 -2
  32. data/lib/docker_engine_ruby/resources/services.rb +6 -6
  33. data/lib/docker_engine_ruby/resources/swarm.rb +2 -2
  34. data/lib/docker_engine_ruby/version.rb +1 -1
  35. data/lib/docker_engine_ruby.rb +16 -5
  36. data/rbi/docker_engine_ruby/models/config_list_response.rbi +3 -1
  37. data/rbi/docker_engine_ruby/models/config_object.rbi +130 -0
  38. data/rbi/docker_engine_ruby/models/config_spec.rbi +127 -0
  39. data/rbi/docker_engine_ruby/models/image_list_response.rbi +3 -1
  40. data/rbi/docker_engine_ruby/models/image_summary.rbi +1073 -0
  41. data/rbi/docker_engine_ruby/models/info.rbi +4 -4
  42. data/rbi/docker_engine_ruby/models/network_create_response.rbi +37 -0
  43. data/rbi/docker_engine_ruby/models/network_list_response.rbi +3 -1
  44. data/rbi/docker_engine_ruby/models/network_summary.rbi +444 -0
  45. data/rbi/docker_engine_ruby/models/node.rbi +4 -4
  46. data/rbi/docker_engine_ruby/models/node_spec.rbi +126 -0
  47. data/rbi/docker_engine_ruby/models/secret.rbi +4 -4
  48. data/rbi/docker_engine_ruby/models/secret_spec.rbi +181 -0
  49. data/rbi/docker_engine_ruby/models/service.rbi +4 -4
  50. data/rbi/docker_engine_ruby/models/service_create_response.rbi +50 -0
  51. data/rbi/docker_engine_ruby/models/{spec.rbi → service_spec.rbi} +148 -104
  52. data/rbi/docker_engine_ruby/models/service_update_response.rbi +33 -0
  53. data/rbi/docker_engine_ruby/models/swarm.rbi +4 -4
  54. data/rbi/docker_engine_ruby/models/swarm_init_params.rbi +4 -4
  55. data/rbi/docker_engine_ruby/models/swarm_spec.rbi +568 -0
  56. data/rbi/docker_engine_ruby/models/task.rbi +4 -4
  57. data/rbi/docker_engine_ruby/models/task_spec.rbi +3011 -0
  58. data/rbi/docker_engine_ruby/models.rbi +23 -1
  59. data/rbi/docker_engine_ruby/resources/configs.rbi +4 -4
  60. data/rbi/docker_engine_ruby/resources/images.rbi +1 -1
  61. data/rbi/docker_engine_ruby/resources/networks.rbi +2 -2
  62. data/rbi/docker_engine_ruby/resources/nodes.rbi +1 -1
  63. data/rbi/docker_engine_ruby/resources/secrets.rbi +2 -2
  64. data/rbi/docker_engine_ruby/resources/services.rbi +4 -4
  65. data/rbi/docker_engine_ruby/resources/swarm.rbi +2 -2
  66. data/sig/docker_engine_ruby/models/config_list_response.rbs +1 -1
  67. data/sig/docker_engine_ruby/models/config_object.rbs +64 -0
  68. data/sig/docker_engine_ruby/models/config_spec.rbs +59 -0
  69. data/sig/docker_engine_ruby/models/image_list_response.rbs +1 -1
  70. data/sig/docker_engine_ruby/models/image_summary.rbs +457 -0
  71. data/sig/docker_engine_ruby/models/info.rbs +7 -5
  72. data/sig/docker_engine_ruby/models/network_create_response.rbs +15 -0
  73. data/sig/docker_engine_ruby/models/network_list_response.rbs +1 -1
  74. data/sig/docker_engine_ruby/models/network_summary.rbs +238 -0
  75. data/sig/docker_engine_ruby/models/node.rbs +5 -5
  76. data/sig/docker_engine_ruby/models/node_spec.rbs +70 -0
  77. data/sig/docker_engine_ruby/models/secret.rbs +5 -5
  78. data/sig/docker_engine_ruby/models/secret_spec.rbs +82 -0
  79. data/sig/docker_engine_ruby/models/service.rbs +7 -5
  80. data/sig/docker_engine_ruby/models/service_create_response.rbs +17 -0
  81. data/sig/docker_engine_ruby/models/{spec.rbs → service_spec.rbs} +107 -103
  82. data/sig/docker_engine_ruby/models/service_update_response.rbs +15 -0
  83. data/sig/docker_engine_ruby/models/swarm.rbs +5 -5
  84. data/sig/docker_engine_ruby/models/swarm_init_params.rbs +5 -5
  85. data/sig/docker_engine_ruby/models/swarm_spec.rbs +293 -0
  86. data/sig/docker_engine_ruby/models/task.rbs +5 -5
  87. data/sig/docker_engine_ruby/models/task_spec.rbs +1480 -0
  88. data/sig/docker_engine_ruby/models.rbs +23 -1
  89. data/sig/docker_engine_ruby/resources/configs.rbs +3 -3
  90. data/sig/docker_engine_ruby/resources/networks.rbs +1 -1
  91. data/sig/docker_engine_ruby/resources/nodes.rbs +1 -1
  92. data/sig/docker_engine_ruby/resources/secrets.rbs +2 -2
  93. data/sig/docker_engine_ruby/resources/services.rbs +4 -4
  94. data/sig/docker_engine_ruby/resources/swarm.rbs +2 -2
  95. metadata +37 -4
@@ -0,0 +1,3011 @@
1
+ # typed: strong
2
+
3
+ module DockerEngineRuby
4
+ module Models
5
+ class TaskSpec < DockerEngineRuby::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(DockerEngineRuby::TaskSpec, DockerEngineRuby::Internal::AnyHash)
9
+ end
10
+
11
+ # Container spec for the service.
12
+ #
13
+ # <p><br /></p>
14
+ #
15
+ # > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually
16
+ # > exclusive. PluginSpec is only used when the Runtime field is set to `plugin`.
17
+ # > NetworkAttachmentSpec is used when the Runtime field is set to `attachment`.
18
+ sig { returns(T.nilable(DockerEngineRuby::TaskSpec::ContainerSpec)) }
19
+ attr_reader :container_spec
20
+
21
+ sig do
22
+ params(
23
+ container_spec: DockerEngineRuby::TaskSpec::ContainerSpec::OrHash
24
+ ).void
25
+ end
26
+ attr_writer :container_spec
27
+
28
+ # A counter that triggers an update even if no relevant parameters have been
29
+ # changed.
30
+ sig { returns(T.nilable(Integer)) }
31
+ attr_reader :force_update
32
+
33
+ sig { params(force_update: Integer).void }
34
+ attr_writer :force_update
35
+
36
+ # Specifies the log driver to use for tasks created from this spec. If not
37
+ # present, the default one for the swarm will be used, finally falling back to the
38
+ # engine default if not specified.
39
+ sig { returns(T.nilable(DockerEngineRuby::TaskSpec::LogDriver)) }
40
+ attr_reader :log_driver
41
+
42
+ sig do
43
+ params(log_driver: DockerEngineRuby::TaskSpec::LogDriver::OrHash).void
44
+ end
45
+ attr_writer :log_driver
46
+
47
+ # Read-only spec type for non-swarm containers attached to swarm overlay networks.
48
+ #
49
+ # <p><br /></p>
50
+ #
51
+ # > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually
52
+ # > exclusive. PluginSpec is only used when the Runtime field is set to `plugin`.
53
+ # > NetworkAttachmentSpec is used when the Runtime field is set to `attachment`.
54
+ sig do
55
+ returns(T.nilable(DockerEngineRuby::TaskSpec::NetworkAttachmentSpec))
56
+ end
57
+ attr_reader :network_attachment_spec
58
+
59
+ sig do
60
+ params(
61
+ network_attachment_spec:
62
+ DockerEngineRuby::TaskSpec::NetworkAttachmentSpec::OrHash
63
+ ).void
64
+ end
65
+ attr_writer :network_attachment_spec
66
+
67
+ # Specifies which networks the service should attach to.
68
+ sig { returns(T.nilable(T::Array[DockerEngineRuby::TaskSpec::Network])) }
69
+ attr_reader :networks
70
+
71
+ sig do
72
+ params(
73
+ networks: T::Array[DockerEngineRuby::TaskSpec::Network::OrHash]
74
+ ).void
75
+ end
76
+ attr_writer :networks
77
+
78
+ sig { returns(T.nilable(DockerEngineRuby::TaskSpec::Placement)) }
79
+ attr_reader :placement
80
+
81
+ sig do
82
+ params(placement: DockerEngineRuby::TaskSpec::Placement::OrHash).void
83
+ end
84
+ attr_writer :placement
85
+
86
+ # Plugin spec for the service. _(Experimental release only.)_
87
+ #
88
+ # <p><br /></p>
89
+ #
90
+ # > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually
91
+ # > exclusive. PluginSpec is only used when the Runtime field is set to `plugin`.
92
+ # > NetworkAttachmentSpec is used when the Runtime field is set to `attachment`.
93
+ sig { returns(T.nilable(DockerEngineRuby::TaskSpec::PluginSpec)) }
94
+ attr_reader :plugin_spec
95
+
96
+ sig do
97
+ params(plugin_spec: DockerEngineRuby::TaskSpec::PluginSpec::OrHash).void
98
+ end
99
+ attr_writer :plugin_spec
100
+
101
+ # Resource requirements which apply to each individual container created as part
102
+ # of the service.
103
+ sig { returns(T.nilable(DockerEngineRuby::TaskSpec::Resources)) }
104
+ attr_reader :resources
105
+
106
+ sig do
107
+ params(resources: DockerEngineRuby::TaskSpec::Resources::OrHash).void
108
+ end
109
+ attr_writer :resources
110
+
111
+ # Specification for the restart policy which applies to containers created as part
112
+ # of this service.
113
+ sig { returns(T.nilable(DockerEngineRuby::TaskSpec::RestartPolicy)) }
114
+ attr_reader :restart_policy
115
+
116
+ sig do
117
+ params(
118
+ restart_policy: DockerEngineRuby::TaskSpec::RestartPolicy::OrHash
119
+ ).void
120
+ end
121
+ attr_writer :restart_policy
122
+
123
+ # Runtime is the type of runtime specified for the task executor.
124
+ sig { returns(T.nilable(String)) }
125
+ attr_reader :runtime
126
+
127
+ sig { params(runtime: String).void }
128
+ attr_writer :runtime
129
+
130
+ # User modifiable task configuration.
131
+ sig do
132
+ params(
133
+ container_spec: DockerEngineRuby::TaskSpec::ContainerSpec::OrHash,
134
+ force_update: Integer,
135
+ log_driver: DockerEngineRuby::TaskSpec::LogDriver::OrHash,
136
+ network_attachment_spec:
137
+ DockerEngineRuby::TaskSpec::NetworkAttachmentSpec::OrHash,
138
+ networks: T::Array[DockerEngineRuby::TaskSpec::Network::OrHash],
139
+ placement: DockerEngineRuby::TaskSpec::Placement::OrHash,
140
+ plugin_spec: DockerEngineRuby::TaskSpec::PluginSpec::OrHash,
141
+ resources: DockerEngineRuby::TaskSpec::Resources::OrHash,
142
+ restart_policy: DockerEngineRuby::TaskSpec::RestartPolicy::OrHash,
143
+ runtime: String
144
+ ).returns(T.attached_class)
145
+ end
146
+ def self.new(
147
+ # Container spec for the service.
148
+ #
149
+ # <p><br /></p>
150
+ #
151
+ # > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually
152
+ # > exclusive. PluginSpec is only used when the Runtime field is set to `plugin`.
153
+ # > NetworkAttachmentSpec is used when the Runtime field is set to `attachment`.
154
+ container_spec: nil,
155
+ # A counter that triggers an update even if no relevant parameters have been
156
+ # changed.
157
+ force_update: nil,
158
+ # Specifies the log driver to use for tasks created from this spec. If not
159
+ # present, the default one for the swarm will be used, finally falling back to the
160
+ # engine default if not specified.
161
+ log_driver: nil,
162
+ # Read-only spec type for non-swarm containers attached to swarm overlay networks.
163
+ #
164
+ # <p><br /></p>
165
+ #
166
+ # > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually
167
+ # > exclusive. PluginSpec is only used when the Runtime field is set to `plugin`.
168
+ # > NetworkAttachmentSpec is used when the Runtime field is set to `attachment`.
169
+ network_attachment_spec: nil,
170
+ # Specifies which networks the service should attach to.
171
+ networks: nil,
172
+ placement: nil,
173
+ # Plugin spec for the service. _(Experimental release only.)_
174
+ #
175
+ # <p><br /></p>
176
+ #
177
+ # > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually
178
+ # > exclusive. PluginSpec is only used when the Runtime field is set to `plugin`.
179
+ # > NetworkAttachmentSpec is used when the Runtime field is set to `attachment`.
180
+ plugin_spec: nil,
181
+ # Resource requirements which apply to each individual container created as part
182
+ # of the service.
183
+ resources: nil,
184
+ # Specification for the restart policy which applies to containers created as part
185
+ # of this service.
186
+ restart_policy: nil,
187
+ # Runtime is the type of runtime specified for the task executor.
188
+ runtime: nil
189
+ )
190
+ end
191
+
192
+ sig do
193
+ override.returns(
194
+ {
195
+ container_spec: DockerEngineRuby::TaskSpec::ContainerSpec,
196
+ force_update: Integer,
197
+ log_driver: DockerEngineRuby::TaskSpec::LogDriver,
198
+ network_attachment_spec:
199
+ DockerEngineRuby::TaskSpec::NetworkAttachmentSpec,
200
+ networks: T::Array[DockerEngineRuby::TaskSpec::Network],
201
+ placement: DockerEngineRuby::TaskSpec::Placement,
202
+ plugin_spec: DockerEngineRuby::TaskSpec::PluginSpec,
203
+ resources: DockerEngineRuby::TaskSpec::Resources,
204
+ restart_policy: DockerEngineRuby::TaskSpec::RestartPolicy,
205
+ runtime: String
206
+ }
207
+ )
208
+ end
209
+ def to_hash
210
+ end
211
+
212
+ class ContainerSpec < DockerEngineRuby::Internal::Type::BaseModel
213
+ OrHash =
214
+ T.type_alias do
215
+ T.any(
216
+ DockerEngineRuby::TaskSpec::ContainerSpec,
217
+ DockerEngineRuby::Internal::AnyHash
218
+ )
219
+ end
220
+
221
+ sig { returns(T.nilable(T::Array[String])) }
222
+ attr_reader :args
223
+
224
+ sig { params(args: T::Array[String]).void }
225
+ attr_writer :args
226
+
227
+ sig { returns(T.nilable(T::Array[String])) }
228
+ attr_reader :capability_add
229
+
230
+ sig { params(capability_add: T::Array[String]).void }
231
+ attr_writer :capability_add
232
+
233
+ sig { returns(T.nilable(T::Array[String])) }
234
+ attr_reader :capability_drop
235
+
236
+ sig { params(capability_drop: T::Array[String]).void }
237
+ attr_writer :capability_drop
238
+
239
+ sig { returns(T.nilable(T::Array[String])) }
240
+ attr_reader :command
241
+
242
+ sig { params(command: T::Array[String]).void }
243
+ attr_writer :command
244
+
245
+ sig do
246
+ returns(
247
+ T.nilable(
248
+ T::Array[DockerEngineRuby::TaskSpec::ContainerSpec::Config]
249
+ )
250
+ )
251
+ end
252
+ attr_reader :configs
253
+
254
+ sig do
255
+ params(
256
+ configs:
257
+ T::Array[
258
+ DockerEngineRuby::TaskSpec::ContainerSpec::Config::OrHash
259
+ ]
260
+ ).void
261
+ end
262
+ attr_writer :configs
263
+
264
+ sig { returns(T.nilable(String)) }
265
+ attr_reader :dir
266
+
267
+ sig { params(dir: String).void }
268
+ attr_writer :dir
269
+
270
+ sig do
271
+ returns(
272
+ T.nilable(DockerEngineRuby::TaskSpec::ContainerSpec::DNSConfig)
273
+ )
274
+ end
275
+ attr_reader :dns_config
276
+
277
+ sig do
278
+ params(
279
+ dns_config:
280
+ DockerEngineRuby::TaskSpec::ContainerSpec::DNSConfig::OrHash
281
+ ).void
282
+ end
283
+ attr_writer :dns_config
284
+
285
+ sig { returns(T.nilable(T::Array[String])) }
286
+ attr_reader :env
287
+
288
+ sig { params(env: T::Array[String]).void }
289
+ attr_writer :env
290
+
291
+ sig { returns(T.nilable(T::Array[String])) }
292
+ attr_reader :groups
293
+
294
+ sig { params(groups: T::Array[String]).void }
295
+ attr_writer :groups
296
+
297
+ # A test to perform to check that the container is healthy. Healthcheck commands
298
+ # should be side-effect free.
299
+ sig do
300
+ returns(
301
+ T.nilable(DockerEngineRuby::TaskSpec::ContainerSpec::HealthCheck)
302
+ )
303
+ end
304
+ attr_reader :health_check
305
+
306
+ sig do
307
+ params(
308
+ health_check:
309
+ DockerEngineRuby::TaskSpec::ContainerSpec::HealthCheck::OrHash
310
+ ).void
311
+ end
312
+ attr_writer :health_check
313
+
314
+ sig { returns(T.nilable(String)) }
315
+ attr_reader :hostname
316
+
317
+ sig { params(hostname: String).void }
318
+ attr_writer :hostname
319
+
320
+ sig { returns(T.nilable(T::Array[String])) }
321
+ attr_reader :hosts
322
+
323
+ sig { params(hosts: T::Array[String]).void }
324
+ attr_writer :hosts
325
+
326
+ sig { returns(T.nilable(String)) }
327
+ attr_reader :image
328
+
329
+ sig { params(image: String).void }
330
+ attr_writer :image
331
+
332
+ sig { returns(T.nilable(T::Boolean)) }
333
+ attr_accessor :init
334
+
335
+ sig do
336
+ returns(
337
+ T.nilable(
338
+ DockerEngineRuby::TaskSpec::ContainerSpec::Isolation::OrSymbol
339
+ )
340
+ )
341
+ end
342
+ attr_reader :isolation
343
+
344
+ sig do
345
+ params(
346
+ isolation:
347
+ DockerEngineRuby::TaskSpec::ContainerSpec::Isolation::OrSymbol
348
+ ).void
349
+ end
350
+ attr_writer :isolation
351
+
352
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
353
+ attr_reader :labels
354
+
355
+ sig { params(labels: T::Hash[Symbol, String]).void }
356
+ attr_writer :labels
357
+
358
+ sig do
359
+ returns(
360
+ T.nilable(
361
+ T::Array[DockerEngineRuby::TaskSpec::ContainerSpec::Mount]
362
+ )
363
+ )
364
+ end
365
+ attr_reader :mounts
366
+
367
+ sig do
368
+ params(
369
+ mounts:
370
+ T::Array[DockerEngineRuby::TaskSpec::ContainerSpec::Mount::OrHash]
371
+ ).void
372
+ end
373
+ attr_writer :mounts
374
+
375
+ sig { returns(T.nilable(Integer)) }
376
+ attr_reader :oom_score_adj
377
+
378
+ sig { params(oom_score_adj: Integer).void }
379
+ attr_writer :oom_score_adj
380
+
381
+ sig { returns(T.nilable(T::Boolean)) }
382
+ attr_reader :open_stdin
383
+
384
+ sig { params(open_stdin: T::Boolean).void }
385
+ attr_writer :open_stdin
386
+
387
+ sig do
388
+ returns(
389
+ T.nilable(DockerEngineRuby::TaskSpec::ContainerSpec::Privileges)
390
+ )
391
+ end
392
+ attr_reader :privileges
393
+
394
+ sig do
395
+ params(
396
+ privileges:
397
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::OrHash
398
+ ).void
399
+ end
400
+ attr_writer :privileges
401
+
402
+ sig { returns(T.nilable(T::Boolean)) }
403
+ attr_reader :read_only
404
+
405
+ sig { params(read_only: T::Boolean).void }
406
+ attr_writer :read_only
407
+
408
+ sig do
409
+ returns(
410
+ T.nilable(
411
+ T::Array[DockerEngineRuby::TaskSpec::ContainerSpec::Secret]
412
+ )
413
+ )
414
+ end
415
+ attr_reader :secrets
416
+
417
+ sig do
418
+ params(
419
+ secrets:
420
+ T::Array[
421
+ DockerEngineRuby::TaskSpec::ContainerSpec::Secret::OrHash
422
+ ]
423
+ ).void
424
+ end
425
+ attr_writer :secrets
426
+
427
+ sig { returns(T.nilable(Integer)) }
428
+ attr_reader :stop_grace_period
429
+
430
+ sig { params(stop_grace_period: Integer).void }
431
+ attr_writer :stop_grace_period
432
+
433
+ sig { returns(T.nilable(String)) }
434
+ attr_reader :stop_signal
435
+
436
+ sig { params(stop_signal: String).void }
437
+ attr_writer :stop_signal
438
+
439
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
440
+ attr_reader :sysctls
441
+
442
+ sig { params(sysctls: T::Hash[Symbol, String]).void }
443
+ attr_writer :sysctls
444
+
445
+ sig { returns(T.nilable(T::Boolean)) }
446
+ attr_reader :tty
447
+
448
+ sig { params(tty: T::Boolean).void }
449
+ attr_writer :tty
450
+
451
+ sig do
452
+ returns(
453
+ T.nilable(
454
+ T::Array[DockerEngineRuby::TaskSpec::ContainerSpec::Ulimit]
455
+ )
456
+ )
457
+ end
458
+ attr_reader :ulimits
459
+
460
+ sig do
461
+ params(
462
+ ulimits:
463
+ T::Array[
464
+ DockerEngineRuby::TaskSpec::ContainerSpec::Ulimit::OrHash
465
+ ]
466
+ ).void
467
+ end
468
+ attr_writer :ulimits
469
+
470
+ sig { returns(T.nilable(String)) }
471
+ attr_reader :user
472
+
473
+ sig { params(user: String).void }
474
+ attr_writer :user
475
+
476
+ # Container spec for the service.
477
+ #
478
+ # <p><br /></p>
479
+ #
480
+ # > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually
481
+ # > exclusive. PluginSpec is only used when the Runtime field is set to `plugin`.
482
+ # > NetworkAttachmentSpec is used when the Runtime field is set to `attachment`.
483
+ sig do
484
+ params(
485
+ args: T::Array[String],
486
+ capability_add: T::Array[String],
487
+ capability_drop: T::Array[String],
488
+ command: T::Array[String],
489
+ configs:
490
+ T::Array[
491
+ DockerEngineRuby::TaskSpec::ContainerSpec::Config::OrHash
492
+ ],
493
+ dir: String,
494
+ dns_config:
495
+ DockerEngineRuby::TaskSpec::ContainerSpec::DNSConfig::OrHash,
496
+ env: T::Array[String],
497
+ groups: T::Array[String],
498
+ health_check:
499
+ DockerEngineRuby::TaskSpec::ContainerSpec::HealthCheck::OrHash,
500
+ hostname: String,
501
+ hosts: T::Array[String],
502
+ image: String,
503
+ init: T.nilable(T::Boolean),
504
+ isolation:
505
+ DockerEngineRuby::TaskSpec::ContainerSpec::Isolation::OrSymbol,
506
+ labels: T::Hash[Symbol, String],
507
+ mounts:
508
+ T::Array[
509
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::OrHash
510
+ ],
511
+ oom_score_adj: Integer,
512
+ open_stdin: T::Boolean,
513
+ privileges:
514
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::OrHash,
515
+ read_only: T::Boolean,
516
+ secrets:
517
+ T::Array[
518
+ DockerEngineRuby::TaskSpec::ContainerSpec::Secret::OrHash
519
+ ],
520
+ stop_grace_period: Integer,
521
+ stop_signal: String,
522
+ sysctls: T::Hash[Symbol, String],
523
+ tty: T::Boolean,
524
+ ulimits:
525
+ T::Array[
526
+ DockerEngineRuby::TaskSpec::ContainerSpec::Ulimit::OrHash
527
+ ],
528
+ user: String
529
+ ).returns(T.attached_class)
530
+ end
531
+ def self.new(
532
+ args: nil,
533
+ capability_add: nil,
534
+ capability_drop: nil,
535
+ command: nil,
536
+ configs: nil,
537
+ dir: nil,
538
+ dns_config: nil,
539
+ env: nil,
540
+ groups: nil,
541
+ # A test to perform to check that the container is healthy. Healthcheck commands
542
+ # should be side-effect free.
543
+ health_check: nil,
544
+ hostname: nil,
545
+ hosts: nil,
546
+ image: nil,
547
+ init: nil,
548
+ isolation: nil,
549
+ labels: nil,
550
+ mounts: nil,
551
+ oom_score_adj: nil,
552
+ open_stdin: nil,
553
+ privileges: nil,
554
+ read_only: nil,
555
+ secrets: nil,
556
+ stop_grace_period: nil,
557
+ stop_signal: nil,
558
+ sysctls: nil,
559
+ tty: nil,
560
+ ulimits: nil,
561
+ user: nil
562
+ )
563
+ end
564
+
565
+ sig do
566
+ override.returns(
567
+ {
568
+ args: T::Array[String],
569
+ capability_add: T::Array[String],
570
+ capability_drop: T::Array[String],
571
+ command: T::Array[String],
572
+ configs:
573
+ T::Array[DockerEngineRuby::TaskSpec::ContainerSpec::Config],
574
+ dir: String,
575
+ dns_config: DockerEngineRuby::TaskSpec::ContainerSpec::DNSConfig,
576
+ env: T::Array[String],
577
+ groups: T::Array[String],
578
+ health_check:
579
+ DockerEngineRuby::TaskSpec::ContainerSpec::HealthCheck,
580
+ hostname: String,
581
+ hosts: T::Array[String],
582
+ image: String,
583
+ init: T.nilable(T::Boolean),
584
+ isolation:
585
+ DockerEngineRuby::TaskSpec::ContainerSpec::Isolation::OrSymbol,
586
+ labels: T::Hash[Symbol, String],
587
+ mounts:
588
+ T::Array[DockerEngineRuby::TaskSpec::ContainerSpec::Mount],
589
+ oom_score_adj: Integer,
590
+ open_stdin: T::Boolean,
591
+ privileges: DockerEngineRuby::TaskSpec::ContainerSpec::Privileges,
592
+ read_only: T::Boolean,
593
+ secrets:
594
+ T::Array[DockerEngineRuby::TaskSpec::ContainerSpec::Secret],
595
+ stop_grace_period: Integer,
596
+ stop_signal: String,
597
+ sysctls: T::Hash[Symbol, String],
598
+ tty: T::Boolean,
599
+ ulimits:
600
+ T::Array[DockerEngineRuby::TaskSpec::ContainerSpec::Ulimit],
601
+ user: String
602
+ }
603
+ )
604
+ end
605
+ def to_hash
606
+ end
607
+
608
+ class Config < DockerEngineRuby::Internal::Type::BaseModel
609
+ OrHash =
610
+ T.type_alias do
611
+ T.any(
612
+ DockerEngineRuby::TaskSpec::ContainerSpec::Config,
613
+ DockerEngineRuby::Internal::AnyHash
614
+ )
615
+ end
616
+
617
+ sig { returns(T.nilable(String)) }
618
+ attr_reader :config_id
619
+
620
+ sig { params(config_id: String).void }
621
+ attr_writer :config_id
622
+
623
+ sig { returns(T.nilable(String)) }
624
+ attr_reader :config_name
625
+
626
+ sig { params(config_name: String).void }
627
+ attr_writer :config_name
628
+
629
+ sig do
630
+ returns(
631
+ T.nilable(DockerEngineRuby::TaskSpec::ContainerSpec::Config::File)
632
+ )
633
+ end
634
+ attr_reader :file
635
+
636
+ sig do
637
+ params(
638
+ file:
639
+ DockerEngineRuby::TaskSpec::ContainerSpec::Config::File::OrHash
640
+ ).void
641
+ end
642
+ attr_writer :file
643
+
644
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
645
+ attr_reader :runtime
646
+
647
+ sig { params(runtime: T::Hash[Symbol, T.anything]).void }
648
+ attr_writer :runtime
649
+
650
+ sig do
651
+ params(
652
+ config_id: String,
653
+ config_name: String,
654
+ file:
655
+ DockerEngineRuby::TaskSpec::ContainerSpec::Config::File::OrHash,
656
+ runtime: T::Hash[Symbol, T.anything]
657
+ ).returns(T.attached_class)
658
+ end
659
+ def self.new(
660
+ config_id: nil,
661
+ config_name: nil,
662
+ file: nil,
663
+ runtime: nil
664
+ )
665
+ end
666
+
667
+ sig do
668
+ override.returns(
669
+ {
670
+ config_id: String,
671
+ config_name: String,
672
+ file: DockerEngineRuby::TaskSpec::ContainerSpec::Config::File,
673
+ runtime: T::Hash[Symbol, T.anything]
674
+ }
675
+ )
676
+ end
677
+ def to_hash
678
+ end
679
+
680
+ class File < DockerEngineRuby::Internal::Type::BaseModel
681
+ OrHash =
682
+ T.type_alias do
683
+ T.any(
684
+ DockerEngineRuby::TaskSpec::ContainerSpec::Config::File,
685
+ DockerEngineRuby::Internal::AnyHash
686
+ )
687
+ end
688
+
689
+ sig { returns(T.nilable(String)) }
690
+ attr_reader :gid
691
+
692
+ sig { params(gid: String).void }
693
+ attr_writer :gid
694
+
695
+ sig { returns(T.nilable(Integer)) }
696
+ attr_reader :mode
697
+
698
+ sig { params(mode: Integer).void }
699
+ attr_writer :mode
700
+
701
+ sig { returns(T.nilable(String)) }
702
+ attr_reader :name
703
+
704
+ sig { params(name: String).void }
705
+ attr_writer :name
706
+
707
+ sig { returns(T.nilable(String)) }
708
+ attr_reader :uid
709
+
710
+ sig { params(uid: String).void }
711
+ attr_writer :uid
712
+
713
+ sig do
714
+ params(
715
+ gid: String,
716
+ mode: Integer,
717
+ name: String,
718
+ uid: String
719
+ ).returns(T.attached_class)
720
+ end
721
+ def self.new(gid: nil, mode: nil, name: nil, uid: nil)
722
+ end
723
+
724
+ sig do
725
+ override.returns(
726
+ { gid: String, mode: Integer, name: String, uid: String }
727
+ )
728
+ end
729
+ def to_hash
730
+ end
731
+ end
732
+ end
733
+
734
+ class DNSConfig < DockerEngineRuby::Internal::Type::BaseModel
735
+ OrHash =
736
+ T.type_alias do
737
+ T.any(
738
+ DockerEngineRuby::TaskSpec::ContainerSpec::DNSConfig,
739
+ DockerEngineRuby::Internal::AnyHash
740
+ )
741
+ end
742
+
743
+ sig { returns(T.nilable(T::Array[String])) }
744
+ attr_reader :nameservers
745
+
746
+ sig { params(nameservers: T::Array[String]).void }
747
+ attr_writer :nameservers
748
+
749
+ sig { returns(T.nilable(T::Array[String])) }
750
+ attr_reader :options
751
+
752
+ sig { params(options: T::Array[String]).void }
753
+ attr_writer :options
754
+
755
+ sig { returns(T.nilable(T::Array[String])) }
756
+ attr_reader :search
757
+
758
+ sig { params(search: T::Array[String]).void }
759
+ attr_writer :search
760
+
761
+ sig do
762
+ params(
763
+ nameservers: T::Array[String],
764
+ options: T::Array[String],
765
+ search: T::Array[String]
766
+ ).returns(T.attached_class)
767
+ end
768
+ def self.new(nameservers: nil, options: nil, search: nil)
769
+ end
770
+
771
+ sig do
772
+ override.returns(
773
+ {
774
+ nameservers: T::Array[String],
775
+ options: T::Array[String],
776
+ search: T::Array[String]
777
+ }
778
+ )
779
+ end
780
+ def to_hash
781
+ end
782
+ end
783
+
784
+ class HealthCheck < DockerEngineRuby::Internal::Type::BaseModel
785
+ OrHash =
786
+ T.type_alias do
787
+ T.any(
788
+ DockerEngineRuby::TaskSpec::ContainerSpec::HealthCheck,
789
+ DockerEngineRuby::Internal::AnyHash
790
+ )
791
+ end
792
+
793
+ # The time to wait between checks in nanoseconds. It should be 0 or at least
794
+ # 1000000 (1 ms). 0 means inherit.
795
+ sig { returns(T.nilable(Integer)) }
796
+ attr_reader :interval
797
+
798
+ sig { params(interval: Integer).void }
799
+ attr_writer :interval
800
+
801
+ # The number of consecutive failures needed to consider a container as unhealthy.
802
+ # 0 means inherit.
803
+ sig { returns(T.nilable(Integer)) }
804
+ attr_reader :retries
805
+
806
+ sig { params(retries: Integer).void }
807
+ attr_writer :retries
808
+
809
+ # The time to wait between checks in nanoseconds during the start period. It
810
+ # should be 0 or at least 1000000 (1 ms). 0 means inherit.
811
+ sig { returns(T.nilable(Integer)) }
812
+ attr_reader :start_interval
813
+
814
+ sig { params(start_interval: Integer).void }
815
+ attr_writer :start_interval
816
+
817
+ # Start period for the container to initialize before starting health-retries
818
+ # countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means
819
+ # inherit.
820
+ sig { returns(T.nilable(Integer)) }
821
+ attr_reader :start_period
822
+
823
+ sig { params(start_period: Integer).void }
824
+ attr_writer :start_period
825
+
826
+ # The test to perform. Possible values are:
827
+ #
828
+ # - `[]` inherit healthcheck from image or parent image
829
+ # - `["NONE"]` disable healthcheck
830
+ # - `["CMD", args...]` exec arguments directly
831
+ # - `["CMD-SHELL", command]` run command with system's default shell
832
+ #
833
+ # A non-zero exit code indicates a failed healthcheck:
834
+ #
835
+ # - `0` healthy
836
+ # - `1` unhealthy
837
+ # - `2` reserved (treated as unhealthy)
838
+ # - other values: error running probe
839
+ sig { returns(T.nilable(T::Array[String])) }
840
+ attr_reader :test_
841
+
842
+ sig { params(test_: T::Array[String]).void }
843
+ attr_writer :test_
844
+
845
+ # The time to wait before considering the check to have hung. It should be 0 or at
846
+ # least 1000000 (1 ms). 0 means inherit.
847
+ #
848
+ # If the health check command does not complete within this timeout, the check is
849
+ # considered failed and the health check process is forcibly terminated without a
850
+ # graceful shutdown.
851
+ sig { returns(T.nilable(Integer)) }
852
+ attr_reader :timeout
853
+
854
+ sig { params(timeout: Integer).void }
855
+ attr_writer :timeout
856
+
857
+ # A test to perform to check that the container is healthy. Healthcheck commands
858
+ # should be side-effect free.
859
+ sig do
860
+ params(
861
+ interval: Integer,
862
+ retries: Integer,
863
+ start_interval: Integer,
864
+ start_period: Integer,
865
+ test_: T::Array[String],
866
+ timeout: Integer
867
+ ).returns(T.attached_class)
868
+ end
869
+ def self.new(
870
+ # The time to wait between checks in nanoseconds. It should be 0 or at least
871
+ # 1000000 (1 ms). 0 means inherit.
872
+ interval: nil,
873
+ # The number of consecutive failures needed to consider a container as unhealthy.
874
+ # 0 means inherit.
875
+ retries: nil,
876
+ # The time to wait between checks in nanoseconds during the start period. It
877
+ # should be 0 or at least 1000000 (1 ms). 0 means inherit.
878
+ start_interval: nil,
879
+ # Start period for the container to initialize before starting health-retries
880
+ # countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means
881
+ # inherit.
882
+ start_period: nil,
883
+ # The test to perform. Possible values are:
884
+ #
885
+ # - `[]` inherit healthcheck from image or parent image
886
+ # - `["NONE"]` disable healthcheck
887
+ # - `["CMD", args...]` exec arguments directly
888
+ # - `["CMD-SHELL", command]` run command with system's default shell
889
+ #
890
+ # A non-zero exit code indicates a failed healthcheck:
891
+ #
892
+ # - `0` healthy
893
+ # - `1` unhealthy
894
+ # - `2` reserved (treated as unhealthy)
895
+ # - other values: error running probe
896
+ test_: nil,
897
+ # The time to wait before considering the check to have hung. It should be 0 or at
898
+ # least 1000000 (1 ms). 0 means inherit.
899
+ #
900
+ # If the health check command does not complete within this timeout, the check is
901
+ # considered failed and the health check process is forcibly terminated without a
902
+ # graceful shutdown.
903
+ timeout: nil
904
+ )
905
+ end
906
+
907
+ sig do
908
+ override.returns(
909
+ {
910
+ interval: Integer,
911
+ retries: Integer,
912
+ start_interval: Integer,
913
+ start_period: Integer,
914
+ test_: T::Array[String],
915
+ timeout: Integer
916
+ }
917
+ )
918
+ end
919
+ def to_hash
920
+ end
921
+ end
922
+
923
+ module Isolation
924
+ extend DockerEngineRuby::Internal::Type::Enum
925
+
926
+ TaggedSymbol =
927
+ T.type_alias do
928
+ T.all(
929
+ Symbol,
930
+ DockerEngineRuby::TaskSpec::ContainerSpec::Isolation
931
+ )
932
+ end
933
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
934
+
935
+ DEFAULT =
936
+ T.let(
937
+ :default,
938
+ DockerEngineRuby::TaskSpec::ContainerSpec::Isolation::TaggedSymbol
939
+ )
940
+ PROCESS =
941
+ T.let(
942
+ :process,
943
+ DockerEngineRuby::TaskSpec::ContainerSpec::Isolation::TaggedSymbol
944
+ )
945
+ HYPERV =
946
+ T.let(
947
+ :hyperv,
948
+ DockerEngineRuby::TaskSpec::ContainerSpec::Isolation::TaggedSymbol
949
+ )
950
+ EMPTY =
951
+ T.let(
952
+ :"",
953
+ DockerEngineRuby::TaskSpec::ContainerSpec::Isolation::TaggedSymbol
954
+ )
955
+
956
+ sig do
957
+ override.returns(
958
+ T::Array[
959
+ DockerEngineRuby::TaskSpec::ContainerSpec::Isolation::TaggedSymbol
960
+ ]
961
+ )
962
+ end
963
+ def self.values
964
+ end
965
+ end
966
+
967
+ class Mount < DockerEngineRuby::Internal::Type::BaseModel
968
+ OrHash =
969
+ T.type_alias do
970
+ T.any(
971
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount,
972
+ DockerEngineRuby::Internal::AnyHash
973
+ )
974
+ end
975
+
976
+ # Optional configuration for the `bind` type.
977
+ sig do
978
+ returns(
979
+ T.nilable(
980
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions
981
+ )
982
+ )
983
+ end
984
+ attr_reader :bind_options
985
+
986
+ sig do
987
+ params(
988
+ bind_options:
989
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::OrHash
990
+ ).void
991
+ end
992
+ attr_writer :bind_options
993
+
994
+ # The consistency requirement for the mount: `default`, `consistent`, `cached`, or
995
+ # `delegated`.
996
+ sig { returns(T.nilable(String)) }
997
+ attr_reader :consistency
998
+
999
+ sig { params(consistency: String).void }
1000
+ attr_writer :consistency
1001
+
1002
+ # Optional configuration for the `image` type.
1003
+ sig do
1004
+ returns(
1005
+ T.nilable(
1006
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::ImageOptions
1007
+ )
1008
+ )
1009
+ end
1010
+ attr_reader :image_options
1011
+
1012
+ sig do
1013
+ params(
1014
+ image_options:
1015
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::ImageOptions::OrHash
1016
+ ).void
1017
+ end
1018
+ attr_writer :image_options
1019
+
1020
+ # Whether the mount should be read-only.
1021
+ sig { returns(T.nilable(T::Boolean)) }
1022
+ attr_reader :read_only
1023
+
1024
+ sig { params(read_only: T::Boolean).void }
1025
+ attr_writer :read_only
1026
+
1027
+ # Mount source (e.g. a volume name, a host path). The source cannot be specified
1028
+ # when using `Type=tmpfs`. For `Type=bind`, the source path must either exist, or
1029
+ # the `CreateMountpoint` must be set to `true` to create the source path on the
1030
+ # host if missing.
1031
+ #
1032
+ # For `Type=npipe`, the pipe must exist prior to creating the container.
1033
+ sig { returns(T.nilable(String)) }
1034
+ attr_reader :source
1035
+
1036
+ sig { params(source: String).void }
1037
+ attr_writer :source
1038
+
1039
+ # Container path.
1040
+ sig { returns(T.nilable(String)) }
1041
+ attr_reader :target
1042
+
1043
+ sig { params(target: String).void }
1044
+ attr_writer :target
1045
+
1046
+ # Optional configuration for the `tmpfs` type.
1047
+ sig do
1048
+ returns(
1049
+ T.nilable(
1050
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::TmpfsOptions
1051
+ )
1052
+ )
1053
+ end
1054
+ attr_reader :tmpfs_options
1055
+
1056
+ sig do
1057
+ params(
1058
+ tmpfs_options:
1059
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::TmpfsOptions::OrHash
1060
+ ).void
1061
+ end
1062
+ attr_writer :tmpfs_options
1063
+
1064
+ # The mount type. Available types:
1065
+ #
1066
+ # - `bind` a mount of a file or directory from the host into the container.
1067
+ # - `cluster` a Swarm cluster volume.
1068
+ # - `image` an OCI image.
1069
+ # - `npipe` a named pipe from the host into the container.
1070
+ # - `tmpfs` a `tmpfs`.
1071
+ # - `volume` a docker volume with the given `Name`.
1072
+ sig do
1073
+ returns(
1074
+ T.nilable(
1075
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type::OrSymbol
1076
+ )
1077
+ )
1078
+ end
1079
+ attr_reader :type
1080
+
1081
+ sig do
1082
+ params(
1083
+ type:
1084
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type::OrSymbol
1085
+ ).void
1086
+ end
1087
+ attr_writer :type
1088
+
1089
+ # Optional configuration for the `volume` type.
1090
+ sig do
1091
+ returns(
1092
+ T.nilable(
1093
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::VolumeOptions
1094
+ )
1095
+ )
1096
+ end
1097
+ attr_reader :volume_options
1098
+
1099
+ sig do
1100
+ params(
1101
+ volume_options:
1102
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::VolumeOptions::OrHash
1103
+ ).void
1104
+ end
1105
+ attr_writer :volume_options
1106
+
1107
+ sig do
1108
+ params(
1109
+ bind_options:
1110
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::OrHash,
1111
+ consistency: String,
1112
+ image_options:
1113
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::ImageOptions::OrHash,
1114
+ read_only: T::Boolean,
1115
+ source: String,
1116
+ target: String,
1117
+ tmpfs_options:
1118
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::TmpfsOptions::OrHash,
1119
+ type:
1120
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type::OrSymbol,
1121
+ volume_options:
1122
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::VolumeOptions::OrHash
1123
+ ).returns(T.attached_class)
1124
+ end
1125
+ def self.new(
1126
+ # Optional configuration for the `bind` type.
1127
+ bind_options: nil,
1128
+ # The consistency requirement for the mount: `default`, `consistent`, `cached`, or
1129
+ # `delegated`.
1130
+ consistency: nil,
1131
+ # Optional configuration for the `image` type.
1132
+ image_options: nil,
1133
+ # Whether the mount should be read-only.
1134
+ read_only: nil,
1135
+ # Mount source (e.g. a volume name, a host path). The source cannot be specified
1136
+ # when using `Type=tmpfs`. For `Type=bind`, the source path must either exist, or
1137
+ # the `CreateMountpoint` must be set to `true` to create the source path on the
1138
+ # host if missing.
1139
+ #
1140
+ # For `Type=npipe`, the pipe must exist prior to creating the container.
1141
+ source: nil,
1142
+ # Container path.
1143
+ target: nil,
1144
+ # Optional configuration for the `tmpfs` type.
1145
+ tmpfs_options: nil,
1146
+ # The mount type. Available types:
1147
+ #
1148
+ # - `bind` a mount of a file or directory from the host into the container.
1149
+ # - `cluster` a Swarm cluster volume.
1150
+ # - `image` an OCI image.
1151
+ # - `npipe` a named pipe from the host into the container.
1152
+ # - `tmpfs` a `tmpfs`.
1153
+ # - `volume` a docker volume with the given `Name`.
1154
+ type: nil,
1155
+ # Optional configuration for the `volume` type.
1156
+ volume_options: nil
1157
+ )
1158
+ end
1159
+
1160
+ sig do
1161
+ override.returns(
1162
+ {
1163
+ bind_options:
1164
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions,
1165
+ consistency: String,
1166
+ image_options:
1167
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::ImageOptions,
1168
+ read_only: T::Boolean,
1169
+ source: String,
1170
+ target: String,
1171
+ tmpfs_options:
1172
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::TmpfsOptions,
1173
+ type:
1174
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type::OrSymbol,
1175
+ volume_options:
1176
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::VolumeOptions
1177
+ }
1178
+ )
1179
+ end
1180
+ def to_hash
1181
+ end
1182
+
1183
+ class BindOptions < DockerEngineRuby::Internal::Type::BaseModel
1184
+ OrHash =
1185
+ T.type_alias do
1186
+ T.any(
1187
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions,
1188
+ DockerEngineRuby::Internal::AnyHash
1189
+ )
1190
+ end
1191
+
1192
+ sig { returns(T.nilable(T::Boolean)) }
1193
+ attr_reader :create_mountpoint
1194
+
1195
+ sig { params(create_mountpoint: T::Boolean).void }
1196
+ attr_writer :create_mountpoint
1197
+
1198
+ sig { returns(T.nilable(T::Boolean)) }
1199
+ attr_reader :non_recursive
1200
+
1201
+ sig { params(non_recursive: T::Boolean).void }
1202
+ attr_writer :non_recursive
1203
+
1204
+ sig do
1205
+ returns(
1206
+ T.nilable(
1207
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation::OrSymbol
1208
+ )
1209
+ )
1210
+ end
1211
+ attr_reader :propagation
1212
+
1213
+ sig do
1214
+ params(
1215
+ propagation:
1216
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation::OrSymbol
1217
+ ).void
1218
+ end
1219
+ attr_writer :propagation
1220
+
1221
+ sig { returns(T.nilable(T::Boolean)) }
1222
+ attr_reader :read_only_force_recursive
1223
+
1224
+ sig { params(read_only_force_recursive: T::Boolean).void }
1225
+ attr_writer :read_only_force_recursive
1226
+
1227
+ sig { returns(T.nilable(T::Boolean)) }
1228
+ attr_reader :read_only_non_recursive
1229
+
1230
+ sig { params(read_only_non_recursive: T::Boolean).void }
1231
+ attr_writer :read_only_non_recursive
1232
+
1233
+ # Optional configuration for the `bind` type.
1234
+ sig do
1235
+ params(
1236
+ create_mountpoint: T::Boolean,
1237
+ non_recursive: T::Boolean,
1238
+ propagation:
1239
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation::OrSymbol,
1240
+ read_only_force_recursive: T::Boolean,
1241
+ read_only_non_recursive: T::Boolean
1242
+ ).returns(T.attached_class)
1243
+ end
1244
+ def self.new(
1245
+ create_mountpoint: nil,
1246
+ non_recursive: nil,
1247
+ propagation: nil,
1248
+ read_only_force_recursive: nil,
1249
+ read_only_non_recursive: nil
1250
+ )
1251
+ end
1252
+
1253
+ sig do
1254
+ override.returns(
1255
+ {
1256
+ create_mountpoint: T::Boolean,
1257
+ non_recursive: T::Boolean,
1258
+ propagation:
1259
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation::OrSymbol,
1260
+ read_only_force_recursive: T::Boolean,
1261
+ read_only_non_recursive: T::Boolean
1262
+ }
1263
+ )
1264
+ end
1265
+ def to_hash
1266
+ end
1267
+
1268
+ module Propagation
1269
+ extend DockerEngineRuby::Internal::Type::Enum
1270
+
1271
+ TaggedSymbol =
1272
+ T.type_alias do
1273
+ T.all(
1274
+ Symbol,
1275
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation
1276
+ )
1277
+ end
1278
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1279
+
1280
+ PRIVATE =
1281
+ T.let(
1282
+ :private,
1283
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation::TaggedSymbol
1284
+ )
1285
+ RPRIVATE =
1286
+ T.let(
1287
+ :rprivate,
1288
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation::TaggedSymbol
1289
+ )
1290
+ SHARED =
1291
+ T.let(
1292
+ :shared,
1293
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation::TaggedSymbol
1294
+ )
1295
+ RSHARED =
1296
+ T.let(
1297
+ :rshared,
1298
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation::TaggedSymbol
1299
+ )
1300
+ SLAVE =
1301
+ T.let(
1302
+ :slave,
1303
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation::TaggedSymbol
1304
+ )
1305
+ RSLAVE =
1306
+ T.let(
1307
+ :rslave,
1308
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation::TaggedSymbol
1309
+ )
1310
+
1311
+ sig do
1312
+ override.returns(
1313
+ T::Array[
1314
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::BindOptions::Propagation::TaggedSymbol
1315
+ ]
1316
+ )
1317
+ end
1318
+ def self.values
1319
+ end
1320
+ end
1321
+ end
1322
+
1323
+ class ImageOptions < DockerEngineRuby::Internal::Type::BaseModel
1324
+ OrHash =
1325
+ T.type_alias do
1326
+ T.any(
1327
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::ImageOptions,
1328
+ DockerEngineRuby::Internal::AnyHash
1329
+ )
1330
+ end
1331
+
1332
+ sig { returns(T.nilable(String)) }
1333
+ attr_reader :subpath
1334
+
1335
+ sig { params(subpath: String).void }
1336
+ attr_writer :subpath
1337
+
1338
+ # Optional configuration for the `image` type.
1339
+ sig { params(subpath: String).returns(T.attached_class) }
1340
+ def self.new(subpath: nil)
1341
+ end
1342
+
1343
+ sig { override.returns({ subpath: String }) }
1344
+ def to_hash
1345
+ end
1346
+ end
1347
+
1348
+ class TmpfsOptions < DockerEngineRuby::Internal::Type::BaseModel
1349
+ OrHash =
1350
+ T.type_alias do
1351
+ T.any(
1352
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::TmpfsOptions,
1353
+ DockerEngineRuby::Internal::AnyHash
1354
+ )
1355
+ end
1356
+
1357
+ sig { returns(T.nilable(Integer)) }
1358
+ attr_reader :mode
1359
+
1360
+ sig { params(mode: Integer).void }
1361
+ attr_writer :mode
1362
+
1363
+ sig { returns(T.nilable(T::Array[T::Array[String]])) }
1364
+ attr_reader :options
1365
+
1366
+ sig { params(options: T::Array[T::Array[String]]).void }
1367
+ attr_writer :options
1368
+
1369
+ sig { returns(T.nilable(Integer)) }
1370
+ attr_reader :size_bytes
1371
+
1372
+ sig { params(size_bytes: Integer).void }
1373
+ attr_writer :size_bytes
1374
+
1375
+ # Optional configuration for the `tmpfs` type.
1376
+ sig do
1377
+ params(
1378
+ mode: Integer,
1379
+ options: T::Array[T::Array[String]],
1380
+ size_bytes: Integer
1381
+ ).returns(T.attached_class)
1382
+ end
1383
+ def self.new(mode: nil, options: nil, size_bytes: nil)
1384
+ end
1385
+
1386
+ sig do
1387
+ override.returns(
1388
+ {
1389
+ mode: Integer,
1390
+ options: T::Array[T::Array[String]],
1391
+ size_bytes: Integer
1392
+ }
1393
+ )
1394
+ end
1395
+ def to_hash
1396
+ end
1397
+ end
1398
+
1399
+ # The mount type. Available types:
1400
+ #
1401
+ # - `bind` a mount of a file or directory from the host into the container.
1402
+ # - `cluster` a Swarm cluster volume.
1403
+ # - `image` an OCI image.
1404
+ # - `npipe` a named pipe from the host into the container.
1405
+ # - `tmpfs` a `tmpfs`.
1406
+ # - `volume` a docker volume with the given `Name`.
1407
+ module Type
1408
+ extend DockerEngineRuby::Internal::Type::Enum
1409
+
1410
+ TaggedSymbol =
1411
+ T.type_alias do
1412
+ T.all(
1413
+ Symbol,
1414
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type
1415
+ )
1416
+ end
1417
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1418
+
1419
+ BIND =
1420
+ T.let(
1421
+ :bind,
1422
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type::TaggedSymbol
1423
+ )
1424
+ CLUSTER =
1425
+ T.let(
1426
+ :cluster,
1427
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type::TaggedSymbol
1428
+ )
1429
+ IMAGE =
1430
+ T.let(
1431
+ :image,
1432
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type::TaggedSymbol
1433
+ )
1434
+ NPIPE =
1435
+ T.let(
1436
+ :npipe,
1437
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type::TaggedSymbol
1438
+ )
1439
+ TMPFS =
1440
+ T.let(
1441
+ :tmpfs,
1442
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type::TaggedSymbol
1443
+ )
1444
+ VOLUME =
1445
+ T.let(
1446
+ :volume,
1447
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type::TaggedSymbol
1448
+ )
1449
+
1450
+ sig do
1451
+ override.returns(
1452
+ T::Array[
1453
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::Type::TaggedSymbol
1454
+ ]
1455
+ )
1456
+ end
1457
+ def self.values
1458
+ end
1459
+ end
1460
+
1461
+ class VolumeOptions < DockerEngineRuby::Internal::Type::BaseModel
1462
+ OrHash =
1463
+ T.type_alias do
1464
+ T.any(
1465
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::VolumeOptions,
1466
+ DockerEngineRuby::Internal::AnyHash
1467
+ )
1468
+ end
1469
+
1470
+ sig do
1471
+ returns(
1472
+ T.nilable(
1473
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::VolumeOptions::DriverConfig
1474
+ )
1475
+ )
1476
+ end
1477
+ attr_reader :driver_config
1478
+
1479
+ sig do
1480
+ params(
1481
+ driver_config:
1482
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::VolumeOptions::DriverConfig::OrHash
1483
+ ).void
1484
+ end
1485
+ attr_writer :driver_config
1486
+
1487
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
1488
+ attr_reader :labels
1489
+
1490
+ sig { params(labels: T::Hash[Symbol, String]).void }
1491
+ attr_writer :labels
1492
+
1493
+ sig { returns(T.nilable(T::Boolean)) }
1494
+ attr_reader :no_copy
1495
+
1496
+ sig { params(no_copy: T::Boolean).void }
1497
+ attr_writer :no_copy
1498
+
1499
+ sig { returns(T.nilable(String)) }
1500
+ attr_reader :subpath
1501
+
1502
+ sig { params(subpath: String).void }
1503
+ attr_writer :subpath
1504
+
1505
+ # Optional configuration for the `volume` type.
1506
+ sig do
1507
+ params(
1508
+ driver_config:
1509
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::VolumeOptions::DriverConfig::OrHash,
1510
+ labels: T::Hash[Symbol, String],
1511
+ no_copy: T::Boolean,
1512
+ subpath: String
1513
+ ).returns(T.attached_class)
1514
+ end
1515
+ def self.new(
1516
+ driver_config: nil,
1517
+ labels: nil,
1518
+ no_copy: nil,
1519
+ subpath: nil
1520
+ )
1521
+ end
1522
+
1523
+ sig do
1524
+ override.returns(
1525
+ {
1526
+ driver_config:
1527
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::VolumeOptions::DriverConfig,
1528
+ labels: T::Hash[Symbol, String],
1529
+ no_copy: T::Boolean,
1530
+ subpath: String
1531
+ }
1532
+ )
1533
+ end
1534
+ def to_hash
1535
+ end
1536
+
1537
+ class DriverConfig < DockerEngineRuby::Internal::Type::BaseModel
1538
+ OrHash =
1539
+ T.type_alias do
1540
+ T.any(
1541
+ DockerEngineRuby::TaskSpec::ContainerSpec::Mount::VolumeOptions::DriverConfig,
1542
+ DockerEngineRuby::Internal::AnyHash
1543
+ )
1544
+ end
1545
+
1546
+ sig { returns(T.nilable(String)) }
1547
+ attr_reader :name
1548
+
1549
+ sig { params(name: String).void }
1550
+ attr_writer :name
1551
+
1552
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
1553
+ attr_reader :options
1554
+
1555
+ sig { params(options: T::Hash[Symbol, String]).void }
1556
+ attr_writer :options
1557
+
1558
+ sig do
1559
+ params(name: String, options: T::Hash[Symbol, String]).returns(
1560
+ T.attached_class
1561
+ )
1562
+ end
1563
+ def self.new(name: nil, options: nil)
1564
+ end
1565
+
1566
+ sig do
1567
+ override.returns(
1568
+ { name: String, options: T::Hash[Symbol, String] }
1569
+ )
1570
+ end
1571
+ def to_hash
1572
+ end
1573
+ end
1574
+ end
1575
+ end
1576
+
1577
+ class Privileges < DockerEngineRuby::Internal::Type::BaseModel
1578
+ OrHash =
1579
+ T.type_alias do
1580
+ T.any(
1581
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges,
1582
+ DockerEngineRuby::Internal::AnyHash
1583
+ )
1584
+ end
1585
+
1586
+ sig do
1587
+ returns(
1588
+ T.nilable(
1589
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor
1590
+ )
1591
+ )
1592
+ end
1593
+ attr_reader :app_armor
1594
+
1595
+ sig do
1596
+ params(
1597
+ app_armor:
1598
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor::OrHash
1599
+ ).void
1600
+ end
1601
+ attr_writer :app_armor
1602
+
1603
+ sig do
1604
+ returns(
1605
+ T.nilable(
1606
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::CredentialSpec
1607
+ )
1608
+ )
1609
+ end
1610
+ attr_reader :credential_spec
1611
+
1612
+ sig do
1613
+ params(
1614
+ credential_spec:
1615
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::CredentialSpec::OrHash
1616
+ ).void
1617
+ end
1618
+ attr_writer :credential_spec
1619
+
1620
+ sig { returns(T.nilable(T::Boolean)) }
1621
+ attr_reader :no_new_privileges
1622
+
1623
+ sig { params(no_new_privileges: T::Boolean).void }
1624
+ attr_writer :no_new_privileges
1625
+
1626
+ sig do
1627
+ returns(
1628
+ T.nilable(
1629
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp
1630
+ )
1631
+ )
1632
+ end
1633
+ attr_reader :seccomp
1634
+
1635
+ sig do
1636
+ params(
1637
+ seccomp:
1638
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp::OrHash
1639
+ ).void
1640
+ end
1641
+ attr_writer :seccomp
1642
+
1643
+ sig do
1644
+ returns(
1645
+ T.nilable(
1646
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::SeLinuxContext
1647
+ )
1648
+ )
1649
+ end
1650
+ attr_reader :se_linux_context
1651
+
1652
+ sig do
1653
+ params(
1654
+ se_linux_context:
1655
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::SeLinuxContext::OrHash
1656
+ ).void
1657
+ end
1658
+ attr_writer :se_linux_context
1659
+
1660
+ sig do
1661
+ params(
1662
+ app_armor:
1663
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor::OrHash,
1664
+ credential_spec:
1665
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::CredentialSpec::OrHash,
1666
+ no_new_privileges: T::Boolean,
1667
+ seccomp:
1668
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp::OrHash,
1669
+ se_linux_context:
1670
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::SeLinuxContext::OrHash
1671
+ ).returns(T.attached_class)
1672
+ end
1673
+ def self.new(
1674
+ app_armor: nil,
1675
+ credential_spec: nil,
1676
+ no_new_privileges: nil,
1677
+ seccomp: nil,
1678
+ se_linux_context: nil
1679
+ )
1680
+ end
1681
+
1682
+ sig do
1683
+ override.returns(
1684
+ {
1685
+ app_armor:
1686
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor,
1687
+ credential_spec:
1688
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::CredentialSpec,
1689
+ no_new_privileges: T::Boolean,
1690
+ seccomp:
1691
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp,
1692
+ se_linux_context:
1693
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::SeLinuxContext
1694
+ }
1695
+ )
1696
+ end
1697
+ def to_hash
1698
+ end
1699
+
1700
+ class AppArmor < DockerEngineRuby::Internal::Type::BaseModel
1701
+ OrHash =
1702
+ T.type_alias do
1703
+ T.any(
1704
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor,
1705
+ DockerEngineRuby::Internal::AnyHash
1706
+ )
1707
+ end
1708
+
1709
+ sig do
1710
+ returns(
1711
+ T.nilable(
1712
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor::Mode::OrSymbol
1713
+ )
1714
+ )
1715
+ end
1716
+ attr_reader :mode
1717
+
1718
+ sig do
1719
+ params(
1720
+ mode:
1721
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor::Mode::OrSymbol
1722
+ ).void
1723
+ end
1724
+ attr_writer :mode
1725
+
1726
+ sig do
1727
+ params(
1728
+ mode:
1729
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor::Mode::OrSymbol
1730
+ ).returns(T.attached_class)
1731
+ end
1732
+ def self.new(mode: nil)
1733
+ end
1734
+
1735
+ sig do
1736
+ override.returns(
1737
+ {
1738
+ mode:
1739
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor::Mode::OrSymbol
1740
+ }
1741
+ )
1742
+ end
1743
+ def to_hash
1744
+ end
1745
+
1746
+ module Mode
1747
+ extend DockerEngineRuby::Internal::Type::Enum
1748
+
1749
+ TaggedSymbol =
1750
+ T.type_alias do
1751
+ T.all(
1752
+ Symbol,
1753
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor::Mode
1754
+ )
1755
+ end
1756
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1757
+
1758
+ DEFAULT =
1759
+ T.let(
1760
+ :default,
1761
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor::Mode::TaggedSymbol
1762
+ )
1763
+ DISABLED =
1764
+ T.let(
1765
+ :disabled,
1766
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor::Mode::TaggedSymbol
1767
+ )
1768
+
1769
+ sig do
1770
+ override.returns(
1771
+ T::Array[
1772
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::AppArmor::Mode::TaggedSymbol
1773
+ ]
1774
+ )
1775
+ end
1776
+ def self.values
1777
+ end
1778
+ end
1779
+ end
1780
+
1781
+ class CredentialSpec < DockerEngineRuby::Internal::Type::BaseModel
1782
+ OrHash =
1783
+ T.type_alias do
1784
+ T.any(
1785
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::CredentialSpec,
1786
+ DockerEngineRuby::Internal::AnyHash
1787
+ )
1788
+ end
1789
+
1790
+ sig { returns(T.nilable(String)) }
1791
+ attr_reader :config
1792
+
1793
+ sig { params(config: String).void }
1794
+ attr_writer :config
1795
+
1796
+ sig { returns(T.nilable(String)) }
1797
+ attr_reader :file
1798
+
1799
+ sig { params(file: String).void }
1800
+ attr_writer :file
1801
+
1802
+ sig { returns(T.nilable(String)) }
1803
+ attr_reader :registry
1804
+
1805
+ sig { params(registry: String).void }
1806
+ attr_writer :registry
1807
+
1808
+ sig do
1809
+ params(config: String, file: String, registry: String).returns(
1810
+ T.attached_class
1811
+ )
1812
+ end
1813
+ def self.new(config: nil, file: nil, registry: nil)
1814
+ end
1815
+
1816
+ sig do
1817
+ override.returns(
1818
+ { config: String, file: String, registry: String }
1819
+ )
1820
+ end
1821
+ def to_hash
1822
+ end
1823
+ end
1824
+
1825
+ class Seccomp < DockerEngineRuby::Internal::Type::BaseModel
1826
+ OrHash =
1827
+ T.type_alias do
1828
+ T.any(
1829
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp,
1830
+ DockerEngineRuby::Internal::AnyHash
1831
+ )
1832
+ end
1833
+
1834
+ sig do
1835
+ returns(
1836
+ T.nilable(
1837
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp::Mode::OrSymbol
1838
+ )
1839
+ )
1840
+ end
1841
+ attr_reader :mode
1842
+
1843
+ sig do
1844
+ params(
1845
+ mode:
1846
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp::Mode::OrSymbol
1847
+ ).void
1848
+ end
1849
+ attr_writer :mode
1850
+
1851
+ sig { returns(T.nilable(String)) }
1852
+ attr_reader :profile
1853
+
1854
+ sig { params(profile: String).void }
1855
+ attr_writer :profile
1856
+
1857
+ sig do
1858
+ params(
1859
+ mode:
1860
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp::Mode::OrSymbol,
1861
+ profile: String
1862
+ ).returns(T.attached_class)
1863
+ end
1864
+ def self.new(mode: nil, profile: nil)
1865
+ end
1866
+
1867
+ sig do
1868
+ override.returns(
1869
+ {
1870
+ mode:
1871
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp::Mode::OrSymbol,
1872
+ profile: String
1873
+ }
1874
+ )
1875
+ end
1876
+ def to_hash
1877
+ end
1878
+
1879
+ module Mode
1880
+ extend DockerEngineRuby::Internal::Type::Enum
1881
+
1882
+ TaggedSymbol =
1883
+ T.type_alias do
1884
+ T.all(
1885
+ Symbol,
1886
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp::Mode
1887
+ )
1888
+ end
1889
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1890
+
1891
+ DEFAULT =
1892
+ T.let(
1893
+ :default,
1894
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp::Mode::TaggedSymbol
1895
+ )
1896
+ UNCONFINED =
1897
+ T.let(
1898
+ :unconfined,
1899
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp::Mode::TaggedSymbol
1900
+ )
1901
+ CUSTOM =
1902
+ T.let(
1903
+ :custom,
1904
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp::Mode::TaggedSymbol
1905
+ )
1906
+
1907
+ sig do
1908
+ override.returns(
1909
+ T::Array[
1910
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::Seccomp::Mode::TaggedSymbol
1911
+ ]
1912
+ )
1913
+ end
1914
+ def self.values
1915
+ end
1916
+ end
1917
+ end
1918
+
1919
+ class SeLinuxContext < DockerEngineRuby::Internal::Type::BaseModel
1920
+ OrHash =
1921
+ T.type_alias do
1922
+ T.any(
1923
+ DockerEngineRuby::TaskSpec::ContainerSpec::Privileges::SeLinuxContext,
1924
+ DockerEngineRuby::Internal::AnyHash
1925
+ )
1926
+ end
1927
+
1928
+ sig { returns(T.nilable(T::Boolean)) }
1929
+ attr_reader :disable
1930
+
1931
+ sig { params(disable: T::Boolean).void }
1932
+ attr_writer :disable
1933
+
1934
+ sig { returns(T.nilable(String)) }
1935
+ attr_reader :level
1936
+
1937
+ sig { params(level: String).void }
1938
+ attr_writer :level
1939
+
1940
+ sig { returns(T.nilable(String)) }
1941
+ attr_reader :role
1942
+
1943
+ sig { params(role: String).void }
1944
+ attr_writer :role
1945
+
1946
+ sig { returns(T.nilable(String)) }
1947
+ attr_reader :type
1948
+
1949
+ sig { params(type: String).void }
1950
+ attr_writer :type
1951
+
1952
+ sig { returns(T.nilable(String)) }
1953
+ attr_reader :user
1954
+
1955
+ sig { params(user: String).void }
1956
+ attr_writer :user
1957
+
1958
+ sig do
1959
+ params(
1960
+ disable: T::Boolean,
1961
+ level: String,
1962
+ role: String,
1963
+ type: String,
1964
+ user: String
1965
+ ).returns(T.attached_class)
1966
+ end
1967
+ def self.new(
1968
+ disable: nil,
1969
+ level: nil,
1970
+ role: nil,
1971
+ type: nil,
1972
+ user: nil
1973
+ )
1974
+ end
1975
+
1976
+ sig do
1977
+ override.returns(
1978
+ {
1979
+ disable: T::Boolean,
1980
+ level: String,
1981
+ role: String,
1982
+ type: String,
1983
+ user: String
1984
+ }
1985
+ )
1986
+ end
1987
+ def to_hash
1988
+ end
1989
+ end
1990
+ end
1991
+
1992
+ class Secret < DockerEngineRuby::Internal::Type::BaseModel
1993
+ OrHash =
1994
+ T.type_alias do
1995
+ T.any(
1996
+ DockerEngineRuby::TaskSpec::ContainerSpec::Secret,
1997
+ DockerEngineRuby::Internal::AnyHash
1998
+ )
1999
+ end
2000
+
2001
+ sig do
2002
+ returns(
2003
+ T.nilable(DockerEngineRuby::TaskSpec::ContainerSpec::Secret::File)
2004
+ )
2005
+ end
2006
+ attr_reader :file
2007
+
2008
+ sig do
2009
+ params(
2010
+ file:
2011
+ DockerEngineRuby::TaskSpec::ContainerSpec::Secret::File::OrHash
2012
+ ).void
2013
+ end
2014
+ attr_writer :file
2015
+
2016
+ sig { returns(T.nilable(String)) }
2017
+ attr_reader :secret_id
2018
+
2019
+ sig { params(secret_id: String).void }
2020
+ attr_writer :secret_id
2021
+
2022
+ sig { returns(T.nilable(String)) }
2023
+ attr_reader :secret_name
2024
+
2025
+ sig { params(secret_name: String).void }
2026
+ attr_writer :secret_name
2027
+
2028
+ sig do
2029
+ params(
2030
+ file:
2031
+ DockerEngineRuby::TaskSpec::ContainerSpec::Secret::File::OrHash,
2032
+ secret_id: String,
2033
+ secret_name: String
2034
+ ).returns(T.attached_class)
2035
+ end
2036
+ def self.new(file: nil, secret_id: nil, secret_name: nil)
2037
+ end
2038
+
2039
+ sig do
2040
+ override.returns(
2041
+ {
2042
+ file: DockerEngineRuby::TaskSpec::ContainerSpec::Secret::File,
2043
+ secret_id: String,
2044
+ secret_name: String
2045
+ }
2046
+ )
2047
+ end
2048
+ def to_hash
2049
+ end
2050
+
2051
+ class File < DockerEngineRuby::Internal::Type::BaseModel
2052
+ OrHash =
2053
+ T.type_alias do
2054
+ T.any(
2055
+ DockerEngineRuby::TaskSpec::ContainerSpec::Secret::File,
2056
+ DockerEngineRuby::Internal::AnyHash
2057
+ )
2058
+ end
2059
+
2060
+ sig { returns(T.nilable(String)) }
2061
+ attr_reader :gid
2062
+
2063
+ sig { params(gid: String).void }
2064
+ attr_writer :gid
2065
+
2066
+ sig { returns(T.nilable(Integer)) }
2067
+ attr_reader :mode
2068
+
2069
+ sig { params(mode: Integer).void }
2070
+ attr_writer :mode
2071
+
2072
+ sig { returns(T.nilable(String)) }
2073
+ attr_reader :name
2074
+
2075
+ sig { params(name: String).void }
2076
+ attr_writer :name
2077
+
2078
+ sig { returns(T.nilable(String)) }
2079
+ attr_reader :uid
2080
+
2081
+ sig { params(uid: String).void }
2082
+ attr_writer :uid
2083
+
2084
+ sig do
2085
+ params(
2086
+ gid: String,
2087
+ mode: Integer,
2088
+ name: String,
2089
+ uid: String
2090
+ ).returns(T.attached_class)
2091
+ end
2092
+ def self.new(gid: nil, mode: nil, name: nil, uid: nil)
2093
+ end
2094
+
2095
+ sig do
2096
+ override.returns(
2097
+ { gid: String, mode: Integer, name: String, uid: String }
2098
+ )
2099
+ end
2100
+ def to_hash
2101
+ end
2102
+ end
2103
+ end
2104
+
2105
+ class Ulimit < DockerEngineRuby::Internal::Type::BaseModel
2106
+ OrHash =
2107
+ T.type_alias do
2108
+ T.any(
2109
+ DockerEngineRuby::TaskSpec::ContainerSpec::Ulimit,
2110
+ DockerEngineRuby::Internal::AnyHash
2111
+ )
2112
+ end
2113
+
2114
+ sig { returns(T.nilable(Integer)) }
2115
+ attr_reader :hard
2116
+
2117
+ sig { params(hard: Integer).void }
2118
+ attr_writer :hard
2119
+
2120
+ sig { returns(T.nilable(String)) }
2121
+ attr_reader :name
2122
+
2123
+ sig { params(name: String).void }
2124
+ attr_writer :name
2125
+
2126
+ sig { returns(T.nilable(Integer)) }
2127
+ attr_reader :soft
2128
+
2129
+ sig { params(soft: Integer).void }
2130
+ attr_writer :soft
2131
+
2132
+ sig do
2133
+ params(hard: Integer, name: String, soft: Integer).returns(
2134
+ T.attached_class
2135
+ )
2136
+ end
2137
+ def self.new(hard: nil, name: nil, soft: nil)
2138
+ end
2139
+
2140
+ sig do
2141
+ override.returns({ hard: Integer, name: String, soft: Integer })
2142
+ end
2143
+ def to_hash
2144
+ end
2145
+ end
2146
+ end
2147
+
2148
+ class LogDriver < DockerEngineRuby::Internal::Type::BaseModel
2149
+ OrHash =
2150
+ T.type_alias do
2151
+ T.any(
2152
+ DockerEngineRuby::TaskSpec::LogDriver,
2153
+ DockerEngineRuby::Internal::AnyHash
2154
+ )
2155
+ end
2156
+
2157
+ sig { returns(T.nilable(String)) }
2158
+ attr_reader :name
2159
+
2160
+ sig { params(name: String).void }
2161
+ attr_writer :name
2162
+
2163
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
2164
+ attr_reader :options
2165
+
2166
+ sig { params(options: T::Hash[Symbol, String]).void }
2167
+ attr_writer :options
2168
+
2169
+ # Specifies the log driver to use for tasks created from this spec. If not
2170
+ # present, the default one for the swarm will be used, finally falling back to the
2171
+ # engine default if not specified.
2172
+ sig do
2173
+ params(name: String, options: T::Hash[Symbol, String]).returns(
2174
+ T.attached_class
2175
+ )
2176
+ end
2177
+ def self.new(name: nil, options: nil)
2178
+ end
2179
+
2180
+ sig do
2181
+ override.returns({ name: String, options: T::Hash[Symbol, String] })
2182
+ end
2183
+ def to_hash
2184
+ end
2185
+ end
2186
+
2187
+ class NetworkAttachmentSpec < DockerEngineRuby::Internal::Type::BaseModel
2188
+ OrHash =
2189
+ T.type_alias do
2190
+ T.any(
2191
+ DockerEngineRuby::TaskSpec::NetworkAttachmentSpec,
2192
+ DockerEngineRuby::Internal::AnyHash
2193
+ )
2194
+ end
2195
+
2196
+ sig { returns(T.nilable(String)) }
2197
+ attr_reader :container_id
2198
+
2199
+ sig { params(container_id: String).void }
2200
+ attr_writer :container_id
2201
+
2202
+ # Read-only spec type for non-swarm containers attached to swarm overlay networks.
2203
+ #
2204
+ # <p><br /></p>
2205
+ #
2206
+ # > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually
2207
+ # > exclusive. PluginSpec is only used when the Runtime field is set to `plugin`.
2208
+ # > NetworkAttachmentSpec is used when the Runtime field is set to `attachment`.
2209
+ sig { params(container_id: String).returns(T.attached_class) }
2210
+ def self.new(container_id: nil)
2211
+ end
2212
+
2213
+ sig { override.returns({ container_id: String }) }
2214
+ def to_hash
2215
+ end
2216
+ end
2217
+
2218
+ class Network < DockerEngineRuby::Internal::Type::BaseModel
2219
+ OrHash =
2220
+ T.type_alias do
2221
+ T.any(
2222
+ DockerEngineRuby::TaskSpec::Network,
2223
+ DockerEngineRuby::Internal::AnyHash
2224
+ )
2225
+ end
2226
+
2227
+ # Discoverable alternate names for the service on this network.
2228
+ sig { returns(T.nilable(T::Array[String])) }
2229
+ attr_reader :aliases
2230
+
2231
+ sig { params(aliases: T::Array[String]).void }
2232
+ attr_writer :aliases
2233
+
2234
+ # Driver attachment options for the network target.
2235
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
2236
+ attr_reader :driver_opts
2237
+
2238
+ sig { params(driver_opts: T::Hash[Symbol, String]).void }
2239
+ attr_writer :driver_opts
2240
+
2241
+ # The target network for attachment. Must be a network name or ID.
2242
+ sig { returns(T.nilable(String)) }
2243
+ attr_reader :target
2244
+
2245
+ sig { params(target: String).void }
2246
+ attr_writer :target
2247
+
2248
+ # Specifies how a service should be attached to a particular network.
2249
+ sig do
2250
+ params(
2251
+ aliases: T::Array[String],
2252
+ driver_opts: T::Hash[Symbol, String],
2253
+ target: String
2254
+ ).returns(T.attached_class)
2255
+ end
2256
+ def self.new(
2257
+ # Discoverable alternate names for the service on this network.
2258
+ aliases: nil,
2259
+ # Driver attachment options for the network target.
2260
+ driver_opts: nil,
2261
+ # The target network for attachment. Must be a network name or ID.
2262
+ target: nil
2263
+ )
2264
+ end
2265
+
2266
+ sig do
2267
+ override.returns(
2268
+ {
2269
+ aliases: T::Array[String],
2270
+ driver_opts: T::Hash[Symbol, String],
2271
+ target: String
2272
+ }
2273
+ )
2274
+ end
2275
+ def to_hash
2276
+ end
2277
+ end
2278
+
2279
+ class Placement < DockerEngineRuby::Internal::Type::BaseModel
2280
+ OrHash =
2281
+ T.type_alias do
2282
+ T.any(
2283
+ DockerEngineRuby::TaskSpec::Placement,
2284
+ DockerEngineRuby::Internal::AnyHash
2285
+ )
2286
+ end
2287
+
2288
+ sig { returns(T.nilable(T::Array[String])) }
2289
+ attr_reader :constraints
2290
+
2291
+ sig { params(constraints: T::Array[String]).void }
2292
+ attr_writer :constraints
2293
+
2294
+ sig { returns(T.nilable(Integer)) }
2295
+ attr_reader :max_replicas
2296
+
2297
+ sig { params(max_replicas: Integer).void }
2298
+ attr_writer :max_replicas
2299
+
2300
+ sig do
2301
+ returns(
2302
+ T.nilable(T::Array[DockerEngineRuby::TaskSpec::Placement::Platform])
2303
+ )
2304
+ end
2305
+ attr_reader :platforms
2306
+
2307
+ sig do
2308
+ params(
2309
+ platforms:
2310
+ T::Array[DockerEngineRuby::TaskSpec::Placement::Platform::OrHash]
2311
+ ).void
2312
+ end
2313
+ attr_writer :platforms
2314
+
2315
+ sig do
2316
+ returns(
2317
+ T.nilable(
2318
+ T::Array[DockerEngineRuby::TaskSpec::Placement::Preference]
2319
+ )
2320
+ )
2321
+ end
2322
+ attr_reader :preferences
2323
+
2324
+ sig do
2325
+ params(
2326
+ preferences:
2327
+ T::Array[
2328
+ DockerEngineRuby::TaskSpec::Placement::Preference::OrHash
2329
+ ]
2330
+ ).void
2331
+ end
2332
+ attr_writer :preferences
2333
+
2334
+ sig do
2335
+ params(
2336
+ constraints: T::Array[String],
2337
+ max_replicas: Integer,
2338
+ platforms:
2339
+ T::Array[DockerEngineRuby::TaskSpec::Placement::Platform::OrHash],
2340
+ preferences:
2341
+ T::Array[
2342
+ DockerEngineRuby::TaskSpec::Placement::Preference::OrHash
2343
+ ]
2344
+ ).returns(T.attached_class)
2345
+ end
2346
+ def self.new(
2347
+ constraints: nil,
2348
+ max_replicas: nil,
2349
+ platforms: nil,
2350
+ preferences: nil
2351
+ )
2352
+ end
2353
+
2354
+ sig do
2355
+ override.returns(
2356
+ {
2357
+ constraints: T::Array[String],
2358
+ max_replicas: Integer,
2359
+ platforms:
2360
+ T::Array[DockerEngineRuby::TaskSpec::Placement::Platform],
2361
+ preferences:
2362
+ T::Array[DockerEngineRuby::TaskSpec::Placement::Preference]
2363
+ }
2364
+ )
2365
+ end
2366
+ def to_hash
2367
+ end
2368
+
2369
+ class Platform < DockerEngineRuby::Internal::Type::BaseModel
2370
+ OrHash =
2371
+ T.type_alias do
2372
+ T.any(
2373
+ DockerEngineRuby::TaskSpec::Placement::Platform,
2374
+ DockerEngineRuby::Internal::AnyHash
2375
+ )
2376
+ end
2377
+
2378
+ # Architecture represents the hardware architecture (for example, `x86_64`).
2379
+ sig { returns(T.nilable(String)) }
2380
+ attr_reader :architecture
2381
+
2382
+ sig { params(architecture: String).void }
2383
+ attr_writer :architecture
2384
+
2385
+ # OS represents the Operating System (for example, `linux` or `windows`).
2386
+ sig { returns(T.nilable(String)) }
2387
+ attr_reader :os
2388
+
2389
+ sig { params(os: String).void }
2390
+ attr_writer :os
2391
+
2392
+ # Platform represents the platform (Arch/OS).
2393
+ sig do
2394
+ params(architecture: String, os: String).returns(T.attached_class)
2395
+ end
2396
+ def self.new(
2397
+ # Architecture represents the hardware architecture (for example, `x86_64`).
2398
+ architecture: nil,
2399
+ # OS represents the Operating System (for example, `linux` or `windows`).
2400
+ os: nil
2401
+ )
2402
+ end
2403
+
2404
+ sig { override.returns({ architecture: String, os: String }) }
2405
+ def to_hash
2406
+ end
2407
+ end
2408
+
2409
+ class Preference < DockerEngineRuby::Internal::Type::BaseModel
2410
+ OrHash =
2411
+ T.type_alias do
2412
+ T.any(
2413
+ DockerEngineRuby::TaskSpec::Placement::Preference,
2414
+ DockerEngineRuby::Internal::AnyHash
2415
+ )
2416
+ end
2417
+
2418
+ sig do
2419
+ returns(
2420
+ T.nilable(
2421
+ DockerEngineRuby::TaskSpec::Placement::Preference::Spread
2422
+ )
2423
+ )
2424
+ end
2425
+ attr_reader :spread
2426
+
2427
+ sig do
2428
+ params(
2429
+ spread:
2430
+ DockerEngineRuby::TaskSpec::Placement::Preference::Spread::OrHash
2431
+ ).void
2432
+ end
2433
+ attr_writer :spread
2434
+
2435
+ sig do
2436
+ params(
2437
+ spread:
2438
+ DockerEngineRuby::TaskSpec::Placement::Preference::Spread::OrHash
2439
+ ).returns(T.attached_class)
2440
+ end
2441
+ def self.new(spread: nil)
2442
+ end
2443
+
2444
+ sig do
2445
+ override.returns(
2446
+ {
2447
+ spread:
2448
+ DockerEngineRuby::TaskSpec::Placement::Preference::Spread
2449
+ }
2450
+ )
2451
+ end
2452
+ def to_hash
2453
+ end
2454
+
2455
+ class Spread < DockerEngineRuby::Internal::Type::BaseModel
2456
+ OrHash =
2457
+ T.type_alias do
2458
+ T.any(
2459
+ DockerEngineRuby::TaskSpec::Placement::Preference::Spread,
2460
+ DockerEngineRuby::Internal::AnyHash
2461
+ )
2462
+ end
2463
+
2464
+ sig { returns(T.nilable(String)) }
2465
+ attr_reader :spread_descriptor
2466
+
2467
+ sig { params(spread_descriptor: String).void }
2468
+ attr_writer :spread_descriptor
2469
+
2470
+ sig { params(spread_descriptor: String).returns(T.attached_class) }
2471
+ def self.new(spread_descriptor: nil)
2472
+ end
2473
+
2474
+ sig { override.returns({ spread_descriptor: String }) }
2475
+ def to_hash
2476
+ end
2477
+ end
2478
+ end
2479
+ end
2480
+
2481
+ class PluginSpec < DockerEngineRuby::Internal::Type::BaseModel
2482
+ OrHash =
2483
+ T.type_alias do
2484
+ T.any(
2485
+ DockerEngineRuby::TaskSpec::PluginSpec,
2486
+ DockerEngineRuby::Internal::AnyHash
2487
+ )
2488
+ end
2489
+
2490
+ sig { returns(T.nilable(T::Boolean)) }
2491
+ attr_reader :disabled
2492
+
2493
+ sig { params(disabled: T::Boolean).void }
2494
+ attr_writer :disabled
2495
+
2496
+ sig { returns(T.nilable(String)) }
2497
+ attr_reader :name
2498
+
2499
+ sig { params(name: String).void }
2500
+ attr_writer :name
2501
+
2502
+ sig { returns(T.nilable(T::Array[DockerEngineRuby::Privilege])) }
2503
+ attr_reader :plugin_privilege
2504
+
2505
+ sig do
2506
+ params(
2507
+ plugin_privilege: T::Array[DockerEngineRuby::Privilege::OrHash]
2508
+ ).void
2509
+ end
2510
+ attr_writer :plugin_privilege
2511
+
2512
+ sig { returns(T.nilable(String)) }
2513
+ attr_reader :remote
2514
+
2515
+ sig { params(remote: String).void }
2516
+ attr_writer :remote
2517
+
2518
+ # Plugin spec for the service. _(Experimental release only.)_
2519
+ #
2520
+ # <p><br /></p>
2521
+ #
2522
+ # > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually
2523
+ # > exclusive. PluginSpec is only used when the Runtime field is set to `plugin`.
2524
+ # > NetworkAttachmentSpec is used when the Runtime field is set to `attachment`.
2525
+ sig do
2526
+ params(
2527
+ disabled: T::Boolean,
2528
+ name: String,
2529
+ plugin_privilege: T::Array[DockerEngineRuby::Privilege::OrHash],
2530
+ remote: String
2531
+ ).returns(T.attached_class)
2532
+ end
2533
+ def self.new(
2534
+ disabled: nil,
2535
+ name: nil,
2536
+ plugin_privilege: nil,
2537
+ remote: nil
2538
+ )
2539
+ end
2540
+
2541
+ sig do
2542
+ override.returns(
2543
+ {
2544
+ disabled: T::Boolean,
2545
+ name: String,
2546
+ plugin_privilege: T::Array[DockerEngineRuby::Privilege],
2547
+ remote: String
2548
+ }
2549
+ )
2550
+ end
2551
+ def to_hash
2552
+ end
2553
+ end
2554
+
2555
+ class Resources < DockerEngineRuby::Internal::Type::BaseModel
2556
+ OrHash =
2557
+ T.type_alias do
2558
+ T.any(
2559
+ DockerEngineRuby::TaskSpec::Resources,
2560
+ DockerEngineRuby::Internal::AnyHash
2561
+ )
2562
+ end
2563
+
2564
+ # An object describing a limit on resources which can be requested by a task.
2565
+ sig do
2566
+ returns(T.nilable(DockerEngineRuby::TaskSpec::Resources::Limits))
2567
+ end
2568
+ attr_reader :limits
2569
+
2570
+ sig do
2571
+ params(
2572
+ limits: DockerEngineRuby::TaskSpec::Resources::Limits::OrHash
2573
+ ).void
2574
+ end
2575
+ attr_writer :limits
2576
+
2577
+ sig { returns(T.nilable(Integer)) }
2578
+ attr_accessor :memory_swappiness
2579
+
2580
+ # An object describing the resources which can be advertised by a node and
2581
+ # requested by a task.
2582
+ sig do
2583
+ returns(
2584
+ T.nilable(DockerEngineRuby::TaskSpec::Resources::Reservations)
2585
+ )
2586
+ end
2587
+ attr_reader :reservations
2588
+
2589
+ sig do
2590
+ params(
2591
+ reservations:
2592
+ DockerEngineRuby::TaskSpec::Resources::Reservations::OrHash
2593
+ ).void
2594
+ end
2595
+ attr_writer :reservations
2596
+
2597
+ sig { returns(T.nilable(Integer)) }
2598
+ attr_accessor :swap_bytes
2599
+
2600
+ # Resource requirements which apply to each individual container created as part
2601
+ # of the service.
2602
+ sig do
2603
+ params(
2604
+ limits: DockerEngineRuby::TaskSpec::Resources::Limits::OrHash,
2605
+ memory_swappiness: T.nilable(Integer),
2606
+ reservations:
2607
+ DockerEngineRuby::TaskSpec::Resources::Reservations::OrHash,
2608
+ swap_bytes: T.nilable(Integer)
2609
+ ).returns(T.attached_class)
2610
+ end
2611
+ def self.new(
2612
+ # An object describing a limit on resources which can be requested by a task.
2613
+ limits: nil,
2614
+ memory_swappiness: nil,
2615
+ # An object describing the resources which can be advertised by a node and
2616
+ # requested by a task.
2617
+ reservations: nil,
2618
+ swap_bytes: nil
2619
+ )
2620
+ end
2621
+
2622
+ sig do
2623
+ override.returns(
2624
+ {
2625
+ limits: DockerEngineRuby::TaskSpec::Resources::Limits,
2626
+ memory_swappiness: T.nilable(Integer),
2627
+ reservations: DockerEngineRuby::TaskSpec::Resources::Reservations,
2628
+ swap_bytes: T.nilable(Integer)
2629
+ }
2630
+ )
2631
+ end
2632
+ def to_hash
2633
+ end
2634
+
2635
+ class Limits < DockerEngineRuby::Internal::Type::BaseModel
2636
+ OrHash =
2637
+ T.type_alias do
2638
+ T.any(
2639
+ DockerEngineRuby::TaskSpec::Resources::Limits,
2640
+ DockerEngineRuby::Internal::AnyHash
2641
+ )
2642
+ end
2643
+
2644
+ sig { returns(T.nilable(Integer)) }
2645
+ attr_reader :memory_bytes
2646
+
2647
+ sig { params(memory_bytes: Integer).void }
2648
+ attr_writer :memory_bytes
2649
+
2650
+ sig { returns(T.nilable(Integer)) }
2651
+ attr_reader :nano_cpus
2652
+
2653
+ sig { params(nano_cpus: Integer).void }
2654
+ attr_writer :nano_cpus
2655
+
2656
+ # Limits the maximum number of PIDs in the container. Set `0` for unlimited.
2657
+ sig { returns(T.nilable(Integer)) }
2658
+ attr_reader :pids
2659
+
2660
+ sig { params(pids: Integer).void }
2661
+ attr_writer :pids
2662
+
2663
+ # An object describing a limit on resources which can be requested by a task.
2664
+ sig do
2665
+ params(
2666
+ memory_bytes: Integer,
2667
+ nano_cpus: Integer,
2668
+ pids: Integer
2669
+ ).returns(T.attached_class)
2670
+ end
2671
+ def self.new(
2672
+ memory_bytes: nil,
2673
+ nano_cpus: nil,
2674
+ # Limits the maximum number of PIDs in the container. Set `0` for unlimited.
2675
+ pids: nil
2676
+ )
2677
+ end
2678
+
2679
+ sig do
2680
+ override.returns(
2681
+ { memory_bytes: Integer, nano_cpus: Integer, pids: Integer }
2682
+ )
2683
+ end
2684
+ def to_hash
2685
+ end
2686
+ end
2687
+
2688
+ class Reservations < DockerEngineRuby::Internal::Type::BaseModel
2689
+ OrHash =
2690
+ T.type_alias do
2691
+ T.any(
2692
+ DockerEngineRuby::TaskSpec::Resources::Reservations,
2693
+ DockerEngineRuby::Internal::AnyHash
2694
+ )
2695
+ end
2696
+
2697
+ sig do
2698
+ returns(
2699
+ T.nilable(
2700
+ T::Array[
2701
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource
2702
+ ]
2703
+ )
2704
+ )
2705
+ end
2706
+ attr_reader :generic_resources
2707
+
2708
+ sig do
2709
+ params(
2710
+ generic_resources:
2711
+ T::Array[
2712
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::OrHash
2713
+ ]
2714
+ ).void
2715
+ end
2716
+ attr_writer :generic_resources
2717
+
2718
+ sig { returns(T.nilable(Integer)) }
2719
+ attr_reader :memory_bytes
2720
+
2721
+ sig { params(memory_bytes: Integer).void }
2722
+ attr_writer :memory_bytes
2723
+
2724
+ sig { returns(T.nilable(Integer)) }
2725
+ attr_reader :nano_cpus
2726
+
2727
+ sig { params(nano_cpus: Integer).void }
2728
+ attr_writer :nano_cpus
2729
+
2730
+ # An object describing the resources which can be advertised by a node and
2731
+ # requested by a task.
2732
+ sig do
2733
+ params(
2734
+ generic_resources:
2735
+ T::Array[
2736
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::OrHash
2737
+ ],
2738
+ memory_bytes: Integer,
2739
+ nano_cpus: Integer
2740
+ ).returns(T.attached_class)
2741
+ end
2742
+ def self.new(
2743
+ generic_resources: nil,
2744
+ memory_bytes: nil,
2745
+ nano_cpus: nil
2746
+ )
2747
+ end
2748
+
2749
+ sig do
2750
+ override.returns(
2751
+ {
2752
+ generic_resources:
2753
+ T::Array[
2754
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource
2755
+ ],
2756
+ memory_bytes: Integer,
2757
+ nano_cpus: Integer
2758
+ }
2759
+ )
2760
+ end
2761
+ def to_hash
2762
+ end
2763
+
2764
+ class GenericResource < DockerEngineRuby::Internal::Type::BaseModel
2765
+ OrHash =
2766
+ T.type_alias do
2767
+ T.any(
2768
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource,
2769
+ DockerEngineRuby::Internal::AnyHash
2770
+ )
2771
+ end
2772
+
2773
+ sig do
2774
+ returns(
2775
+ T.nilable(
2776
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::DiscreteResourceSpec
2777
+ )
2778
+ )
2779
+ end
2780
+ attr_reader :discrete_resource_spec
2781
+
2782
+ sig do
2783
+ params(
2784
+ discrete_resource_spec:
2785
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::DiscreteResourceSpec::OrHash
2786
+ ).void
2787
+ end
2788
+ attr_writer :discrete_resource_spec
2789
+
2790
+ sig do
2791
+ returns(
2792
+ T.nilable(
2793
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::NamedResourceSpec
2794
+ )
2795
+ )
2796
+ end
2797
+ attr_reader :named_resource_spec
2798
+
2799
+ sig do
2800
+ params(
2801
+ named_resource_spec:
2802
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::NamedResourceSpec::OrHash
2803
+ ).void
2804
+ end
2805
+ attr_writer :named_resource_spec
2806
+
2807
+ sig do
2808
+ params(
2809
+ discrete_resource_spec:
2810
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::DiscreteResourceSpec::OrHash,
2811
+ named_resource_spec:
2812
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::NamedResourceSpec::OrHash
2813
+ ).returns(T.attached_class)
2814
+ end
2815
+ def self.new(discrete_resource_spec: nil, named_resource_spec: nil)
2816
+ end
2817
+
2818
+ sig do
2819
+ override.returns(
2820
+ {
2821
+ discrete_resource_spec:
2822
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::DiscreteResourceSpec,
2823
+ named_resource_spec:
2824
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::NamedResourceSpec
2825
+ }
2826
+ )
2827
+ end
2828
+ def to_hash
2829
+ end
2830
+
2831
+ class DiscreteResourceSpec < DockerEngineRuby::Internal::Type::BaseModel
2832
+ OrHash =
2833
+ T.type_alias do
2834
+ T.any(
2835
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::DiscreteResourceSpec,
2836
+ DockerEngineRuby::Internal::AnyHash
2837
+ )
2838
+ end
2839
+
2840
+ sig { returns(T.nilable(String)) }
2841
+ attr_reader :kind
2842
+
2843
+ sig { params(kind: String).void }
2844
+ attr_writer :kind
2845
+
2846
+ sig { returns(T.nilable(Integer)) }
2847
+ attr_reader :value
2848
+
2849
+ sig { params(value: Integer).void }
2850
+ attr_writer :value
2851
+
2852
+ sig do
2853
+ params(kind: String, value: Integer).returns(T.attached_class)
2854
+ end
2855
+ def self.new(kind: nil, value: nil)
2856
+ end
2857
+
2858
+ sig { override.returns({ kind: String, value: Integer }) }
2859
+ def to_hash
2860
+ end
2861
+ end
2862
+
2863
+ class NamedResourceSpec < DockerEngineRuby::Internal::Type::BaseModel
2864
+ OrHash =
2865
+ T.type_alias do
2866
+ T.any(
2867
+ DockerEngineRuby::TaskSpec::Resources::Reservations::GenericResource::NamedResourceSpec,
2868
+ DockerEngineRuby::Internal::AnyHash
2869
+ )
2870
+ end
2871
+
2872
+ sig { returns(T.nilable(String)) }
2873
+ attr_reader :kind
2874
+
2875
+ sig { params(kind: String).void }
2876
+ attr_writer :kind
2877
+
2878
+ sig { returns(T.nilable(String)) }
2879
+ attr_reader :value
2880
+
2881
+ sig { params(value: String).void }
2882
+ attr_writer :value
2883
+
2884
+ sig do
2885
+ params(kind: String, value: String).returns(T.attached_class)
2886
+ end
2887
+ def self.new(kind: nil, value: nil)
2888
+ end
2889
+
2890
+ sig { override.returns({ kind: String, value: String }) }
2891
+ def to_hash
2892
+ end
2893
+ end
2894
+ end
2895
+ end
2896
+ end
2897
+
2898
+ class RestartPolicy < DockerEngineRuby::Internal::Type::BaseModel
2899
+ OrHash =
2900
+ T.type_alias do
2901
+ T.any(
2902
+ DockerEngineRuby::TaskSpec::RestartPolicy,
2903
+ DockerEngineRuby::Internal::AnyHash
2904
+ )
2905
+ end
2906
+
2907
+ sig do
2908
+ returns(
2909
+ T.nilable(
2910
+ DockerEngineRuby::TaskSpec::RestartPolicy::Condition::OrSymbol
2911
+ )
2912
+ )
2913
+ end
2914
+ attr_reader :condition
2915
+
2916
+ sig do
2917
+ params(
2918
+ condition:
2919
+ DockerEngineRuby::TaskSpec::RestartPolicy::Condition::OrSymbol
2920
+ ).void
2921
+ end
2922
+ attr_writer :condition
2923
+
2924
+ sig { returns(T.nilable(Integer)) }
2925
+ attr_reader :delay
2926
+
2927
+ sig { params(delay: Integer).void }
2928
+ attr_writer :delay
2929
+
2930
+ sig { returns(T.nilable(Integer)) }
2931
+ attr_reader :max_attempts
2932
+
2933
+ sig { params(max_attempts: Integer).void }
2934
+ attr_writer :max_attempts
2935
+
2936
+ sig { returns(T.nilable(Integer)) }
2937
+ attr_reader :window
2938
+
2939
+ sig { params(window: Integer).void }
2940
+ attr_writer :window
2941
+
2942
+ # Specification for the restart policy which applies to containers created as part
2943
+ # of this service.
2944
+ sig do
2945
+ params(
2946
+ condition:
2947
+ DockerEngineRuby::TaskSpec::RestartPolicy::Condition::OrSymbol,
2948
+ delay: Integer,
2949
+ max_attempts: Integer,
2950
+ window: Integer
2951
+ ).returns(T.attached_class)
2952
+ end
2953
+ def self.new(condition: nil, delay: nil, max_attempts: nil, window: nil)
2954
+ end
2955
+
2956
+ sig do
2957
+ override.returns(
2958
+ {
2959
+ condition:
2960
+ DockerEngineRuby::TaskSpec::RestartPolicy::Condition::OrSymbol,
2961
+ delay: Integer,
2962
+ max_attempts: Integer,
2963
+ window: Integer
2964
+ }
2965
+ )
2966
+ end
2967
+ def to_hash
2968
+ end
2969
+
2970
+ module Condition
2971
+ extend DockerEngineRuby::Internal::Type::Enum
2972
+
2973
+ TaggedSymbol =
2974
+ T.type_alias do
2975
+ T.all(
2976
+ Symbol,
2977
+ DockerEngineRuby::TaskSpec::RestartPolicy::Condition
2978
+ )
2979
+ end
2980
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2981
+
2982
+ NONE =
2983
+ T.let(
2984
+ :none,
2985
+ DockerEngineRuby::TaskSpec::RestartPolicy::Condition::TaggedSymbol
2986
+ )
2987
+ ON_FAILURE =
2988
+ T.let(
2989
+ :"on-failure",
2990
+ DockerEngineRuby::TaskSpec::RestartPolicy::Condition::TaggedSymbol
2991
+ )
2992
+ ANY =
2993
+ T.let(
2994
+ :any,
2995
+ DockerEngineRuby::TaskSpec::RestartPolicy::Condition::TaggedSymbol
2996
+ )
2997
+
2998
+ sig do
2999
+ override.returns(
3000
+ T::Array[
3001
+ DockerEngineRuby::TaskSpec::RestartPolicy::Condition::TaggedSymbol
3002
+ ]
3003
+ )
3004
+ end
3005
+ def self.values
3006
+ end
3007
+ end
3008
+ end
3009
+ end
3010
+ end
3011
+ end