@stack-spot/portal-network 0.1.0 → 0.3.0

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.
Files changed (163) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.json +7 -6
  3. package/src/apis.json +2 -10
  4. package/src/client/account.ts +111 -4
  5. package/src/error/CanceledError.ts +3 -0
  6. package/src/error/DefaultAPIError.ts +27 -1
  7. package/src/error/StackspotAPIError.ts +33 -1
  8. package/src/index.ts +1 -0
  9. package/src/network/AutoInfiniteQuery.ts +104 -0
  10. package/src/network/AutoOperation.ts +7 -1
  11. package/src/network/AutoQuery.ts +2 -1
  12. package/src/network/ManualInfiniteQuery.ts +95 -0
  13. package/src/network/ManualQuery.ts +2 -2
  14. package/src/network/NetworkClient.ts +53 -41
  15. package/src/network/ReactQueryNetworkClient.ts +131 -33
  16. package/src/network/react-query-client.ts +3 -0
  17. package/src/network/types.ts +207 -11
  18. package/src/utils/use-extended-list.ts +80 -0
  19. package/.generate-api.failed.json +0 -1
  20. package/dist/api/account.d.ts +0 -2368
  21. package/dist/api/account.d.ts.map +0 -1
  22. package/dist/api/account.js +0 -1521
  23. package/dist/api/account.js.map +0 -1
  24. package/dist/api/ai.d.ts +0 -1432
  25. package/dist/api/ai.d.ts.map +0 -1
  26. package/dist/api/ai.js +0 -1342
  27. package/dist/api/ai.js.map +0 -1
  28. package/dist/api/apiRuntime.d.ts +0 -922
  29. package/dist/api/apiRuntime.d.ts.map +0 -1
  30. package/dist/api/apiRuntime.js +0 -599
  31. package/dist/api/apiRuntime.js.map +0 -1
  32. package/dist/api/cloudAccount.d.ts +0 -473
  33. package/dist/api/cloudAccount.d.ts.map +0 -1
  34. package/dist/api/cloudAccount.js +0 -300
  35. package/dist/api/cloudAccount.js.map +0 -1
  36. package/dist/api/cloudServices.d.ts +0 -1233
  37. package/dist/api/cloudServices.d.ts.map +0 -1
  38. package/dist/api/cloudServices.js +0 -715
  39. package/dist/api/cloudServices.js.map +0 -1
  40. package/dist/api/insights.d.ts +0 -123
  41. package/dist/api/insights.d.ts.map +0 -1
  42. package/dist/api/insights.js +0 -112
  43. package/dist/api/insights.js.map +0 -1
  44. package/dist/api/plugin.d.ts +0 -368
  45. package/dist/api/plugin.d.ts.map +0 -1
  46. package/dist/api/plugin.js +0 -218
  47. package/dist/api/plugin.js.map +0 -1
  48. package/dist/api/serviceCatalog.d.ts +0 -737
  49. package/dist/api/serviceCatalog.d.ts.map +0 -1
  50. package/dist/api/serviceCatalog.js +0 -611
  51. package/dist/api/serviceCatalog.js.map +0 -1
  52. package/dist/api/workflows.d.ts +0 -366
  53. package/dist/api/workflows.d.ts.map +0 -1
  54. package/dist/api/workflows.js +0 -175
  55. package/dist/api/workflows.js.map +0 -1
  56. package/dist/api/workspace.js +0 -1476
  57. package/dist/api/workspace.js.map +0 -1
  58. package/dist/api/workspaceManager.d.ts +0 -1121
  59. package/dist/api/workspaceManager.d.ts.map +0 -1
  60. package/dist/api/workspaceManager.js +0 -357
  61. package/dist/api/workspaceManager.js.map +0 -1
  62. package/dist/api/workspaceSearchEngine.d.ts +0 -93
  63. package/dist/api/workspaceSearchEngine.d.ts.map +0 -1
  64. package/dist/api/workspaceSearchEngine.js +0 -55
  65. package/dist/api/workspaceSearchEngine.js.map +0 -1
  66. package/dist/apis.json +0 -129
  67. package/dist/client/account.d.ts +0 -46
  68. package/dist/client/account.d.ts.map +0 -1
  69. package/dist/client/account.js +0 -104
  70. package/dist/client/account.js.map +0 -1
  71. package/dist/error/CanceledError.d.ts +0 -5
  72. package/dist/error/CanceledError.d.ts.map +0 -1
  73. package/dist/error/CanceledError.js +0 -7
  74. package/dist/error/CanceledError.js.map +0 -1
  75. package/dist/error/DefaultAPIError.d.ts +0 -9
  76. package/dist/error/DefaultAPIError.d.ts.map +0 -1
  77. package/dist/error/DefaultAPIError.js +0 -58
  78. package/dist/error/DefaultAPIError.js.map +0 -1
  79. package/dist/error/StackspotAPIError.d.ts +0 -19
  80. package/dist/error/StackspotAPIError.d.ts.map +0 -1
  81. package/dist/error/StackspotAPIError.js +0 -39
  82. package/dist/error/StackspotAPIError.js.map +0 -1
  83. package/dist/error/dictionary/account.d.ts +0 -55
  84. package/dist/error/dictionary/account.d.ts.map +0 -1
  85. package/dist/error/dictionary/account.js +0 -55
  86. package/dist/error/dictionary/account.js.map +0 -1
  87. package/dist/error/dictionary/action.d.ts +0 -163
  88. package/dist/error/dictionary/action.d.ts.map +0 -1
  89. package/dist/error/dictionary/action.js +0 -163
  90. package/dist/error/dictionary/action.js.map +0 -1
  91. package/dist/error/dictionary/base.d.ts +0 -21
  92. package/dist/error/dictionary/base.d.ts.map +0 -1
  93. package/dist/error/dictionary/base.js +0 -21
  94. package/dist/error/dictionary/base.js.map +0 -1
  95. package/dist/error/dictionary/cnt-fields.d.ts +0 -13
  96. package/dist/error/dictionary/cnt-fields.d.ts.map +0 -1
  97. package/dist/error/dictionary/cnt-fields.js +0 -13
  98. package/dist/error/dictionary/cnt-fields.js.map +0 -1
  99. package/dist/error/dictionary/cnt.d.ts +0 -79
  100. package/dist/error/dictionary/cnt.d.ts.map +0 -1
  101. package/dist/error/dictionary/cnt.js +0 -79
  102. package/dist/error/dictionary/cnt.js.map +0 -1
  103. package/dist/error/dictionary/rte.d.ts +0 -23
  104. package/dist/error/dictionary/rte.d.ts.map +0 -1
  105. package/dist/error/dictionary/rte.js +0 -23
  106. package/dist/error/dictionary/rte.js.map +0 -1
  107. package/dist/error/dictionary/rtm.d.ts +0 -9
  108. package/dist/error/dictionary/rtm.d.ts.map +0 -1
  109. package/dist/error/dictionary/rtm.js +0 -9
  110. package/dist/error/dictionary/rtm.js.map +0 -1
  111. package/dist/error/dictionary/workspace-fields.d.ts +0 -9
  112. package/dist/error/dictionary/workspace-fields.d.ts.map +0 -1
  113. package/dist/error/dictionary/workspace-fields.js +0 -9
  114. package/dist/error/dictionary/workspace-fields.js.map +0 -1
  115. package/dist/error/dictionary/workspace.d.ts +0 -99
  116. package/dist/error/dictionary/workspace.d.ts.map +0 -1
  117. package/dist/error/dictionary/workspace.js +0 -99
  118. package/dist/error/dictionary/workspace.js.map +0 -1
  119. package/dist/index.d.ts +0 -6
  120. package/dist/index.d.ts.map +0 -1
  121. package/dist/index.js +0 -6
  122. package/dist/index.js.map +0 -1
  123. package/dist/network/AutoMutation.d.ts +0 -10
  124. package/dist/network/AutoMutation.d.ts.map +0 -1
  125. package/dist/network/AutoMutation.js +0 -20
  126. package/dist/network/AutoMutation.js.map +0 -1
  127. package/dist/network/AutoOperation.d.ts +0 -19
  128. package/dist/network/AutoOperation.d.ts.map +0 -1
  129. package/dist/network/AutoOperation.js +0 -99
  130. package/dist/network/AutoOperation.js.map +0 -1
  131. package/dist/network/AutoQuery.d.ts +0 -19
  132. package/dist/network/AutoQuery.d.ts.map +0 -1
  133. package/dist/network/AutoQuery.js +0 -70
  134. package/dist/network/AutoQuery.js.map +0 -1
  135. package/dist/network/ManualMutation.d.ts +0 -11
  136. package/dist/network/ManualMutation.d.ts.map +0 -1
  137. package/dist/network/ManualMutation.js +0 -32
  138. package/dist/network/ManualMutation.js.map +0 -1
  139. package/dist/network/ManualOperation.d.ts +0 -13
  140. package/dist/network/ManualOperation.d.ts.map +0 -1
  141. package/dist/network/ManualOperation.js +0 -53
  142. package/dist/network/ManualOperation.js.map +0 -1
  143. package/dist/network/ManualQuery.d.ts +0 -20
  144. package/dist/network/ManualQuery.d.ts.map +0 -1
  145. package/dist/network/ManualQuery.js +0 -77
  146. package/dist/network/ManualQuery.js.map +0 -1
  147. package/dist/network/NetworkClient.d.ts +0 -20
  148. package/dist/network/NetworkClient.d.ts.map +0 -1
  149. package/dist/network/NetworkClient.js +0 -85
  150. package/dist/network/NetworkClient.js.map +0 -1
  151. package/dist/network/ReactQueryNetworkClient.d.ts +0 -16
  152. package/dist/network/ReactQueryNetworkClient.d.ts.map +0 -1
  153. package/dist/network/ReactQueryNetworkClient.js +0 -125
  154. package/dist/network/ReactQueryNetworkClient.js.map +0 -1
  155. package/dist/network/react-query-client.d.ts +0 -3
  156. package/dist/network/react-query-client.d.ts.map +0 -1
  157. package/dist/network/react-query-client.js +0 -3
  158. package/dist/network/react-query-client.js.map +0 -1
  159. package/dist/network/types.d.ts +0 -55
  160. package/dist/network/types.d.ts.map +0 -1
  161. package/dist/network/types.js +0 -2
  162. package/dist/network/types.js.map +0 -1
  163. package/src/api/plugin.ts +0 -685
@@ -1,715 +0,0 @@
1
- /**
2
- * OpenAPI definition
3
- * v0
4
- * DO NOT MODIFY - This file has been generated using oazapfts.
5
- * See https://www.npmjs.com/package/oazapfts
6
- */
7
- import * as Oazapfts from "@oazapfts/runtime";
8
- import * as QS from "@oazapfts/runtime/query";
9
- export const defaults = {
10
- headers: {},
11
- baseUrl: "https://cloud-services-cloud-services-api.dev.stackspot.com",
12
- };
13
- const oazapfts = Oazapfts.runtime(defaults);
14
- export const servers = {
15
- generatedServerUrl: "https://cloud-services-cloud-services-api.dev.stackspot.com"
16
- };
17
- /**
18
- * Get a single case
19
- */
20
- export function getCase({ jwtToken, id, pageNum, pageSize }, opts) {
21
- return oazapfts.ok(oazapfts.fetchJson(`/support/cases/${encodeURIComponent(id)}${QS.query(QS.explode({
22
- jwtToken,
23
- pageNum,
24
- pageSize
25
- }))}`, {
26
- ...opts
27
- }));
28
- }
29
- /**
30
- * Update a case
31
- */
32
- export function updateCase({ jwtToken, id, caseUpdate }, opts) {
33
- return oazapfts.ok(oazapfts.fetchJson(`/support/cases/${encodeURIComponent(id)}${QS.query(QS.explode({
34
- jwtToken
35
- }))}`, oazapfts.json({
36
- ...opts,
37
- method: "PUT",
38
- body: caseUpdate
39
- })));
40
- }
41
- /**
42
- * Get a single saving plan
43
- */
44
- export function getSavingPlan({ id }, opts) {
45
- return oazapfts.ok(oazapfts.fetchJson(`/saving-plan/${encodeURIComponent(id)}${QS.query(QS.explode({
46
- id
47
- }))}`, {
48
- ...opts
49
- }));
50
- }
51
- /**
52
- * Update saving plan
53
- */
54
- export function updateSavingPlan({ id, savingPlanUpdate }, opts) {
55
- return oazapfts.ok(oazapfts.fetchJson(`/saving-plan/${encodeURIComponent(id)}${QS.query(QS.explode({
56
- id
57
- }))}`, oazapfts.json({
58
- ...opts,
59
- method: "PUT",
60
- body: savingPlanUpdate
61
- })));
62
- }
63
- /**
64
- * Update a GuardRail
65
- */
66
- export function updateGuardrail({ jwtToken, guardrailUpdate }, opts) {
67
- return oazapfts.ok(oazapfts.fetchJson(`/admin/guardrail${QS.query(QS.explode({
68
- jwtToken
69
- }))}`, oazapfts.json({
70
- ...opts,
71
- method: "PUT",
72
- body: guardrailUpdate
73
- })));
74
- }
75
- /**
76
- * Create a GuardRail
77
- */
78
- export function createGuardrail({ jwtToken, guardrailRequest }, opts) {
79
- return oazapfts.ok(oazapfts.fetchJson(`/admin/guardrail${QS.query(QS.explode({
80
- jwtToken
81
- }))}`, oazapfts.json({
82
- ...opts,
83
- method: "POST",
84
- body: guardrailRequest
85
- })));
86
- }
87
- /**
88
- * Update a baseline
89
- */
90
- export function updateBaseline({ baselineId, baselineUpdate }, opts) {
91
- return oazapfts.ok(oazapfts.fetchJson(`/admin/baseline/${encodeURIComponent(baselineId)}`, oazapfts.json({
92
- ...opts,
93
- method: "PUT",
94
- body: baselineUpdate
95
- })));
96
- }
97
- /**
98
- * Retrieves billing account summaries
99
- */
100
- export function listBillingAccounts({ jwtToken, stackSpotAccountId, showDeleted }, opts) {
101
- return oazapfts.ok(oazapfts.fetchJson(`/v2/finops/billing-accounts${QS.query(QS.explode({
102
- jwtToken,
103
- stackSpotAccountId,
104
- showDeleted
105
- }))}`, {
106
- ...opts
107
- }));
108
- }
109
- /**
110
- * Create new billing account
111
- */
112
- export function createBillingAccount({ jwtToken, billingAccountRequest }, opts) {
113
- return oazapfts.ok(oazapfts.fetchJson(`/v2/finops/billing-accounts${QS.query(QS.explode({
114
- jwtToken
115
- }))}`, oazapfts.json({
116
- ...opts,
117
- method: "POST",
118
- body: billingAccountRequest
119
- })));
120
- }
121
- /**
122
- * Retrieves cost and usage metrics for your account.
123
- */
124
- export function processAllocationCostRequest({ jwtToken, allocationCostRequest }, opts) {
125
- return oazapfts.ok(oazapfts.fetchJson(`/v2/finops/allocation-cost${QS.query(QS.explode({
126
- jwtToken
127
- }))}`, oazapfts.json({
128
- ...opts,
129
- method: "POST",
130
- body: allocationCostRequest
131
- })));
132
- }
133
- /**
134
- * List support cases
135
- */
136
- export function listCases({ jwtToken, sortBy, sortOrder, search, page, pageSize, visibility }, opts) {
137
- return oazapfts.ok(oazapfts.fetchJson(`/support/cases${QS.query(QS.explode({
138
- jwtToken,
139
- sortBy,
140
- sortOrder,
141
- search,
142
- page,
143
- pageSize,
144
- visibility
145
- }))}`, {
146
- ...opts
147
- }));
148
- }
149
- /**
150
- * Create a support case
151
- */
152
- export function createCase({ jwtToken, caseRequest }, opts) {
153
- return oazapfts.ok(oazapfts.fetchJson(`/support/cases${QS.query(QS.explode({
154
- jwtToken
155
- }))}`, oazapfts.json({
156
- ...opts,
157
- method: "POST",
158
- body: caseRequest
159
- })));
160
- }
161
- /**
162
- * Upload an attachment
163
- */
164
- export function uploadAttachment({ jwtToken, attachmentUpload }, opts) {
165
- return oazapfts.ok(oazapfts.fetchJson(`/support/attachment${QS.query(QS.explode({
166
- jwtToken
167
- }))}`, oazapfts.json({
168
- ...opts,
169
- method: "POST",
170
- body: attachmentUpload
171
- })));
172
- }
173
- /**
174
- * Get list of saving plans
175
- */
176
- export function getListOfSavingPlans({ sortBy, sortOrder, filter, page, pageSize }, opts) {
177
- return oazapfts.ok(oazapfts.fetchJson(`/saving-plan${QS.query(QS.explode({
178
- sortBy,
179
- sortOrder,
180
- filter,
181
- page,
182
- pageSize
183
- }))}`, {
184
- ...opts
185
- }));
186
- }
187
- /**
188
- * Create saving plan
189
- */
190
- export function createSavingPlanByBudgetSaveType({ savingPlanRequest }, opts) {
191
- return oazapfts.ok(oazapfts.fetchJson("/saving-plan", oazapfts.json({
192
- ...opts,
193
- method: "POST",
194
- body: savingPlanRequest
195
- })));
196
- }
197
- /**
198
- * Enable a GuardRail in any level
199
- */
200
- export function enableGuardrail({ jwtToken, account, workspace, env, enable, guardrailId }, opts) {
201
- return oazapfts.ok(oazapfts.fetchJson(`/guardrail/${encodeURIComponent(guardrailId)}${QS.query(QS.explode({
202
- jwtToken,
203
- account,
204
- workspace,
205
- env,
206
- enable
207
- }))}`, {
208
- ...opts,
209
- method: "POST"
210
- }));
211
- }
212
- /**
213
- * Register a cloud offer for a Stackspot Account.
214
- */
215
- export function registerOffer({ registerOfferRequest }, opts) {
216
- return oazapfts.ok(oazapfts.fetchJson("/cloud-offer", oazapfts.json({
217
- ...opts,
218
- method: "POST",
219
- body: registerOfferRequest
220
- })));
221
- }
222
- /**
223
- * List all cloud accounts created for all workspaces
224
- */
225
- export function listCloudAccounts({ jwtToken, sortBy, sortOrder, filter, page, pageSize, $type, environment, status }, opts) {
226
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-account${QS.query(QS.explode({
227
- jwtToken,
228
- sortBy,
229
- sortOrder,
230
- filter,
231
- page,
232
- pageSize,
233
- "type": $type,
234
- environment,
235
- status
236
- }))}`, {
237
- ...opts
238
- }));
239
- }
240
- /**
241
- * Connect a cloud account
242
- */
243
- export function createCloudAccount({ jwtToken, connectAccountRequest }, opts) {
244
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-account${QS.query(QS.explode({
245
- jwtToken
246
- }))}`, oazapfts.json({
247
- ...opts,
248
- method: "POST",
249
- body: connectAccountRequest
250
- })));
251
- }
252
- /**
253
- * Provision managed accounts in a workspace
254
- */
255
- export function provisionManagedAccountsForWorkspace({ jwtToken, managedAccountProvisionRequest }, opts) {
256
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-account/managed-account${QS.query(QS.explode({
257
- jwtToken
258
- }))}`, oazapfts.json({
259
- ...opts,
260
- method: "POST",
261
- body: managedAccountProvisionRequest
262
- })));
263
- }
264
- /**
265
- * Disconnect a Managed Account that was requested to disconnect via support case
266
- */
267
- export function disconnectCloudAccountRequestedForDisconnect({ disconnectSupportCaseManagedAccountRequest }, opts) {
268
- return oazapfts.ok(oazapfts.fetchJson("/admin/managed-cloud/support-case/disconnect", oazapfts.json({
269
- ...opts,
270
- method: "POST",
271
- body: disconnectSupportCaseManagedAccountRequest
272
- })));
273
- }
274
- /**
275
- * Get all relation between stackspot accounts and control towers
276
- */
277
- export function getAllAccountTower({ stackspotAccountId }, opts) {
278
- return oazapfts.ok(oazapfts.fetchJson(`/admin/managed-cloud/control-tower${QS.query(QS.explode({
279
- stackspotAccountId
280
- }))}`, {
281
- ...opts
282
- }));
283
- }
284
- /**
285
- * Add a Control Tower ID to a Stackspot Account that will be used in creation of a Managed Cloud Account
286
- */
287
- export function createAccountTower({ stackspotAccountTowerRequest }, opts) {
288
- return oazapfts.ok(oazapfts.fetchJson("/admin/managed-cloud/control-tower", oazapfts.json({
289
- ...opts,
290
- method: "POST",
291
- body: stackspotAccountTowerRequest
292
- })));
293
- }
294
- export function createNewContract({ createContractRequest }, opts) {
295
- return oazapfts.ok(oazapfts.fetchJson("/admin/finops/contract", oazapfts.json({
296
- ...opts,
297
- method: "POST",
298
- body: createContractRequest
299
- })));
300
- }
301
- /**
302
- * Links services to a Stackspot account, allowing users from that account to see resources in CRE
303
- */
304
- export function linkResourceTypesToStackspotAccount({ linkResourceTypeToStackspotAccountRequest }, opts) {
305
- return oazapfts.ok(oazapfts.fetchJson("/admin/cloud-resource/link-service-to-stackspot-account", oazapfts.json({
306
- ...opts,
307
- method: "POST",
308
- body: linkResourceTypeToStackspotAccountRequest
309
- })));
310
- }
311
- /**
312
- *
313
- * Updates Managed Account related information. If the account is of CustomCloud type, it changes to CloudServices
314
- * (managed account type).
315
- *
316
- */
317
- export function updateManagedInfo({ updateManagedInfoRequest }, opts) {
318
- return oazapfts.ok(oazapfts.fetchJson("/admin/cloud-account/update-managed-account", oazapfts.json({
319
- ...opts,
320
- method: "POST",
321
- body: updateManagedInfoRequest
322
- })));
323
- }
324
- /**
325
- * Disconnect a Cloud Account
326
- */
327
- export function disconnectCloudAccountById({ disconnectCloudAccountRequest }, opts) {
328
- return oazapfts.ok(oazapfts.fetchJson("/admin/cloud-account/disconnect", oazapfts.json({
329
- ...opts,
330
- method: "POST",
331
- body: disconnectCloudAccountRequest
332
- })));
333
- }
334
- /**
335
- * Return all baseline registered
336
- */
337
- export function getBaselines(opts) {
338
- return oazapfts.ok(oazapfts.fetchJson("/admin/baseline", {
339
- ...opts
340
- }));
341
- }
342
- /**
343
- * Create a baseline
344
- */
345
- export function createBaseline({ baselineRequest }, opts) {
346
- return oazapfts.ok(oazapfts.fetchJson("/admin/baseline", oazapfts.json({
347
- ...opts,
348
- method: "POST",
349
- body: baselineRequest
350
- })));
351
- }
352
- /**
353
- * Retrieves details from a billing account
354
- */
355
- export function getBillingAccountById({ jwtToken, stackSpotAccountId, billingAccountId }, opts) {
356
- return oazapfts.ok(oazapfts.fetchJson(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
357
- jwtToken,
358
- stackSpotAccountId
359
- }))}`, {
360
- ...opts
361
- }));
362
- }
363
- /**
364
- * Delete a billing account
365
- */
366
- export function deleteBillingAccountById({ jwtToken, stackSpotAccountId, billingAccountId }, opts) {
367
- return oazapfts.ok(oazapfts.fetchJson(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
368
- jwtToken,
369
- stackSpotAccountId
370
- }))}`, {
371
- ...opts,
372
- method: "DELETE"
373
- }));
374
- }
375
- /**
376
- * Get form fields and information
377
- */
378
- export function getFormField(opts) {
379
- return oazapfts.ok(oazapfts.fetchJson("/support/form/fields", {
380
- ...opts
381
- }));
382
- }
383
- /**
384
- * Get an attachment file
385
- */
386
- export function getAttachment({ jwtToken, id }, opts) {
387
- return oazapfts.ok(oazapfts.fetchJson(`/support/attachment/${encodeURIComponent(id)}${QS.query(QS.explode({
388
- jwtToken
389
- }))}`, {
390
- ...opts
391
- }));
392
- }
393
- export function healthz(opts) {
394
- return oazapfts.ok(oazapfts.fetchJson("/healthz", {
395
- ...opts
396
- }));
397
- }
398
- /**
399
- * Get all GuardRails
400
- */
401
- export function getGuardrails({ jwtToken, account, workspace, env }, opts) {
402
- return oazapfts.ok(oazapfts.fetchJson(`/guardrail${QS.query(QS.explode({
403
- jwtToken,
404
- account,
405
- workspace,
406
- env
407
- }))}`, {
408
- ...opts
409
- }));
410
- }
411
- /**
412
- * Get overview of costs, with current month, last month and three last month
413
- */
414
- export function getCostOverview({ jwtToken, sortBy, sortOrder }, opts) {
415
- return oazapfts.ok(oazapfts.fetchJson(`/finops/reports${QS.query(QS.explode({
416
- jwtToken,
417
- sortBy,
418
- sortOrder
419
- }))}`, {
420
- ...opts
421
- }));
422
- }
423
- export function downloadCsvFiles({ jwtToken, year, month }, opts) {
424
- return oazapfts.ok(oazapfts.fetchJson(`/finops/reports/download${QS.query(QS.explode({
425
- jwtToken,
426
- year,
427
- month
428
- }))}`, {
429
- ...opts
430
- }));
431
- }
432
- /**
433
- * List all tags.
434
- */
435
- export function getAllTags({ stackspotAccountId }, opts) {
436
- return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-list-tags${QS.query(QS.explode({
437
- stackspotAccountId
438
- }))}`, {
439
- ...opts
440
- }));
441
- }
442
- /**
443
- * lists all subTags of a given tag with their respective costs.
444
- */
445
- export function getAllocationCostTagValues({ jwtToken, masterAccount, tag, startDate, endDate, sort, page, pageSize }, opts) {
446
- return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-list-tag-values${QS.query(QS.explode({
447
- jwtToken,
448
- masterAccount,
449
- tag,
450
- startDate,
451
- endDate,
452
- sort,
453
- page,
454
- pageSize
455
- }))}`, {
456
- ...opts
457
- }));
458
- }
459
- /**
460
- * List all services of a subtag. Each service contains name and cost value.
461
- */
462
- export function getAllocationCostServices({ jwtToken, masterAccount, tag, tagValueName, startDate, endDate, sort, page, pageSize }, opts) {
463
- return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-list-services${QS.query(QS.explode({
464
- jwtToken,
465
- masterAccount,
466
- tag,
467
- tagValueName,
468
- startDate,
469
- endDate,
470
- sort,
471
- page,
472
- pageSize
473
- }))}`, {
474
- ...opts
475
- }));
476
- }
477
- /**
478
- * list service details
479
- */
480
- export function getAllocationCostServiceDetails({ jwtToken, masterAccount, tag, tagValueName, serviceName, startDate, endDate, $type, filter, page, pageSize, sort }, opts) {
481
- return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-list-service-details${QS.query(QS.explode({
482
- jwtToken,
483
- masterAccount,
484
- tag,
485
- tagValueName,
486
- serviceName,
487
- startDate,
488
- endDate,
489
- "type": $type,
490
- filter,
491
- page,
492
- pageSize,
493
- sort
494
- }))}`, {
495
- ...opts
496
- }));
497
- }
498
- /**
499
- * list all master accounts
500
- */
501
- export function getAllMasterAccount({ stackspotAccountId }, opts) {
502
- return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-list-master-accounts${QS.query(QS.explode({
503
- stackspotAccountId
504
- }))}`, {
505
- ...opts
506
- }));
507
- }
508
- /**
509
- * list filters related to the type
510
- */
511
- export function getAllocationCostFilters({ jwtToken, $type }, opts) {
512
- return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-filters${QS.query(QS.explode({
513
- jwtToken,
514
- "type": $type
515
- }))}`, {
516
- ...opts
517
- }));
518
- }
519
- /**
520
- * returns the detailed csv with the masterAccount CUR information
521
- */
522
- export function getAllocationCostCsv({ jwtToken, stackspotAccountId, masterAccount, startDate, endDate }, opts) {
523
- return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-csv${QS.query(QS.explode({
524
- jwtToken,
525
- stackspotAccountId,
526
- masterAccount,
527
- startDate,
528
- endDate
529
- }))}`, {
530
- ...opts
531
- }));
532
- }
533
- /**
534
- * List Instances of a particular Service Resource running in a Workspace
535
- */
536
- export function listInstances({ jwtToken, workspaceId, resourceId, pageToken, search }, opts) {
537
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-resource/workspace/${encodeURIComponent(workspaceId)}/resource/${encodeURIComponent(resourceId)}/instance${QS.query(QS.explode({
538
- jwtToken,
539
- pageToken,
540
- search
541
- }))}`, {
542
- ...opts
543
- }));
544
- }
545
- /**
546
- * List Managed Services
547
- */
548
- export function listServices({ jwtToken }, opts) {
549
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-resource/service${QS.query(QS.explode({
550
- jwtToken
551
- }))}`, {
552
- ...opts
553
- }));
554
- }
555
- /**
556
- * A detailed description of a particular Instance
557
- */
558
- export function getInstanceDetails({ jwtToken, cloudAccountId, resourceId, instanceId }, opts) {
559
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-resource/cloud-account/${encodeURIComponent(cloudAccountId)}/resource/${encodeURIComponent(resourceId)}/instance/${encodeURIComponent(instanceId)}${QS.query(QS.explode({
560
- jwtToken
561
- }))}`, {
562
- ...opts
563
- }));
564
- }
565
- /**
566
- * Get the cloud offer of a Stackspot Account.
567
- */
568
- export function getOfferOfAccount({ id }, opts) {
569
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-offer/account/${encodeURIComponent(id)}`, {
570
- ...opts
571
- }));
572
- }
573
- /**
574
- * Get the external-id for the given Cloud Account ID.
575
- */
576
- export function getCloudAccountExternalId({ cloudAccountId }, opts) {
577
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-account/${encodeURIComponent(cloudAccountId)}/external-id`, {
578
- ...opts
579
- }));
580
- }
581
- /**
582
- * Get the cloud account workflow of a workspace environment
583
- */
584
- export function getProvisionWorkflowInWorkspace({ jwtToken, workspaceId }, opts) {
585
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-account/workspace/${encodeURIComponent(workspaceId)}/workflow${QS.query(QS.explode({
586
- jwtToken
587
- }))}`, {
588
- ...opts
589
- }));
590
- }
591
- /**
592
- * Get a cloud account connected to a workspace environment
593
- */
594
- export function getCloudAccountByEnvironment({ accountId, workspaceId, environmentId }, opts) {
595
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-account/workspace/${encodeURIComponent(workspaceId)}/environment/${encodeURIComponent(environmentId)}`, {
596
- ...opts,
597
- headers: oazapfts.mergeHeaders(opts?.headers, {
598
- accountId
599
- })
600
- }));
601
- }
602
- /**
603
- * Get a list of cloud accounts connected to a workspace
604
- */
605
- export function getCloudAccountByWorkspace({ jwtToken, accountId, id }, opts) {
606
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-account/workspace/${encodeURIComponent(id)}${QS.query(QS.explode({
607
- jwtToken
608
- }))}`, {
609
- ...opts,
610
- headers: oazapfts.mergeHeaders(opts?.headers, {
611
- accountId
612
- })
613
- }));
614
- }
615
- /**
616
- * Get all available templates for Managed Cloud
617
- */
618
- export function getManagedCloudTemplate(opts) {
619
- return oazapfts.ok(oazapfts.fetchJson("/cloud-account/managed-account/template", {
620
- ...opts
621
- }));
622
- }
623
- /**
624
- * Get all available regions for Managed Cloud
625
- */
626
- export function getManagedCloudRegion(opts) {
627
- return oazapfts.ok(oazapfts.fetchJson("/cloud-account/managed-account/region", {
628
- ...opts
629
- }));
630
- }
631
- /**
632
- * Get pages alerts from workspace and environment. That alerts can be filtered
633
- */
634
- export function getAlerts({ jwtToken, workspace, env, pillar, severity, status, search, sort, page, pageSize }, opts) {
635
- return oazapfts.ok(oazapfts.fetchJson(`/alerts${QS.query(QS.explode({
636
- jwtToken,
637
- workspace,
638
- env,
639
- pillar,
640
- severity,
641
- status,
642
- search,
643
- sort,
644
- page,
645
- pageSize
646
- }))}`, {
647
- ...opts
648
- }));
649
- }
650
- export function downloadDataByAccountId({ stackspotAccountId, year, month }, opts) {
651
- return oazapfts.ok(oazapfts.fetchJson(`/admin/finops/reports/download${QS.query(QS.explode({
652
- stackspot_account_id: stackspotAccountId,
653
- year,
654
- month
655
- }))}`, {
656
- ...opts
657
- }));
658
- }
659
- /**
660
- * List available services
661
- */
662
- export function listServices1(opts) {
663
- return oazapfts.ok(oazapfts.fetchJson("/admin/cloud-resource/service", {
664
- ...opts
665
- }));
666
- }
667
- /**
668
- * Get Cloud Account data with details
669
- */
670
- export function getCloudAccount({ stackspotAccountId, workspaceId, environmentId, provider, $type, status }, opts) {
671
- return oazapfts.ok(oazapfts.fetchJson(`/admin/cloud-account${QS.query(QS.explode({
672
- stackspotAccountId,
673
- workspaceId,
674
- environmentId,
675
- provider,
676
- "type": $type,
677
- status
678
- }))}`, {
679
- ...opts
680
- }));
681
- }
682
- /**
683
- * Delete a cloud account.
684
- */
685
- export function deleteCloudAccountFromEnvironment({ jwtToken, id }, opts) {
686
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-account/${encodeURIComponent(id)}${QS.query(QS.explode({
687
- jwtToken
688
- }))}`, {
689
- ...opts,
690
- method: "DELETE"
691
- }));
692
- }
693
- /**
694
- *
695
- * Delete all accounts in a workspace.
696
- *
697
- */
698
- export function deleteManagedAccountsFromWorkspace({ jwtToken, workspaceId }, opts) {
699
- return oazapfts.ok(oazapfts.fetchJson(`/cloud-account/workspace/${encodeURIComponent(workspaceId)}${QS.query(QS.explode({
700
- jwtToken
701
- }))}`, {
702
- ...opts,
703
- method: "DELETE"
704
- }));
705
- }
706
- /**
707
- * Delete a relation between control tower and stackspot account
708
- */
709
- export function deleteAccountTower({ id }, opts) {
710
- return oazapfts.ok(oazapfts.fetchJson(`/admin/managed-cloud/control-tower/${encodeURIComponent(id)}`, {
711
- ...opts,
712
- method: "DELETE"
713
- }));
714
- }
715
- //# sourceMappingURL=cloudServices.js.map