Skip to content

Commit 1261584

Browse files
feat(api): api update
1 parent 761dffa commit 1261584

File tree

110 files changed

+1206
-3555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+1206
-3555
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 102
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hexlet%2Fdocker-7dbd508c79cf09803a2a05ee36b55ae9219a6218f0637891b33e1ac25db10b5d.yml
3-
openapi_spec_hash: 16948cc9b83def4e333889ca4e0497f3
4-
config_hash: a0d02ef4b296f2f9edd1fffc571fe475
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hexlet%2Fdocker-7c27e60683f553b522c94b55041ccbc74513c0149abef7c85c313c18aba4132a.yml
3+
openapi_spec_hash: 2a49592907fe275ad63f5caca002f67d
4+
config_hash: 6c8d41e69c7e4032b23f6adbe9fc9a81

lib/docker_engine_ruby/client.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ class Client < DockerEngineRuby::Internal::Transport::BaseClient
2020
ENVIRONMENTS = {production: "http://localhost:2375", production_tls: "https://localhost:2376"}
2121
# rubocop:enable Style/MutableConstant
2222

23+
# Path to the trusted CA certificate file (PEM) used to verify the Docker daemon
24+
# certificate.
25+
# @return [String, nil]
26+
attr_reader :tls_ca_cert_path
27+
28+
# Path to the client TLS certificate file (PEM).
29+
# @return [String, nil]
30+
attr_reader :tls_client_cert_path
31+
32+
# Path to the client TLS private key file (PEM).
33+
# @return [String, nil]
34+
attr_reader :tls_client_key_path
35+
2336
# @return [DockerEngineRuby::Resources::Auth]
2437
attr_reader :auth
2538

@@ -67,6 +80,15 @@ class Client < DockerEngineRuby::Internal::Transport::BaseClient
6780

6881
# Creates and returns a new client for interacting with the API.
6982
#
83+
# @param tls_ca_cert_path [String, nil] Path to the trusted CA certificate file (PEM) used to verify the Docker daemon
84+
# certificate. Defaults to `ENV["DOCKER_TLS_CA_CERT_PATH"]`
85+
#
86+
# @param tls_client_cert_path [String, nil] Path to the client TLS certificate file (PEM). Defaults to
87+
# `ENV["DOCKER_TLS_CLIENT_CERT_PATH"]`
88+
#
89+
# @param tls_client_key_path [String, nil] Path to the client TLS private key file (PEM). Defaults to
90+
# `ENV["DOCKER_TLS_CLIENT_KEY_PATH"]`
91+
#
7092
# @param environment [:production, :production_tls, nil] Specifies the environment to use for the API.
7193
#
7294
# Each environment maps to a different base URL:
@@ -85,6 +107,9 @@ class Client < DockerEngineRuby::Internal::Transport::BaseClient
85107
#
86108
# @param max_retry_delay [Float]
87109
def initialize(
110+
tls_ca_cert_path: ENV["DOCKER_TLS_CA_CERT_PATH"],
111+
tls_client_cert_path: ENV["DOCKER_TLS_CLIENT_CERT_PATH"],
112+
tls_client_key_path: ENV["DOCKER_TLS_CLIENT_KEY_PATH"],
88113
environment: nil,
89114
base_url: ENV["DOCKER_BASE_URL"],
90115
max_retries: self.class::DEFAULT_MAX_RETRIES,
@@ -97,6 +122,10 @@ def initialize(
97122
raise ArgumentError.new(message)
98123
end
99124

125+
@tls_ca_cert_path = tls_ca_cert_path&.to_s
126+
@tls_client_cert_path = tls_client_cert_path&.to_s
127+
@tls_client_key_path = tls_client_key_path&.to_s
128+
100129
super(
101130
base_url: base_url,
102131
timeout: timeout,

lib/docker_engine_ruby/models/config.rb

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,8 @@ class Config < DockerEngineRuby::Internal::Type::BaseModel
6262
#
6363
# `{"<port>/<tcp|udp|sctp>": {}}`
6464
#
65-
# @return [Hash{Symbol=>Hash{Symbol=>Object}}, nil]
66-
optional :exposed_ports,
67-
DockerEngineRuby::Internal::Type::HashOf[DockerEngineRuby::Internal::Type::HashOf[DockerEngineRuby::Internal::Type::Unknown]],
68-
api_name: :ExposedPorts,
69-
nil?: true
65+
# @return [Object, nil]
66+
optional :exposed_ports, DockerEngineRuby::Internal::Type::Unknown, api_name: :ExposedPorts, nil?: true
7067

7168
# @!attribute healthcheck
7269
# A test to perform to check that the container is healthy. Healthcheck commands
@@ -91,8 +88,8 @@ class Config < DockerEngineRuby::Internal::Type::BaseModel
9188
# @!attribute labels
9289
# User-defined key/value metadata.
9390
#
94-
# @return [Hash{Symbol=>String}, nil]
95-
optional :labels, DockerEngineRuby::Internal::Type::HashOf[String], api_name: :Labels
91+
# @return [Object, nil]
92+
optional :labels, DockerEngineRuby::Internal::Type::Unknown, api_name: :Labels
9693

9794
# @!attribute network_disabled
9895
# Disable networking for the container.
@@ -158,10 +155,8 @@ class Config < DockerEngineRuby::Internal::Type::BaseModel
158155
# @!attribute volumes
159156
# An object mapping mount point paths inside the container to empty objects.
160157
#
161-
# @return [Hash{Symbol=>Hash{Symbol=>Object}}, nil]
162-
optional :volumes,
163-
DockerEngineRuby::Internal::Type::HashOf[DockerEngineRuby::Internal::Type::HashOf[DockerEngineRuby::Internal::Type::Unknown]],
164-
api_name: :Volumes
158+
# @return [Object, nil]
159+
optional :volumes, DockerEngineRuby::Internal::Type::Unknown, api_name: :Volumes
165160

166161
# @!attribute working_dir
167162
# The working directory for commands to run in.
@@ -191,15 +186,15 @@ class Config < DockerEngineRuby::Internal::Type::BaseModel
191186
#
192187
# @param env [Array<String>] A list of environment variables to set inside the container in the
193188
#
194-
# @param exposed_ports [Hash{Symbol=>Hash{Symbol=>Object}}, nil] An object mapping ports to an empty object in the form:
189+
# @param exposed_ports [Object, nil] An object mapping ports to an empty object in the form:
195190
#
196191
# @param healthcheck [DockerEngineRuby::Models::Config::Healthcheck] A test to perform to check that the container is healthy.
197192
#
198193
# @param hostname [String] The hostname to use for the container, as a valid RFC 1123 hostname.
199194
#
200195
# @param image [String] The name (or reference) of the image to use when creating the container,
201196
#
202-
# @param labels [Hash{Symbol=>String}] User-defined key/value metadata.
197+
# @param labels [Object] User-defined key/value metadata.
203198
#
204199
# @param network_disabled [Boolean, nil] Disable networking for the container.
205200
#
@@ -219,7 +214,7 @@ class Config < DockerEngineRuby::Internal::Type::BaseModel
219214
#
220215
# @param user [String] Commands run as this user inside the container. If omitted, commands
221216
#
222-
# @param volumes [Hash{Symbol=>Hash{Symbol=>Object}}] An object mapping mount point paths inside the container to empty
217+
# @param volumes [Object] An object mapping mount point paths inside the container to empty
223218
#
224219
# @param working_dir [String] The working directory for commands to run in.
225220

lib/docker_engine_ruby/models/config_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class ConfigSpec < DockerEngineRuby::Internal::Type::BaseModel
1515
# @!attribute labels
1616
# User-defined key/value metadata.
1717
#
18-
# @return [Hash{Symbol=>String}, nil]
19-
optional :labels, DockerEngineRuby::Internal::Type::HashOf[String], api_name: :Labels
18+
# @return [Object, nil]
19+
optional :labels, DockerEngineRuby::Internal::Type::Unknown, api_name: :Labels
2020

2121
# @!attribute name
2222
# User-defined name of the config.
@@ -36,7 +36,7 @@ class ConfigSpec < DockerEngineRuby::Internal::Type::BaseModel
3636
#
3737
# @param data [String] Data is the data to store as a config, formatted as a standard base64-encoded
3838
#
39-
# @param labels [Hash{Symbol=>String}] User-defined key/value metadata.
39+
# @param labels [Object] User-defined key/value metadata.
4040
#
4141
# @param name [String] User-defined name of the config.
4242
#
@@ -53,15 +53,15 @@ class Templating < DockerEngineRuby::Internal::Type::BaseModel
5353
# @!attribute options
5454
# Key/value map of driver-specific options.
5555
#
56-
# @return [Hash{Symbol=>String}, nil]
57-
optional :options, DockerEngineRuby::Internal::Type::HashOf[String], api_name: :Options
56+
# @return [Object, nil]
57+
optional :options, DockerEngineRuby::Internal::Type::Unknown, api_name: :Options
5858

5959
# @!method initialize(name:, options: nil)
6060
# Driver represents a driver (network, logging, secrets).
6161
#
6262
# @param name [String] Name of the driver.
6363
#
64-
# @param options [Hash{Symbol=>String}] Key/value map of driver-specific options.
64+
# @param options [Object] Key/value map of driver-specific options.
6565
end
6666
end
6767
end

lib/docker_engine_ruby/models/connect_request.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,8 @@ class EndpointConfig < DockerEngineRuby::Internal::Type::BaseModel
4949
# DriverOpts is a mapping of driver options and values. These options are passed
5050
# directly to the driver and are driver specific.
5151
#
52-
# @return [Hash{Symbol=>String}, nil]
53-
optional :driver_opts,
54-
DockerEngineRuby::Internal::Type::HashOf[String],
55-
api_name: :DriverOpts,
56-
nil?: true
52+
# @return [Object, nil]
53+
optional :driver_opts, DockerEngineRuby::Internal::Type::Unknown, api_name: :DriverOpts, nil?: true
5754

5855
# @!attribute endpoint_id
5956
# Unique ID for the service endpoint in a Sandbox.
@@ -142,7 +139,7 @@ class EndpointConfig < DockerEngineRuby::Internal::Type::BaseModel
142139
#
143140
# @param dns_names [Array<String>] List of all DNS names an endpoint has on a specific network. This
144141
#
145-
# @param driver_opts [Hash{Symbol=>String}, nil] DriverOpts is a mapping of driver options and values. These options
142+
# @param driver_opts [Object, nil] DriverOpts is a mapping of driver options and values. These options
146143
#
147144
# @param endpoint_id [String] Unique ID for the service endpoint in a Sandbox.
148145
#

0 commit comments

Comments
 (0)