Module: ApiClient
- Includes:
- ApiRoutes
- Included in:
- ClusterService, DevService, InstallService, KubeconfigService, PreviewService, Uffizzi::Cli::Account, Uffizzi::Cli::Cluster, Uffizzi::Cli::Config, Uffizzi::Cli::Connect, Uffizzi::Cli::Dev, Uffizzi::Cli::Dev::Ingress, Uffizzi::Cli::Disconnect, Uffizzi::Cli::Install, Uffizzi::Cli::Login, Uffizzi::Cli::LoginByIdentityToken, Uffizzi::Cli::Logout, Uffizzi::Cli::Preview, Uffizzi::Cli::Preview::Service, Uffizzi::Cli::Project, Uffizzi::Cli::Project::Compose, Uffizzi::Cli::Project::Secret, Uffizzi::Cli::Status, Uffizzi::Cli::Uninstall
- Defined in:
- lib/uffizzi/clients/api/api_client.rb
Defined Under Namespace
Classes: ResponseError
Instance Method Summary
collapse
-
#bulk_create_secrets(server, project_slug, params) ⇒ Object
-
#check_can_install(server, account_id) ⇒ Object
-
#check_credential(server, account_id, type) ⇒ Object
-
#create_access_token(server, session_id) ⇒ Object
-
#create_account_controller_settings(server, account_id, params = {}) ⇒ Object
-
#create_ci_session(server, params = {}) ⇒ Object
-
#create_cluster(server, project_slug, params) ⇒ Object
-
#create_credential(server, account_id, params) ⇒ Object
-
#create_deployment(server, project_slug, params) ⇒ Object
-
#create_project(server, account_id, params) ⇒ Object
-
#create_session(server, params = {}) ⇒ Object
-
#delete_account_controller_settings(server, account_id, id) ⇒ Object
-
#delete_cluster(server, project_slug, params) ⇒ Object
-
#delete_credential(server, account_id, credential_type) ⇒ Object
-
#delete_deployment(server, project_slug, deployment_id) ⇒ Object
-
#delete_project(server, project_slug) ⇒ Object
-
#delete_secret(server, project_slug, id) ⇒ Object
-
#deploy_containers(server, project_slug, deployment_id, params) ⇒ Object
-
#describe_compose_file(server, project_slug) ⇒ Object
-
#describe_deployment(server, project_slug, deployment_id) ⇒ Object
-
#destroy_session(server) ⇒ Object
-
#fetch_account(server, account_name) ⇒ Object
-
#fetch_account_projects(server, account_id) ⇒ Object
-
#fetch_accounts(server) ⇒ Object
-
#fetch_credentials(server, account_id) ⇒ Object
-
#fetch_deployment_service_logs(server, project_slug, deployment_id, container_name) ⇒ Object
-
#fetch_deployment_services(server, project_slug, deployment_id) ⇒ Object
-
#fetch_deployments(server, project_slug, filter) ⇒ Object
-
#fetch_events(server, project_slug, deployment_id) ⇒ Object
-
#fetch_project(server, project_slug) ⇒ Object
-
#fetch_projects(server) ⇒ Object
-
#fetch_secrets(server, project_slug) ⇒ Object
-
#get_access_token(server, code) ⇒ Object
-
#get_account_clusters(server, account_id) ⇒ Object
-
#get_account_controller_settings(server, account_id) ⇒ Object
-
#get_activity_items(server, project_slug, deployment_id) ⇒ Object
-
#get_cluster(server, project_slug, params) ⇒ Object
-
#get_cluster_ingresses(server, project_slug, params) ⇒ Object
-
#get_k8s_container_description(server, project_slug, deployment_id, container_name) ⇒ Object
-
#get_project_clusters(server, project_slug, params = nil) ⇒ Object
-
#scale_down_cluster(server, project_slug, cluster_name) ⇒ Object
-
#scale_up_cluster(server, project_slug, cluster_name) ⇒ Object
-
#set_compose_file(server, params, project_slug) ⇒ Object
-
#sync_cluster(server, project_slug, cluster_name) ⇒ Object
-
#unset_compose_file(server, project_slug) ⇒ Object
-
#update_account(server, account_name, params) ⇒ Object
-
#update_account_controller_settings(server, account_id, id, params = {}) ⇒ Object
-
#update_credential(server, account_id, params, type) ⇒ Object
-
#update_deployment(server, project_slug, deployment_id, params) ⇒ Object
-
#validate_compose_file(server, project_slug) ⇒ Object
Methods included from ApiRoutes
#access_token_url, #access_tokens_url, #account_can_install_uri, #account_clusters_uri, #account_controller_setting_uri, #account_controller_settings_uri, #account_projects_uri, #account_uri, #accounts_uri, #activity_items_uri, #browser_sign_in_url, #check_credential_uri, #ci_session_uri, #cluster_uri, #compose_file_uri, #create_projects_uri, #credential_uri, #credentials_uri, #deploy_containers_uri, #deployment_uri, #deployments_uri, #events_uri, #k8s_container_description_uri, #preview_service_logs_uri, #preview_services_uri, #project_cluster_ingresses_uri, #project_clusters_uri, #project_uri, #projects_uri, #scale_down_cluster_uri, #scale_up_cluster_uri, #secret_uri, #secrets_uri, #session_uri, #sync_cluster_uri, #validate_compose_file_uri
Instance Method Details
#bulk_create_secrets(server, project_slug, params) ⇒ Object
175
176
177
178
179
180
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 175
def bulk_create_secrets(server, project_slug, params)
uri = "#{secrets_uri(server, project_slug)}/bulk_create"
response = http_client.make_post_request(uri, params)
build_response(response)
end
|
#check_can_install(server, account_id) ⇒ Object
47
48
49
50
51
52
53
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 47
def check_can_install(server, account_id)
uri = account_can_install_uri(server, account_id)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#check_credential(server, account_id, type) ⇒ Object
77
78
79
80
81
82
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 77
def check_credential(server, account_id, type)
uri = check_credential_uri(server, account_id, type)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#create_access_token(server, session_id) ⇒ Object
301
302
303
304
305
306
307
308
309
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 301
def create_access_token(server, session_id)
uri = access_tokens_url(server)
params = { session_id: session_id }
response = http_client.make_post_request(uri, params)
build_response(response)
end
|
#create_account_controller_settings(server, account_id, params = {}) ⇒ Object
353
354
355
356
357
358
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 353
def create_account_controller_settings(server, account_id, params = {})
uri = account_controller_settings_uri(server, account_id)
response = http_client.make_post_request(uri, params)
build_response(response)
end
|
#create_ci_session(server, params = {}) ⇒ Object
26
27
28
29
30
31
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 26
def create_ci_session(server, params = {})
uri = ci_session_uri(server)
response = http_client.make_post_request(uri, params)
build_response(response)
end
|
#create_cluster(server, project_slug, params) ⇒ Object
273
274
275
276
277
278
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 273
def create_cluster(server, project_slug, params)
uri = project_clusters_uri(server, project_slug, oidc_token: nil)
response = http_client.make_post_request(uri, params)
build_response(response)
end
|
#create_credential(server, account_id, params) ⇒ Object
119
120
121
122
123
124
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 119
def create_credential(server, account_id, params)
uri = credentials_uri(server, account_id)
response = http_client.make_post_request(uri, params)
build_response(response)
end
|
#create_deployment(server, project_slug, params) ⇒ Object
210
211
212
213
214
215
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 210
def create_deployment(server, project_slug, params)
uri = deployments_uri(server, project_slug)
response = http_client.make_post_request(uri, params)
build_response(response)
end
|
#create_project(server, account_id, params) ⇒ Object
105
106
107
108
109
110
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 105
def create_project(server, account_id, params)
uri = create_projects_uri(server, account_id)
response = http_client.make_post_request(uri, params)
build_response(response)
end
|
#create_session(server, params = {}) ⇒ Object
19
20
21
22
23
24
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 19
def create_session(server, params = {})
uri = session_uri(server)
response = http_client.make_post_request(uri, params)
build_response(response)
end
|
#delete_account_controller_settings(server, account_id, id) ⇒ Object
367
368
369
370
371
372
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 367
def delete_account_controller_settings(server, account_id, id)
uri = account_controller_setting_uri(server, account_id, id)
response = http_client.make_delete_request(uri)
build_response(response)
end
|
#delete_cluster(server, project_slug, params) ⇒ Object
332
333
334
335
336
337
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 332
def delete_cluster(server, project_slug, params)
uri = cluster_uri(server, project_slug, cluster_name: params[:cluster_name], oidc_token: params[:oidc_token])
response = http_client.make_delete_request(uri)
build_response(response)
end
|
#delete_credential(server, account_id, credential_type) ⇒ Object
140
141
142
143
144
145
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 140
def delete_credential(server, account_id, credential_type)
uri = credential_uri(server, account_id, credential_type)
response = http_client.make_delete_request(uri)
build_response(response)
end
|
#delete_deployment(server, project_slug, deployment_id) ⇒ Object
224
225
226
227
228
229
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 224
def delete_deployment(server, project_slug, deployment_id)
uri = deployment_uri(server, project_slug, deployment_id)
response = http_client.make_delete_request(uri)
build_response(response)
end
|
#delete_project(server, project_slug) ⇒ Object
112
113
114
115
116
117
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 112
def delete_project(server, project_slug)
uri = project_uri(server, project_slug)
response = http_client.make_delete_request(uri)
build_response(response)
end
|
#delete_secret(server, project_slug, id) ⇒ Object
182
183
184
185
186
187
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 182
def delete_secret(server, project_slug, id)
uri = secret_uri(server, project_slug, id)
response = http_client.make_delete_request(uri)
build_response(response)
end
|
#deploy_containers(server, project_slug, deployment_id, params) ⇒ Object
252
253
254
255
256
257
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 252
def deploy_containers(server, project_slug, deployment_id, params)
uri = deploy_containers_uri(server, project_slug, deployment_id)
response = http_client.make_post_request(uri, params)
build_response(response)
end
|
#describe_compose_file(server, project_slug) ⇒ Object
189
190
191
192
193
194
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 189
def describe_compose_file(server, project_slug)
uri = compose_file_uri(server, project_slug)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#describe_deployment(server, project_slug, deployment_id) ⇒ Object
231
232
233
234
235
236
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 231
def describe_deployment(server, project_slug, deployment_id)
uri = deployment_uri(server, project_slug, deployment_id)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#destroy_session(server) ⇒ Object
33
34
35
36
37
38
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 33
def destroy_session(server)
uri = session_uri(server)
response = http_client.make_delete_request(uri)
build_response(response)
end
|
#fetch_account(server, account_name) ⇒ Object
91
92
93
94
95
96
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 91
def fetch_account(server, account_name)
uri = account_uri(server, account_name)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#fetch_account_projects(server, account_id) ⇒ Object
62
63
64
65
66
67
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 62
def fetch_account_projects(server, account_id)
uri = account_projects_uri(server, account_id)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#fetch_accounts(server) ⇒ Object
40
41
42
43
44
45
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 40
def fetch_accounts(server)
uri = accounts_uri(server)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#fetch_credentials(server, account_id) ⇒ Object
69
70
71
72
73
74
75
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 69
def fetch_credentials(server, account_id)
uri = credentials_uri(server, account_id)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#fetch_deployment_service_logs(server, project_slug, deployment_id, container_name) ⇒ Object
147
148
149
150
151
152
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 147
def fetch_deployment_service_logs(server, project_slug, deployment_id, container_name)
uri = preview_service_logs_uri(server, project_slug, deployment_id, container_name)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#fetch_deployment_services(server, project_slug, deployment_id) ⇒ Object
133
134
135
136
137
138
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 133
def fetch_deployment_services(server, project_slug, deployment_id)
uri = preview_services_uri(server, project_slug, deployment_id)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#fetch_deployments(server, project_slug, filter) ⇒ Object
203
204
205
206
207
208
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 203
def fetch_deployments(server, project_slug, filter)
uri = deployments_uri(server, project_slug, filter)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#fetch_events(server, project_slug, deployment_id) ⇒ Object
238
239
240
241
242
243
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 238
def fetch_events(server, project_slug, deployment_id)
uri = events_uri(server, project_slug, deployment_id)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#fetch_project(server, project_slug) ⇒ Object
84
85
86
87
88
89
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 84
def fetch_project(server, project_slug)
uri = project_uri(server, project_slug)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#fetch_projects(server) ⇒ Object
55
56
57
58
59
60
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 55
def fetch_projects(server)
uri = projects_uri(server)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#fetch_secrets(server, project_slug) ⇒ Object
168
169
170
171
172
173
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 168
def fetch_secrets(server, project_slug)
uri = secrets_uri(server, project_slug)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#get_access_token(server, code) ⇒ Object
325
326
327
328
329
330
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 325
def get_access_token(server, code)
uri = access_token_url(server, code)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#get_account_clusters(server, account_id) ⇒ Object
339
340
341
342
343
344
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 339
def get_account_clusters(server, account_id)
uri = account_clusters_uri(server, account_id)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#get_account_controller_settings(server, account_id) ⇒ Object
346
347
348
349
350
351
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 346
def get_account_controller_settings(server, account_id)
uri = account_controller_settings_uri(server, account_id)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#get_activity_items(server, project_slug, deployment_id) ⇒ Object
245
246
247
248
249
250
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 245
def get_activity_items(server, project_slug, deployment_id)
uri = activity_items_uri(server, project_slug, deployment_id)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#get_cluster(server, project_slug, params) ⇒ Object
311
312
313
314
315
316
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 311
def get_cluster(server, project_slug, params)
uri = cluster_uri(server, project_slug, cluster_name: params[:cluster_name], oidc_token: params[:oidc_token])
response = http_client.make_get_request(uri)
build_response(response)
end
|
#get_cluster_ingresses(server, project_slug, params) ⇒ Object
318
319
320
321
322
323
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 318
def get_cluster_ingresses(server, project_slug, params)
uri = project_cluster_ingresses_uri(server, project_slug, cluster_name: params[:cluster_name], oidc_token: params[:oidc_token])
response = http_client.make_get_request(uri)
build_response(response)
end
|
#get_k8s_container_description(server, project_slug, deployment_id, container_name) ⇒ Object
259
260
261
262
263
264
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 259
def get_k8s_container_description(server, project_slug, deployment_id, container_name)
uri = k8s_container_description_uri(server, project_slug, deployment_id, container_name)
response = http_client.make_get_request(uri)
build_response(response)
end
|
#get_project_clusters(server, project_slug, params = nil) ⇒ Object
266
267
268
269
270
271
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 266
def get_project_clusters(server, project_slug, params = nil)
uri = project_clusters_uri(server, project_slug, oidc_token: params[:oidc_token])
response = http_client.make_get_request(uri)
build_response(response)
end
|
#scale_down_cluster(server, project_slug, cluster_name) ⇒ Object
280
281
282
283
284
285
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 280
def scale_down_cluster(server, project_slug, cluster_name)
uri = scale_down_cluster_uri(server, project_slug, cluster_name)
response = http_client.make_put_request(uri)
build_response(response)
end
|
#scale_up_cluster(server, project_slug, cluster_name) ⇒ Object
287
288
289
290
291
292
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 287
def scale_up_cluster(server, project_slug, cluster_name)
uri = scale_up_cluster_uri(server, project_slug, cluster_name)
response = http_client.make_put_request(uri)
build_response(response)
end
|
#set_compose_file(server, params, project_slug) ⇒ Object
154
155
156
157
158
159
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 154
def set_compose_file(server, params, project_slug)
uri = compose_file_uri(server, project_slug)
response = http_client.make_post_request(uri, params)
build_response(response)
end
|
#sync_cluster(server, project_slug, cluster_name) ⇒ Object
294
295
296
297
298
299
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 294
def sync_cluster(server, project_slug, cluster_name)
uri = sync_cluster_uri(server, project_slug, cluster_name)
response = http_client.make_put_request(uri)
build_response(response)
end
|
#unset_compose_file(server, project_slug) ⇒ Object
161
162
163
164
165
166
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 161
def unset_compose_file(server, project_slug)
uri = compose_file_uri(server, project_slug)
response = http_client.make_delete_request(uri)
build_response(response)
end
|
#update_account(server, account_name, params) ⇒ Object
98
99
100
101
102
103
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 98
def update_account(server, account_name, params)
uri = account_uri(server, account_name)
response = http_client.make_put_request(uri, params)
build_response(response)
end
|
#update_account_controller_settings(server, account_id, id, params = {}) ⇒ Object
360
361
362
363
364
365
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 360
def update_account_controller_settings(server, account_id, id, params = {})
uri = account_controller_setting_uri(server, account_id, id)
response = http_client.make_put_request(uri, params)
build_response(response)
end
|
#update_credential(server, account_id, params, type) ⇒ Object
126
127
128
129
130
131
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 126
def update_credential(server, account_id, params, type)
uri = credential_uri(server, account_id, type)
response = http_client.make_put_request(uri, params)
build_response(response)
end
|
#update_deployment(server, project_slug, deployment_id, params) ⇒ Object
217
218
219
220
221
222
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 217
def update_deployment(server, project_slug, deployment_id, params)
uri = deployment_uri(server, project_slug, deployment_id)
response = http_client.make_put_request(uri, params)
build_response(response)
end
|
#validate_compose_file(server, project_slug) ⇒ Object
196
197
198
199
200
201
|
# File 'lib/uffizzi/clients/api/api_client.rb', line 196
def validate_compose_file(server, project_slug)
uri = validate_compose_file_uri(server, project_slug)
response = http_client.make_get_request(uri)
build_response(response)
end
|