kubernetes-cli 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,219 @@
1
+ # typed: strong
2
+ class KubernetesCLI
3
+ extend T::Sig
4
+ BeforeCallback = T.type_alias { T.proc.params(cmd: T::Array[String]).void }
5
+ AfterCallback = T.type_alias { T.proc.params(cmd: T::Array[String], last_status: Process::Status).void }
6
+ STATUS_KEY = :kubernetes_cli_last_status
7
+ STDOUT_KEY = :kubernetes_cli_stdout
8
+ STDERR_KEY = :kubernetes_cli_stderr
9
+
10
+ class KubernetesError < StandardError
11
+ end
12
+
13
+ class InvalidResourceError < KubernetesError
14
+ extend T::Sig
15
+
16
+ sig { returns(T.nilable(::KubeDSL::DSLObject)) }
17
+ attr_reader :resource
18
+
19
+ sig { params(resource: ::KubeDSL::DSLObject).returns(::KubeDSL::DSLObject) }
20
+ attr_writer :resource
21
+
22
+ sig { params(args: T.untyped).void }
23
+ def initialize(*args); end
24
+ end
25
+
26
+ class InvalidResourceUriError < KubernetesError
27
+ extend T::Sig
28
+
29
+ sig { returns(T.nilable(String)) }
30
+ attr_reader :resource_uri
31
+
32
+ sig { params(resource_uri: String).returns(String) }
33
+ attr_writer :resource_uri
34
+
35
+ sig { params(args: T.untyped).void }
36
+ def initialize(*args); end
37
+ end
38
+
39
+ class GetResourceError < KubernetesError
40
+ end
41
+
42
+ class DeleteResourceError < KubernetesError
43
+ end
44
+
45
+ class PatchResourceError < KubernetesError
46
+ end
47
+
48
+ class AnnotateResourceError < KubernetesError
49
+ end
50
+
51
+ class GetVersionError < KubernetesError
52
+ end
53
+
54
+ sig { returns(String) }
55
+ attr_reader :kubeconfig_path
56
+
57
+ sig { returns(String) }
58
+ attr_reader :executable
59
+
60
+ sig { params(kubeconfig_path: String, executable: String).void }
61
+ def initialize(kubeconfig_path, executable = KubectlRb.executable); end
62
+
63
+ sig { params(block: BeforeCallback).void }
64
+ def before_execute(&block); end
65
+
66
+ sig { params(block: AfterCallback).void }
67
+ def after_execute(&block); end
68
+
69
+ sig { returns(T.nilable(Process::Status)) }
70
+ def last_status; end
71
+
72
+ sig { params(block: T.proc.params(last_status: Process::Status).void).void }
73
+ def with_last_status(&block); end
74
+
75
+ sig { params(block: T.proc.params(last_status: Process::Status).void).void }
76
+ def on_last_status_failure(&block); end
77
+
78
+ sig { returns(T::Hash[T.untyped, T.untyped]) }
79
+ def version; end
80
+
81
+ sig { params(cmd: T.any(String, T::Array[String])).void }
82
+ def run_cmd(cmd); end
83
+
84
+ sig do
85
+ params(
86
+ container_cmd: T.any(String, T::Array[String]),
87
+ namespace: String,
88
+ pod: String,
89
+ tty: T::Boolean,
90
+ container: T.nilable(String),
91
+ out_file: T.nilable(String)
92
+ ).void
93
+ end
94
+ def exec_cmd(container_cmd, namespace, pod, tty = true, container = nil, out_file = nil); end
95
+
96
+ sig do
97
+ params(
98
+ container_cmd: T.any(String, T::Array[String]),
99
+ namespace: String,
100
+ pod: String,
101
+ tty: T::Boolean,
102
+ container: T.nilable(String)
103
+ ).void
104
+ end
105
+ def system_cmd(container_cmd, namespace, pod, tty = true, container = nil); end
106
+
107
+ sig { params(res: ::KubeDSL::DSLObject, dry_run: T::Boolean).void }
108
+ def apply(res, dry_run: false); end
109
+
110
+ sig { params(uri: String, dry_run: T::Boolean).void }
111
+ def apply_uri(uri, dry_run: false); end
112
+
113
+ sig { params(type: String, namespace: String, name: String).returns(T::Hash[String, T.untyped]) }
114
+ def get_object(type, namespace, name); end
115
+
116
+ sig { params(type: String, namespace: T.any(String, Symbol), match_labels: T::Hash[String, String]).returns(T::Array[T.untyped]) }
117
+ def get_objects(type, namespace, match_labels = {}); end
118
+
119
+ sig { params(type: String, namespace: String, name: String).void }
120
+ def delete_object(type, namespace, name); end
121
+
122
+ sig { params(type: String, namespace: T.any(String, Symbol), match_labels: T::Hash[String, String]).void }
123
+ def delete_objects(type, namespace, match_labels = {}); end
124
+
125
+ sig do
126
+ params(
127
+ type: String,
128
+ namespace: String,
129
+ name: String,
130
+ patch_data: String,
131
+ patch_type: String
132
+ ).void
133
+ end
134
+ def patch_object(type, namespace, name, patch_data, patch_type = 'merge'); end
135
+
136
+ sig do
137
+ params(
138
+ type: String,
139
+ namespace: String,
140
+ name: String,
141
+ annotations: T::Hash[String, String],
142
+ overwrite: T::Boolean
143
+ ).void
144
+ end
145
+ def annotate(type, namespace, name, annotations, overwrite: true); end
146
+
147
+ sig { params(namespace: String, selector: T::Hash[String, String], follow: T::Boolean).void }
148
+ def logtail(namespace, selector, follow: true); end
149
+
150
+ sig { returns(String) }
151
+ def current_context; end
152
+
153
+ sig { returns(String) }
154
+ def api_resources; end
155
+
156
+ sig { params(namespace: String, deployment: String).void }
157
+ def restart_deployment(namespace, deployment); end
158
+
159
+ sig { params(out: T.any(StringIO, IO), err: T.any(StringIO, IO), block: T.proc.void).void }
160
+ def with_pipes(out = STDOUT, err = STDERR, &block); end
161
+
162
+ sig { returns(T.any(StringIO, IO)) }
163
+ def stdout; end
164
+
165
+ sig { params(new_stdout: T.nilable(T.any(StringIO, IO))).void }
166
+ def stdout=(new_stdout); end
167
+
168
+ sig { returns(T.any(StringIO, IO)) }
169
+ def stderr; end
170
+
171
+ sig { params(new_stderr: T.nilable(T.any(StringIO, IO))).void }
172
+ def stderr=(new_stderr); end
173
+
174
+ sig { returns(T::Hash[String, String]) }
175
+ def env; end
176
+
177
+ sig { returns(T::Array[String]) }
178
+ def base_cmd; end
179
+
180
+ sig { params(cmd: T::Array[String]).void }
181
+ def execc(cmd); end
182
+
183
+ sig { params(cmd: T::Array[String]).void }
184
+ def systemm(cmd); end
185
+
186
+ sig { params(cmd: T::Array[String]).void }
187
+ def systemm_default(cmd); end
188
+
189
+ sig { params(cmd: T::Array[String]).void }
190
+ def systemm_open3(cmd); end
191
+
192
+ sig { params(cmd: T::Array[String]).returns(String) }
193
+ def backticks(cmd); end
194
+
195
+ sig { params(cmd: T::Array[String]).returns(String) }
196
+ def backticks_default(cmd); end
197
+
198
+ sig { params(cmd: T::Array[String]).returns(String) }
199
+ def backticks_open3(cmd); end
200
+
201
+ sig do
202
+ params(
203
+ env: T::Hash[String, String],
204
+ cmd: T::Array[String],
205
+ opts: T::Hash[Symbol, T.untyped],
206
+ block: T.proc.params(p_stdin: IO).void
207
+ ).void
208
+ end
209
+ def open3_w(env, cmd, opts = {}, &block); end
210
+
211
+ sig { params(cmd: T::Array[String]).void }
212
+ def run_before_callbacks(cmd); end
213
+
214
+ sig { params(cmd: T::Array[String]).void }
215
+ def run_after_callbacks(cmd); end
216
+
217
+ sig { params(status: Process::Status).void }
218
+ def last_status=(status); end
219
+ end