Skip to content

Commit c615d3a

Browse files
feat(api): manual updates
1 parent fd38923 commit c615d3a

File tree

4 files changed

+58
-3
lines changed

4 files changed

+58
-3
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-6e812d87c873c9043a6a27073a11dddeaad71a03c799dc6c00b3d37eace67d68.yml
3+
openapi_spec_hash: b880c18f8f82f84fc09b435c605704de
4+
config_hash: 3d6332fff1b0e408ebdd41124c0ea369

lib/docker_engine_ruby/client.rb

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

23+
# Docker daemon URL, e.g. https://localhost:2376
24+
# @return [String, nil]
25+
attr_reader :docker_host
26+
27+
# Directory with ca.pem, cert.pem, key.pem
28+
# @return [String, nil]
29+
attr_reader :docker_cert_path
30+
31+
# Set to 1 to enable TLS verification
32+
# @return [String, nil]
33+
attr_reader :docker_tls_verify
34+
2335
# @return [DockerEngineRuby::Resources::Auth]
2436
attr_reader :auth
2537

@@ -67,6 +79,12 @@ class Client < DockerEngineRuby::Internal::Transport::BaseClient
6779

6880
# Creates and returns a new client for interacting with the API.
6981
#
82+
# @param docker_host [String, nil] Docker daemon URL, e.g. https://localhost:2376 Defaults to `ENV["DOCKER_HOST"]`
83+
#
84+
# @param docker_cert_path [String, nil] Directory with ca.pem, cert.pem, key.pem Defaults to `ENV["DOCKER_CERT_PATH"]`
85+
#
86+
# @param docker_tls_verify [String, nil] Set to 1 to enable TLS verification Defaults to `ENV["DOCKER_TLS_VERIFY"]`
87+
#
7088
# @param environment [:production, :production_tls, nil] Specifies the environment to use for the API.
7189
#
7290
# Each environment maps to a different base URL:
@@ -85,6 +103,9 @@ class Client < DockerEngineRuby::Internal::Transport::BaseClient
85103
#
86104
# @param max_retry_delay [Float]
87105
def initialize(
106+
docker_host: ENV["DOCKER_HOST"],
107+
docker_cert_path: ENV["DOCKER_CERT_PATH"],
108+
docker_tls_verify: ENV["DOCKER_TLS_VERIFY"],
88109
environment: nil,
89110
base_url: ENV["DOCKER_BASE_URL"],
90111
max_retries: self.class::DEFAULT_MAX_RETRIES,
@@ -97,6 +118,10 @@ def initialize(
97118
raise ArgumentError.new(message)
98119
end
99120

121+
@docker_host = docker_host&.to_s
122+
@docker_cert_path = docker_cert_path&.to_s
123+
@docker_tls_verify = docker_tls_verify&.to_s
124+
100125
super(
101126
base_url: base_url,
102127
timeout: timeout,

rbi/docker_engine_ruby/client.rbi

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ module DockerEngineRuby
1919
T::Hash[Symbol, String]
2020
)
2121

22+
# Docker daemon URL, e.g. https://localhost:2376
23+
sig { returns(T.nilable(String)) }
24+
attr_reader :docker_host
25+
26+
# Directory with ca.pem, cert.pem, key.pem
27+
sig { returns(T.nilable(String)) }
28+
attr_reader :docker_cert_path
29+
30+
# Set to 1 to enable TLS verification
31+
sig { returns(T.nilable(String)) }
32+
attr_reader :docker_tls_verify
33+
2234
sig { returns(DockerEngineRuby::Resources::Auth) }
2335
attr_reader :auth
2436

@@ -67,6 +79,9 @@ module DockerEngineRuby
6779
# Creates and returns a new client for interacting with the API.
6880
sig do
6981
params(
82+
docker_host: T.nilable(String),
83+
docker_cert_path: T.nilable(String),
84+
docker_tls_verify: T.nilable(String),
7085
environment: T.nilable(T.any(Symbol, String)),
7186
base_url: T.nilable(String),
7287
max_retries: Integer,
@@ -76,6 +91,12 @@ module DockerEngineRuby
7691
).returns(T.attached_class)
7792
end
7893
def self.new(
94+
# Docker daemon URL, e.g. https://localhost:2376 Defaults to `ENV["DOCKER_HOST"]`
95+
docker_host: ENV["DOCKER_HOST"],
96+
# Directory with ca.pem, cert.pem, key.pem Defaults to `ENV["DOCKER_CERT_PATH"]`
97+
docker_cert_path: ENV["DOCKER_CERT_PATH"],
98+
# Set to 1 to enable TLS verification Defaults to `ENV["DOCKER_TLS_VERIFY"]`
99+
docker_tls_verify: ENV["DOCKER_TLS_VERIFY"],
79100
# Specifies the environment to use for the API.
80101
#
81102
# Each environment maps to a different base URL:

sig/docker_engine_ruby/client.rbs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ module DockerEngineRuby
1313
production_tls: "https://localhost:2376"
1414
}
1515

16+
attr_reader docker_host: String?
17+
18+
attr_reader docker_cert_path: String?
19+
20+
attr_reader docker_tls_verify: String?
21+
1622
attr_reader auth: DockerEngineRuby::Resources::Auth
1723

1824
attr_reader system_: DockerEngineRuby::Resources::System
@@ -44,6 +50,9 @@ module DockerEngineRuby
4450
attr_reader distribution: DockerEngineRuby::Resources::Distribution
4551

4652
def initialize: (
53+
?docker_host: String?,
54+
?docker_cert_path: String?,
55+
?docker_tls_verify: String?,
4756
?environment: :production | :production_tls | nil,
4857
?base_url: String?,
4958
?max_retries: Integer,

0 commit comments

Comments
 (0)