infrawrench-sdk 0.1.1
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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +94 -0
- data/infrawrench-sdk.gemspec +58 -0
- data/lib/infrawrench/client.rb +4112 -0
- data/lib/infrawrench/sdk.rb +17 -0
- data/lib/infrawrench/transport.rb +302 -0
- data/lib/infrawrench/version.rb +19 -0
- data/lib/infrawrench-sdk.rb +18 -0
- data/sig/infrawrench/sdk.rbs +2099 -0
- metadata +62 -0
|
@@ -0,0 +1,4112 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# infrawrench-sdk v0.1.1 | MIT | Copyright (c) 2026 Infrawrench LLC
|
|
4
|
+
# https://github.com/Infrawrench/Infrawrench
|
|
5
|
+
#
|
|
6
|
+
# Generated from the Infrawrench API OpenAPI 3.1 spec (API version 0.1.1).
|
|
7
|
+
#
|
|
8
|
+
# DO NOT EDIT. Regenerate with:
|
|
9
|
+
# pnpm --filter @infrawrench/web generate:sdk
|
|
10
|
+
#
|
|
11
|
+
# Internal routes are absent by construction: the generator consumes the same
|
|
12
|
+
# published spec that /openapi.json serves, which drops every operation
|
|
13
|
+
# marked x-internal.
|
|
14
|
+
|
|
15
|
+
module Infrawrench
|
|
16
|
+
# `client.accounts.credentials`
|
|
17
|
+
class AccountsCredentialsNamespace
|
|
18
|
+
# @api private
|
|
19
|
+
# @param transport [Transport]
|
|
20
|
+
def initialize(transport)
|
|
21
|
+
@transport = transport
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Fetch the decrypted credentials for an account
|
|
25
|
+
#
|
|
26
|
+
# Returns the credentials map as it was originally submitted. Sensitive —
|
|
27
|
+
# gate access carefully.
|
|
28
|
+
#
|
|
29
|
+
# _Requires permission: `secrets:read`._
|
|
30
|
+
#
|
|
31
|
+
# GET /api/org/{orgId}/accounts/{id}/credentials
|
|
32
|
+
#
|
|
33
|
+
# Raises on 404: Not found
|
|
34
|
+
#
|
|
35
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
36
|
+
# constructed with.
|
|
37
|
+
# @param id [String]
|
|
38
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
39
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
40
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
41
|
+
def get(id:, org_id: nil, request_options: nil)
|
|
42
|
+
@transport.request(
|
|
43
|
+
http_method: "GET",
|
|
44
|
+
path: "/api/org/{orgId}/accounts/{id}/credentials",
|
|
45
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
46
|
+
request_options: request_options
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Rotate the credentials an account uses to talk to the upstream provider
|
|
51
|
+
#
|
|
52
|
+
# Replaces the encrypted credentials blob in place. Used to swap a stale or
|
|
53
|
+
# narrowly-scoped token for a freshly-minted one without recreating the
|
|
54
|
+
# account (preserves existing resources, pins, dashboards, sync history).
|
|
55
|
+
#
|
|
56
|
+
# _Requires permission: `secrets:write`._
|
|
57
|
+
#
|
|
58
|
+
# PUT /api/org/{orgId}/accounts/{id}/credentials
|
|
59
|
+
#
|
|
60
|
+
# Raises on 400: Bad request
|
|
61
|
+
#
|
|
62
|
+
# Raises on 404: Not found
|
|
63
|
+
#
|
|
64
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
65
|
+
# constructed with.
|
|
66
|
+
# @param id [String]
|
|
67
|
+
# @param body [Hash] Request body, shaped as `Hash`.
|
|
68
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
69
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
70
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
71
|
+
def update(id:, body:, org_id: nil, request_options: nil)
|
|
72
|
+
@transport.request(
|
|
73
|
+
http_method: "PUT",
|
|
74
|
+
path: "/api/org/{orgId}/accounts/{id}/credentials",
|
|
75
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
76
|
+
body: body,
|
|
77
|
+
request_options: request_options
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# `client.accounts.sync_type`
|
|
83
|
+
class AccountsSyncTypeNamespace
|
|
84
|
+
# @api private
|
|
85
|
+
# @param transport [Transport]
|
|
86
|
+
def initialize(transport)
|
|
87
|
+
@transport = transport
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Sync a single resource type and return its resources
|
|
91
|
+
#
|
|
92
|
+
# _Requires permission: `resources:read`._
|
|
93
|
+
#
|
|
94
|
+
# POST /api/org/{orgId}/accounts/{id}/sync-type/{typeId}
|
|
95
|
+
#
|
|
96
|
+
# Raises on 404: Not found
|
|
97
|
+
#
|
|
98
|
+
# Raises on 500: Server error
|
|
99
|
+
#
|
|
100
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
101
|
+
# constructed with.
|
|
102
|
+
# @param id [String]
|
|
103
|
+
# @param type_id [String]
|
|
104
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
105
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<Resource>` — see
|
|
106
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
107
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
108
|
+
def create(id:, type_id:, org_id: nil, request_options: nil)
|
|
109
|
+
@transport.request(
|
|
110
|
+
http_method: "POST",
|
|
111
|
+
path: "/api/org/{orgId}/accounts/{id}/sync-type/{typeId}",
|
|
112
|
+
path_params: { "orgId" => org_id, "id" => id, "typeId" => type_id },
|
|
113
|
+
request_options: request_options
|
|
114
|
+
)
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# `client.accounts`
|
|
119
|
+
class AccountsNamespace
|
|
120
|
+
# @return [AccountsCredentialsNamespace] `client.accounts.credentials`
|
|
121
|
+
attr_reader :credentials
|
|
122
|
+
# @return [AccountsSyncTypeNamespace] `client.accounts.sync_type`
|
|
123
|
+
attr_reader :sync_type
|
|
124
|
+
|
|
125
|
+
# @api private
|
|
126
|
+
# @param transport [Transport]
|
|
127
|
+
def initialize(transport)
|
|
128
|
+
@transport = transport
|
|
129
|
+
@credentials = AccountsCredentialsNamespace.new(@transport)
|
|
130
|
+
@sync_type = AccountsSyncTypeNamespace.new(@transport)
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Create an account
|
|
134
|
+
#
|
|
135
|
+
# Stores encrypted credentials and triggers a first sync. `syncError` is set
|
|
136
|
+
# if the initial sync failed (the account row is still created).
|
|
137
|
+
#
|
|
138
|
+
# _Requires permission: `accounts:write`._
|
|
139
|
+
#
|
|
140
|
+
# POST /api/org/{orgId}/accounts
|
|
141
|
+
#
|
|
142
|
+
# Raises on 400: Bad request
|
|
143
|
+
#
|
|
144
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
145
|
+
# constructed with.
|
|
146
|
+
# @param body [Hash] Request body, shaped as `CreateAccountRequest & Hash`.
|
|
147
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
148
|
+
# @return [Hash] Parsed JSON, shaped as `CreateAccountResponse` — see
|
|
149
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
150
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
151
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
152
|
+
@transport.request(
|
|
153
|
+
http_method: "POST",
|
|
154
|
+
path: "/api/org/{orgId}/accounts",
|
|
155
|
+
path_params: { "orgId" => org_id },
|
|
156
|
+
body: body,
|
|
157
|
+
request_options: request_options
|
|
158
|
+
)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Delete an account
|
|
162
|
+
#
|
|
163
|
+
# _Requires permission: `accounts:delete`._
|
|
164
|
+
#
|
|
165
|
+
# DELETE /api/org/{orgId}/accounts/{id}
|
|
166
|
+
#
|
|
167
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
168
|
+
# constructed with.
|
|
169
|
+
# @param id [String]
|
|
170
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
171
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
172
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
173
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
174
|
+
@transport.request(
|
|
175
|
+
http_method: "DELETE",
|
|
176
|
+
path: "/api/org/{orgId}/accounts/{id}",
|
|
177
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
178
|
+
request_options: request_options
|
|
179
|
+
)
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Account metadata + resource type list
|
|
183
|
+
#
|
|
184
|
+
# _Requires permission: `accounts:read`._
|
|
185
|
+
#
|
|
186
|
+
# GET /api/org/{orgId}/accounts/{id}/detail
|
|
187
|
+
#
|
|
188
|
+
# Raises on 404: Not found
|
|
189
|
+
#
|
|
190
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
191
|
+
# constructed with.
|
|
192
|
+
# @param id [String]
|
|
193
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
194
|
+
# @return [Hash] Parsed JSON, shaped as `AccountDetail` — see `sig/infrawrench/sdk.rbs`.
|
|
195
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
196
|
+
def detail(id:, org_id: nil, request_options: nil)
|
|
197
|
+
@transport.request(
|
|
198
|
+
http_method: "GET",
|
|
199
|
+
path: "/api/org/{orgId}/accounts/{id}/detail",
|
|
200
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
201
|
+
request_options: request_options
|
|
202
|
+
)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# List accounts in this organization
|
|
206
|
+
#
|
|
207
|
+
# _Requires permission: `accounts:read`._
|
|
208
|
+
#
|
|
209
|
+
# GET /api/org/{orgId}/accounts
|
|
210
|
+
#
|
|
211
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
212
|
+
# constructed with.
|
|
213
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
214
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<Account>` — see
|
|
215
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
216
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
217
|
+
def list(org_id: nil, request_options: nil)
|
|
218
|
+
@transport.request(
|
|
219
|
+
http_method: "GET",
|
|
220
|
+
path: "/api/org/{orgId}/accounts",
|
|
221
|
+
path_params: { "orgId" => org_id },
|
|
222
|
+
request_options: request_options
|
|
223
|
+
)
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# List installed plugins and their credential fields
|
|
227
|
+
#
|
|
228
|
+
# _Requires permission: `accounts:read`._
|
|
229
|
+
#
|
|
230
|
+
# GET /api/org/{orgId}/accounts/plugins
|
|
231
|
+
#
|
|
232
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
233
|
+
# constructed with.
|
|
234
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
235
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<PluginSummary>` — see
|
|
236
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
237
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
238
|
+
def plugins(org_id: nil, request_options: nil)
|
|
239
|
+
@transport.request(
|
|
240
|
+
http_method: "GET",
|
|
241
|
+
path: "/api/org/{orgId}/accounts/plugins",
|
|
242
|
+
path_params: { "orgId" => org_id },
|
|
243
|
+
request_options: request_options
|
|
244
|
+
)
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# List cached resources for an account
|
|
248
|
+
#
|
|
249
|
+
# _Requires permission: `resources:read`._
|
|
250
|
+
#
|
|
251
|
+
# GET /api/org/{orgId}/accounts/{id}/resources
|
|
252
|
+
#
|
|
253
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
254
|
+
# constructed with.
|
|
255
|
+
# @param id [String]
|
|
256
|
+
# @param top_level_only [String, nil] If `true`, only resources with no `parentResourceId`
|
|
257
|
+
# are returned.
|
|
258
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
259
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<Resource>` — see
|
|
260
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
261
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
262
|
+
def resources(id:, org_id: nil, top_level_only: nil, request_options: nil)
|
|
263
|
+
@transport.request(
|
|
264
|
+
http_method: "GET",
|
|
265
|
+
path: "/api/org/{orgId}/accounts/{id}/resources",
|
|
266
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
267
|
+
query: { "topLevelOnly" => top_level_only },
|
|
268
|
+
request_options: request_options
|
|
269
|
+
)
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# Sync all resource types for an account
|
|
273
|
+
#
|
|
274
|
+
# _Requires permission: `resources:read`._
|
|
275
|
+
#
|
|
276
|
+
# POST /api/org/{orgId}/accounts/{id}/sync
|
|
277
|
+
#
|
|
278
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
279
|
+
# constructed with.
|
|
280
|
+
# @param id [String]
|
|
281
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
282
|
+
# @return [Hash] Parsed JSON, shaped as `SyncResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
283
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
284
|
+
def sync(id:, org_id: nil, request_options: nil)
|
|
285
|
+
@transport.request(
|
|
286
|
+
http_method: "POST",
|
|
287
|
+
path: "/api/org/{orgId}/accounts/{id}/sync",
|
|
288
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
289
|
+
request_options: request_options
|
|
290
|
+
)
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Update an account (rename and/or change bastion binding)
|
|
294
|
+
#
|
|
295
|
+
# _Requires permission: `accounts:write`._
|
|
296
|
+
#
|
|
297
|
+
# PATCH /api/org/{orgId}/accounts/{id}
|
|
298
|
+
#
|
|
299
|
+
# Raises on 400: Bad request
|
|
300
|
+
#
|
|
301
|
+
# Raises on 404: Not found
|
|
302
|
+
#
|
|
303
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
304
|
+
# constructed with.
|
|
305
|
+
# @param id [String]
|
|
306
|
+
# @param body [Hash] Request body, shaped as `UpdateAccountRequest`.
|
|
307
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
308
|
+
# @return [Hash] Parsed JSON, shaped as `UpdatedAccount` — see `sig/infrawrench/sdk.rbs`.
|
|
309
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
310
|
+
def update(id:, body:, org_id: nil, request_options: nil)
|
|
311
|
+
@transport.request(
|
|
312
|
+
http_method: "PATCH",
|
|
313
|
+
path: "/api/org/{orgId}/accounts/{id}",
|
|
314
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
315
|
+
body: body,
|
|
316
|
+
request_options: request_options
|
|
317
|
+
)
|
|
318
|
+
end
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
# `client.agents.sessions`
|
|
322
|
+
class AgentsSessionsNamespace
|
|
323
|
+
# @api private
|
|
324
|
+
# @param transport [Transport]
|
|
325
|
+
def initialize(transport)
|
|
326
|
+
@transport = transport
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# Create an agent session
|
|
330
|
+
#
|
|
331
|
+
# _Requires permission: `resources:write`._
|
|
332
|
+
#
|
|
333
|
+
# POST /api/org/{orgId}/agents/sessions
|
|
334
|
+
#
|
|
335
|
+
# Raises on 400: Bad request
|
|
336
|
+
#
|
|
337
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
338
|
+
# constructed with.
|
|
339
|
+
# @param body [Hash] Request body, shaped as `CreateAgentSession`.
|
|
340
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
341
|
+
# @return [Hash] Parsed JSON, shaped as `AgentSession` — see `sig/infrawrench/sdk.rbs`.
|
|
342
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
343
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
344
|
+
@transport.request(
|
|
345
|
+
http_method: "POST",
|
|
346
|
+
path: "/api/org/{orgId}/agents/sessions",
|
|
347
|
+
path_params: { "orgId" => org_id },
|
|
348
|
+
body: body,
|
|
349
|
+
request_options: request_options
|
|
350
|
+
)
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
# Delete an agent session and destroy its VM
|
|
354
|
+
#
|
|
355
|
+
# _Requires permission: `resources:delete`._
|
|
356
|
+
#
|
|
357
|
+
# DELETE /api/org/{orgId}/agents/sessions/{id}
|
|
358
|
+
#
|
|
359
|
+
# Raises on 404: Not found
|
|
360
|
+
#
|
|
361
|
+
# Raises on 502: The provider refused to delete the VM
|
|
362
|
+
#
|
|
363
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
364
|
+
# constructed with.
|
|
365
|
+
# @param id [String]
|
|
366
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
367
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
368
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
369
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
370
|
+
@transport.request(
|
|
371
|
+
http_method: "DELETE",
|
|
372
|
+
path: "/api/org/{orgId}/agents/sessions/{id}",
|
|
373
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
374
|
+
request_options: request_options
|
|
375
|
+
)
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# List agent sessions
|
|
379
|
+
#
|
|
380
|
+
# _Requires permission: `resources:read`._
|
|
381
|
+
#
|
|
382
|
+
# GET /api/org/{orgId}/agents/sessions
|
|
383
|
+
#
|
|
384
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
385
|
+
# constructed with.
|
|
386
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
387
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<AgentSession>` — see
|
|
388
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
389
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
390
|
+
def list(org_id: nil, request_options: nil)
|
|
391
|
+
@transport.request(
|
|
392
|
+
http_method: "GET",
|
|
393
|
+
path: "/api/org/{orgId}/agents/sessions",
|
|
394
|
+
path_params: { "orgId" => org_id },
|
|
395
|
+
request_options: request_options
|
|
396
|
+
)
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
# Return the command and working directory for an agent session
|
|
400
|
+
#
|
|
401
|
+
# _Requires permission: `resources:execute`._
|
|
402
|
+
#
|
|
403
|
+
# POST /api/org/{orgId}/agents/sessions/{id}/open
|
|
404
|
+
#
|
|
405
|
+
# Raises on 404: Not found
|
|
406
|
+
#
|
|
407
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
408
|
+
# constructed with.
|
|
409
|
+
# @param id [String]
|
|
410
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
411
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
412
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
413
|
+
def open(id:, org_id: nil, request_options: nil)
|
|
414
|
+
@transport.request(
|
|
415
|
+
http_method: "POST",
|
|
416
|
+
path: "/api/org/{orgId}/agents/sessions/{id}/open",
|
|
417
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
418
|
+
request_options: request_options
|
|
419
|
+
)
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
# Return reconciliation branch metadata
|
|
423
|
+
#
|
|
424
|
+
# _Requires permission: `resources:execute`._
|
|
425
|
+
#
|
|
426
|
+
# POST /api/org/{orgId}/agents/sessions/{id}/reconcile
|
|
427
|
+
#
|
|
428
|
+
# Raises on 404: Not found
|
|
429
|
+
#
|
|
430
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
431
|
+
# constructed with.
|
|
432
|
+
# @param id [String]
|
|
433
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
434
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
435
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
436
|
+
def reconcile(id:, org_id: nil, request_options: nil)
|
|
437
|
+
@transport.request(
|
|
438
|
+
http_method: "POST",
|
|
439
|
+
path: "/api/org/{orgId}/agents/sessions/{id}/reconcile",
|
|
440
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
441
|
+
request_options: request_options
|
|
442
|
+
)
|
|
443
|
+
end
|
|
444
|
+
end
|
|
445
|
+
|
|
446
|
+
# `client.agents.settings`
|
|
447
|
+
class AgentsSettingsNamespace
|
|
448
|
+
# @api private
|
|
449
|
+
# @param transport [Transport]
|
|
450
|
+
def initialize(transport)
|
|
451
|
+
@transport = transport
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
# Get saved Agents defaults
|
|
455
|
+
#
|
|
456
|
+
# _Requires permission: `accounts:read`._
|
|
457
|
+
#
|
|
458
|
+
# GET /api/org/{orgId}/agents/settings
|
|
459
|
+
#
|
|
460
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
461
|
+
# constructed with.
|
|
462
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
463
|
+
# @return [Hash, nil] Parsed JSON, shaped as `AgentSettings` — see
|
|
464
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
465
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
466
|
+
def get(org_id: nil, request_options: nil)
|
|
467
|
+
@transport.request(
|
|
468
|
+
http_method: "GET",
|
|
469
|
+
path: "/api/org/{orgId}/agents/settings",
|
|
470
|
+
path_params: { "orgId" => org_id },
|
|
471
|
+
request_options: request_options
|
|
472
|
+
)
|
|
473
|
+
end
|
|
474
|
+
|
|
475
|
+
# Save Agents defaults
|
|
476
|
+
#
|
|
477
|
+
# _Requires permission: `accounts:write`._
|
|
478
|
+
#
|
|
479
|
+
# PUT /api/org/{orgId}/agents/settings
|
|
480
|
+
#
|
|
481
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
482
|
+
# constructed with.
|
|
483
|
+
# @param body [Hash] Request body, shaped as `AgentSettings & Hash`.
|
|
484
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
485
|
+
# @return [Hash] Parsed JSON, shaped as `AgentSettings & Hash` — see
|
|
486
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
487
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
488
|
+
def update(body:, org_id: nil, request_options: nil)
|
|
489
|
+
@transport.request(
|
|
490
|
+
http_method: "PUT",
|
|
491
|
+
path: "/api/org/{orgId}/agents/settings",
|
|
492
|
+
path_params: { "orgId" => org_id },
|
|
493
|
+
body: body,
|
|
494
|
+
request_options: request_options
|
|
495
|
+
)
|
|
496
|
+
end
|
|
497
|
+
end
|
|
498
|
+
|
|
499
|
+
# `client.agents`
|
|
500
|
+
class AgentsNamespace
|
|
501
|
+
# @return [AgentsSessionsNamespace] `client.agents.sessions`
|
|
502
|
+
attr_reader :sessions
|
|
503
|
+
# @return [AgentsSettingsNamespace] `client.agents.settings`
|
|
504
|
+
attr_reader :settings
|
|
505
|
+
|
|
506
|
+
# @api private
|
|
507
|
+
# @param transport [Transport]
|
|
508
|
+
def initialize(transport)
|
|
509
|
+
@transport = transport
|
|
510
|
+
@sessions = AgentsSessionsNamespace.new(@transport)
|
|
511
|
+
@settings = AgentsSettingsNamespace.new(@transport)
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
# List accounts whose plugins can create agent VMs
|
|
515
|
+
#
|
|
516
|
+
# _Requires permission: `accounts:read`._
|
|
517
|
+
#
|
|
518
|
+
# GET /api/org/{orgId}/agents/accounts
|
|
519
|
+
#
|
|
520
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
521
|
+
# constructed with.
|
|
522
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
523
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<AgentVmAccount>` — see
|
|
524
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
525
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
526
|
+
def accounts(org_id: nil, request_options: nil)
|
|
527
|
+
@transport.request(
|
|
528
|
+
http_method: "GET",
|
|
529
|
+
path: "/api/org/{orgId}/agents/accounts",
|
|
530
|
+
path_params: { "orgId" => org_id },
|
|
531
|
+
request_options: request_options
|
|
532
|
+
)
|
|
533
|
+
end
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
# `client.api_keys`
|
|
537
|
+
class ApiKeysNamespace
|
|
538
|
+
# @api private
|
|
539
|
+
# @param transport [Transport]
|
|
540
|
+
def initialize(transport)
|
|
541
|
+
@transport = transport
|
|
542
|
+
end
|
|
543
|
+
|
|
544
|
+
# Create an API key (plaintext returned once)
|
|
545
|
+
#
|
|
546
|
+
# POST /api/org/{orgId}/api-keys
|
|
547
|
+
#
|
|
548
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
549
|
+
# constructed with.
|
|
550
|
+
# @param body [Hash] Request body, shaped as `CreateApiKeyRequest`.
|
|
551
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
552
|
+
# @return [Hash] Parsed JSON, shaped as `CreatedApiKey` — see `sig/infrawrench/sdk.rbs`.
|
|
553
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
554
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
555
|
+
@transport.request(
|
|
556
|
+
http_method: "POST",
|
|
557
|
+
path: "/api/org/{orgId}/api-keys",
|
|
558
|
+
path_params: { "orgId" => org_id },
|
|
559
|
+
body: body,
|
|
560
|
+
request_options: request_options
|
|
561
|
+
)
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
# List API keys (no plaintext)
|
|
565
|
+
#
|
|
566
|
+
# GET /api/org/{orgId}/api-keys
|
|
567
|
+
#
|
|
568
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
569
|
+
# constructed with.
|
|
570
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
571
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<ApiKey>` — see
|
|
572
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
573
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
574
|
+
def list(org_id: nil, request_options: nil)
|
|
575
|
+
@transport.request(
|
|
576
|
+
http_method: "GET",
|
|
577
|
+
path: "/api/org/{orgId}/api-keys",
|
|
578
|
+
path_params: { "orgId" => org_id },
|
|
579
|
+
request_options: request_options
|
|
580
|
+
)
|
|
581
|
+
end
|
|
582
|
+
|
|
583
|
+
# Revoke an API key
|
|
584
|
+
#
|
|
585
|
+
# POST /api/org/{orgId}/api-keys/{id}/revoke
|
|
586
|
+
#
|
|
587
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
588
|
+
# constructed with.
|
|
589
|
+
# @param id [String]
|
|
590
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
591
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
592
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
593
|
+
def revoke(id:, org_id: nil, request_options: nil)
|
|
594
|
+
@transport.request(
|
|
595
|
+
http_method: "POST",
|
|
596
|
+
path: "/api/org/{orgId}/api-keys/{id}/revoke",
|
|
597
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
598
|
+
request_options: request_options
|
|
599
|
+
)
|
|
600
|
+
end
|
|
601
|
+
|
|
602
|
+
# Rotate an API key (revokes old, returns new)
|
|
603
|
+
#
|
|
604
|
+
# POST /api/org/{orgId}/api-keys/{id}/rotate
|
|
605
|
+
#
|
|
606
|
+
# Raises on 404: Not found
|
|
607
|
+
#
|
|
608
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
609
|
+
# constructed with.
|
|
610
|
+
# @param id [String]
|
|
611
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
612
|
+
# @return [Hash] Parsed JSON, shaped as `CreatedApiKey` — see `sig/infrawrench/sdk.rbs`.
|
|
613
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
614
|
+
def rotate(id:, org_id: nil, request_options: nil)
|
|
615
|
+
@transport.request(
|
|
616
|
+
http_method: "POST",
|
|
617
|
+
path: "/api/org/{orgId}/api-keys/{id}/rotate",
|
|
618
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
619
|
+
request_options: request_options
|
|
620
|
+
)
|
|
621
|
+
end
|
|
622
|
+
end
|
|
623
|
+
|
|
624
|
+
# `client.artifacts`
|
|
625
|
+
class ArtifactsNamespace
|
|
626
|
+
# @api private
|
|
627
|
+
# @param transport [Transport]
|
|
628
|
+
def initialize(transport)
|
|
629
|
+
@transport = transport
|
|
630
|
+
end
|
|
631
|
+
|
|
632
|
+
# List artifact-registry items for a resource
|
|
633
|
+
#
|
|
634
|
+
# _Requires permission: `storage:read`._
|
|
635
|
+
#
|
|
636
|
+
# POST /api/org/{orgId}/artifacts/list
|
|
637
|
+
#
|
|
638
|
+
# Raises on 400: Bad request
|
|
639
|
+
#
|
|
640
|
+
# Raises on 404: Not found
|
|
641
|
+
#
|
|
642
|
+
# Raises on 500: Server error
|
|
643
|
+
#
|
|
644
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
645
|
+
# constructed with.
|
|
646
|
+
# @param body [Hash] Request body, shaped as `ArtifactsListRequest`.
|
|
647
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
648
|
+
# @return [Hash] Parsed JSON, shaped as `JsonObject` — see `sig/infrawrench/sdk.rbs`.
|
|
649
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
650
|
+
def list(body:, org_id: nil, request_options: nil)
|
|
651
|
+
@transport.request(
|
|
652
|
+
http_method: "POST",
|
|
653
|
+
path: "/api/org/{orgId}/artifacts/list",
|
|
654
|
+
path_params: { "orgId" => org_id },
|
|
655
|
+
body: body,
|
|
656
|
+
request_options: request_options
|
|
657
|
+
)
|
|
658
|
+
end
|
|
659
|
+
end
|
|
660
|
+
|
|
661
|
+
# `client.associations`
|
|
662
|
+
class AssociationsNamespace
|
|
663
|
+
# @api private
|
|
664
|
+
# @param transport [Transport]
|
|
665
|
+
def initialize(transport)
|
|
666
|
+
@transport = transport
|
|
667
|
+
end
|
|
668
|
+
|
|
669
|
+
# Wire one resource's output into another resource's secret field
|
|
670
|
+
#
|
|
671
|
+
# _Requires permission: `secrets:write`._
|
|
672
|
+
#
|
|
673
|
+
# POST /api/org/{orgId}/associations
|
|
674
|
+
#
|
|
675
|
+
# Raises on 404: Not found
|
|
676
|
+
#
|
|
677
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
678
|
+
# constructed with.
|
|
679
|
+
# @param body [Hash] Request body, shaped as `AssociationRequest`.
|
|
680
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
681
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
682
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
683
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
684
|
+
@transport.request(
|
|
685
|
+
http_method: "POST",
|
|
686
|
+
path: "/api/org/{orgId}/associations",
|
|
687
|
+
path_params: { "orgId" => org_id },
|
|
688
|
+
body: body,
|
|
689
|
+
request_options: request_options
|
|
690
|
+
)
|
|
691
|
+
end
|
|
692
|
+
|
|
693
|
+
# Set a secret field to a literal plaintext value
|
|
694
|
+
#
|
|
695
|
+
# _Requires permission: `secrets:write`._
|
|
696
|
+
#
|
|
697
|
+
# POST /api/org/{orgId}/associations/literal
|
|
698
|
+
#
|
|
699
|
+
# Raises on 404: Not found
|
|
700
|
+
#
|
|
701
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
702
|
+
# constructed with.
|
|
703
|
+
# @param body [Hash] Request body, shaped as `LiteralAssociationRequest`.
|
|
704
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
705
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
706
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
707
|
+
def literal(body:, org_id: nil, request_options: nil)
|
|
708
|
+
@transport.request(
|
|
709
|
+
http_method: "POST",
|
|
710
|
+
path: "/api/org/{orgId}/associations/literal",
|
|
711
|
+
path_params: { "orgId" => org_id },
|
|
712
|
+
body: body,
|
|
713
|
+
request_options: request_options
|
|
714
|
+
)
|
|
715
|
+
end
|
|
716
|
+
end
|
|
717
|
+
|
|
718
|
+
# `client.audit_logs`
|
|
719
|
+
class AuditLogsNamespace
|
|
720
|
+
# @api private
|
|
721
|
+
# @param transport [Transport]
|
|
722
|
+
def initialize(transport)
|
|
723
|
+
@transport = transport
|
|
724
|
+
end
|
|
725
|
+
|
|
726
|
+
# List audit log entries (paginated, filterable)
|
|
727
|
+
#
|
|
728
|
+
# _Requires permission: `audit:read`._
|
|
729
|
+
#
|
|
730
|
+
# GET /api/org/{orgId}/audit-logs
|
|
731
|
+
#
|
|
732
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
733
|
+
# constructed with.
|
|
734
|
+
# @param page [Integer, nil]
|
|
735
|
+
# @param page_size [Integer, nil]
|
|
736
|
+
# @param action [String, nil]
|
|
737
|
+
# @param entity_type [String, nil]
|
|
738
|
+
# @param user_id [String, nil]
|
|
739
|
+
# @param from [String, nil]
|
|
740
|
+
# @param to [String, nil]
|
|
741
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
742
|
+
# @return [Hash] Parsed JSON, shaped as `AuditResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
743
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
744
|
+
def get(
|
|
745
|
+
org_id: nil,
|
|
746
|
+
page: nil,
|
|
747
|
+
page_size: nil,
|
|
748
|
+
action: nil,
|
|
749
|
+
entity_type: nil,
|
|
750
|
+
user_id: nil,
|
|
751
|
+
from: nil,
|
|
752
|
+
to: nil,
|
|
753
|
+
request_options: nil
|
|
754
|
+
)
|
|
755
|
+
@transport.request(
|
|
756
|
+
http_method: "GET",
|
|
757
|
+
path: "/api/org/{orgId}/audit-logs",
|
|
758
|
+
path_params: { "orgId" => org_id },
|
|
759
|
+
query: {
|
|
760
|
+
"page" => page,
|
|
761
|
+
"pageSize" => page_size,
|
|
762
|
+
"action" => action,
|
|
763
|
+
"entityType" => entity_type,
|
|
764
|
+
"userId" => user_id,
|
|
765
|
+
"from" => from,
|
|
766
|
+
"to" => to
|
|
767
|
+
},
|
|
768
|
+
request_options: request_options
|
|
769
|
+
)
|
|
770
|
+
end
|
|
771
|
+
end
|
|
772
|
+
|
|
773
|
+
# `client.auth`
|
|
774
|
+
class AuthNamespace
|
|
775
|
+
# @api private
|
|
776
|
+
# @param transport [Transport]
|
|
777
|
+
def initialize(transport)
|
|
778
|
+
@transport = transport
|
|
779
|
+
end
|
|
780
|
+
|
|
781
|
+
# Current session + onboarding status
|
|
782
|
+
#
|
|
783
|
+
# GET /api/auth/me
|
|
784
|
+
#
|
|
785
|
+
# Raises on 401: Unauthenticated
|
|
786
|
+
#
|
|
787
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
788
|
+
# @return [Hash] Parsed JSON, shaped as `Session` — see `sig/infrawrench/sdk.rbs`.
|
|
789
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
790
|
+
def me(request_options: nil)
|
|
791
|
+
@transport.request(
|
|
792
|
+
http_method: "GET",
|
|
793
|
+
path: "/api/auth/me",
|
|
794
|
+
request_options: request_options
|
|
795
|
+
)
|
|
796
|
+
end
|
|
797
|
+
|
|
798
|
+
# Organizations the current user belongs to
|
|
799
|
+
#
|
|
800
|
+
# GET /api/auth/orgs
|
|
801
|
+
#
|
|
802
|
+
# Raises on 401: Unauthenticated
|
|
803
|
+
#
|
|
804
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
805
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<OrgMembership>` — see
|
|
806
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
807
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
808
|
+
def orgs(request_options: nil)
|
|
809
|
+
@transport.request(
|
|
810
|
+
http_method: "GET",
|
|
811
|
+
path: "/api/auth/orgs",
|
|
812
|
+
request_options: request_options
|
|
813
|
+
)
|
|
814
|
+
end
|
|
815
|
+
end
|
|
816
|
+
|
|
817
|
+
# `client.bastions`
|
|
818
|
+
class BastionsNamespace
|
|
819
|
+
# @api private
|
|
820
|
+
# @param transport [Transport]
|
|
821
|
+
def initialize(transport)
|
|
822
|
+
@transport = transport
|
|
823
|
+
end
|
|
824
|
+
|
|
825
|
+
# Register a new bastion (returns the enrollment token once)
|
|
826
|
+
#
|
|
827
|
+
# _Requires permission: `bastions:write`._
|
|
828
|
+
#
|
|
829
|
+
# POST /api/org/{orgId}/bastions
|
|
830
|
+
#
|
|
831
|
+
# Raises on 400: Bad request
|
|
832
|
+
#
|
|
833
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
834
|
+
# constructed with.
|
|
835
|
+
# @param body [Hash] Request body, shaped as `CreateBastionRequest`.
|
|
836
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
837
|
+
# @return [Hash] Parsed JSON, shaped as `CreateBastionResponse` — see
|
|
838
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
839
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
840
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
841
|
+
@transport.request(
|
|
842
|
+
http_method: "POST",
|
|
843
|
+
path: "/api/org/{orgId}/bastions",
|
|
844
|
+
path_params: { "orgId" => org_id },
|
|
845
|
+
body: body,
|
|
846
|
+
request_options: request_options
|
|
847
|
+
)
|
|
848
|
+
end
|
|
849
|
+
|
|
850
|
+
# Revoke a bastion — accounts referencing it have their bastion binding
|
|
851
|
+
# cleared
|
|
852
|
+
#
|
|
853
|
+
# _Requires permission: `bastions:write`._
|
|
854
|
+
#
|
|
855
|
+
# DELETE /api/org/{orgId}/bastions/{id}
|
|
856
|
+
#
|
|
857
|
+
# Raises on 404: Not found
|
|
858
|
+
#
|
|
859
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
860
|
+
# constructed with.
|
|
861
|
+
# @param id [String]
|
|
862
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
863
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
864
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
865
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
866
|
+
@transport.request(
|
|
867
|
+
http_method: "DELETE",
|
|
868
|
+
path: "/api/org/{orgId}/bastions/{id}",
|
|
869
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
870
|
+
request_options: request_options
|
|
871
|
+
)
|
|
872
|
+
end
|
|
873
|
+
|
|
874
|
+
# List bastion agents registered to this org
|
|
875
|
+
#
|
|
876
|
+
# _Requires permission: `bastions:read`._
|
|
877
|
+
#
|
|
878
|
+
# GET /api/org/{orgId}/bastions
|
|
879
|
+
#
|
|
880
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
881
|
+
# constructed with.
|
|
882
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
883
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<Bastion>` — see
|
|
884
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
885
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
886
|
+
def list(org_id: nil, request_options: nil)
|
|
887
|
+
@transport.request(
|
|
888
|
+
http_method: "GET",
|
|
889
|
+
path: "/api/org/{orgId}/bastions",
|
|
890
|
+
path_params: { "orgId" => org_id },
|
|
891
|
+
request_options: request_options
|
|
892
|
+
)
|
|
893
|
+
end
|
|
894
|
+
end
|
|
895
|
+
|
|
896
|
+
# `client.billing`
|
|
897
|
+
class BillingNamespace
|
|
898
|
+
# @api private
|
|
899
|
+
# @param transport [Transport]
|
|
900
|
+
def initialize(transport)
|
|
901
|
+
@transport = transport
|
|
902
|
+
end
|
|
903
|
+
|
|
904
|
+
# Start a Stripe Checkout session
|
|
905
|
+
#
|
|
906
|
+
# Rejected with 400 for complimentary organizations — they are never billed.
|
|
907
|
+
#
|
|
908
|
+
# _Requires permission: `billing:write`._
|
|
909
|
+
#
|
|
910
|
+
# POST /api/org/{orgId}/billing/checkout
|
|
911
|
+
#
|
|
912
|
+
# Raises on 400: Bad request
|
|
913
|
+
#
|
|
914
|
+
# Raises on 500: Server error
|
|
915
|
+
#
|
|
916
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
917
|
+
# constructed with.
|
|
918
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
919
|
+
# @return [Hash] Parsed JSON, shaped as `StripeRedirectUrl` — see `sig/infrawrench/sdk.rbs`.
|
|
920
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
921
|
+
def checkout(org_id: nil, request_options: nil)
|
|
922
|
+
@transport.request(
|
|
923
|
+
http_method: "POST",
|
|
924
|
+
path: "/api/org/{orgId}/billing/checkout",
|
|
925
|
+
path_params: { "orgId" => org_id },
|
|
926
|
+
request_options: request_options
|
|
927
|
+
)
|
|
928
|
+
end
|
|
929
|
+
|
|
930
|
+
# Get a Stripe customer portal URL
|
|
931
|
+
#
|
|
932
|
+
# _Requires permission: `billing:write`._
|
|
933
|
+
#
|
|
934
|
+
# POST /api/org/{orgId}/billing/portal
|
|
935
|
+
#
|
|
936
|
+
# Raises on 404: Not found
|
|
937
|
+
#
|
|
938
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
939
|
+
# constructed with.
|
|
940
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
941
|
+
# @return [Hash] Parsed JSON, shaped as `StripeRedirectUrl` — see `sig/infrawrench/sdk.rbs`.
|
|
942
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
943
|
+
def portal(org_id: nil, request_options: nil)
|
|
944
|
+
@transport.request(
|
|
945
|
+
http_method: "POST",
|
|
946
|
+
path: "/api/org/{orgId}/billing/portal",
|
|
947
|
+
path_params: { "orgId" => org_id },
|
|
948
|
+
request_options: request_options
|
|
949
|
+
)
|
|
950
|
+
end
|
|
951
|
+
|
|
952
|
+
# Get the org's billing status (complimentary flag + subscription or `null`)
|
|
953
|
+
#
|
|
954
|
+
# _Requires permission: `billing:read`._
|
|
955
|
+
#
|
|
956
|
+
# GET /api/org/{orgId}/billing/status
|
|
957
|
+
#
|
|
958
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
959
|
+
# constructed with.
|
|
960
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
961
|
+
# @return [Hash] Parsed JSON, shaped as `BillingStatus` — see `sig/infrawrench/sdk.rbs`.
|
|
962
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
963
|
+
def status(org_id: nil, request_options: nil)
|
|
964
|
+
@transport.request(
|
|
965
|
+
http_method: "GET",
|
|
966
|
+
path: "/api/org/{orgId}/billing/status",
|
|
967
|
+
path_params: { "orgId" => org_id },
|
|
968
|
+
request_options: request_options
|
|
969
|
+
)
|
|
970
|
+
end
|
|
971
|
+
end
|
|
972
|
+
|
|
973
|
+
# `client.budgets`
|
|
974
|
+
class BudgetsNamespace
|
|
975
|
+
# @api private
|
|
976
|
+
# @param transport [Transport]
|
|
977
|
+
def initialize(transport)
|
|
978
|
+
@transport = transport
|
|
979
|
+
end
|
|
980
|
+
|
|
981
|
+
# Create a budget
|
|
982
|
+
#
|
|
983
|
+
# POST /api/org/{orgId}/budgets
|
|
984
|
+
#
|
|
985
|
+
# Raises on 400: Bad request
|
|
986
|
+
#
|
|
987
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
988
|
+
# constructed with.
|
|
989
|
+
# @param body [Hash] Request body, shaped as `BudgetInput`.
|
|
990
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
991
|
+
# @return [Hash] Parsed JSON, shaped as `BudgetFull` — see `sig/infrawrench/sdk.rbs`.
|
|
992
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
993
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
994
|
+
@transport.request(
|
|
995
|
+
http_method: "POST",
|
|
996
|
+
path: "/api/org/{orgId}/budgets",
|
|
997
|
+
path_params: { "orgId" => org_id },
|
|
998
|
+
body: body,
|
|
999
|
+
request_options: request_options
|
|
1000
|
+
)
|
|
1001
|
+
end
|
|
1002
|
+
|
|
1003
|
+
# Delete a budget
|
|
1004
|
+
#
|
|
1005
|
+
# DELETE /api/org/{orgId}/budgets/{id}
|
|
1006
|
+
#
|
|
1007
|
+
# Raises on 404: Not found
|
|
1008
|
+
#
|
|
1009
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1010
|
+
# constructed with.
|
|
1011
|
+
# @param id [String]
|
|
1012
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1013
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1014
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1015
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
1016
|
+
@transport.request(
|
|
1017
|
+
http_method: "DELETE",
|
|
1018
|
+
path: "/api/org/{orgId}/budgets/{id}",
|
|
1019
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1020
|
+
request_options: request_options
|
|
1021
|
+
)
|
|
1022
|
+
end
|
|
1023
|
+
|
|
1024
|
+
# Alert event history for a budget
|
|
1025
|
+
#
|
|
1026
|
+
# GET /api/org/{orgId}/budgets/{id}/events
|
|
1027
|
+
#
|
|
1028
|
+
# Raises on 404: Not found
|
|
1029
|
+
#
|
|
1030
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1031
|
+
# constructed with.
|
|
1032
|
+
# @param id [String]
|
|
1033
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1034
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<BudgetAlertEvent>` — see
|
|
1035
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1036
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1037
|
+
def events(id:, org_id: nil, request_options: nil)
|
|
1038
|
+
@transport.request(
|
|
1039
|
+
http_method: "GET",
|
|
1040
|
+
path: "/api/org/{orgId}/budgets/{id}/events",
|
|
1041
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1042
|
+
request_options: request_options
|
|
1043
|
+
)
|
|
1044
|
+
end
|
|
1045
|
+
|
|
1046
|
+
# Get a budget with current-month status
|
|
1047
|
+
#
|
|
1048
|
+
# GET /api/org/{orgId}/budgets/{id}
|
|
1049
|
+
#
|
|
1050
|
+
# Raises on 404: Not found
|
|
1051
|
+
#
|
|
1052
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1053
|
+
# constructed with.
|
|
1054
|
+
# @param id [String]
|
|
1055
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1056
|
+
# @return [Hash] Parsed JSON, shaped as `BudgetFull` — see `sig/infrawrench/sdk.rbs`.
|
|
1057
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1058
|
+
def get(id:, org_id: nil, request_options: nil)
|
|
1059
|
+
@transport.request(
|
|
1060
|
+
http_method: "GET",
|
|
1061
|
+
path: "/api/org/{orgId}/budgets/{id}",
|
|
1062
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1063
|
+
request_options: request_options
|
|
1064
|
+
)
|
|
1065
|
+
end
|
|
1066
|
+
|
|
1067
|
+
# List budgets with current-month actuals and forecasts
|
|
1068
|
+
#
|
|
1069
|
+
# GET /api/org/{orgId}/budgets
|
|
1070
|
+
#
|
|
1071
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1072
|
+
# constructed with.
|
|
1073
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1074
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<BudgetWithStatus>` — see
|
|
1075
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1076
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1077
|
+
def list(org_id: nil, request_options: nil)
|
|
1078
|
+
@transport.request(
|
|
1079
|
+
http_method: "GET",
|
|
1080
|
+
path: "/api/org/{orgId}/budgets",
|
|
1081
|
+
path_params: { "orgId" => org_id },
|
|
1082
|
+
request_options: request_options
|
|
1083
|
+
)
|
|
1084
|
+
end
|
|
1085
|
+
|
|
1086
|
+
# Update a budget
|
|
1087
|
+
#
|
|
1088
|
+
# PUT /api/org/{orgId}/budgets/{id}
|
|
1089
|
+
#
|
|
1090
|
+
# Raises on 400: Bad request
|
|
1091
|
+
#
|
|
1092
|
+
# Raises on 404: Not found
|
|
1093
|
+
#
|
|
1094
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1095
|
+
# constructed with.
|
|
1096
|
+
# @param id [String]
|
|
1097
|
+
# @param body [Hash] Request body, shaped as `BudgetInput`.
|
|
1098
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1099
|
+
# @return [Hash] Parsed JSON, shaped as `BudgetFull` — see `sig/infrawrench/sdk.rbs`.
|
|
1100
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1101
|
+
def update(id:, body:, org_id: nil, request_options: nil)
|
|
1102
|
+
@transport.request(
|
|
1103
|
+
http_method: "PUT",
|
|
1104
|
+
path: "/api/org/{orgId}/budgets/{id}",
|
|
1105
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1106
|
+
body: body,
|
|
1107
|
+
request_options: request_options
|
|
1108
|
+
)
|
|
1109
|
+
end
|
|
1110
|
+
end
|
|
1111
|
+
|
|
1112
|
+
# `client.connect`
|
|
1113
|
+
class ConnectNamespace
|
|
1114
|
+
# @api private
|
|
1115
|
+
# @param transport [Transport]
|
|
1116
|
+
def initialize(transport)
|
|
1117
|
+
@transport = transport
|
|
1118
|
+
end
|
|
1119
|
+
|
|
1120
|
+
# Deploy env vars from a source resource to an SSH target
|
|
1121
|
+
#
|
|
1122
|
+
# _Requires permission: `resources:execute`._
|
|
1123
|
+
#
|
|
1124
|
+
# POST /api/org/{orgId}/connect/env-deploy
|
|
1125
|
+
#
|
|
1126
|
+
# Raises on 400: Bad request
|
|
1127
|
+
#
|
|
1128
|
+
# Raises on 404: Not found
|
|
1129
|
+
#
|
|
1130
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1131
|
+
# constructed with.
|
|
1132
|
+
# @param body [Hash] Request body, shaped as `ConnectEnvDeployRequest`.
|
|
1133
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1134
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1135
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1136
|
+
def env_deploy(body:, org_id: nil, request_options: nil)
|
|
1137
|
+
@transport.request(
|
|
1138
|
+
http_method: "POST",
|
|
1139
|
+
path: "/api/org/{orgId}/connect/env-deploy",
|
|
1140
|
+
path_params: { "orgId" => org_id },
|
|
1141
|
+
body: body,
|
|
1142
|
+
request_options: request_options
|
|
1143
|
+
)
|
|
1144
|
+
end
|
|
1145
|
+
|
|
1146
|
+
# Materialize source outputs as a secret in the target (e.g. K8s)
|
|
1147
|
+
#
|
|
1148
|
+
# _Requires permission: `resources:write`._
|
|
1149
|
+
#
|
|
1150
|
+
# POST /api/org/{orgId}/connect/secret-export
|
|
1151
|
+
#
|
|
1152
|
+
# Raises on 400: Bad request
|
|
1153
|
+
#
|
|
1154
|
+
# Raises on 404: Not found
|
|
1155
|
+
#
|
|
1156
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1157
|
+
# constructed with.
|
|
1158
|
+
# @param body [Hash] Request body, shaped as `ConnectSecretExportRequest`.
|
|
1159
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1160
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1161
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1162
|
+
def secret_export(body:, org_id: nil, request_options: nil)
|
|
1163
|
+
@transport.request(
|
|
1164
|
+
http_method: "POST",
|
|
1165
|
+
path: "/api/org/{orgId}/connect/secret-export",
|
|
1166
|
+
path_params: { "orgId" => org_id },
|
|
1167
|
+
body: body,
|
|
1168
|
+
request_options: request_options
|
|
1169
|
+
)
|
|
1170
|
+
end
|
|
1171
|
+
|
|
1172
|
+
# List secret-export templates and target capabilities
|
|
1173
|
+
#
|
|
1174
|
+
# _Requires permission: `resources:read`._
|
|
1175
|
+
#
|
|
1176
|
+
# POST /api/org/{orgId}/connect/templates
|
|
1177
|
+
#
|
|
1178
|
+
# Raises on 404: Not found
|
|
1179
|
+
#
|
|
1180
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1181
|
+
# constructed with.
|
|
1182
|
+
# @param body [Hash] Request body, shaped as `ConnectTemplatesRequest`.
|
|
1183
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1184
|
+
# @return [Hash] Parsed JSON, shaped as `ConnectTemplatesResponse` — see
|
|
1185
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1186
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1187
|
+
def templates(body:, org_id: nil, request_options: nil)
|
|
1188
|
+
@transport.request(
|
|
1189
|
+
http_method: "POST",
|
|
1190
|
+
path: "/api/org/{orgId}/connect/templates",
|
|
1191
|
+
path_params: { "orgId" => org_id },
|
|
1192
|
+
body: body,
|
|
1193
|
+
request_options: request_options
|
|
1194
|
+
)
|
|
1195
|
+
end
|
|
1196
|
+
end
|
|
1197
|
+
|
|
1198
|
+
# `client.costs`
|
|
1199
|
+
class CostsNamespace
|
|
1200
|
+
# @api private
|
|
1201
|
+
# @param transport [Transport]
|
|
1202
|
+
def initialize(transport)
|
|
1203
|
+
@transport = transport
|
|
1204
|
+
end
|
|
1205
|
+
|
|
1206
|
+
# List distinct values for a cost dimension
|
|
1207
|
+
#
|
|
1208
|
+
# Feeds the filter and group-by pickers. Pass dimension=tag-keys for tag
|
|
1209
|
+
# keys; dimension=tag requires tagKey.
|
|
1210
|
+
#
|
|
1211
|
+
# GET /api/org/{orgId}/costs/dimensions
|
|
1212
|
+
#
|
|
1213
|
+
# Raises on 400: Bad request
|
|
1214
|
+
#
|
|
1215
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1216
|
+
# constructed with.
|
|
1217
|
+
# @param dimension [String]
|
|
1218
|
+
# @param tag_key [String, nil]
|
|
1219
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1220
|
+
# @return [Hash] Parsed JSON, shaped as `CostDimensionValues` — see
|
|
1221
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1222
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1223
|
+
def dimensions(dimension:, org_id: nil, tag_key: nil, request_options: nil)
|
|
1224
|
+
@transport.request(
|
|
1225
|
+
http_method: "GET",
|
|
1226
|
+
path: "/api/org/{orgId}/costs/dimensions",
|
|
1227
|
+
path_params: { "orgId" => org_id },
|
|
1228
|
+
query: { "dimension" => dimension, "tagKey" => tag_key },
|
|
1229
|
+
request_options: request_options
|
|
1230
|
+
)
|
|
1231
|
+
end
|
|
1232
|
+
|
|
1233
|
+
# Query aggregated cost series
|
|
1234
|
+
#
|
|
1235
|
+
# Aggregates collected provider spend into per-bucket, per-group series for
|
|
1236
|
+
# cost graphs. Currencies are never merged; mixed-currency orgs get one
|
|
1237
|
+
# series per currency. Optionally returns a previous-period comparison and a
|
|
1238
|
+
# trend forecast.
|
|
1239
|
+
#
|
|
1240
|
+
# POST /api/org/{orgId}/costs/query
|
|
1241
|
+
#
|
|
1242
|
+
# Raises on 400: Bad request
|
|
1243
|
+
#
|
|
1244
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1245
|
+
# constructed with.
|
|
1246
|
+
# @param body [Hash] Request body, shaped as `CostQueryRequest`.
|
|
1247
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1248
|
+
# @return [Hash] Parsed JSON, shaped as `CostQueryResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
1249
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1250
|
+
def query(body:, org_id: nil, request_options: nil)
|
|
1251
|
+
@transport.request(
|
|
1252
|
+
http_method: "POST",
|
|
1253
|
+
path: "/api/org/{orgId}/costs/query",
|
|
1254
|
+
path_params: { "orgId" => org_id },
|
|
1255
|
+
body: body,
|
|
1256
|
+
request_options: request_options
|
|
1257
|
+
)
|
|
1258
|
+
end
|
|
1259
|
+
|
|
1260
|
+
# Per-account cost collection status
|
|
1261
|
+
#
|
|
1262
|
+
# Which accounts support cost collection, whether their history backfill has
|
|
1263
|
+
# completed, and the ingested date coverage.
|
|
1264
|
+
#
|
|
1265
|
+
# GET /api/org/{orgId}/costs/status
|
|
1266
|
+
#
|
|
1267
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1268
|
+
# constructed with.
|
|
1269
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1270
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
1271
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1272
|
+
def status(org_id: nil, request_options: nil)
|
|
1273
|
+
@transport.request(
|
|
1274
|
+
http_method: "GET",
|
|
1275
|
+
path: "/api/org/{orgId}/costs/status",
|
|
1276
|
+
path_params: { "orgId" => org_id },
|
|
1277
|
+
request_options: request_options
|
|
1278
|
+
)
|
|
1279
|
+
end
|
|
1280
|
+
end
|
|
1281
|
+
|
|
1282
|
+
# `client.dashboards.default`
|
|
1283
|
+
class DashboardsDefaultNamespace
|
|
1284
|
+
# @api private
|
|
1285
|
+
# @param transport [Transport]
|
|
1286
|
+
def initialize(transport)
|
|
1287
|
+
@transport = transport
|
|
1288
|
+
end
|
|
1289
|
+
|
|
1290
|
+
# Get-or-create the default dashboard with its pins
|
|
1291
|
+
#
|
|
1292
|
+
# _Requires permission: `dashboards:read`._
|
|
1293
|
+
#
|
|
1294
|
+
# GET /api/org/{orgId}/dashboards/default/full
|
|
1295
|
+
#
|
|
1296
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1297
|
+
# constructed with.
|
|
1298
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1299
|
+
# @return [Hash] Parsed JSON, shaped as `DashboardWithPins` — see `sig/infrawrench/sdk.rbs`.
|
|
1300
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1301
|
+
def full(org_id: nil, request_options: nil)
|
|
1302
|
+
@transport.request(
|
|
1303
|
+
http_method: "GET",
|
|
1304
|
+
path: "/api/org/{orgId}/dashboards/default/full",
|
|
1305
|
+
path_params: { "orgId" => org_id },
|
|
1306
|
+
request_options: request_options
|
|
1307
|
+
)
|
|
1308
|
+
end
|
|
1309
|
+
end
|
|
1310
|
+
|
|
1311
|
+
# `client.dashboards.pin`
|
|
1312
|
+
class DashboardsPinNamespace
|
|
1313
|
+
# @api private
|
|
1314
|
+
# @param transport [Transport]
|
|
1315
|
+
def initialize(transport)
|
|
1316
|
+
@transport = transport
|
|
1317
|
+
end
|
|
1318
|
+
|
|
1319
|
+
# Pin a resource to a dashboard
|
|
1320
|
+
#
|
|
1321
|
+
# _Requires permission: `dashboards:write`._
|
|
1322
|
+
#
|
|
1323
|
+
# POST /api/org/{orgId}/dashboards/pin
|
|
1324
|
+
#
|
|
1325
|
+
# Raises on 404: Not found
|
|
1326
|
+
#
|
|
1327
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1328
|
+
# constructed with.
|
|
1329
|
+
# @param body [Hash] Request body, shaped as `PinRequest`.
|
|
1330
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1331
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1332
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1333
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
1334
|
+
@transport.request(
|
|
1335
|
+
http_method: "POST",
|
|
1336
|
+
path: "/api/org/{orgId}/dashboards/pin",
|
|
1337
|
+
path_params: { "orgId" => org_id },
|
|
1338
|
+
body: body,
|
|
1339
|
+
request_options: request_options
|
|
1340
|
+
)
|
|
1341
|
+
end
|
|
1342
|
+
|
|
1343
|
+
# Full enriched pin data + cached probe status
|
|
1344
|
+
#
|
|
1345
|
+
# _Requires permission: `dashboards:read`._
|
|
1346
|
+
#
|
|
1347
|
+
# GET /api/org/{orgId}/dashboards/pin/{pinId}
|
|
1348
|
+
#
|
|
1349
|
+
# Raises on 404: Not found
|
|
1350
|
+
#
|
|
1351
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1352
|
+
# constructed with.
|
|
1353
|
+
# @param pin_id [String]
|
|
1354
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1355
|
+
# @return [Hash] Parsed JSON, shaped as `PinFull` — see `sig/infrawrench/sdk.rbs`.
|
|
1356
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1357
|
+
def get(pin_id:, org_id: nil, request_options: nil)
|
|
1358
|
+
@transport.request(
|
|
1359
|
+
http_method: "GET",
|
|
1360
|
+
path: "/api/org/{orgId}/dashboards/pin/{pinId}",
|
|
1361
|
+
path_params: { "orgId" => org_id, "pinId" => pin_id },
|
|
1362
|
+
request_options: request_options
|
|
1363
|
+
)
|
|
1364
|
+
end
|
|
1365
|
+
|
|
1366
|
+
# Historical metric series for a pinned resource
|
|
1367
|
+
#
|
|
1368
|
+
# Returns per-series metric points between fromMs and toMs. The backend
|
|
1369
|
+
# auto-routes between raw, 1-minute, and 1-hour rollups based on span: ≤2h
|
|
1370
|
+
# raw, ≤7d 1m, >7d 1h.
|
|
1371
|
+
#
|
|
1372
|
+
# GET /api/org/{orgId}/dashboards/pin/{pinId}/range
|
|
1373
|
+
#
|
|
1374
|
+
# Raises on 400: Bad request
|
|
1375
|
+
#
|
|
1376
|
+
# Raises on 404: Not found
|
|
1377
|
+
#
|
|
1378
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1379
|
+
# constructed with.
|
|
1380
|
+
# @param pin_id [String]
|
|
1381
|
+
# @param from_ms [Integer, nil, nil]
|
|
1382
|
+
# @param to_ms [Integer, nil, nil]
|
|
1383
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1384
|
+
# @return [Hash] Parsed JSON, shaped as `PinRangeResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
1385
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1386
|
+
def range(pin_id:, org_id: nil, from_ms: nil, to_ms: nil, request_options: nil)
|
|
1387
|
+
@transport.request(
|
|
1388
|
+
http_method: "GET",
|
|
1389
|
+
path: "/api/org/{orgId}/dashboards/pin/{pinId}/range",
|
|
1390
|
+
path_params: { "orgId" => org_id, "pinId" => pin_id },
|
|
1391
|
+
query: { "fromMs" => from_ms, "toMs" => to_ms },
|
|
1392
|
+
request_options: request_options
|
|
1393
|
+
)
|
|
1394
|
+
end
|
|
1395
|
+
end
|
|
1396
|
+
|
|
1397
|
+
# `client.dashboards.widgets`
|
|
1398
|
+
class DashboardsWidgetsNamespace
|
|
1399
|
+
# @api private
|
|
1400
|
+
# @param transport [Transport]
|
|
1401
|
+
def initialize(transport)
|
|
1402
|
+
@transport = transport
|
|
1403
|
+
end
|
|
1404
|
+
|
|
1405
|
+
# Add a cost-graph or budget widget to a dashboard
|
|
1406
|
+
#
|
|
1407
|
+
# POST /api/org/{orgId}/dashboards/widgets
|
|
1408
|
+
#
|
|
1409
|
+
# Raises on 400: Bad request
|
|
1410
|
+
#
|
|
1411
|
+
# Raises on 404: Not found
|
|
1412
|
+
#
|
|
1413
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1414
|
+
# constructed with.
|
|
1415
|
+
# @param body [Hash] Request body, shaped as `CreateWidgetRequest`.
|
|
1416
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1417
|
+
# @return [Hash] Parsed JSON, shaped as `DashboardWidgetFull` — see
|
|
1418
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1419
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1420
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
1421
|
+
@transport.request(
|
|
1422
|
+
http_method: "POST",
|
|
1423
|
+
path: "/api/org/{orgId}/dashboards/widgets",
|
|
1424
|
+
path_params: { "orgId" => org_id },
|
|
1425
|
+
body: body,
|
|
1426
|
+
request_options: request_options
|
|
1427
|
+
)
|
|
1428
|
+
end
|
|
1429
|
+
|
|
1430
|
+
# Remove a widget from a dashboard
|
|
1431
|
+
#
|
|
1432
|
+
# DELETE /api/org/{orgId}/dashboards/widgets/{widgetId}
|
|
1433
|
+
#
|
|
1434
|
+
# Raises on 404: Not found
|
|
1435
|
+
#
|
|
1436
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1437
|
+
# constructed with.
|
|
1438
|
+
# @param widget_id [String]
|
|
1439
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1440
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1441
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1442
|
+
def delete(widget_id:, org_id: nil, request_options: nil)
|
|
1443
|
+
@transport.request(
|
|
1444
|
+
http_method: "DELETE",
|
|
1445
|
+
path: "/api/org/{orgId}/dashboards/widgets/{widgetId}",
|
|
1446
|
+
path_params: { "orgId" => org_id, "widgetId" => widget_id },
|
|
1447
|
+
request_options: request_options
|
|
1448
|
+
)
|
|
1449
|
+
end
|
|
1450
|
+
|
|
1451
|
+
# Update a widget's title, config, or layout
|
|
1452
|
+
#
|
|
1453
|
+
# PATCH /api/org/{orgId}/dashboards/widgets/{widgetId}
|
|
1454
|
+
#
|
|
1455
|
+
# Raises on 400: Bad request
|
|
1456
|
+
#
|
|
1457
|
+
# Raises on 404: Not found
|
|
1458
|
+
#
|
|
1459
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1460
|
+
# constructed with.
|
|
1461
|
+
# @param widget_id [String]
|
|
1462
|
+
# @param body [Hash] Request body, shaped as `UpdateWidgetRequest`.
|
|
1463
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1464
|
+
# @return [Hash] Parsed JSON, shaped as `DashboardWidgetFull` — see
|
|
1465
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1466
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1467
|
+
def update(widget_id:, body:, org_id: nil, request_options: nil)
|
|
1468
|
+
@transport.request(
|
|
1469
|
+
http_method: "PATCH",
|
|
1470
|
+
path: "/api/org/{orgId}/dashboards/widgets/{widgetId}",
|
|
1471
|
+
path_params: { "orgId" => org_id, "widgetId" => widget_id },
|
|
1472
|
+
body: body,
|
|
1473
|
+
request_options: request_options
|
|
1474
|
+
)
|
|
1475
|
+
end
|
|
1476
|
+
end
|
|
1477
|
+
|
|
1478
|
+
# `client.dashboards`
|
|
1479
|
+
class DashboardsNamespace
|
|
1480
|
+
# @return [DashboardsDefaultNamespace] `client.dashboards.default`
|
|
1481
|
+
attr_reader :default
|
|
1482
|
+
# @return [DashboardsPinNamespace] `client.dashboards.pin`
|
|
1483
|
+
attr_reader :pin
|
|
1484
|
+
# @return [DashboardsWidgetsNamespace] `client.dashboards.widgets`
|
|
1485
|
+
attr_reader :widgets
|
|
1486
|
+
|
|
1487
|
+
# @api private
|
|
1488
|
+
# @param transport [Transport]
|
|
1489
|
+
def initialize(transport)
|
|
1490
|
+
@transport = transport
|
|
1491
|
+
@default = DashboardsDefaultNamespace.new(@transport)
|
|
1492
|
+
@pin = DashboardsPinNamespace.new(@transport)
|
|
1493
|
+
@widgets = DashboardsWidgetsNamespace.new(@transport)
|
|
1494
|
+
end
|
|
1495
|
+
|
|
1496
|
+
# Create a dashboard
|
|
1497
|
+
#
|
|
1498
|
+
# _Requires permission: `dashboards:write`._
|
|
1499
|
+
#
|
|
1500
|
+
# POST /api/org/{orgId}/dashboards
|
|
1501
|
+
#
|
|
1502
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1503
|
+
# constructed with.
|
|
1504
|
+
# @param body [Hash] Request body, shaped as `Hash`.
|
|
1505
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1506
|
+
# @return [Hash] Parsed JSON, shaped as `DashboardFull` — see `sig/infrawrench/sdk.rbs`.
|
|
1507
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1508
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
1509
|
+
@transport.request(
|
|
1510
|
+
http_method: "POST",
|
|
1511
|
+
path: "/api/org/{orgId}/dashboards",
|
|
1512
|
+
path_params: { "orgId" => org_id },
|
|
1513
|
+
body: body,
|
|
1514
|
+
request_options: request_options
|
|
1515
|
+
)
|
|
1516
|
+
end
|
|
1517
|
+
|
|
1518
|
+
# Delete a dashboard
|
|
1519
|
+
#
|
|
1520
|
+
# Cannot delete the default dashboard.
|
|
1521
|
+
#
|
|
1522
|
+
# _Requires permission: `dashboards:write`._
|
|
1523
|
+
#
|
|
1524
|
+
# DELETE /api/org/{orgId}/dashboards/{id}
|
|
1525
|
+
#
|
|
1526
|
+
# Raises on 400: Bad request
|
|
1527
|
+
#
|
|
1528
|
+
# Raises on 404: Not found
|
|
1529
|
+
#
|
|
1530
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1531
|
+
# constructed with.
|
|
1532
|
+
# @param id [String]
|
|
1533
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1534
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1535
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1536
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
1537
|
+
@transport.request(
|
|
1538
|
+
http_method: "DELETE",
|
|
1539
|
+
path: "/api/org/{orgId}/dashboards/{id}",
|
|
1540
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1541
|
+
request_options: request_options
|
|
1542
|
+
)
|
|
1543
|
+
end
|
|
1544
|
+
|
|
1545
|
+
# Get a dashboard with its pins
|
|
1546
|
+
#
|
|
1547
|
+
# _Requires permission: `dashboards:read`._
|
|
1548
|
+
#
|
|
1549
|
+
# GET /api/org/{orgId}/dashboards/{id}
|
|
1550
|
+
#
|
|
1551
|
+
# Raises on 404: Not found
|
|
1552
|
+
#
|
|
1553
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1554
|
+
# constructed with.
|
|
1555
|
+
# @param id [String]
|
|
1556
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1557
|
+
# @return [Hash] Parsed JSON, shaped as `DashboardWithPins` — see `sig/infrawrench/sdk.rbs`.
|
|
1558
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1559
|
+
def get(id:, org_id: nil, request_options: nil)
|
|
1560
|
+
@transport.request(
|
|
1561
|
+
http_method: "GET",
|
|
1562
|
+
path: "/api/org/{orgId}/dashboards/{id}",
|
|
1563
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1564
|
+
request_options: request_options
|
|
1565
|
+
)
|
|
1566
|
+
end
|
|
1567
|
+
|
|
1568
|
+
# List dashboards
|
|
1569
|
+
#
|
|
1570
|
+
# _Requires permission: `dashboards:read`._
|
|
1571
|
+
#
|
|
1572
|
+
# GET /api/org/{orgId}/dashboards
|
|
1573
|
+
#
|
|
1574
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1575
|
+
# constructed with.
|
|
1576
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1577
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<Dashboard>` — see
|
|
1578
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1579
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1580
|
+
def list(org_id: nil, request_options: nil)
|
|
1581
|
+
@transport.request(
|
|
1582
|
+
http_method: "GET",
|
|
1583
|
+
path: "/api/org/{orgId}/dashboards",
|
|
1584
|
+
path_params: { "orgId" => org_id },
|
|
1585
|
+
request_options: request_options
|
|
1586
|
+
)
|
|
1587
|
+
end
|
|
1588
|
+
|
|
1589
|
+
# Read cached stats/metrics for dashboard cards
|
|
1590
|
+
#
|
|
1591
|
+
# _Requires permission: `dashboards:read`._
|
|
1592
|
+
#
|
|
1593
|
+
# POST /api/org/{orgId}/dashboards/probe
|
|
1594
|
+
#
|
|
1595
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1596
|
+
# constructed with.
|
|
1597
|
+
# @param body [Hash] Request body, shaped as `ProbeRequest`.
|
|
1598
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1599
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
1600
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1601
|
+
def probe(body:, org_id: nil, request_options: nil)
|
|
1602
|
+
@transport.request(
|
|
1603
|
+
http_method: "POST",
|
|
1604
|
+
path: "/api/org/{orgId}/dashboards/probe",
|
|
1605
|
+
path_params: { "orgId" => org_id },
|
|
1606
|
+
body: body,
|
|
1607
|
+
request_options: request_options
|
|
1608
|
+
)
|
|
1609
|
+
end
|
|
1610
|
+
|
|
1611
|
+
# Rename a dashboard
|
|
1612
|
+
#
|
|
1613
|
+
# _Requires permission: `dashboards:write`._
|
|
1614
|
+
#
|
|
1615
|
+
# POST /api/org/{orgId}/dashboards/{id}/rename
|
|
1616
|
+
#
|
|
1617
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1618
|
+
# constructed with.
|
|
1619
|
+
# @param id [String]
|
|
1620
|
+
# @param body [Hash] Request body, shaped as `Hash`.
|
|
1621
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1622
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1623
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1624
|
+
def rename(id:, body:, org_id: nil, request_options: nil)
|
|
1625
|
+
@transport.request(
|
|
1626
|
+
http_method: "POST",
|
|
1627
|
+
path: "/api/org/{orgId}/dashboards/{id}/rename",
|
|
1628
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1629
|
+
body: body,
|
|
1630
|
+
request_options: request_options
|
|
1631
|
+
)
|
|
1632
|
+
end
|
|
1633
|
+
|
|
1634
|
+
# Reorder dashboard cards
|
|
1635
|
+
#
|
|
1636
|
+
# Persists the order of a dashboard's grid. Pass `cards` to order resource
|
|
1637
|
+
# pins, workflow pins, and widgets as one sequence; `resourceIds` orders
|
|
1638
|
+
# resource pins alone.
|
|
1639
|
+
#
|
|
1640
|
+
# _Requires permission: `dashboards:write`._
|
|
1641
|
+
#
|
|
1642
|
+
# POST /api/org/{orgId}/dashboards/{id}/reorder
|
|
1643
|
+
#
|
|
1644
|
+
# Raises on 404: Not found
|
|
1645
|
+
#
|
|
1646
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1647
|
+
# constructed with.
|
|
1648
|
+
# @param id [String]
|
|
1649
|
+
# @param body [Hash] Request body, shaped as `ReorderRequest`.
|
|
1650
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1651
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1652
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1653
|
+
def reorder(id:, body:, org_id: nil, request_options: nil)
|
|
1654
|
+
@transport.request(
|
|
1655
|
+
http_method: "POST",
|
|
1656
|
+
path: "/api/org/{orgId}/dashboards/{id}/reorder",
|
|
1657
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1658
|
+
body: body,
|
|
1659
|
+
request_options: request_options
|
|
1660
|
+
)
|
|
1661
|
+
end
|
|
1662
|
+
|
|
1663
|
+
# Unpin a resource
|
|
1664
|
+
#
|
|
1665
|
+
# _Requires permission: `dashboards:write`._
|
|
1666
|
+
#
|
|
1667
|
+
# POST /api/org/{orgId}/dashboards/unpin
|
|
1668
|
+
#
|
|
1669
|
+
# Raises on 404: Not found
|
|
1670
|
+
#
|
|
1671
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1672
|
+
# constructed with.
|
|
1673
|
+
# @param body [Hash] Request body, shaped as `UnpinRequest`.
|
|
1674
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1675
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1676
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1677
|
+
def unpin(body:, org_id: nil, request_options: nil)
|
|
1678
|
+
@transport.request(
|
|
1679
|
+
http_method: "POST",
|
|
1680
|
+
path: "/api/org/{orgId}/dashboards/unpin",
|
|
1681
|
+
path_params: { "orgId" => org_id },
|
|
1682
|
+
body: body,
|
|
1683
|
+
request_options: request_options
|
|
1684
|
+
)
|
|
1685
|
+
end
|
|
1686
|
+
|
|
1687
|
+
# Validate workspace tab targets still exist
|
|
1688
|
+
#
|
|
1689
|
+
# _Requires permission: `dashboards:read`._
|
|
1690
|
+
#
|
|
1691
|
+
# POST /api/org/{orgId}/dashboards/validate-tabs
|
|
1692
|
+
#
|
|
1693
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1694
|
+
# constructed with.
|
|
1695
|
+
# @param body [Hash] Request body, shaped as `ValidateTabsRequest`.
|
|
1696
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1697
|
+
# @return [Hash] Parsed JSON, shaped as `ValidateTabsResponse` — see
|
|
1698
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1699
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1700
|
+
def validate_tabs(body:, org_id: nil, request_options: nil)
|
|
1701
|
+
@transport.request(
|
|
1702
|
+
http_method: "POST",
|
|
1703
|
+
path: "/api/org/{orgId}/dashboards/validate-tabs",
|
|
1704
|
+
path_params: { "orgId" => org_id },
|
|
1705
|
+
body: body,
|
|
1706
|
+
request_options: request_options
|
|
1707
|
+
)
|
|
1708
|
+
end
|
|
1709
|
+
|
|
1710
|
+
# Pin a workflow's metrics to a dashboard
|
|
1711
|
+
#
|
|
1712
|
+
# POST /api/org/{orgId}/dashboards/workflow-pin
|
|
1713
|
+
#
|
|
1714
|
+
# Raises on 404: Not found
|
|
1715
|
+
#
|
|
1716
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1717
|
+
# constructed with.
|
|
1718
|
+
# @param body [Hash] Request body, shaped as `WorkflowPinRequest`.
|
|
1719
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1720
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1721
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1722
|
+
def workflow_pin(body:, org_id: nil, request_options: nil)
|
|
1723
|
+
@transport.request(
|
|
1724
|
+
http_method: "POST",
|
|
1725
|
+
path: "/api/org/{orgId}/dashboards/workflow-pin",
|
|
1726
|
+
path_params: { "orgId" => org_id },
|
|
1727
|
+
body: body,
|
|
1728
|
+
request_options: request_options
|
|
1729
|
+
)
|
|
1730
|
+
end
|
|
1731
|
+
|
|
1732
|
+
# Unpin a workflow from a dashboard
|
|
1733
|
+
#
|
|
1734
|
+
# POST /api/org/{orgId}/dashboards/workflow-unpin
|
|
1735
|
+
#
|
|
1736
|
+
# Raises on 404: Not found
|
|
1737
|
+
#
|
|
1738
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1739
|
+
# constructed with.
|
|
1740
|
+
# @param body [Hash] Request body, shaped as `WorkflowPinRequest`.
|
|
1741
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1742
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1743
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1744
|
+
def workflow_unpin(body:, org_id: nil, request_options: nil)
|
|
1745
|
+
@transport.request(
|
|
1746
|
+
http_method: "POST",
|
|
1747
|
+
path: "/api/org/{orgId}/dashboards/workflow-unpin",
|
|
1748
|
+
path_params: { "orgId" => org_id },
|
|
1749
|
+
body: body,
|
|
1750
|
+
request_options: request_options
|
|
1751
|
+
)
|
|
1752
|
+
end
|
|
1753
|
+
end
|
|
1754
|
+
|
|
1755
|
+
# `client.docker`
|
|
1756
|
+
class DockerNamespace
|
|
1757
|
+
# @api private
|
|
1758
|
+
# @param transport [Transport]
|
|
1759
|
+
def initialize(transport)
|
|
1760
|
+
@transport = transport
|
|
1761
|
+
end
|
|
1762
|
+
|
|
1763
|
+
# Run a Docker daemon operation
|
|
1764
|
+
#
|
|
1765
|
+
# _Requires permission: `resources:execute`._
|
|
1766
|
+
#
|
|
1767
|
+
# POST /api/org/{orgId}/docker/command
|
|
1768
|
+
#
|
|
1769
|
+
# Raises on 400: Bad request
|
|
1770
|
+
#
|
|
1771
|
+
# Raises on 404: Not found
|
|
1772
|
+
#
|
|
1773
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1774
|
+
# constructed with.
|
|
1775
|
+
# @param body [Hash] Request body, shaped as `DockerCommandRequest`.
|
|
1776
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1777
|
+
# @return [Hash] Parsed JSON, shaped as `DockerCommandResponse` — see
|
|
1778
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1779
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1780
|
+
def command(body:, org_id: nil, request_options: nil)
|
|
1781
|
+
@transport.request(
|
|
1782
|
+
http_method: "POST",
|
|
1783
|
+
path: "/api/org/{orgId}/docker/command",
|
|
1784
|
+
path_params: { "orgId" => org_id },
|
|
1785
|
+
body: body,
|
|
1786
|
+
request_options: request_options
|
|
1787
|
+
)
|
|
1788
|
+
end
|
|
1789
|
+
end
|
|
1790
|
+
|
|
1791
|
+
# `client.invitations.by_token`
|
|
1792
|
+
class InvitationsByTokenNamespace
|
|
1793
|
+
# @api private
|
|
1794
|
+
# @param transport [Transport]
|
|
1795
|
+
def initialize(transport)
|
|
1796
|
+
@transport = transport
|
|
1797
|
+
end
|
|
1798
|
+
|
|
1799
|
+
# Get invitation details by token
|
|
1800
|
+
#
|
|
1801
|
+
# GET /api/invitations/by-token/{token}
|
|
1802
|
+
#
|
|
1803
|
+
# Raises on 404: Not found
|
|
1804
|
+
#
|
|
1805
|
+
# @param token [String]
|
|
1806
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1807
|
+
# @return [Hash] Parsed JSON, shaped as `InvitationDetail` — see `sig/infrawrench/sdk.rbs`.
|
|
1808
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1809
|
+
def get(token:, request_options: nil)
|
|
1810
|
+
@transport.request(
|
|
1811
|
+
http_method: "GET",
|
|
1812
|
+
path: "/api/invitations/by-token/{token}",
|
|
1813
|
+
path_params: { "token" => token },
|
|
1814
|
+
request_options: request_options
|
|
1815
|
+
)
|
|
1816
|
+
end
|
|
1817
|
+
end
|
|
1818
|
+
|
|
1819
|
+
# `client.invitations`
|
|
1820
|
+
class InvitationsNamespace
|
|
1821
|
+
# @return [InvitationsByTokenNamespace] `client.invitations.by_token`
|
|
1822
|
+
attr_reader :by_token
|
|
1823
|
+
|
|
1824
|
+
# @api private
|
|
1825
|
+
# @param transport [Transport]
|
|
1826
|
+
def initialize(transport)
|
|
1827
|
+
@transport = transport
|
|
1828
|
+
@by_token = InvitationsByTokenNamespace.new(@transport)
|
|
1829
|
+
end
|
|
1830
|
+
|
|
1831
|
+
# Accept an invitation
|
|
1832
|
+
#
|
|
1833
|
+
# POST /api/invitations/accept
|
|
1834
|
+
#
|
|
1835
|
+
# Raises on 400: Bad request
|
|
1836
|
+
#
|
|
1837
|
+
# Raises on 403: Forbidden
|
|
1838
|
+
#
|
|
1839
|
+
# @param body [Hash] Request body, shaped as `AcceptInvitationRequest`.
|
|
1840
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1841
|
+
# @return [Hash] Parsed JSON, shaped as `AcceptInvitationResponse` — see
|
|
1842
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1843
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1844
|
+
def accept(body:, request_options: nil)
|
|
1845
|
+
@transport.request(
|
|
1846
|
+
http_method: "POST",
|
|
1847
|
+
path: "/api/invitations/accept",
|
|
1848
|
+
body: body,
|
|
1849
|
+
request_options: request_options
|
|
1850
|
+
)
|
|
1851
|
+
end
|
|
1852
|
+
end
|
|
1853
|
+
|
|
1854
|
+
# `client.kv`
|
|
1855
|
+
class KvNamespace
|
|
1856
|
+
# @api private
|
|
1857
|
+
# @param transport [Transport]
|
|
1858
|
+
def initialize(transport)
|
|
1859
|
+
@transport = transport
|
|
1860
|
+
end
|
|
1861
|
+
|
|
1862
|
+
# Run a Redis-style KV command
|
|
1863
|
+
#
|
|
1864
|
+
# _Requires permission: `resources:execute`._
|
|
1865
|
+
#
|
|
1866
|
+
# POST /api/org/{orgId}/kv/command
|
|
1867
|
+
#
|
|
1868
|
+
# Raises on 400: Bad request
|
|
1869
|
+
#
|
|
1870
|
+
# Raises on 404: Not found
|
|
1871
|
+
#
|
|
1872
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1873
|
+
# constructed with.
|
|
1874
|
+
# @param body [Hash] Request body, shaped as `KvCommandRequest`.
|
|
1875
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1876
|
+
# @return [Hash] Parsed JSON, shaped as `KvCommandResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
1877
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1878
|
+
def command(body:, org_id: nil, request_options: nil)
|
|
1879
|
+
@transport.request(
|
|
1880
|
+
http_method: "POST",
|
|
1881
|
+
path: "/api/org/{orgId}/kv/command",
|
|
1882
|
+
path_params: { "orgId" => org_id },
|
|
1883
|
+
body: body,
|
|
1884
|
+
request_options: request_options
|
|
1885
|
+
)
|
|
1886
|
+
end
|
|
1887
|
+
end
|
|
1888
|
+
|
|
1889
|
+
# `client.orgs`
|
|
1890
|
+
class OrgsNamespace
|
|
1891
|
+
# @api private
|
|
1892
|
+
# @param transport [Transport]
|
|
1893
|
+
def initialize(transport)
|
|
1894
|
+
@transport = transport
|
|
1895
|
+
end
|
|
1896
|
+
|
|
1897
|
+
# Create a new organization
|
|
1898
|
+
#
|
|
1899
|
+
# The caller becomes the `owner` of the new organization.
|
|
1900
|
+
#
|
|
1901
|
+
# POST /api/orgs
|
|
1902
|
+
#
|
|
1903
|
+
# Raises on 400: Bad request
|
|
1904
|
+
#
|
|
1905
|
+
# Raises on 401: Unauthenticated
|
|
1906
|
+
#
|
|
1907
|
+
# @param body [Hash] Request body, shaped as `CreateOrgRequest`.
|
|
1908
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1909
|
+
# @return [Hash] Parsed JSON, shaped as `Organization` — see `sig/infrawrench/sdk.rbs`.
|
|
1910
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1911
|
+
def create(body:, request_options: nil)
|
|
1912
|
+
@transport.request(
|
|
1913
|
+
http_method: "POST",
|
|
1914
|
+
path: "/api/orgs",
|
|
1915
|
+
body: body,
|
|
1916
|
+
request_options: request_options
|
|
1917
|
+
)
|
|
1918
|
+
end
|
|
1919
|
+
end
|
|
1920
|
+
|
|
1921
|
+
# `client.profile.email_change`
|
|
1922
|
+
class ProfileEmailChangeNamespace
|
|
1923
|
+
# @api private
|
|
1924
|
+
# @param transport [Transport]
|
|
1925
|
+
def initialize(transport)
|
|
1926
|
+
@transport = transport
|
|
1927
|
+
end
|
|
1928
|
+
|
|
1929
|
+
# Redeem an email change code
|
|
1930
|
+
#
|
|
1931
|
+
# On success the account's email is the new address and it is marked
|
|
1932
|
+
# verified.
|
|
1933
|
+
#
|
|
1934
|
+
# POST /api/profile/email-change/confirm
|
|
1935
|
+
#
|
|
1936
|
+
# Raises on 400: Bad request
|
|
1937
|
+
#
|
|
1938
|
+
# Raises on 401: Unauthenticated
|
|
1939
|
+
#
|
|
1940
|
+
# Raises on 403: Recent sign-in required. Send the user through sign-in
|
|
1941
|
+
# again and retry; the request itself was well-formed.
|
|
1942
|
+
#
|
|
1943
|
+
# @param body [Hash, nil] Request body, shaped as `Hash`.
|
|
1944
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1945
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
1946
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1947
|
+
def confirm(body: nil, request_options: nil)
|
|
1948
|
+
@transport.request(
|
|
1949
|
+
http_method: "POST",
|
|
1950
|
+
path: "/api/profile/email-change/confirm",
|
|
1951
|
+
body: body,
|
|
1952
|
+
request_options: request_options
|
|
1953
|
+
)
|
|
1954
|
+
end
|
|
1955
|
+
|
|
1956
|
+
# Send a confirmation code to a new email address
|
|
1957
|
+
#
|
|
1958
|
+
# Starts an email change. The code goes to the new address and the account
|
|
1959
|
+
# keeps its current address until `/api/profile/email-change/confirm`
|
|
1960
|
+
# redeems it, so an abandoned or mistyped change is harmless.
|
|
1961
|
+
#
|
|
1962
|
+
# POST /api/profile/email-change
|
|
1963
|
+
#
|
|
1964
|
+
# Raises on 400: Bad request
|
|
1965
|
+
#
|
|
1966
|
+
# Raises on 401: Unauthenticated
|
|
1967
|
+
#
|
|
1968
|
+
# Raises on 403: Recent sign-in required. Send the user through sign-in
|
|
1969
|
+
# again and retry; the request itself was well-formed.
|
|
1970
|
+
#
|
|
1971
|
+
# @param body [Hash, nil] Request body, shaped as `Hash`.
|
|
1972
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1973
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
1974
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1975
|
+
def create(body: nil, request_options: nil)
|
|
1976
|
+
@transport.request(
|
|
1977
|
+
http_method: "POST",
|
|
1978
|
+
path: "/api/profile/email-change",
|
|
1979
|
+
body: body,
|
|
1980
|
+
request_options: request_options
|
|
1981
|
+
)
|
|
1982
|
+
end
|
|
1983
|
+
end
|
|
1984
|
+
|
|
1985
|
+
# `client.profile.mfa`
|
|
1986
|
+
class ProfileMfaNamespace
|
|
1987
|
+
# @api private
|
|
1988
|
+
# @param transport [Transport]
|
|
1989
|
+
def initialize(transport)
|
|
1990
|
+
@transport = transport
|
|
1991
|
+
end
|
|
1992
|
+
|
|
1993
|
+
# Issue a fresh challenge for a factor
|
|
1994
|
+
#
|
|
1995
|
+
# POST /api/profile/mfa/{factorId}/challenge
|
|
1996
|
+
#
|
|
1997
|
+
# Raises on 401: Unauthenticated
|
|
1998
|
+
#
|
|
1999
|
+
# Raises on 404: Not found
|
|
2000
|
+
#
|
|
2001
|
+
# @param factor_id [String]
|
|
2002
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2003
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
2004
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2005
|
+
def challenge(factor_id:, request_options: nil)
|
|
2006
|
+
@transport.request(
|
|
2007
|
+
http_method: "POST",
|
|
2008
|
+
path: "/api/profile/mfa/{factorId}/challenge",
|
|
2009
|
+
path_params: { "factorId" => factor_id },
|
|
2010
|
+
request_options: request_options
|
|
2011
|
+
)
|
|
2012
|
+
end
|
|
2013
|
+
|
|
2014
|
+
# Begin TOTP enrolment
|
|
2015
|
+
#
|
|
2016
|
+
# Creates the factor and a first challenge. The factor only becomes usable
|
|
2017
|
+
# once a code is verified; abandon the flow by DELETEing the returned
|
|
2018
|
+
# `factorId`.
|
|
2019
|
+
#
|
|
2020
|
+
# POST /api/profile/mfa
|
|
2021
|
+
#
|
|
2022
|
+
# Raises on 401: Unauthenticated
|
|
2023
|
+
#
|
|
2024
|
+
# Raises on 403: Recent sign-in required. Send the user through sign-in
|
|
2025
|
+
# again and retry; the request itself was well-formed.
|
|
2026
|
+
#
|
|
2027
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2028
|
+
# @return [Hash] Parsed JSON, shaped as `TotpEnrollment` — see `sig/infrawrench/sdk.rbs`.
|
|
2029
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2030
|
+
def create(request_options: nil)
|
|
2031
|
+
@transport.request(
|
|
2032
|
+
http_method: "POST",
|
|
2033
|
+
path: "/api/profile/mfa",
|
|
2034
|
+
request_options: request_options
|
|
2035
|
+
)
|
|
2036
|
+
end
|
|
2037
|
+
|
|
2038
|
+
# Remove an authentication factor
|
|
2039
|
+
#
|
|
2040
|
+
# DELETE /api/profile/mfa/{factorId}
|
|
2041
|
+
#
|
|
2042
|
+
# Raises on 401: Unauthenticated
|
|
2043
|
+
#
|
|
2044
|
+
# Raises on 403: Recent sign-in required. Send the user through sign-in
|
|
2045
|
+
# again and retry; the request itself was well-formed.
|
|
2046
|
+
#
|
|
2047
|
+
# Raises on 404: Not found
|
|
2048
|
+
#
|
|
2049
|
+
# @param factor_id [String]
|
|
2050
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2051
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
2052
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2053
|
+
def delete(factor_id:, request_options: nil)
|
|
2054
|
+
@transport.request(
|
|
2055
|
+
http_method: "DELETE",
|
|
2056
|
+
path: "/api/profile/mfa/{factorId}",
|
|
2057
|
+
path_params: { "factorId" => factor_id },
|
|
2058
|
+
request_options: request_options
|
|
2059
|
+
)
|
|
2060
|
+
end
|
|
2061
|
+
|
|
2062
|
+
# List enrolled authentication factors
|
|
2063
|
+
#
|
|
2064
|
+
# Includes factors whose enrolment was never confirmed — WorkOS does not
|
|
2065
|
+
# expose a verified flag.
|
|
2066
|
+
#
|
|
2067
|
+
# GET /api/profile/mfa
|
|
2068
|
+
#
|
|
2069
|
+
# Raises on 401: Unauthenticated
|
|
2070
|
+
#
|
|
2071
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2072
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<AuthFactor>` — see
|
|
2073
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2074
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2075
|
+
def list(request_options: nil)
|
|
2076
|
+
@transport.request(
|
|
2077
|
+
http_method: "GET",
|
|
2078
|
+
path: "/api/profile/mfa",
|
|
2079
|
+
request_options: request_options
|
|
2080
|
+
)
|
|
2081
|
+
end
|
|
2082
|
+
|
|
2083
|
+
# Verify a code against a challenge
|
|
2084
|
+
#
|
|
2085
|
+
# POST /api/profile/mfa/{factorId}/verify
|
|
2086
|
+
#
|
|
2087
|
+
# Raises on 400: Bad request
|
|
2088
|
+
#
|
|
2089
|
+
# Raises on 401: Unauthenticated
|
|
2090
|
+
#
|
|
2091
|
+
# Raises on 404: Not found
|
|
2092
|
+
#
|
|
2093
|
+
# @param factor_id [String]
|
|
2094
|
+
# @param body [Hash, nil] Request body, shaped as `Hash`.
|
|
2095
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2096
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
2097
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2098
|
+
def verify(factor_id:, body: nil, request_options: nil)
|
|
2099
|
+
@transport.request(
|
|
2100
|
+
http_method: "POST",
|
|
2101
|
+
path: "/api/profile/mfa/{factorId}/verify",
|
|
2102
|
+
path_params: { "factorId" => factor_id },
|
|
2103
|
+
body: body,
|
|
2104
|
+
request_options: request_options
|
|
2105
|
+
)
|
|
2106
|
+
end
|
|
2107
|
+
end
|
|
2108
|
+
|
|
2109
|
+
# `client.profile.sessions`
|
|
2110
|
+
class ProfileSessionsNamespace
|
|
2111
|
+
# @api private
|
|
2112
|
+
# @param transport [Transport]
|
|
2113
|
+
def initialize(transport)
|
|
2114
|
+
@transport = transport
|
|
2115
|
+
end
|
|
2116
|
+
|
|
2117
|
+
# Revoke one session
|
|
2118
|
+
#
|
|
2119
|
+
# Refuses the session making the request — use sign-out for that.
|
|
2120
|
+
#
|
|
2121
|
+
# DELETE /api/profile/sessions/{sessionId}
|
|
2122
|
+
#
|
|
2123
|
+
# Raises on 400: Bad request
|
|
2124
|
+
#
|
|
2125
|
+
# Raises on 401: Unauthenticated
|
|
2126
|
+
#
|
|
2127
|
+
# Raises on 404: Not found
|
|
2128
|
+
#
|
|
2129
|
+
# @param session_id [String]
|
|
2130
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2131
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
2132
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2133
|
+
def delete(session_id:, request_options: nil)
|
|
2134
|
+
@transport.request(
|
|
2135
|
+
http_method: "DELETE",
|
|
2136
|
+
path: "/api/profile/sessions/{sessionId}",
|
|
2137
|
+
path_params: { "sessionId" => session_id },
|
|
2138
|
+
request_options: request_options
|
|
2139
|
+
)
|
|
2140
|
+
end
|
|
2141
|
+
|
|
2142
|
+
# List the signed-in user's active sessions
|
|
2143
|
+
#
|
|
2144
|
+
# GET /api/profile/sessions
|
|
2145
|
+
#
|
|
2146
|
+
# Raises on 401: Unauthenticated
|
|
2147
|
+
#
|
|
2148
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2149
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<UserSession>` — see
|
|
2150
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2151
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2152
|
+
def list(request_options: nil)
|
|
2153
|
+
@transport.request(
|
|
2154
|
+
http_method: "GET",
|
|
2155
|
+
path: "/api/profile/sessions",
|
|
2156
|
+
request_options: request_options
|
|
2157
|
+
)
|
|
2158
|
+
end
|
|
2159
|
+
|
|
2160
|
+
# Revoke every session except the current one
|
|
2161
|
+
#
|
|
2162
|
+
# POST /api/profile/sessions/revoke-others
|
|
2163
|
+
#
|
|
2164
|
+
# Raises on 401: Unauthenticated
|
|
2165
|
+
#
|
|
2166
|
+
# Raises on 403: Recent sign-in required. Send the user through sign-in
|
|
2167
|
+
# again and retry; the request itself was well-formed.
|
|
2168
|
+
#
|
|
2169
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2170
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
2171
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2172
|
+
def revoke_others(request_options: nil)
|
|
2173
|
+
@transport.request(
|
|
2174
|
+
http_method: "POST",
|
|
2175
|
+
path: "/api/profile/sessions/revoke-others",
|
|
2176
|
+
request_options: request_options
|
|
2177
|
+
)
|
|
2178
|
+
end
|
|
2179
|
+
end
|
|
2180
|
+
|
|
2181
|
+
# `client.profile`
|
|
2182
|
+
class ProfileNamespace
|
|
2183
|
+
# @return [ProfileEmailChangeNamespace] `client.profile.email_change`
|
|
2184
|
+
attr_reader :email_change
|
|
2185
|
+
# @return [ProfileMfaNamespace] `client.profile.mfa`
|
|
2186
|
+
attr_reader :mfa
|
|
2187
|
+
# @return [ProfileSessionsNamespace] `client.profile.sessions`
|
|
2188
|
+
attr_reader :sessions
|
|
2189
|
+
|
|
2190
|
+
# @api private
|
|
2191
|
+
# @param transport [Transport]
|
|
2192
|
+
def initialize(transport)
|
|
2193
|
+
@transport = transport
|
|
2194
|
+
@email_change = ProfileEmailChangeNamespace.new(@transport)
|
|
2195
|
+
@mfa = ProfileMfaNamespace.new(@transport)
|
|
2196
|
+
@sessions = ProfileSessionsNamespace.new(@transport)
|
|
2197
|
+
end
|
|
2198
|
+
|
|
2199
|
+
# The signed-in user's account profile
|
|
2200
|
+
#
|
|
2201
|
+
# User-scoped, not organization-scoped: one WorkOS identity is shared across
|
|
2202
|
+
# every organization the user belongs to.
|
|
2203
|
+
#
|
|
2204
|
+
# GET /api/profile
|
|
2205
|
+
#
|
|
2206
|
+
# Raises on 401: Unauthenticated
|
|
2207
|
+
#
|
|
2208
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2209
|
+
# @return [Hash] Parsed JSON, shaped as `Profile` — see `sig/infrawrench/sdk.rbs`.
|
|
2210
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2211
|
+
def get(request_options: nil)
|
|
2212
|
+
@transport.request(
|
|
2213
|
+
http_method: "GET",
|
|
2214
|
+
path: "/api/profile",
|
|
2215
|
+
request_options: request_options
|
|
2216
|
+
)
|
|
2217
|
+
end
|
|
2218
|
+
|
|
2219
|
+
# Mint a password reset link for the signed-in user
|
|
2220
|
+
#
|
|
2221
|
+
# Returns a one-time AuthKit-hosted reset URL rather than emailing it — the
|
|
2222
|
+
# caller already holds a valid session for the account. Also the way to set
|
|
2223
|
+
# a first password on an SSO or OAuth-only account.
|
|
2224
|
+
#
|
|
2225
|
+
# POST /api/profile/password-reset
|
|
2226
|
+
#
|
|
2227
|
+
# Raises on 401: Unauthenticated
|
|
2228
|
+
#
|
|
2229
|
+
# Raises on 403: Recent sign-in required. Send the user through sign-in
|
|
2230
|
+
# again and retry; the request itself was well-formed.
|
|
2231
|
+
#
|
|
2232
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2233
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
2234
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2235
|
+
def password_reset(request_options: nil)
|
|
2236
|
+
@transport.request(
|
|
2237
|
+
http_method: "POST",
|
|
2238
|
+
path: "/api/profile/password-reset",
|
|
2239
|
+
request_options: request_options
|
|
2240
|
+
)
|
|
2241
|
+
end
|
|
2242
|
+
|
|
2243
|
+
# Re-send the email verification message
|
|
2244
|
+
#
|
|
2245
|
+
# POST /api/profile/send-verification-email
|
|
2246
|
+
#
|
|
2247
|
+
# Raises on 400: Bad request
|
|
2248
|
+
#
|
|
2249
|
+
# Raises on 401: Unauthenticated
|
|
2250
|
+
#
|
|
2251
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2252
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
2253
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2254
|
+
def send_verification_email(request_options: nil)
|
|
2255
|
+
@transport.request(
|
|
2256
|
+
http_method: "POST",
|
|
2257
|
+
path: "/api/profile/send-verification-email",
|
|
2258
|
+
request_options: request_options
|
|
2259
|
+
)
|
|
2260
|
+
end
|
|
2261
|
+
|
|
2262
|
+
# Update the signed-in user's name
|
|
2263
|
+
#
|
|
2264
|
+
# PATCH /api/profile
|
|
2265
|
+
#
|
|
2266
|
+
# Raises on 400: Bad request
|
|
2267
|
+
#
|
|
2268
|
+
# Raises on 401: Unauthenticated
|
|
2269
|
+
#
|
|
2270
|
+
# @param body [Hash, nil] Request body, shaped as `Hash`.
|
|
2271
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2272
|
+
# @return [Hash] Parsed JSON, shaped as `ProfileSummary` — see `sig/infrawrench/sdk.rbs`.
|
|
2273
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2274
|
+
def update(body: nil, request_options: nil)
|
|
2275
|
+
@transport.request(
|
|
2276
|
+
http_method: "PATCH",
|
|
2277
|
+
path: "/api/profile",
|
|
2278
|
+
body: body,
|
|
2279
|
+
request_options: request_options
|
|
2280
|
+
)
|
|
2281
|
+
end
|
|
2282
|
+
end
|
|
2283
|
+
|
|
2284
|
+
# `client.resources.manifest`
|
|
2285
|
+
class ResourcesManifestNamespace
|
|
2286
|
+
# @api private
|
|
2287
|
+
# @param transport [Transport]
|
|
2288
|
+
def initialize(transport)
|
|
2289
|
+
@transport = transport
|
|
2290
|
+
end
|
|
2291
|
+
|
|
2292
|
+
# Apply an edited manifest to a resource
|
|
2293
|
+
#
|
|
2294
|
+
# _Requires permission: `resources:write`._
|
|
2295
|
+
#
|
|
2296
|
+
# POST /api/org/{orgId}/resources/{pluginId}/{typeId}/manifest
|
|
2297
|
+
#
|
|
2298
|
+
# Raises on 400: Bad request
|
|
2299
|
+
#
|
|
2300
|
+
# Raises on 404: Not found
|
|
2301
|
+
#
|
|
2302
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2303
|
+
# constructed with.
|
|
2304
|
+
# @param plugin_id [String]
|
|
2305
|
+
# @param type_id [String]
|
|
2306
|
+
# @param body [Hash] Request body, shaped as `ApplyManifestRequest`.
|
|
2307
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2308
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
2309
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2310
|
+
def create(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
|
|
2311
|
+
@transport.request(
|
|
2312
|
+
http_method: "POST",
|
|
2313
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/manifest",
|
|
2314
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2315
|
+
body: body,
|
|
2316
|
+
request_options: request_options
|
|
2317
|
+
)
|
|
2318
|
+
end
|
|
2319
|
+
|
|
2320
|
+
# Fetch the raw manifest (YAML/JSON) for a resource
|
|
2321
|
+
#
|
|
2322
|
+
# _Requires permission: `resources:read`._
|
|
2323
|
+
#
|
|
2324
|
+
# GET /api/org/{orgId}/resources/{pluginId}/{typeId}/manifest
|
|
2325
|
+
#
|
|
2326
|
+
# Raises on 400: Bad request
|
|
2327
|
+
#
|
|
2328
|
+
# Raises on 404: Not found
|
|
2329
|
+
#
|
|
2330
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2331
|
+
# constructed with.
|
|
2332
|
+
# @param plugin_id [String]
|
|
2333
|
+
# @param type_id [String]
|
|
2334
|
+
# @param resource_id [String]
|
|
2335
|
+
# @param account_id [String]
|
|
2336
|
+
# @param parent_resource_id [String, nil]
|
|
2337
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2338
|
+
# @return [Hash] Parsed JSON, shaped as `Manifest` — see `sig/infrawrench/sdk.rbs`.
|
|
2339
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2340
|
+
def get(
|
|
2341
|
+
plugin_id:,
|
|
2342
|
+
type_id:,
|
|
2343
|
+
resource_id:,
|
|
2344
|
+
account_id:,
|
|
2345
|
+
org_id: nil,
|
|
2346
|
+
parent_resource_id: nil,
|
|
2347
|
+
request_options: nil
|
|
2348
|
+
)
|
|
2349
|
+
@transport.request(
|
|
2350
|
+
http_method: "GET",
|
|
2351
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/manifest",
|
|
2352
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2353
|
+
query: {
|
|
2354
|
+
"resourceId" => resource_id,
|
|
2355
|
+
"accountId" => account_id,
|
|
2356
|
+
"parentResourceId" => parent_resource_id
|
|
2357
|
+
},
|
|
2358
|
+
request_options: request_options
|
|
2359
|
+
)
|
|
2360
|
+
end
|
|
2361
|
+
end
|
|
2362
|
+
|
|
2363
|
+
# `client.resources.secret_versions`
|
|
2364
|
+
class ResourcesSecretVersionsNamespace
|
|
2365
|
+
# @api private
|
|
2366
|
+
# @param transport [Transport]
|
|
2367
|
+
def initialize(transport)
|
|
2368
|
+
@transport = transport
|
|
2369
|
+
end
|
|
2370
|
+
|
|
2371
|
+
# Reveal the plaintext value of a specific version (one-time)
|
|
2372
|
+
#
|
|
2373
|
+
# _Requires permission: `secrets:read`._
|
|
2374
|
+
#
|
|
2375
|
+
# POST /api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/access
|
|
2376
|
+
#
|
|
2377
|
+
# Raises on 400: Bad request
|
|
2378
|
+
#
|
|
2379
|
+
# Raises on 404: Not found
|
|
2380
|
+
#
|
|
2381
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2382
|
+
# constructed with.
|
|
2383
|
+
# @param plugin_id [String]
|
|
2384
|
+
# @param type_id [String]
|
|
2385
|
+
# @param body [Hash] Request body, shaped as `SecretAccessRequest`.
|
|
2386
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2387
|
+
# @return [Hash] Parsed JSON, shaped as `SecretAccessResponse` — see
|
|
2388
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2389
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2390
|
+
def access(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
|
|
2391
|
+
@transport.request(
|
|
2392
|
+
http_method: "POST",
|
|
2393
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/access",
|
|
2394
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2395
|
+
body: body,
|
|
2396
|
+
request_options: request_options
|
|
2397
|
+
)
|
|
2398
|
+
end
|
|
2399
|
+
|
|
2400
|
+
# Add a new secret version
|
|
2401
|
+
#
|
|
2402
|
+
# _Requires permission: `secrets:write`._
|
|
2403
|
+
#
|
|
2404
|
+
# POST /api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/add
|
|
2405
|
+
#
|
|
2406
|
+
# Raises on 400: Bad request
|
|
2407
|
+
#
|
|
2408
|
+
# Raises on 404: Not found
|
|
2409
|
+
#
|
|
2410
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2411
|
+
# constructed with.
|
|
2412
|
+
# @param plugin_id [String]
|
|
2413
|
+
# @param type_id [String]
|
|
2414
|
+
# @param body [Hash] Request body, shaped as `SecretAddRequest`.
|
|
2415
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2416
|
+
# @return [Hash] Parsed JSON, shaped as `SecretVersionResponse` — see
|
|
2417
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2418
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2419
|
+
def add(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
|
|
2420
|
+
@transport.request(
|
|
2421
|
+
http_method: "POST",
|
|
2422
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/add",
|
|
2423
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2424
|
+
body: body,
|
|
2425
|
+
request_options: request_options
|
|
2426
|
+
)
|
|
2427
|
+
end
|
|
2428
|
+
|
|
2429
|
+
# List secret versions for a versioned-secret resource
|
|
2430
|
+
#
|
|
2431
|
+
# _Requires permission: `secrets:read`._
|
|
2432
|
+
#
|
|
2433
|
+
# GET /api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions
|
|
2434
|
+
#
|
|
2435
|
+
# Raises on 400: Bad request
|
|
2436
|
+
#
|
|
2437
|
+
# Raises on 404: Not found
|
|
2438
|
+
#
|
|
2439
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2440
|
+
# constructed with.
|
|
2441
|
+
# @param plugin_id [String]
|
|
2442
|
+
# @param type_id [String]
|
|
2443
|
+
# @param resource_id [String]
|
|
2444
|
+
# @param account_id [String]
|
|
2445
|
+
# @param parent_resource_id [String, nil]
|
|
2446
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2447
|
+
# @return [Hash] Parsed JSON, shaped as `SecretVersionsResponse` — see
|
|
2448
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2449
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2450
|
+
def get(
|
|
2451
|
+
plugin_id:,
|
|
2452
|
+
type_id:,
|
|
2453
|
+
resource_id:,
|
|
2454
|
+
account_id:,
|
|
2455
|
+
org_id: nil,
|
|
2456
|
+
parent_resource_id: nil,
|
|
2457
|
+
request_options: nil
|
|
2458
|
+
)
|
|
2459
|
+
@transport.request(
|
|
2460
|
+
http_method: "GET",
|
|
2461
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions",
|
|
2462
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2463
|
+
query: {
|
|
2464
|
+
"resourceId" => resource_id,
|
|
2465
|
+
"accountId" => account_id,
|
|
2466
|
+
"parentResourceId" => parent_resource_id
|
|
2467
|
+
},
|
|
2468
|
+
request_options: request_options
|
|
2469
|
+
)
|
|
2470
|
+
end
|
|
2471
|
+
|
|
2472
|
+
# Enable/disable/destroy a secret version
|
|
2473
|
+
#
|
|
2474
|
+
# _Requires permission: `secrets:write`._
|
|
2475
|
+
#
|
|
2476
|
+
# POST /api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/modify
|
|
2477
|
+
#
|
|
2478
|
+
# Raises on 400: Bad request
|
|
2479
|
+
#
|
|
2480
|
+
# Raises on 404: Not found
|
|
2481
|
+
#
|
|
2482
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2483
|
+
# constructed with.
|
|
2484
|
+
# @param plugin_id [String]
|
|
2485
|
+
# @param type_id [String]
|
|
2486
|
+
# @param body [Hash] Request body, shaped as `SecretModifyRequest`.
|
|
2487
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2488
|
+
# @return [Hash] Parsed JSON, shaped as `SecretVersionResponse` — see
|
|
2489
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2490
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2491
|
+
def modify(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
|
|
2492
|
+
@transport.request(
|
|
2493
|
+
http_method: "POST",
|
|
2494
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/modify",
|
|
2495
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2496
|
+
body: body,
|
|
2497
|
+
request_options: request_options
|
|
2498
|
+
)
|
|
2499
|
+
end
|
|
2500
|
+
end
|
|
2501
|
+
|
|
2502
|
+
# `client.resources`
|
|
2503
|
+
class ResourcesNamespace
|
|
2504
|
+
# @return [ResourcesManifestNamespace] `client.resources.manifest`
|
|
2505
|
+
attr_reader :manifest
|
|
2506
|
+
# @return [ResourcesSecretVersionsNamespace] `client.resources.secret_versions`
|
|
2507
|
+
attr_reader :secret_versions
|
|
2508
|
+
|
|
2509
|
+
# @api private
|
|
2510
|
+
# @param transport [Transport]
|
|
2511
|
+
def initialize(transport)
|
|
2512
|
+
@transport = transport
|
|
2513
|
+
@manifest = ResourcesManifestNamespace.new(@transport)
|
|
2514
|
+
@secret_versions = ResourcesSecretVersionsNamespace.new(@transport)
|
|
2515
|
+
end
|
|
2516
|
+
|
|
2517
|
+
# Attach a resource onto another (e.g. disk → VM)
|
|
2518
|
+
#
|
|
2519
|
+
# _Requires permission: `resources:write`._
|
|
2520
|
+
#
|
|
2521
|
+
# POST /api/org/{orgId}/resources/attach
|
|
2522
|
+
#
|
|
2523
|
+
# Raises on 400: Bad request
|
|
2524
|
+
#
|
|
2525
|
+
# Raises on 404: Not found
|
|
2526
|
+
#
|
|
2527
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2528
|
+
# constructed with.
|
|
2529
|
+
# @param body [Hash] Request body, shaped as `AttachRequest`.
|
|
2530
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2531
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
2532
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2533
|
+
def attach(body:, org_id: nil, request_options: nil)
|
|
2534
|
+
@transport.request(
|
|
2535
|
+
http_method: "POST",
|
|
2536
|
+
path: "/api/org/{orgId}/resources/attach",
|
|
2537
|
+
path_params: { "orgId" => org_id },
|
|
2538
|
+
body: body,
|
|
2539
|
+
request_options: request_options
|
|
2540
|
+
)
|
|
2541
|
+
end
|
|
2542
|
+
|
|
2543
|
+
# Create a new resource via its plugin
|
|
2544
|
+
#
|
|
2545
|
+
# _Requires permission: `resources:write`._
|
|
2546
|
+
#
|
|
2547
|
+
# POST /api/org/{orgId}/resources/create
|
|
2548
|
+
#
|
|
2549
|
+
# Raises on 400: Bad request
|
|
2550
|
+
#
|
|
2551
|
+
# Raises on 404: Not found
|
|
2552
|
+
#
|
|
2553
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2554
|
+
# constructed with.
|
|
2555
|
+
# @param body [Hash] Request body, shaped as `CreateResourceRequest`.
|
|
2556
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2557
|
+
# @return [Hash] Parsed JSON, shaped as `CreateResourceResponse` — see
|
|
2558
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2559
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2560
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
2561
|
+
@transport.request(
|
|
2562
|
+
http_method: "POST",
|
|
2563
|
+
path: "/api/org/{orgId}/resources/create",
|
|
2564
|
+
path_params: { "orgId" => org_id },
|
|
2565
|
+
body: body,
|
|
2566
|
+
request_options: request_options
|
|
2567
|
+
)
|
|
2568
|
+
end
|
|
2569
|
+
|
|
2570
|
+
# Get the dynamic create form for a resource type
|
|
2571
|
+
#
|
|
2572
|
+
# Calls the plugin's `getCreateConfig`. The returned `CreateResourceConfig`
|
|
2573
|
+
# is plugin-shaped — see `JsonObject`.
|
|
2574
|
+
#
|
|
2575
|
+
# _Requires permission: `resources:write`._
|
|
2576
|
+
#
|
|
2577
|
+
# POST /api/org/{orgId}/resources/create-config
|
|
2578
|
+
#
|
|
2579
|
+
# Raises on 400: Bad request
|
|
2580
|
+
#
|
|
2581
|
+
# Raises on 404: Not found
|
|
2582
|
+
#
|
|
2583
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2584
|
+
# constructed with.
|
|
2585
|
+
# @param body [Hash] Request body, shaped as `CreateConfigRequest`.
|
|
2586
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2587
|
+
# @return [Hash] Parsed JSON, shaped as `JsonObject` — see `sig/infrawrench/sdk.rbs`.
|
|
2588
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2589
|
+
def create_config(body:, org_id: nil, request_options: nil)
|
|
2590
|
+
@transport.request(
|
|
2591
|
+
http_method: "POST",
|
|
2592
|
+
path: "/api/org/{orgId}/resources/create-config",
|
|
2593
|
+
path_params: { "orgId" => org_id },
|
|
2594
|
+
body: body,
|
|
2595
|
+
request_options: request_options
|
|
2596
|
+
)
|
|
2597
|
+
end
|
|
2598
|
+
|
|
2599
|
+
# Cost estimate for the current create form values
|
|
2600
|
+
#
|
|
2601
|
+
# _Requires permission: `resources:read`._
|
|
2602
|
+
#
|
|
2603
|
+
# POST /api/org/{orgId}/resources/create-cost-estimate
|
|
2604
|
+
#
|
|
2605
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2606
|
+
# constructed with.
|
|
2607
|
+
# @param body [Hash] Request body, shaped as `CreateCostEstimateRequest`.
|
|
2608
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2609
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
2610
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2611
|
+
def create_cost_estimate(body:, org_id: nil, request_options: nil)
|
|
2612
|
+
@transport.request(
|
|
2613
|
+
http_method: "POST",
|
|
2614
|
+
path: "/api/org/{orgId}/resources/create-cost-estimate",
|
|
2615
|
+
path_params: { "orgId" => org_id },
|
|
2616
|
+
body: body,
|
|
2617
|
+
request_options: request_options
|
|
2618
|
+
)
|
|
2619
|
+
end
|
|
2620
|
+
|
|
2621
|
+
# Pricing per size for a create form
|
|
2622
|
+
#
|
|
2623
|
+
# _Requires permission: `resources:read`._
|
|
2624
|
+
#
|
|
2625
|
+
# POST /api/org/{orgId}/resources/create-pricing
|
|
2626
|
+
#
|
|
2627
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2628
|
+
# constructed with.
|
|
2629
|
+
# @param body [Hash] Request body, shaped as `CreatePricingRequest`.
|
|
2630
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2631
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
2632
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2633
|
+
def create_pricing(body:, org_id: nil, request_options: nil)
|
|
2634
|
+
@transport.request(
|
|
2635
|
+
http_method: "POST",
|
|
2636
|
+
path: "/api/org/{orgId}/resources/create-pricing",
|
|
2637
|
+
path_params: { "orgId" => org_id },
|
|
2638
|
+
body: body,
|
|
2639
|
+
request_options: request_options
|
|
2640
|
+
)
|
|
2641
|
+
end
|
|
2642
|
+
|
|
2643
|
+
# Delete a resource via the plugin
|
|
2644
|
+
#
|
|
2645
|
+
# _Requires permission: `resources:delete`._
|
|
2646
|
+
#
|
|
2647
|
+
# DELETE /api/org/{orgId}/resources/{pluginId}/{typeId}
|
|
2648
|
+
#
|
|
2649
|
+
# Raises on 400: Bad request
|
|
2650
|
+
#
|
|
2651
|
+
# Raises on 404: Not found
|
|
2652
|
+
#
|
|
2653
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2654
|
+
# constructed with.
|
|
2655
|
+
# @param plugin_id [String]
|
|
2656
|
+
# @param type_id [String]
|
|
2657
|
+
# @param resource_id [String]
|
|
2658
|
+
# @param account_id [String]
|
|
2659
|
+
# @param parent_resource_id [String, nil]
|
|
2660
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2661
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
2662
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2663
|
+
def delete(
|
|
2664
|
+
plugin_id:,
|
|
2665
|
+
type_id:,
|
|
2666
|
+
resource_id:,
|
|
2667
|
+
account_id:,
|
|
2668
|
+
org_id: nil,
|
|
2669
|
+
parent_resource_id: nil,
|
|
2670
|
+
request_options: nil
|
|
2671
|
+
)
|
|
2672
|
+
@transport.request(
|
|
2673
|
+
http_method: "DELETE",
|
|
2674
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}",
|
|
2675
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2676
|
+
query: {
|
|
2677
|
+
"resourceId" => resource_id,
|
|
2678
|
+
"accountId" => account_id,
|
|
2679
|
+
"parentResourceId" => parent_resource_id
|
|
2680
|
+
},
|
|
2681
|
+
request_options: request_options
|
|
2682
|
+
)
|
|
2683
|
+
end
|
|
2684
|
+
|
|
2685
|
+
# Get human-readable describe text for a resource
|
|
2686
|
+
#
|
|
2687
|
+
# _Requires permission: `resources:read`._
|
|
2688
|
+
#
|
|
2689
|
+
# POST /api/org/{orgId}/resources/{pluginId}/{typeId}/describe
|
|
2690
|
+
#
|
|
2691
|
+
# Raises on 400: Bad request
|
|
2692
|
+
#
|
|
2693
|
+
# Raises on 404: Not found
|
|
2694
|
+
#
|
|
2695
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2696
|
+
# constructed with.
|
|
2697
|
+
# @param plugin_id [String]
|
|
2698
|
+
# @param type_id [String]
|
|
2699
|
+
# @param body [Hash] Request body, shaped as `DescribeRequest`.
|
|
2700
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2701
|
+
# @return [Hash] Parsed JSON, shaped as `DescribeResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
2702
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2703
|
+
def describe(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
|
|
2704
|
+
@transport.request(
|
|
2705
|
+
http_method: "POST",
|
|
2706
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/describe",
|
|
2707
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2708
|
+
body: body,
|
|
2709
|
+
request_options: request_options
|
|
2710
|
+
)
|
|
2711
|
+
end
|
|
2712
|
+
|
|
2713
|
+
# Full resource detail page payload
|
|
2714
|
+
#
|
|
2715
|
+
# Performs a live `listResources` against the provider, falls back to DB on
|
|
2716
|
+
# failure, and returns the plugin's `renderDetail` schema plus host-derived
|
|
2717
|
+
# flags (SQL/KV/SSH availability, child resources, peer panes, etc).
|
|
2718
|
+
#
|
|
2719
|
+
# _Requires permission: `resources:read`._
|
|
2720
|
+
#
|
|
2721
|
+
# GET /api/org/{orgId}/resources/{pluginId}/{typeId}/detail
|
|
2722
|
+
#
|
|
2723
|
+
# Raises on 400: Bad request
|
|
2724
|
+
#
|
|
2725
|
+
# Raises on 404: Not found
|
|
2726
|
+
#
|
|
2727
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2728
|
+
# constructed with.
|
|
2729
|
+
# @param plugin_id [String]
|
|
2730
|
+
# @param type_id [String]
|
|
2731
|
+
# @param resource_id [String]
|
|
2732
|
+
# @param account_id [String, nil]
|
|
2733
|
+
# @param parent_resource_id [String, nil]
|
|
2734
|
+
# @param include_peer_panes [String, nil] Default true. If false, peer panes are returned as
|
|
2735
|
+
# stubs.
|
|
2736
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2737
|
+
# @return [Hash] Parsed JSON, shaped as `ResourceDetail` — see `sig/infrawrench/sdk.rbs`.
|
|
2738
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2739
|
+
def detail(
|
|
2740
|
+
plugin_id:,
|
|
2741
|
+
type_id:,
|
|
2742
|
+
resource_id:,
|
|
2743
|
+
org_id: nil,
|
|
2744
|
+
account_id: nil,
|
|
2745
|
+
parent_resource_id: nil,
|
|
2746
|
+
include_peer_panes: nil,
|
|
2747
|
+
request_options: nil
|
|
2748
|
+
)
|
|
2749
|
+
@transport.request(
|
|
2750
|
+
http_method: "GET",
|
|
2751
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/detail",
|
|
2752
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2753
|
+
query: {
|
|
2754
|
+
"resourceId" => resource_id,
|
|
2755
|
+
"accountId" => account_id,
|
|
2756
|
+
"parentResourceId" => parent_resource_id,
|
|
2757
|
+
"includePeerPanes" => include_peer_panes
|
|
2758
|
+
},
|
|
2759
|
+
request_options: request_options
|
|
2760
|
+
)
|
|
2761
|
+
end
|
|
2762
|
+
|
|
2763
|
+
# Export a credential file for a resource (one-time reveal)
|
|
2764
|
+
#
|
|
2765
|
+
# _Requires permission: `secrets:read`._
|
|
2766
|
+
#
|
|
2767
|
+
# POST /api/org/{orgId}/resources/{pluginId}/{typeId}/export-credential
|
|
2768
|
+
#
|
|
2769
|
+
# Raises on 400: Bad request
|
|
2770
|
+
#
|
|
2771
|
+
# Raises on 404: Not found
|
|
2772
|
+
#
|
|
2773
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2774
|
+
# constructed with.
|
|
2775
|
+
# @param plugin_id [String]
|
|
2776
|
+
# @param type_id [String]
|
|
2777
|
+
# @param body [Hash] Request body, shaped as `ExportCredentialRequest`.
|
|
2778
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2779
|
+
# @return [Hash] Parsed JSON, shaped as `CredentialExport` — see `sig/infrawrench/sdk.rbs`.
|
|
2780
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2781
|
+
def export_credential(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
|
|
2782
|
+
@transport.request(
|
|
2783
|
+
http_method: "POST",
|
|
2784
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/export-credential",
|
|
2785
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2786
|
+
body: body,
|
|
2787
|
+
request_options: request_options
|
|
2788
|
+
)
|
|
2789
|
+
end
|
|
2790
|
+
|
|
2791
|
+
# Execute an in-form field action (e.g. generate an IAM role)
|
|
2792
|
+
#
|
|
2793
|
+
# Calls the plugin's `executeFieldAction`. Returns `{ value }` to assign to
|
|
2794
|
+
# the field; for `select` fields the optional `option` should be spliced
|
|
2795
|
+
# into the options list so the new value can be displayed.
|
|
2796
|
+
#
|
|
2797
|
+
# POST /api/org/{orgId}/resources/field-action
|
|
2798
|
+
#
|
|
2799
|
+
# Raises on 400: Bad request
|
|
2800
|
+
#
|
|
2801
|
+
# Raises on 404: Not found
|
|
2802
|
+
#
|
|
2803
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2804
|
+
# constructed with.
|
|
2805
|
+
# @param body [Hash] Request body, shaped as `FieldActionRequest`.
|
|
2806
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2807
|
+
# @return [Hash] Parsed JSON, shaped as `FieldActionResponse` — see
|
|
2808
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2809
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2810
|
+
def field_action(body:, org_id: nil, request_options: nil)
|
|
2811
|
+
@transport.request(
|
|
2812
|
+
http_method: "POST",
|
|
2813
|
+
path: "/api/org/{orgId}/resources/field-action",
|
|
2814
|
+
path_params: { "orgId" => org_id },
|
|
2815
|
+
body: body,
|
|
2816
|
+
request_options: request_options
|
|
2817
|
+
)
|
|
2818
|
+
end
|
|
2819
|
+
|
|
2820
|
+
# Bulk-import resources from YAML (kubectl apply -f equivalent)
|
|
2821
|
+
#
|
|
2822
|
+
# _Requires permission: `resources:write`._
|
|
2823
|
+
#
|
|
2824
|
+
# POST /api/org/{orgId}/resources/{pluginId}/import-yaml
|
|
2825
|
+
#
|
|
2826
|
+
# Raises on 400: Bad request
|
|
2827
|
+
#
|
|
2828
|
+
# Raises on 404: Not found
|
|
2829
|
+
#
|
|
2830
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2831
|
+
# constructed with.
|
|
2832
|
+
# @param plugin_id [String]
|
|
2833
|
+
# @param body [Hash] Request body, shaped as `ImportYamlRequest`.
|
|
2834
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2835
|
+
# @return [Hash] Parsed JSON, shaped as `JsonObject` — see `sig/infrawrench/sdk.rbs`.
|
|
2836
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2837
|
+
def import_yaml(plugin_id:, body:, org_id: nil, request_options: nil)
|
|
2838
|
+
@transport.request(
|
|
2839
|
+
http_method: "POST",
|
|
2840
|
+
path: "/api/org/{orgId}/resources/{pluginId}/import-yaml",
|
|
2841
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id },
|
|
2842
|
+
body: body,
|
|
2843
|
+
request_options: request_options
|
|
2844
|
+
)
|
|
2845
|
+
end
|
|
2846
|
+
|
|
2847
|
+
# Invoke a plugin-defined action on a resource
|
|
2848
|
+
#
|
|
2849
|
+
# _Requires permission: `resources:write`._
|
|
2850
|
+
#
|
|
2851
|
+
# POST /api/org/{orgId}/resources/invoke-action
|
|
2852
|
+
#
|
|
2853
|
+
# Raises on 400: Bad request
|
|
2854
|
+
#
|
|
2855
|
+
# Raises on 404: Not found
|
|
2856
|
+
#
|
|
2857
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2858
|
+
# constructed with.
|
|
2859
|
+
# @param body [Hash] Request body, shaped as `InvokeActionRequest`.
|
|
2860
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2861
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
2862
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2863
|
+
def invoke_action(body:, org_id: nil, request_options: nil)
|
|
2864
|
+
@transport.request(
|
|
2865
|
+
http_method: "POST",
|
|
2866
|
+
path: "/api/org/{orgId}/resources/invoke-action",
|
|
2867
|
+
path_params: { "orgId" => org_id },
|
|
2868
|
+
body: body,
|
|
2869
|
+
request_options: request_options
|
|
2870
|
+
)
|
|
2871
|
+
end
|
|
2872
|
+
|
|
2873
|
+
# Fetch logs for a resource
|
|
2874
|
+
#
|
|
2875
|
+
# _Requires permission: `resources:read`._
|
|
2876
|
+
#
|
|
2877
|
+
# POST /api/org/{orgId}/resources/{pluginId}/{typeId}/logs
|
|
2878
|
+
#
|
|
2879
|
+
# Raises on 400: Bad request
|
|
2880
|
+
#
|
|
2881
|
+
# Raises on 404: Not found
|
|
2882
|
+
#
|
|
2883
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2884
|
+
# constructed with.
|
|
2885
|
+
# @param plugin_id [String]
|
|
2886
|
+
# @param type_id [String]
|
|
2887
|
+
# @param body [Hash] Request body, shaped as `LogsRequest`.
|
|
2888
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2889
|
+
# @return [Hash] Parsed JSON, shaped as `LogsResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
2890
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2891
|
+
def logs(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
|
|
2892
|
+
@transport.request(
|
|
2893
|
+
http_method: "POST",
|
|
2894
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/logs",
|
|
2895
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2896
|
+
body: body,
|
|
2897
|
+
request_options: request_options
|
|
2898
|
+
)
|
|
2899
|
+
end
|
|
2900
|
+
|
|
2901
|
+
# Fetch metric series for a resource
|
|
2902
|
+
#
|
|
2903
|
+
# _Requires permission: `resources:read`._
|
|
2904
|
+
#
|
|
2905
|
+
# POST /api/org/{orgId}/resources/{pluginId}/{typeId}/metrics
|
|
2906
|
+
#
|
|
2907
|
+
# Raises on 400: Bad request
|
|
2908
|
+
#
|
|
2909
|
+
# Raises on 404: Not found
|
|
2910
|
+
#
|
|
2911
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2912
|
+
# constructed with.
|
|
2913
|
+
# @param plugin_id [String]
|
|
2914
|
+
# @param type_id [String]
|
|
2915
|
+
# @param body [Hash] Request body, shaped as `MetricsRequest`.
|
|
2916
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2917
|
+
# @return [Hash] Parsed JSON, shaped as `MetricsResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
2918
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2919
|
+
def metrics(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
|
|
2920
|
+
@transport.request(
|
|
2921
|
+
http_method: "POST",
|
|
2922
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/metrics",
|
|
2923
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2924
|
+
body: body,
|
|
2925
|
+
request_options: request_options
|
|
2926
|
+
)
|
|
2927
|
+
end
|
|
2928
|
+
|
|
2929
|
+
# Run a NoSQL document-browser command (e.g. MongoDB shell)
|
|
2930
|
+
#
|
|
2931
|
+
# _Requires permission: `resources:execute`._
|
|
2932
|
+
#
|
|
2933
|
+
# POST /api/org/{orgId}/resources/nosql-command
|
|
2934
|
+
#
|
|
2935
|
+
# Raises on 400: Bad request
|
|
2936
|
+
#
|
|
2937
|
+
# Raises on 404: Not found
|
|
2938
|
+
#
|
|
2939
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2940
|
+
# constructed with.
|
|
2941
|
+
# @param body [Hash] Request body, shaped as `NoSqlCommandRequest`.
|
|
2942
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2943
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
2944
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2945
|
+
def nosql_command(body:, org_id: nil, request_options: nil)
|
|
2946
|
+
@transport.request(
|
|
2947
|
+
http_method: "POST",
|
|
2948
|
+
path: "/api/org/{orgId}/resources/nosql-command",
|
|
2949
|
+
path_params: { "orgId" => org_id },
|
|
2950
|
+
body: body,
|
|
2951
|
+
request_options: request_options
|
|
2952
|
+
)
|
|
2953
|
+
end
|
|
2954
|
+
|
|
2955
|
+
# Lazy-fetch peer-integration panes for a resource
|
|
2956
|
+
#
|
|
2957
|
+
# _Requires permission: `resources:read`._
|
|
2958
|
+
#
|
|
2959
|
+
# POST /api/org/{orgId}/resources/{pluginId}/{typeId}/peer-panes
|
|
2960
|
+
#
|
|
2961
|
+
# Raises on 404: Not found
|
|
2962
|
+
#
|
|
2963
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2964
|
+
# constructed with.
|
|
2965
|
+
# @param plugin_id [String]
|
|
2966
|
+
# @param type_id [String]
|
|
2967
|
+
# @param body [Hash] Request body, shaped as `PeerPanesRequest`.
|
|
2968
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2969
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<PeerPane>` — see
|
|
2970
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2971
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2972
|
+
def peer_panes(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
|
|
2973
|
+
@transport.request(
|
|
2974
|
+
http_method: "POST",
|
|
2975
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/peer-panes",
|
|
2976
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
2977
|
+
body: body,
|
|
2978
|
+
request_options: request_options
|
|
2979
|
+
)
|
|
2980
|
+
end
|
|
2981
|
+
|
|
2982
|
+
# Fetch options for a `resource-picker` field
|
|
2983
|
+
#
|
|
2984
|
+
# _Requires permission: `resources:read`._
|
|
2985
|
+
#
|
|
2986
|
+
# POST /api/org/{orgId}/resources/picker-resources
|
|
2987
|
+
#
|
|
2988
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2989
|
+
# constructed with.
|
|
2990
|
+
# @param body [Hash] Request body, shaped as `PickerResourcesRequest`.
|
|
2991
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2992
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<PickerResource>` — see
|
|
2993
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2994
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2995
|
+
def picker_resources(body:, org_id: nil, request_options: nil)
|
|
2996
|
+
@transport.request(
|
|
2997
|
+
http_method: "POST",
|
|
2998
|
+
path: "/api/org/{orgId}/resources/picker-resources",
|
|
2999
|
+
path_params: { "orgId" => org_id },
|
|
3000
|
+
body: body,
|
|
3001
|
+
request_options: request_options
|
|
3002
|
+
)
|
|
3003
|
+
end
|
|
3004
|
+
|
|
3005
|
+
# Update a resource via its plugin
|
|
3006
|
+
#
|
|
3007
|
+
# Applies the supplied field changes upstream and persists the refreshed
|
|
3008
|
+
# fields/display name to the DB. The body's `fields` map only carries the
|
|
3009
|
+
# keys the caller actually changed.
|
|
3010
|
+
#
|
|
3011
|
+
# POST /api/org/{orgId}/resources/update
|
|
3012
|
+
#
|
|
3013
|
+
# Raises on 400: Bad request
|
|
3014
|
+
#
|
|
3015
|
+
# Raises on 404: Not found
|
|
3016
|
+
#
|
|
3017
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3018
|
+
# constructed with.
|
|
3019
|
+
# @param body [Hash] Request body, shaped as `UpdateResourceRequest`.
|
|
3020
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3021
|
+
# @return [Hash] Parsed JSON, shaped as `UpdateResourceResponse` — see
|
|
3022
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3023
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3024
|
+
def update(body:, org_id: nil, request_options: nil)
|
|
3025
|
+
@transport.request(
|
|
3026
|
+
http_method: "POST",
|
|
3027
|
+
path: "/api/org/{orgId}/resources/update",
|
|
3028
|
+
path_params: { "orgId" => org_id },
|
|
3029
|
+
body: body,
|
|
3030
|
+
request_options: request_options
|
|
3031
|
+
)
|
|
3032
|
+
end
|
|
3033
|
+
end
|
|
3034
|
+
|
|
3035
|
+
# `client.search`
|
|
3036
|
+
class SearchNamespace
|
|
3037
|
+
# @api private
|
|
3038
|
+
# @param transport [Transport]
|
|
3039
|
+
def initialize(transport)
|
|
3040
|
+
@transport = transport
|
|
3041
|
+
end
|
|
3042
|
+
|
|
3043
|
+
# Search resources (capped at 50 hits) and workflows across the org
|
|
3044
|
+
#
|
|
3045
|
+
# _Requires permission: `resources:read`._
|
|
3046
|
+
#
|
|
3047
|
+
# GET /api/org/{orgId}/search
|
|
3048
|
+
#
|
|
3049
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3050
|
+
# constructed with.
|
|
3051
|
+
# @param q [String, nil]
|
|
3052
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3053
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<SearchHit>` — see
|
|
3054
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3055
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3056
|
+
def list(org_id: nil, q: nil, request_options: nil)
|
|
3057
|
+
@transport.request(
|
|
3058
|
+
http_method: "GET",
|
|
3059
|
+
path: "/api/org/{orgId}/search",
|
|
3060
|
+
path_params: { "orgId" => org_id },
|
|
3061
|
+
query: { "q" => q },
|
|
3062
|
+
request_options: request_options
|
|
3063
|
+
)
|
|
3064
|
+
end
|
|
3065
|
+
end
|
|
3066
|
+
|
|
3067
|
+
# `client.sftp`
|
|
3068
|
+
class SftpNamespace
|
|
3069
|
+
# @api private
|
|
3070
|
+
# @param transport [Transport]
|
|
3071
|
+
def initialize(transport)
|
|
3072
|
+
@transport = transport
|
|
3073
|
+
end
|
|
3074
|
+
|
|
3075
|
+
# Delete a file or directory over SFTP
|
|
3076
|
+
#
|
|
3077
|
+
# _Requires permission: `storage:write`._
|
|
3078
|
+
#
|
|
3079
|
+
# POST /api/org/{orgId}/sftp/delete
|
|
3080
|
+
#
|
|
3081
|
+
# Raises on 404: Not found
|
|
3082
|
+
#
|
|
3083
|
+
# Raises on 500: Server error
|
|
3084
|
+
#
|
|
3085
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3086
|
+
# constructed with.
|
|
3087
|
+
# @param body [Hash] Request body, shaped as `SftpDeleteRequest`.
|
|
3088
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3089
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3090
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3091
|
+
def delete(body:, org_id: nil, request_options: nil)
|
|
3092
|
+
@transport.request(
|
|
3093
|
+
http_method: "POST",
|
|
3094
|
+
path: "/api/org/{orgId}/sftp/delete",
|
|
3095
|
+
path_params: { "orgId" => org_id },
|
|
3096
|
+
body: body,
|
|
3097
|
+
request_options: request_options
|
|
3098
|
+
)
|
|
3099
|
+
end
|
|
3100
|
+
|
|
3101
|
+
# Download one or many files via SFTP (zipped if more than one)
|
|
3102
|
+
#
|
|
3103
|
+
# _Requires permission: `storage:read`._
|
|
3104
|
+
#
|
|
3105
|
+
# GET /api/org/{orgId}/v1/sftp/download
|
|
3106
|
+
#
|
|
3107
|
+
# Raises on 400: Bad request
|
|
3108
|
+
#
|
|
3109
|
+
# Raises on 404: Not found
|
|
3110
|
+
#
|
|
3111
|
+
# Raises on 500: Server error
|
|
3112
|
+
#
|
|
3113
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3114
|
+
# constructed with.
|
|
3115
|
+
# @param account_id [String]
|
|
3116
|
+
# @param paths [String] JSON-encoded array of remote paths
|
|
3117
|
+
# @param base_path [String, nil]
|
|
3118
|
+
# @param ssh_key_id [String, nil]
|
|
3119
|
+
# @param ssh_host [String, nil]
|
|
3120
|
+
# @param ssh_username [String, nil]
|
|
3121
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3122
|
+
# @return [String] Raw response bytes.
|
|
3123
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3124
|
+
def download(
|
|
3125
|
+
account_id:,
|
|
3126
|
+
paths:,
|
|
3127
|
+
org_id: nil,
|
|
3128
|
+
base_path: nil,
|
|
3129
|
+
ssh_key_id: nil,
|
|
3130
|
+
ssh_host: nil,
|
|
3131
|
+
ssh_username: nil,
|
|
3132
|
+
request_options: nil
|
|
3133
|
+
)
|
|
3134
|
+
@transport.request(
|
|
3135
|
+
http_method: "GET",
|
|
3136
|
+
path: "/api/org/{orgId}/v1/sftp/download",
|
|
3137
|
+
path_params: { "orgId" => org_id },
|
|
3138
|
+
query: {
|
|
3139
|
+
"accountId" => account_id,
|
|
3140
|
+
"paths" => paths,
|
|
3141
|
+
"basePath" => base_path,
|
|
3142
|
+
"sshKeyId" => ssh_key_id,
|
|
3143
|
+
"sshHost" => ssh_host,
|
|
3144
|
+
"sshUsername" => ssh_username
|
|
3145
|
+
},
|
|
3146
|
+
accept: :binary,
|
|
3147
|
+
request_options: request_options
|
|
3148
|
+
)
|
|
3149
|
+
end
|
|
3150
|
+
|
|
3151
|
+
# List a directory over SFTP
|
|
3152
|
+
#
|
|
3153
|
+
# _Requires permission: `storage:read`._
|
|
3154
|
+
#
|
|
3155
|
+
# POST /api/org/{orgId}/sftp/list
|
|
3156
|
+
#
|
|
3157
|
+
# Raises on 404: Not found
|
|
3158
|
+
#
|
|
3159
|
+
# Raises on 500: Server error
|
|
3160
|
+
#
|
|
3161
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3162
|
+
# constructed with.
|
|
3163
|
+
# @param body [Hash] Request body, shaped as `SftpListRequest`.
|
|
3164
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3165
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<SftpEntry>` — see
|
|
3166
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3167
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3168
|
+
def list(body:, org_id: nil, request_options: nil)
|
|
3169
|
+
@transport.request(
|
|
3170
|
+
http_method: "POST",
|
|
3171
|
+
path: "/api/org/{orgId}/sftp/list",
|
|
3172
|
+
path_params: { "orgId" => org_id },
|
|
3173
|
+
body: body,
|
|
3174
|
+
request_options: request_options
|
|
3175
|
+
)
|
|
3176
|
+
end
|
|
3177
|
+
|
|
3178
|
+
# Create a directory over SFTP
|
|
3179
|
+
#
|
|
3180
|
+
# _Requires permission: `storage:write`._
|
|
3181
|
+
#
|
|
3182
|
+
# POST /api/org/{orgId}/sftp/mkdir
|
|
3183
|
+
#
|
|
3184
|
+
# Raises on 404: Not found
|
|
3185
|
+
#
|
|
3186
|
+
# Raises on 500: Server error
|
|
3187
|
+
#
|
|
3188
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3189
|
+
# constructed with.
|
|
3190
|
+
# @param body [Hash] Request body, shaped as `SftpPathRequest`.
|
|
3191
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3192
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3193
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3194
|
+
def mkdir(body:, org_id: nil, request_options: nil)
|
|
3195
|
+
@transport.request(
|
|
3196
|
+
http_method: "POST",
|
|
3197
|
+
path: "/api/org/{orgId}/sftp/mkdir",
|
|
3198
|
+
path_params: { "orgId" => org_id },
|
|
3199
|
+
body: body,
|
|
3200
|
+
request_options: request_options
|
|
3201
|
+
)
|
|
3202
|
+
end
|
|
3203
|
+
|
|
3204
|
+
# Upload a file via SFTP
|
|
3205
|
+
#
|
|
3206
|
+
# _Requires permission: `storage:write`._
|
|
3207
|
+
#
|
|
3208
|
+
# POST /api/org/{orgId}/v1/sftp/upload
|
|
3209
|
+
#
|
|
3210
|
+
# Raises on 400: Bad request
|
|
3211
|
+
#
|
|
3212
|
+
# Raises on 404: Not found
|
|
3213
|
+
#
|
|
3214
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3215
|
+
# constructed with.
|
|
3216
|
+
# @param body [Hash] Sent as `multipart/form-data`; `file` carries the file bytes.
|
|
3217
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3218
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3219
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3220
|
+
def upload(body:, org_id: nil, request_options: nil)
|
|
3221
|
+
@transport.request(
|
|
3222
|
+
http_method: "POST",
|
|
3223
|
+
path: "/api/org/{orgId}/v1/sftp/upload",
|
|
3224
|
+
path_params: { "orgId" => org_id },
|
|
3225
|
+
form: body,
|
|
3226
|
+
form_files: ["file"],
|
|
3227
|
+
request_options: request_options
|
|
3228
|
+
)
|
|
3229
|
+
end
|
|
3230
|
+
end
|
|
3231
|
+
|
|
3232
|
+
# `client.sql`
|
|
3233
|
+
class SqlNamespace
|
|
3234
|
+
# @api private
|
|
3235
|
+
# @param transport [Transport]
|
|
3236
|
+
def initialize(transport)
|
|
3237
|
+
@transport = transport
|
|
3238
|
+
end
|
|
3239
|
+
|
|
3240
|
+
# Dry-run cost estimate (e.g. BigQuery byte scan)
|
|
3241
|
+
#
|
|
3242
|
+
# _Requires permission: `resources:read`._
|
|
3243
|
+
#
|
|
3244
|
+
# POST /api/org/{orgId}/sql/estimate
|
|
3245
|
+
#
|
|
3246
|
+
# Raises on 400: Bad request
|
|
3247
|
+
#
|
|
3248
|
+
# Raises on 404: Not found
|
|
3249
|
+
#
|
|
3250
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3251
|
+
# constructed with.
|
|
3252
|
+
# @param body [Hash] Request body, shaped as `SqlEstimateRequest`.
|
|
3253
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3254
|
+
# @return [Hash] Parsed JSON, shaped as `JsonObject` — see `sig/infrawrench/sdk.rbs`.
|
|
3255
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3256
|
+
def estimate(body:, org_id: nil, request_options: nil)
|
|
3257
|
+
@transport.request(
|
|
3258
|
+
http_method: "POST",
|
|
3259
|
+
path: "/api/org/{orgId}/sql/estimate",
|
|
3260
|
+
path_params: { "orgId" => org_id },
|
|
3261
|
+
body: body,
|
|
3262
|
+
request_options: request_options
|
|
3263
|
+
)
|
|
3264
|
+
end
|
|
3265
|
+
|
|
3266
|
+
# Run an INSERT/UPDATE/DELETE/DDL statement
|
|
3267
|
+
#
|
|
3268
|
+
# _Requires permission: `resources:execute`._
|
|
3269
|
+
#
|
|
3270
|
+
# POST /api/org/{orgId}/sql/execute
|
|
3271
|
+
#
|
|
3272
|
+
# Raises on 400: Bad request
|
|
3273
|
+
#
|
|
3274
|
+
# Raises on 404: Not found
|
|
3275
|
+
#
|
|
3276
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3277
|
+
# constructed with.
|
|
3278
|
+
# @param body [Hash] Request body, shaped as `SqlExecuteRequest`.
|
|
3279
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3280
|
+
# @return [Hash] Parsed JSON, shaped as `SqlExecuteResponse` — see
|
|
3281
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3282
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3283
|
+
def execute(body:, org_id: nil, request_options: nil)
|
|
3284
|
+
@transport.request(
|
|
3285
|
+
http_method: "POST",
|
|
3286
|
+
path: "/api/org/{orgId}/sql/execute",
|
|
3287
|
+
path_params: { "orgId" => org_id },
|
|
3288
|
+
body: body,
|
|
3289
|
+
request_options: request_options
|
|
3290
|
+
)
|
|
3291
|
+
end
|
|
3292
|
+
|
|
3293
|
+
# Run a read-only SQL query
|
|
3294
|
+
#
|
|
3295
|
+
# Routes to the right driver: REST `executeQuery` (BigQuery, Databricks),
|
|
3296
|
+
# per-resource SQL driver (Neon, Turso) or account-level SQL driver
|
|
3297
|
+
# (Postgres, MySQL).
|
|
3298
|
+
#
|
|
3299
|
+
# _Requires permission: `resources:execute`._
|
|
3300
|
+
#
|
|
3301
|
+
# POST /api/org/{orgId}/sql/query
|
|
3302
|
+
#
|
|
3303
|
+
# Raises on 400: Bad request
|
|
3304
|
+
#
|
|
3305
|
+
# Raises on 404: Not found
|
|
3306
|
+
#
|
|
3307
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3308
|
+
# constructed with.
|
|
3309
|
+
# @param body [Hash] Request body, shaped as `SqlQueryRequest`.
|
|
3310
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3311
|
+
# @return [Hash] Parsed JSON, shaped as `SqlQueryResponse | JsonObject` — see
|
|
3312
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3313
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3314
|
+
def query(body:, org_id: nil, request_options: nil)
|
|
3315
|
+
@transport.request(
|
|
3316
|
+
http_method: "POST",
|
|
3317
|
+
path: "/api/org/{orgId}/sql/query",
|
|
3318
|
+
path_params: { "orgId" => org_id },
|
|
3319
|
+
body: body,
|
|
3320
|
+
request_options: request_options
|
|
3321
|
+
)
|
|
3322
|
+
end
|
|
3323
|
+
end
|
|
3324
|
+
|
|
3325
|
+
# `client.ssh_keys`
|
|
3326
|
+
class SshKeysNamespace
|
|
3327
|
+
# @api private
|
|
3328
|
+
# @param transport [Transport]
|
|
3329
|
+
def initialize(transport)
|
|
3330
|
+
@transport = transport
|
|
3331
|
+
end
|
|
3332
|
+
|
|
3333
|
+
# Generate a new Ed25519 keypair (private key returned once)
|
|
3334
|
+
#
|
|
3335
|
+
# _Requires permission: `ssh-keys:write`._
|
|
3336
|
+
#
|
|
3337
|
+
# POST /api/org/{orgId}/ssh-keys
|
|
3338
|
+
#
|
|
3339
|
+
# Raises on 400: Bad request
|
|
3340
|
+
#
|
|
3341
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3342
|
+
# constructed with.
|
|
3343
|
+
# @param body [Hash] Request body, shaped as `GenerateSshKeyRequest`.
|
|
3344
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3345
|
+
# @return [Hash] Parsed JSON, shaped as `GeneratedSshKey` — see `sig/infrawrench/sdk.rbs`.
|
|
3346
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3347
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
3348
|
+
@transport.request(
|
|
3349
|
+
http_method: "POST",
|
|
3350
|
+
path: "/api/org/{orgId}/ssh-keys",
|
|
3351
|
+
path_params: { "orgId" => org_id },
|
|
3352
|
+
body: body,
|
|
3353
|
+
request_options: request_options
|
|
3354
|
+
)
|
|
3355
|
+
end
|
|
3356
|
+
|
|
3357
|
+
# Delete an SSH key (owner only)
|
|
3358
|
+
#
|
|
3359
|
+
# _Requires permission: `ssh-keys:write`._
|
|
3360
|
+
#
|
|
3361
|
+
# DELETE /api/org/{orgId}/ssh-keys/{id}
|
|
3362
|
+
#
|
|
3363
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3364
|
+
# constructed with.
|
|
3365
|
+
# @param id [String]
|
|
3366
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3367
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3368
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3369
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
3370
|
+
@transport.request(
|
|
3371
|
+
http_method: "DELETE",
|
|
3372
|
+
path: "/api/org/{orgId}/ssh-keys/{id}",
|
|
3373
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
3374
|
+
request_options: request_options
|
|
3375
|
+
)
|
|
3376
|
+
end
|
|
3377
|
+
|
|
3378
|
+
# Import an existing public key
|
|
3379
|
+
#
|
|
3380
|
+
# _Requires permission: `ssh-keys:write`._
|
|
3381
|
+
#
|
|
3382
|
+
# POST /api/org/{orgId}/ssh-keys/import
|
|
3383
|
+
#
|
|
3384
|
+
# Raises on 400: Bad request
|
|
3385
|
+
#
|
|
3386
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3387
|
+
# constructed with.
|
|
3388
|
+
# @param body [Hash] Request body, shaped as `ImportSshKeyRequest`.
|
|
3389
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3390
|
+
# @return [Hash] Parsed JSON, shaped as `ImportedSshKey` — see `sig/infrawrench/sdk.rbs`.
|
|
3391
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3392
|
+
def import(body:, org_id: nil, request_options: nil)
|
|
3393
|
+
@transport.request(
|
|
3394
|
+
http_method: "POST",
|
|
3395
|
+
path: "/api/org/{orgId}/ssh-keys/import",
|
|
3396
|
+
path_params: { "orgId" => org_id },
|
|
3397
|
+
body: body,
|
|
3398
|
+
request_options: request_options
|
|
3399
|
+
)
|
|
3400
|
+
end
|
|
3401
|
+
|
|
3402
|
+
# List org SSH keys
|
|
3403
|
+
#
|
|
3404
|
+
# _Requires permission: `ssh-keys:read`._
|
|
3405
|
+
#
|
|
3406
|
+
# GET /api/org/{orgId}/ssh-keys
|
|
3407
|
+
#
|
|
3408
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3409
|
+
# constructed with.
|
|
3410
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3411
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<SshKey>` — see
|
|
3412
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3413
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3414
|
+
def list(org_id: nil, request_options: nil)
|
|
3415
|
+
@transport.request(
|
|
3416
|
+
http_method: "GET",
|
|
3417
|
+
path: "/api/org/{orgId}/ssh-keys",
|
|
3418
|
+
path_params: { "orgId" => org_id },
|
|
3419
|
+
request_options: request_options
|
|
3420
|
+
)
|
|
3421
|
+
end
|
|
3422
|
+
end
|
|
3423
|
+
|
|
3424
|
+
# `client.ssh_tunnels`
|
|
3425
|
+
class SshTunnelsNamespace
|
|
3426
|
+
# @api private
|
|
3427
|
+
# @param transport [Transport]
|
|
3428
|
+
def initialize(transport)
|
|
3429
|
+
@transport = transport
|
|
3430
|
+
end
|
|
3431
|
+
|
|
3432
|
+
# List active tunnels for this org
|
|
3433
|
+
#
|
|
3434
|
+
# _Requires permission: `resources:execute`._
|
|
3435
|
+
#
|
|
3436
|
+
# GET /api/org/{orgId}/ssh-tunnels/active
|
|
3437
|
+
#
|
|
3438
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3439
|
+
# constructed with.
|
|
3440
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3441
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
3442
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3443
|
+
def active(org_id: nil, request_options: nil)
|
|
3444
|
+
@transport.request(
|
|
3445
|
+
http_method: "GET",
|
|
3446
|
+
path: "/api/org/{orgId}/ssh-tunnels/active",
|
|
3447
|
+
path_params: { "orgId" => org_id },
|
|
3448
|
+
request_options: request_options
|
|
3449
|
+
)
|
|
3450
|
+
end
|
|
3451
|
+
|
|
3452
|
+
# Close a tunnel by id
|
|
3453
|
+
#
|
|
3454
|
+
# _Requires permission: `resources:execute`._
|
|
3455
|
+
#
|
|
3456
|
+
# POST /api/org/{orgId}/ssh-tunnels/close
|
|
3457
|
+
#
|
|
3458
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3459
|
+
# constructed with.
|
|
3460
|
+
# @param body [Hash] Request body, shaped as `Hash`.
|
|
3461
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3462
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3463
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3464
|
+
def close(body:, org_id: nil, request_options: nil)
|
|
3465
|
+
@transport.request(
|
|
3466
|
+
http_method: "POST",
|
|
3467
|
+
path: "/api/org/{orgId}/ssh-tunnels/close",
|
|
3468
|
+
path_params: { "orgId" => org_id },
|
|
3469
|
+
body: body,
|
|
3470
|
+
request_options: request_options
|
|
3471
|
+
)
|
|
3472
|
+
end
|
|
3473
|
+
|
|
3474
|
+
# Create an account whose traffic is tunneled over SSH
|
|
3475
|
+
#
|
|
3476
|
+
# Verifies the SSH connection works before persisting.
|
|
3477
|
+
#
|
|
3478
|
+
# _Requires permission: `accounts:write`._
|
|
3479
|
+
#
|
|
3480
|
+
# POST /api/org/{orgId}/ssh-tunnels/create-account
|
|
3481
|
+
#
|
|
3482
|
+
# Raises on 400: Bad request
|
|
3483
|
+
#
|
|
3484
|
+
# Raises on 404: Not found
|
|
3485
|
+
#
|
|
3486
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3487
|
+
# constructed with.
|
|
3488
|
+
# @param body [Hash] Request body, shaped as `SshTunnelCreateAccountRequest`.
|
|
3489
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3490
|
+
# @return [Hash] Parsed JSON, shaped as `SshTunnelCreateAccountResponse` — see
|
|
3491
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3492
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3493
|
+
def create_account(body:, org_id: nil, request_options: nil)
|
|
3494
|
+
@transport.request(
|
|
3495
|
+
http_method: "POST",
|
|
3496
|
+
path: "/api/org/{orgId}/ssh-tunnels/create-account",
|
|
3497
|
+
path_params: { "orgId" => org_id },
|
|
3498
|
+
body: body,
|
|
3499
|
+
request_options: request_options
|
|
3500
|
+
)
|
|
3501
|
+
end
|
|
3502
|
+
|
|
3503
|
+
# Run a command over SSH using an org SSH key
|
|
3504
|
+
#
|
|
3505
|
+
# _Requires permission: `resources:execute`._
|
|
3506
|
+
#
|
|
3507
|
+
# POST /api/org/{orgId}/ssh-tunnels/exec
|
|
3508
|
+
#
|
|
3509
|
+
# Raises on 400: Bad request
|
|
3510
|
+
#
|
|
3511
|
+
# Raises on 404: Not found
|
|
3512
|
+
#
|
|
3513
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3514
|
+
# constructed with.
|
|
3515
|
+
# @param body [Hash] Request body, shaped as `SshExecRequest`.
|
|
3516
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3517
|
+
# @return [Hash] Parsed JSON, shaped as `SshExecResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
3518
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3519
|
+
def exec(body:, org_id: nil, request_options: nil)
|
|
3520
|
+
@transport.request(
|
|
3521
|
+
http_method: "POST",
|
|
3522
|
+
path: "/api/org/{orgId}/ssh-tunnels/exec",
|
|
3523
|
+
path_params: { "orgId" => org_id },
|
|
3524
|
+
body: body,
|
|
3525
|
+
request_options: request_options
|
|
3526
|
+
)
|
|
3527
|
+
end
|
|
3528
|
+
|
|
3529
|
+
# Re-open the tunnel for an existing account
|
|
3530
|
+
#
|
|
3531
|
+
# _Requires permission: `resources:execute`._
|
|
3532
|
+
#
|
|
3533
|
+
# POST /api/org/{orgId}/ssh-tunnels/open
|
|
3534
|
+
#
|
|
3535
|
+
# Raises on 404: Not found
|
|
3536
|
+
#
|
|
3537
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3538
|
+
# constructed with.
|
|
3539
|
+
# @param body [Hash] Request body, shaped as `Hash`.
|
|
3540
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3541
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
3542
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3543
|
+
def open(body:, org_id: nil, request_options: nil)
|
|
3544
|
+
@transport.request(
|
|
3545
|
+
http_method: "POST",
|
|
3546
|
+
path: "/api/org/{orgId}/ssh-tunnels/open",
|
|
3547
|
+
path_params: { "orgId" => org_id },
|
|
3548
|
+
body: body,
|
|
3549
|
+
request_options: request_options
|
|
3550
|
+
)
|
|
3551
|
+
end
|
|
3552
|
+
end
|
|
3553
|
+
|
|
3554
|
+
# `client.storage`
|
|
3555
|
+
class StorageNamespace
|
|
3556
|
+
# @api private
|
|
3557
|
+
# @param transport [Transport]
|
|
3558
|
+
def initialize(transport)
|
|
3559
|
+
@transport = transport
|
|
3560
|
+
end
|
|
3561
|
+
|
|
3562
|
+
# Delete a storage object
|
|
3563
|
+
#
|
|
3564
|
+
# _Requires permission: `storage:write`._
|
|
3565
|
+
#
|
|
3566
|
+
# POST /api/org/{orgId}/storage/delete
|
|
3567
|
+
#
|
|
3568
|
+
# Raises on 400: Bad request
|
|
3569
|
+
#
|
|
3570
|
+
# Raises on 404: Not found
|
|
3571
|
+
#
|
|
3572
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3573
|
+
# constructed with.
|
|
3574
|
+
# @param body [Hash] Request body, shaped as `StoragePathRequest`.
|
|
3575
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3576
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3577
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3578
|
+
def delete(body:, org_id: nil, request_options: nil)
|
|
3579
|
+
@transport.request(
|
|
3580
|
+
http_method: "POST",
|
|
3581
|
+
path: "/api/org/{orgId}/storage/delete",
|
|
3582
|
+
path_params: { "orgId" => org_id },
|
|
3583
|
+
body: body,
|
|
3584
|
+
request_options: request_options
|
|
3585
|
+
)
|
|
3586
|
+
end
|
|
3587
|
+
|
|
3588
|
+
# Download one or many objects (zipped if more than one)
|
|
3589
|
+
#
|
|
3590
|
+
# _Requires permission: `storage:read`._
|
|
3591
|
+
#
|
|
3592
|
+
# GET /api/org/{orgId}/v1/storage/download
|
|
3593
|
+
#
|
|
3594
|
+
# Raises on 400: Bad request
|
|
3595
|
+
#
|
|
3596
|
+
# Raises on 404: Not found
|
|
3597
|
+
#
|
|
3598
|
+
# Raises on 500: Server error
|
|
3599
|
+
#
|
|
3600
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3601
|
+
# constructed with.
|
|
3602
|
+
# @param account_id [String]
|
|
3603
|
+
# @param bucket [String]
|
|
3604
|
+
# @param keys [String] JSON-encoded array of object keys, e.g. `["a.txt","b.txt"]`
|
|
3605
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3606
|
+
# @return [String] Raw response bytes.
|
|
3607
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3608
|
+
def download(account_id:, bucket:, keys:, org_id: nil, request_options: nil)
|
|
3609
|
+
@transport.request(
|
|
3610
|
+
http_method: "GET",
|
|
3611
|
+
path: "/api/org/{orgId}/v1/storage/download",
|
|
3612
|
+
path_params: { "orgId" => org_id },
|
|
3613
|
+
query: { "accountId" => account_id, "bucket" => bucket, "keys" => keys },
|
|
3614
|
+
accept: :binary,
|
|
3615
|
+
request_options: request_options
|
|
3616
|
+
)
|
|
3617
|
+
end
|
|
3618
|
+
|
|
3619
|
+
# List objects in a bucket / prefix
|
|
3620
|
+
#
|
|
3621
|
+
# _Requires permission: `storage:read`._
|
|
3622
|
+
#
|
|
3623
|
+
# POST /api/org/{orgId}/storage/list
|
|
3624
|
+
#
|
|
3625
|
+
# Raises on 400: Bad request
|
|
3626
|
+
#
|
|
3627
|
+
# Raises on 404: Not found
|
|
3628
|
+
#
|
|
3629
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3630
|
+
# constructed with.
|
|
3631
|
+
# @param body [Hash] Request body, shaped as `StorageListRequest`.
|
|
3632
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3633
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<StorageObject>` — see
|
|
3634
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3635
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3636
|
+
def list(body:, org_id: nil, request_options: nil)
|
|
3637
|
+
@transport.request(
|
|
3638
|
+
http_method: "POST",
|
|
3639
|
+
path: "/api/org/{orgId}/storage/list",
|
|
3640
|
+
path_params: { "orgId" => org_id },
|
|
3641
|
+
body: body,
|
|
3642
|
+
request_options: request_options
|
|
3643
|
+
)
|
|
3644
|
+
end
|
|
3645
|
+
|
|
3646
|
+
# Create a folder marker in a bucket
|
|
3647
|
+
#
|
|
3648
|
+
# _Requires permission: `storage:write`._
|
|
3649
|
+
#
|
|
3650
|
+
# POST /api/org/{orgId}/storage/mkdir
|
|
3651
|
+
#
|
|
3652
|
+
# Raises on 400: Bad request
|
|
3653
|
+
#
|
|
3654
|
+
# Raises on 404: Not found
|
|
3655
|
+
#
|
|
3656
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3657
|
+
# constructed with.
|
|
3658
|
+
# @param body [Hash] Request body, shaped as `StoragePathRequest`.
|
|
3659
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3660
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3661
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3662
|
+
def mkdir(body:, org_id: nil, request_options: nil)
|
|
3663
|
+
@transport.request(
|
|
3664
|
+
http_method: "POST",
|
|
3665
|
+
path: "/api/org/{orgId}/storage/mkdir",
|
|
3666
|
+
path_params: { "orgId" => org_id },
|
|
3667
|
+
body: body,
|
|
3668
|
+
request_options: request_options
|
|
3669
|
+
)
|
|
3670
|
+
end
|
|
3671
|
+
|
|
3672
|
+
# Upload a file to object storage
|
|
3673
|
+
#
|
|
3674
|
+
# Multipart/form-data. Plugin must implement `uploadStorageObject`.
|
|
3675
|
+
#
|
|
3676
|
+
# _Requires permission: `storage:write`._
|
|
3677
|
+
#
|
|
3678
|
+
# POST /api/org/{orgId}/v1/storage/upload
|
|
3679
|
+
#
|
|
3680
|
+
# Raises on 400: Bad request
|
|
3681
|
+
#
|
|
3682
|
+
# Raises on 404: Not found
|
|
3683
|
+
#
|
|
3684
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3685
|
+
# constructed with.
|
|
3686
|
+
# @param body [Hash] Sent as `multipart/form-data`; `file` carries the file bytes.
|
|
3687
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3688
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3689
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3690
|
+
def upload(body:, org_id: nil, request_options: nil)
|
|
3691
|
+
@transport.request(
|
|
3692
|
+
http_method: "POST",
|
|
3693
|
+
path: "/api/org/{orgId}/v1/storage/upload",
|
|
3694
|
+
path_params: { "orgId" => org_id },
|
|
3695
|
+
form: body,
|
|
3696
|
+
form_files: ["file"],
|
|
3697
|
+
request_options: request_options
|
|
3698
|
+
)
|
|
3699
|
+
end
|
|
3700
|
+
end
|
|
3701
|
+
|
|
3702
|
+
# `client.team.invitations`
|
|
3703
|
+
class TeamInvitationsNamespace
|
|
3704
|
+
# @api private
|
|
3705
|
+
# @param transport [Transport]
|
|
3706
|
+
def initialize(transport)
|
|
3707
|
+
@transport = transport
|
|
3708
|
+
end
|
|
3709
|
+
|
|
3710
|
+
# Create an invitation (token valid for 7 days)
|
|
3711
|
+
#
|
|
3712
|
+
# _Requires permission: `team:invite`._
|
|
3713
|
+
#
|
|
3714
|
+
# POST /api/org/{orgId}/team/invitations
|
|
3715
|
+
#
|
|
3716
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3717
|
+
# constructed with.
|
|
3718
|
+
# @param body [Hash] Request body, shaped as `InviteRequest`.
|
|
3719
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3720
|
+
# @return [Hash] Parsed JSON, shaped as `InviteResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
3721
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3722
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
3723
|
+
@transport.request(
|
|
3724
|
+
http_method: "POST",
|
|
3725
|
+
path: "/api/org/{orgId}/team/invitations",
|
|
3726
|
+
path_params: { "orgId" => org_id },
|
|
3727
|
+
body: body,
|
|
3728
|
+
request_options: request_options
|
|
3729
|
+
)
|
|
3730
|
+
end
|
|
3731
|
+
|
|
3732
|
+
# Revoke a pending invitation
|
|
3733
|
+
#
|
|
3734
|
+
# _Requires permission: `team:invite`._
|
|
3735
|
+
#
|
|
3736
|
+
# DELETE /api/org/{orgId}/team/invitations/{id}
|
|
3737
|
+
#
|
|
3738
|
+
# Raises on 404: Not found
|
|
3739
|
+
#
|
|
3740
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3741
|
+
# constructed with.
|
|
3742
|
+
# @param id [String]
|
|
3743
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3744
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3745
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3746
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
3747
|
+
@transport.request(
|
|
3748
|
+
http_method: "DELETE",
|
|
3749
|
+
path: "/api/org/{orgId}/team/invitations/{id}",
|
|
3750
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
3751
|
+
request_options: request_options
|
|
3752
|
+
)
|
|
3753
|
+
end
|
|
3754
|
+
|
|
3755
|
+
# List pending and historical invitations
|
|
3756
|
+
#
|
|
3757
|
+
# _Requires permission: `team:read`._
|
|
3758
|
+
#
|
|
3759
|
+
# GET /api/org/{orgId}/team/invitations
|
|
3760
|
+
#
|
|
3761
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3762
|
+
# constructed with.
|
|
3763
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3764
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<Invitation>` — see
|
|
3765
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3766
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3767
|
+
def list(org_id: nil, request_options: nil)
|
|
3768
|
+
@transport.request(
|
|
3769
|
+
http_method: "GET",
|
|
3770
|
+
path: "/api/org/{orgId}/team/invitations",
|
|
3771
|
+
path_params: { "orgId" => org_id },
|
|
3772
|
+
request_options: request_options
|
|
3773
|
+
)
|
|
3774
|
+
end
|
|
3775
|
+
end
|
|
3776
|
+
|
|
3777
|
+
# `client.team.members`
|
|
3778
|
+
class TeamMembersNamespace
|
|
3779
|
+
# @api private
|
|
3780
|
+
# @param transport [Transport]
|
|
3781
|
+
def initialize(transport)
|
|
3782
|
+
@transport = transport
|
|
3783
|
+
end
|
|
3784
|
+
|
|
3785
|
+
# Remove a member from the org
|
|
3786
|
+
#
|
|
3787
|
+
# _Requires permission: `team:remove`._
|
|
3788
|
+
#
|
|
3789
|
+
# DELETE /api/org/{orgId}/team/members/{id}
|
|
3790
|
+
#
|
|
3791
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3792
|
+
# constructed with.
|
|
3793
|
+
# @param id [String]
|
|
3794
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3795
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3796
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3797
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
3798
|
+
@transport.request(
|
|
3799
|
+
http_method: "DELETE",
|
|
3800
|
+
path: "/api/org/{orgId}/team/members/{id}",
|
|
3801
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
3802
|
+
request_options: request_options
|
|
3803
|
+
)
|
|
3804
|
+
end
|
|
3805
|
+
|
|
3806
|
+
# List org members
|
|
3807
|
+
#
|
|
3808
|
+
# _Requires permission: `team:read`._
|
|
3809
|
+
#
|
|
3810
|
+
# GET /api/org/{orgId}/team/members
|
|
3811
|
+
#
|
|
3812
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3813
|
+
# constructed with.
|
|
3814
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3815
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<OrgMember>` — see
|
|
3816
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3817
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3818
|
+
def list(org_id: nil, request_options: nil)
|
|
3819
|
+
@transport.request(
|
|
3820
|
+
http_method: "GET",
|
|
3821
|
+
path: "/api/org/{orgId}/team/members",
|
|
3822
|
+
path_params: { "orgId" => org_id },
|
|
3823
|
+
request_options: request_options
|
|
3824
|
+
)
|
|
3825
|
+
end
|
|
3826
|
+
|
|
3827
|
+
# Change a member's role
|
|
3828
|
+
#
|
|
3829
|
+
# _Requires permission: `team:role:write`._
|
|
3830
|
+
#
|
|
3831
|
+
# PATCH /api/org/{orgId}/team/members/{id}/role
|
|
3832
|
+
#
|
|
3833
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3834
|
+
# constructed with.
|
|
3835
|
+
# @param id [String]
|
|
3836
|
+
# @param body [Hash] Request body, shaped as `RoleChangeRequest`.
|
|
3837
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3838
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3839
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3840
|
+
def role(id:, body:, org_id: nil, request_options: nil)
|
|
3841
|
+
@transport.request(
|
|
3842
|
+
http_method: "PATCH",
|
|
3843
|
+
path: "/api/org/{orgId}/team/members/{id}/role",
|
|
3844
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
3845
|
+
body: body,
|
|
3846
|
+
request_options: request_options
|
|
3847
|
+
)
|
|
3848
|
+
end
|
|
3849
|
+
end
|
|
3850
|
+
|
|
3851
|
+
# `client.team.roles`
|
|
3852
|
+
class TeamRolesNamespace
|
|
3853
|
+
# @api private
|
|
3854
|
+
# @param transport [Transport]
|
|
3855
|
+
def initialize(transport)
|
|
3856
|
+
@transport = transport
|
|
3857
|
+
end
|
|
3858
|
+
|
|
3859
|
+
# Create a custom role
|
|
3860
|
+
#
|
|
3861
|
+
# _Requires permission: `team:role:write`._
|
|
3862
|
+
#
|
|
3863
|
+
# POST /api/org/{orgId}/team/roles
|
|
3864
|
+
#
|
|
3865
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3866
|
+
# constructed with.
|
|
3867
|
+
# @param body [Hash] Request body, shaped as `RoleCreateRequest`.
|
|
3868
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3869
|
+
# @return [Hash] Parsed JSON, shaped as `Role` — see `sig/infrawrench/sdk.rbs`.
|
|
3870
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3871
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
3872
|
+
@transport.request(
|
|
3873
|
+
http_method: "POST",
|
|
3874
|
+
path: "/api/org/{orgId}/team/roles",
|
|
3875
|
+
path_params: { "orgId" => org_id },
|
|
3876
|
+
body: body,
|
|
3877
|
+
request_options: request_options
|
|
3878
|
+
)
|
|
3879
|
+
end
|
|
3880
|
+
|
|
3881
|
+
# Delete a custom role (must have no members or pending invitations)
|
|
3882
|
+
#
|
|
3883
|
+
# _Requires permission: `team:role:write`._
|
|
3884
|
+
#
|
|
3885
|
+
# DELETE /api/org/{orgId}/team/roles/{id}
|
|
3886
|
+
#
|
|
3887
|
+
# Raises on 404: Not found
|
|
3888
|
+
#
|
|
3889
|
+
# Raises on 409: Conflict
|
|
3890
|
+
#
|
|
3891
|
+
# Raises on 422: Bad request
|
|
3892
|
+
#
|
|
3893
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3894
|
+
# constructed with.
|
|
3895
|
+
# @param id [String]
|
|
3896
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3897
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3898
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3899
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
3900
|
+
@transport.request(
|
|
3901
|
+
http_method: "DELETE",
|
|
3902
|
+
path: "/api/org/{orgId}/team/roles/{id}",
|
|
3903
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
3904
|
+
request_options: request_options
|
|
3905
|
+
)
|
|
3906
|
+
end
|
|
3907
|
+
|
|
3908
|
+
# List roles (system + custom)
|
|
3909
|
+
#
|
|
3910
|
+
# _Requires permission: `team:read`._
|
|
3911
|
+
#
|
|
3912
|
+
# GET /api/org/{orgId}/team/roles
|
|
3913
|
+
#
|
|
3914
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3915
|
+
# constructed with.
|
|
3916
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3917
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<Role>` — see
|
|
3918
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3919
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3920
|
+
def list(org_id: nil, request_options: nil)
|
|
3921
|
+
@transport.request(
|
|
3922
|
+
http_method: "GET",
|
|
3923
|
+
path: "/api/org/{orgId}/team/roles",
|
|
3924
|
+
path_params: { "orgId" => org_id },
|
|
3925
|
+
request_options: request_options
|
|
3926
|
+
)
|
|
3927
|
+
end
|
|
3928
|
+
|
|
3929
|
+
# Edit a custom role
|
|
3930
|
+
#
|
|
3931
|
+
# _Requires permission: `team:role:write`._
|
|
3932
|
+
#
|
|
3933
|
+
# PATCH /api/org/{orgId}/team/roles/{id}
|
|
3934
|
+
#
|
|
3935
|
+
# Raises on 404: Not found
|
|
3936
|
+
#
|
|
3937
|
+
# Raises on 422: Bad request
|
|
3938
|
+
#
|
|
3939
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3940
|
+
# constructed with.
|
|
3941
|
+
# @param id [String]
|
|
3942
|
+
# @param body [Hash] Request body, shaped as `RoleUpdateRequest`.
|
|
3943
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3944
|
+
# @return [Hash] Parsed JSON, shaped as `Role` — see `sig/infrawrench/sdk.rbs`.
|
|
3945
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3946
|
+
def update(id:, body:, org_id: nil, request_options: nil)
|
|
3947
|
+
@transport.request(
|
|
3948
|
+
http_method: "PATCH",
|
|
3949
|
+
path: "/api/org/{orgId}/team/roles/{id}",
|
|
3950
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
3951
|
+
body: body,
|
|
3952
|
+
request_options: request_options
|
|
3953
|
+
)
|
|
3954
|
+
end
|
|
3955
|
+
end
|
|
3956
|
+
|
|
3957
|
+
# `client.team`
|
|
3958
|
+
class TeamNamespace
|
|
3959
|
+
# @return [TeamInvitationsNamespace] `client.team.invitations`
|
|
3960
|
+
attr_reader :invitations
|
|
3961
|
+
# @return [TeamMembersNamespace] `client.team.members`
|
|
3962
|
+
attr_reader :members
|
|
3963
|
+
# @return [TeamRolesNamespace] `client.team.roles`
|
|
3964
|
+
attr_reader :roles
|
|
3965
|
+
|
|
3966
|
+
# @api private
|
|
3967
|
+
# @param transport [Transport]
|
|
3968
|
+
def initialize(transport)
|
|
3969
|
+
@transport = transport
|
|
3970
|
+
@invitations = TeamInvitationsNamespace.new(@transport)
|
|
3971
|
+
@members = TeamMembersNamespace.new(@transport)
|
|
3972
|
+
@roles = TeamRolesNamespace.new(@transport)
|
|
3973
|
+
end
|
|
3974
|
+
|
|
3975
|
+
# Current user's effective permissions and role
|
|
3976
|
+
#
|
|
3977
|
+
# GET /api/org/{orgId}/team/me
|
|
3978
|
+
#
|
|
3979
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3980
|
+
# constructed with.
|
|
3981
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3982
|
+
# @return [Hash] Parsed JSON, shaped as `MeResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
3983
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3984
|
+
def me(org_id: nil, request_options: nil)
|
|
3985
|
+
@transport.request(
|
|
3986
|
+
http_method: "GET",
|
|
3987
|
+
path: "/api/org/{orgId}/team/me",
|
|
3988
|
+
path_params: { "orgId" => org_id },
|
|
3989
|
+
request_options: request_options
|
|
3990
|
+
)
|
|
3991
|
+
end
|
|
3992
|
+
|
|
3993
|
+
# List all permission strings the server recognises
|
|
3994
|
+
#
|
|
3995
|
+
# _Requires permission: `team:read`._
|
|
3996
|
+
#
|
|
3997
|
+
# GET /api/org/{orgId}/team/permissions
|
|
3998
|
+
#
|
|
3999
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
4000
|
+
# constructed with.
|
|
4001
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
4002
|
+
# @return [Hash] Parsed JSON, shaped as `PermissionCatalog` — see `sig/infrawrench/sdk.rbs`.
|
|
4003
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
4004
|
+
def permissions(org_id: nil, request_options: nil)
|
|
4005
|
+
@transport.request(
|
|
4006
|
+
http_method: "GET",
|
|
4007
|
+
path: "/api/org/{orgId}/team/permissions",
|
|
4008
|
+
path_params: { "orgId" => org_id },
|
|
4009
|
+
request_options: request_options
|
|
4010
|
+
)
|
|
4011
|
+
end
|
|
4012
|
+
end
|
|
4013
|
+
|
|
4014
|
+
# A client for the Infrawrench API.
|
|
4015
|
+
#
|
|
4016
|
+
# client = Infrawrench::APIV1Client.new(
|
|
4017
|
+
# api_key: ENV.fetch("INFRAWRENCH_API_KEY"),
|
|
4018
|
+
# org_id: ENV.fetch("INFRAWRENCH_ORG_ID")
|
|
4019
|
+
# )
|
|
4020
|
+
# client.accounts
|
|
4021
|
+
#
|
|
4022
|
+
class APIV1Client
|
|
4023
|
+
# @return [Transport] Shared request plumbing. Reach for this only to
|
|
4024
|
+
# inspect the resolved base URL.
|
|
4025
|
+
attr_reader :transport
|
|
4026
|
+
# @return [AccountsNamespace] `client.accounts`
|
|
4027
|
+
attr_reader :accounts
|
|
4028
|
+
# @return [AgentsNamespace] `client.agents`
|
|
4029
|
+
attr_reader :agents
|
|
4030
|
+
# @return [ApiKeysNamespace] `client.api_keys`
|
|
4031
|
+
attr_reader :api_keys
|
|
4032
|
+
# @return [ArtifactsNamespace] `client.artifacts`
|
|
4033
|
+
attr_reader :artifacts
|
|
4034
|
+
# @return [AssociationsNamespace] `client.associations`
|
|
4035
|
+
attr_reader :associations
|
|
4036
|
+
# @return [AuditLogsNamespace] `client.audit_logs`
|
|
4037
|
+
attr_reader :audit_logs
|
|
4038
|
+
# @return [AuthNamespace] `client.auth`
|
|
4039
|
+
attr_reader :auth
|
|
4040
|
+
# @return [BastionsNamespace] `client.bastions`
|
|
4041
|
+
attr_reader :bastions
|
|
4042
|
+
# @return [BillingNamespace] `client.billing`
|
|
4043
|
+
attr_reader :billing
|
|
4044
|
+
# @return [BudgetsNamespace] `client.budgets`
|
|
4045
|
+
attr_reader :budgets
|
|
4046
|
+
# @return [ConnectNamespace] `client.connect`
|
|
4047
|
+
attr_reader :connect
|
|
4048
|
+
# @return [CostsNamespace] `client.costs`
|
|
4049
|
+
attr_reader :costs
|
|
4050
|
+
# @return [DashboardsNamespace] `client.dashboards`
|
|
4051
|
+
attr_reader :dashboards
|
|
4052
|
+
# @return [DockerNamespace] `client.docker`
|
|
4053
|
+
attr_reader :docker
|
|
4054
|
+
# @return [InvitationsNamespace] `client.invitations`
|
|
4055
|
+
attr_reader :invitations
|
|
4056
|
+
# @return [KvNamespace] `client.kv`
|
|
4057
|
+
attr_reader :kv
|
|
4058
|
+
# @return [OrgsNamespace] `client.orgs`
|
|
4059
|
+
attr_reader :orgs
|
|
4060
|
+
# @return [ProfileNamespace] `client.profile`
|
|
4061
|
+
attr_reader :profile
|
|
4062
|
+
# @return [ResourcesNamespace] `client.resources`
|
|
4063
|
+
attr_reader :resources
|
|
4064
|
+
# @return [SearchNamespace] `client.search`
|
|
4065
|
+
attr_reader :search
|
|
4066
|
+
# @return [SftpNamespace] `client.sftp`
|
|
4067
|
+
attr_reader :sftp
|
|
4068
|
+
# @return [SqlNamespace] `client.sql`
|
|
4069
|
+
attr_reader :sql
|
|
4070
|
+
# @return [SshKeysNamespace] `client.ssh_keys`
|
|
4071
|
+
attr_reader :ssh_keys
|
|
4072
|
+
# @return [SshTunnelsNamespace] `client.ssh_tunnels`
|
|
4073
|
+
attr_reader :ssh_tunnels
|
|
4074
|
+
# @return [StorageNamespace] `client.storage`
|
|
4075
|
+
attr_reader :storage
|
|
4076
|
+
# @return [TeamNamespace] `client.team`
|
|
4077
|
+
attr_reader :team
|
|
4078
|
+
|
|
4079
|
+
# @param options [Hash] Client configuration — `:base_url`, `:api_key`,
|
|
4080
|
+
# `:org_id`, `:headers`, `:timeout`, `:open_timeout` and `:http_handler`.
|
|
4081
|
+
# See {Transport#initialize}, which owns the list.
|
|
4082
|
+
def initialize(**options)
|
|
4083
|
+
@transport = Transport.new(**options)
|
|
4084
|
+
@accounts = AccountsNamespace.new(@transport)
|
|
4085
|
+
@agents = AgentsNamespace.new(@transport)
|
|
4086
|
+
@api_keys = ApiKeysNamespace.new(@transport)
|
|
4087
|
+
@artifacts = ArtifactsNamespace.new(@transport)
|
|
4088
|
+
@associations = AssociationsNamespace.new(@transport)
|
|
4089
|
+
@audit_logs = AuditLogsNamespace.new(@transport)
|
|
4090
|
+
@auth = AuthNamespace.new(@transport)
|
|
4091
|
+
@bastions = BastionsNamespace.new(@transport)
|
|
4092
|
+
@billing = BillingNamespace.new(@transport)
|
|
4093
|
+
@budgets = BudgetsNamespace.new(@transport)
|
|
4094
|
+
@connect = ConnectNamespace.new(@transport)
|
|
4095
|
+
@costs = CostsNamespace.new(@transport)
|
|
4096
|
+
@dashboards = DashboardsNamespace.new(@transport)
|
|
4097
|
+
@docker = DockerNamespace.new(@transport)
|
|
4098
|
+
@invitations = InvitationsNamespace.new(@transport)
|
|
4099
|
+
@kv = KvNamespace.new(@transport)
|
|
4100
|
+
@orgs = OrgsNamespace.new(@transport)
|
|
4101
|
+
@profile = ProfileNamespace.new(@transport)
|
|
4102
|
+
@resources = ResourcesNamespace.new(@transport)
|
|
4103
|
+
@search = SearchNamespace.new(@transport)
|
|
4104
|
+
@sftp = SftpNamespace.new(@transport)
|
|
4105
|
+
@sql = SqlNamespace.new(@transport)
|
|
4106
|
+
@ssh_keys = SshKeysNamespace.new(@transport)
|
|
4107
|
+
@ssh_tunnels = SshTunnelsNamespace.new(@transport)
|
|
4108
|
+
@storage = StorageNamespace.new(@transport)
|
|
4109
|
+
@team = TeamNamespace.new(@transport)
|
|
4110
|
+
end
|
|
4111
|
+
end
|
|
4112
|
+
end
|