@stack-spot/portal-network 0.229.0 → 0.229.2
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.
- package/CHANGELOG.md +16 -0
- package/dist/api/account.d.ts +331 -5
- package/dist/api/account.d.ts.map +1 -1
- package/dist/api/account.js +167 -5
- package/dist/api/account.js.map +1 -1
- package/dist/api-addresses.d.ts.map +1 -1
- package/dist/api-addresses.js +0 -1
- package/dist/api-addresses.js.map +1 -1
- package/dist/apis-itau.json +0 -8
- package/dist/apis.json +0 -8
- package/dist/client/account.d.ts.map +1 -1
- package/dist/client/account.js +6 -6
- package/dist/client/types.d.ts +0 -48
- package/dist/client/types.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/account.ts +590 -5
- package/src/api-addresses.ts +0 -1
- package/src/apis-itau.json +0 -8
- package/src/apis.json +0 -8
- package/src/client/account.ts +10 -10
- package/src/client/types.ts +9 -66
- package/src/index.ts +0 -1
- package/dist/api/cloudServices.d.ts +0 -614
- package/dist/api/cloudServices.d.ts.map +0 -1
- package/dist/api/cloudServices.js +0 -355
- package/dist/api/cloudServices.js.map +0 -1
- package/dist/client/cloud-services.d.ts +0 -113
- package/dist/client/cloud-services.d.ts.map +0 -1
- package/dist/client/cloud-services.js +0 -146
- package/dist/client/cloud-services.js.map +0 -1
- package/src/api/cloudServices.ts +0 -1445
- package/src/client/cloud-services.ts +0 -94
|
@@ -1,355 +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
|
-
* Update a GuardRail
|
|
19
|
-
*/
|
|
20
|
-
export function updateGuardrail({ guardrailUpdate }, opts) {
|
|
21
|
-
return oazapfts.ok(oazapfts.fetchJson("/admin/guardrail", oazapfts.json({
|
|
22
|
-
...opts,
|
|
23
|
-
method: "PUT",
|
|
24
|
-
body: guardrailUpdate
|
|
25
|
-
})));
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Create a GuardRail
|
|
29
|
-
*/
|
|
30
|
-
export function createGuardrail({ guardrailRequest }, opts) {
|
|
31
|
-
return oazapfts.ok(oazapfts.fetchJson("/admin/guardrail", oazapfts.json({
|
|
32
|
-
...opts,
|
|
33
|
-
method: "POST",
|
|
34
|
-
body: guardrailRequest
|
|
35
|
-
})));
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Update a baseline
|
|
39
|
-
*/
|
|
40
|
-
export function updateBaseline({ baselineId, baselineUpdate }, opts) {
|
|
41
|
-
return oazapfts.ok(oazapfts.fetchJson(`/admin/baseline/${encodeURIComponent(baselineId)}`, oazapfts.json({
|
|
42
|
-
...opts,
|
|
43
|
-
method: "PUT",
|
|
44
|
-
body: baselineUpdate
|
|
45
|
-
})));
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Retrieves billing account summaries
|
|
49
|
-
*/
|
|
50
|
-
export function listBillingAccounts({ stackSpotAccountId, showDeleted }, opts) {
|
|
51
|
-
return oazapfts.ok(oazapfts.fetchJson(`/v2/finops/billing-accounts${QS.query(QS.explode({
|
|
52
|
-
stackSpotAccountId,
|
|
53
|
-
showDeleted
|
|
54
|
-
}))}`, {
|
|
55
|
-
...opts
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Create new billing account
|
|
60
|
-
*/
|
|
61
|
-
export function createBillingAccount({ billingAccountRequest }, opts) {
|
|
62
|
-
return oazapfts.ok(oazapfts.fetchJson("/v2/finops/billing-accounts", oazapfts.json({
|
|
63
|
-
...opts,
|
|
64
|
-
method: "POST",
|
|
65
|
-
body: billingAccountRequest
|
|
66
|
-
})));
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Retrieves cost and usage metrics for your account.
|
|
70
|
-
*/
|
|
71
|
-
export function processAllocationCostRequest({ allocationCostRequest }, opts) {
|
|
72
|
-
return oazapfts.ok(oazapfts.fetchJson("/v2/finops/allocation-cost", oazapfts.json({
|
|
73
|
-
...opts,
|
|
74
|
-
method: "POST",
|
|
75
|
-
body: allocationCostRequest
|
|
76
|
-
})));
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Enable a GuardRail in any level
|
|
80
|
-
*/
|
|
81
|
-
export function enableGuardrail({ account, workspace, env, enable, guardrailId }, opts) {
|
|
82
|
-
return oazapfts.ok(oazapfts.fetchJson(`/guardrail/${encodeURIComponent(guardrailId)}${QS.query(QS.explode({
|
|
83
|
-
account,
|
|
84
|
-
workspace,
|
|
85
|
-
env,
|
|
86
|
-
enable
|
|
87
|
-
}))}`, {
|
|
88
|
-
...opts,
|
|
89
|
-
method: "POST"
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Register a cloud offer for a Stackspot Account.
|
|
94
|
-
*/
|
|
95
|
-
export function registerOffer({ registerOfferRequest }, opts) {
|
|
96
|
-
return oazapfts.ok(oazapfts.fetchJson("/cloud-offer", oazapfts.json({
|
|
97
|
-
...opts,
|
|
98
|
-
method: "POST",
|
|
99
|
-
body: registerOfferRequest
|
|
100
|
-
})));
|
|
101
|
-
}
|
|
102
|
-
export function createNewContract({ createContractRequest }, opts) {
|
|
103
|
-
return oazapfts.ok(oazapfts.fetchJson("/admin/finops/contract", oazapfts.json({
|
|
104
|
-
...opts,
|
|
105
|
-
method: "POST",
|
|
106
|
-
body: createContractRequest
|
|
107
|
-
})));
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Links services to a Stackspot account, allowing users from that account to see resources in CRE
|
|
111
|
-
*/
|
|
112
|
-
export function linkResourceTypesToStackspotAccount({ linkResourceTypeToStackspotAccountRequest }, opts) {
|
|
113
|
-
return oazapfts.ok(oazapfts.fetchJson("/admin/cloud-resource/link-service-to-stackspot-account", oazapfts.json({
|
|
114
|
-
...opts,
|
|
115
|
-
method: "POST",
|
|
116
|
-
body: linkResourceTypeToStackspotAccountRequest
|
|
117
|
-
})));
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Return all baseline registered
|
|
121
|
-
*/
|
|
122
|
-
export function getBaselines(opts) {
|
|
123
|
-
return oazapfts.ok(oazapfts.fetchJson("/admin/baseline", {
|
|
124
|
-
...opts
|
|
125
|
-
}));
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Create a baseline
|
|
129
|
-
*/
|
|
130
|
-
export function createBaseline({ baselineRequest }, opts) {
|
|
131
|
-
return oazapfts.ok(oazapfts.fetchJson("/admin/baseline", oazapfts.json({
|
|
132
|
-
...opts,
|
|
133
|
-
method: "POST",
|
|
134
|
-
body: baselineRequest
|
|
135
|
-
})));
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Retrieves details from a billing account
|
|
139
|
-
*/
|
|
140
|
-
export function getBillingAccountById({ stackSpotAccountId, billingAccountId }, opts) {
|
|
141
|
-
return oazapfts.ok(oazapfts.fetchJson(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
|
|
142
|
-
stackSpotAccountId
|
|
143
|
-
}))}`, {
|
|
144
|
-
...opts
|
|
145
|
-
}));
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Delete a billing account
|
|
149
|
-
*/
|
|
150
|
-
export function deleteBillingAccountById({ stackSpotAccountId, billingAccountId }, opts) {
|
|
151
|
-
return oazapfts.ok(oazapfts.fetchJson(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
|
|
152
|
-
stackSpotAccountId
|
|
153
|
-
}))}`, {
|
|
154
|
-
...opts,
|
|
155
|
-
method: "DELETE"
|
|
156
|
-
}));
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Get all GuardRails
|
|
160
|
-
*/
|
|
161
|
-
export function getGuardrails({ account, workspace, env }, opts) {
|
|
162
|
-
return oazapfts.ok(oazapfts.fetchJson(`/guardrail${QS.query(QS.explode({
|
|
163
|
-
account,
|
|
164
|
-
workspace,
|
|
165
|
-
env
|
|
166
|
-
}))}`, {
|
|
167
|
-
...opts
|
|
168
|
-
}));
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Get overview of costs, with current month, last month and three last month
|
|
172
|
-
*/
|
|
173
|
-
export function getCostOverview({ sortBy, sortOrder }, opts) {
|
|
174
|
-
return oazapfts.ok(oazapfts.fetchJson(`/finops/reports${QS.query(QS.explode({
|
|
175
|
-
sortBy,
|
|
176
|
-
sortOrder
|
|
177
|
-
}))}`, {
|
|
178
|
-
...opts
|
|
179
|
-
}));
|
|
180
|
-
}
|
|
181
|
-
export function downloadCsvFiles({ year, month }, opts) {
|
|
182
|
-
return oazapfts.ok(oazapfts.fetchJson(`/finops/reports/download${QS.query(QS.explode({
|
|
183
|
-
year,
|
|
184
|
-
month
|
|
185
|
-
}))}`, {
|
|
186
|
-
...opts
|
|
187
|
-
}));
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* List all tags.
|
|
191
|
-
*/
|
|
192
|
-
export function getAllTags({ stackspotAccountId }, opts) {
|
|
193
|
-
return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-list-tags${QS.query(QS.explode({
|
|
194
|
-
stackspotAccountId
|
|
195
|
-
}))}`, {
|
|
196
|
-
...opts
|
|
197
|
-
}));
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* lists all subTags of a given tag with their respective costs.
|
|
201
|
-
*/
|
|
202
|
-
export function getAllocationCostTagValues({ masterAccount, tag, startDate, endDate, sort, page, pageSize }, opts) {
|
|
203
|
-
return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-list-tag-values${QS.query(QS.explode({
|
|
204
|
-
masterAccount,
|
|
205
|
-
tag,
|
|
206
|
-
startDate,
|
|
207
|
-
endDate,
|
|
208
|
-
sort,
|
|
209
|
-
page,
|
|
210
|
-
pageSize
|
|
211
|
-
}))}`, {
|
|
212
|
-
...opts
|
|
213
|
-
}));
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* List all services of a subtag. Each service contains name and cost value.
|
|
217
|
-
*/
|
|
218
|
-
export function getAllocationCostServices({ masterAccount, tag, tagValueName, startDate, endDate, sort, page, pageSize }, opts) {
|
|
219
|
-
return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-list-services${QS.query(QS.explode({
|
|
220
|
-
masterAccount,
|
|
221
|
-
tag,
|
|
222
|
-
tagValueName,
|
|
223
|
-
startDate,
|
|
224
|
-
endDate,
|
|
225
|
-
sort,
|
|
226
|
-
page,
|
|
227
|
-
pageSize
|
|
228
|
-
}))}`, {
|
|
229
|
-
...opts
|
|
230
|
-
}));
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* list service details
|
|
234
|
-
*/
|
|
235
|
-
export function getAllocationCostServiceDetails({ masterAccount, tag, tagValueName, serviceName, startDate, endDate, $type, filter, page, pageSize, sort }, opts) {
|
|
236
|
-
return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-list-service-details${QS.query(QS.explode({
|
|
237
|
-
masterAccount,
|
|
238
|
-
tag,
|
|
239
|
-
tagValueName,
|
|
240
|
-
serviceName,
|
|
241
|
-
startDate,
|
|
242
|
-
endDate,
|
|
243
|
-
"type": $type,
|
|
244
|
-
filter,
|
|
245
|
-
page,
|
|
246
|
-
pageSize,
|
|
247
|
-
sort
|
|
248
|
-
}))}`, {
|
|
249
|
-
...opts
|
|
250
|
-
}));
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* list all master accounts
|
|
254
|
-
*/
|
|
255
|
-
export function getAllMasterAccount({ stackspotAccountId }, opts) {
|
|
256
|
-
return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-list-master-accounts${QS.query(QS.explode({
|
|
257
|
-
stackspotAccountId
|
|
258
|
-
}))}`, {
|
|
259
|
-
...opts
|
|
260
|
-
}));
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* list filters related to the type
|
|
264
|
-
*/
|
|
265
|
-
export function getAllocationCostFilters({ $type }, opts) {
|
|
266
|
-
return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-filters${QS.query(QS.explode({
|
|
267
|
-
"type": $type
|
|
268
|
-
}))}`, {
|
|
269
|
-
...opts
|
|
270
|
-
}));
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* returns the detailed csv with the masterAccount CUR information
|
|
274
|
-
*/
|
|
275
|
-
export function getAllocationCostCsv({ stackspotAccountId, masterAccount, startDate, endDate }, opts) {
|
|
276
|
-
return oazapfts.ok(oazapfts.fetchJson(`/finops/allocation-cost-csv${QS.query(QS.explode({
|
|
277
|
-
stackspotAccountId,
|
|
278
|
-
masterAccount,
|
|
279
|
-
startDate,
|
|
280
|
-
endDate
|
|
281
|
-
}))}`, {
|
|
282
|
-
...opts
|
|
283
|
-
}));
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* List Instances of a particular Service Resource running in a Workspace
|
|
287
|
-
*/
|
|
288
|
-
export function listInstances({ workspaceId, resourceId, pageToken, search }, opts) {
|
|
289
|
-
return oazapfts.ok(oazapfts.fetchJson(`/cloud-resource/workspace/${encodeURIComponent(workspaceId)}/resource/${encodeURIComponent(resourceId)}/instance${QS.query(QS.explode({
|
|
290
|
-
pageToken,
|
|
291
|
-
search
|
|
292
|
-
}))}`, {
|
|
293
|
-
...opts
|
|
294
|
-
}));
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* List Managed Services
|
|
298
|
-
*/
|
|
299
|
-
export function listServices(opts) {
|
|
300
|
-
return oazapfts.ok(oazapfts.fetchJson("/cloud-resource/service", {
|
|
301
|
-
...opts
|
|
302
|
-
}));
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* A detailed description of a particular Instance
|
|
306
|
-
*/
|
|
307
|
-
export function getInstanceDetails({ cloudAccountId, resourceId, instanceId }, opts) {
|
|
308
|
-
return oazapfts.ok(oazapfts.fetchJson(`/cloud-resource/cloud-account/${encodeURIComponent(cloudAccountId)}/resource/${encodeURIComponent(resourceId)}/instance/${encodeURIComponent(instanceId)}`, {
|
|
309
|
-
...opts
|
|
310
|
-
}));
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Get the cloud offer of a Stackspot Account.
|
|
314
|
-
*/
|
|
315
|
-
export function getOfferOfAccount({ id }, opts) {
|
|
316
|
-
return oazapfts.ok(oazapfts.fetchJson(`/cloud-offer/account/${encodeURIComponent(id)}`, {
|
|
317
|
-
...opts
|
|
318
|
-
}));
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* Get pages alerts from workspace and environment. That alerts can be filtered
|
|
322
|
-
*/
|
|
323
|
-
export function getAlerts({ workspace, env, pillar, severity, status, search, sort, page, pageSize }, opts) {
|
|
324
|
-
return oazapfts.ok(oazapfts.fetchJson(`/alerts${QS.query(QS.explode({
|
|
325
|
-
workspace,
|
|
326
|
-
env,
|
|
327
|
-
pillar,
|
|
328
|
-
severity,
|
|
329
|
-
status,
|
|
330
|
-
search,
|
|
331
|
-
sort,
|
|
332
|
-
page,
|
|
333
|
-
pageSize
|
|
334
|
-
}))}`, {
|
|
335
|
-
...opts
|
|
336
|
-
}));
|
|
337
|
-
}
|
|
338
|
-
export function downloadDataByAccountId({ stackspotAccountId, year, month }, opts) {
|
|
339
|
-
return oazapfts.ok(oazapfts.fetchJson(`/admin/finops/reports/download${QS.query(QS.explode({
|
|
340
|
-
stackspot_account_id: stackspotAccountId,
|
|
341
|
-
year,
|
|
342
|
-
month
|
|
343
|
-
}))}`, {
|
|
344
|
-
...opts
|
|
345
|
-
}));
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* List available services
|
|
349
|
-
*/
|
|
350
|
-
export function listServices1(opts) {
|
|
351
|
-
return oazapfts.ok(oazapfts.fetchJson("/admin/cloud-resource/service", {
|
|
352
|
-
...opts
|
|
353
|
-
}));
|
|
354
|
-
}
|
|
355
|
-
//# sourceMappingURL=cloudServices.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloudServices.js","sourceRoot":"","sources":["../../src/api/cloudServices.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC9C,MAAM,CAAC,MAAM,QAAQ,GAA8C;IAC/D,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,6DAA6D;CACzE,CAAC;AACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,kBAAkB,EAAE,6DAA6D;CACpF,CAAC;AA2XF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,eAAe,EAEhD,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAkBlC,kBAAkB,EAAE,QAAQ,CAAC,IAAI,CAAC;QACjC,GAAG,IAAI;QACP,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,eAAe;KACxB,CAAC,CAAC,CAAC,CAAC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illingAccountSummaryResponse } from '../api/cloudServices.js';
|
|
3
|
-
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
4
|
-
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
5
|
-
import { CostAllocationResult, CostAllocationVariables, FixedManagedService } from './types.js';
|
|
6
|
-
declare class CloudServicesClient extends ReactQueryNetworkClient {
|
|
7
|
-
constructor();
|
|
8
|
-
protected buildStackSpotError(error: HttpError): StackspotAPIError;
|
|
9
|
-
/**
|
|
10
|
-
* Gets overview of costs over the current month, last month and last 3 months.
|
|
11
|
-
*/
|
|
12
|
-
costOverview: import("../network/types.js").QueryObject<Omit<{
|
|
13
|
-
sortBy?: string;
|
|
14
|
-
sortOrder?: string;
|
|
15
|
-
}, "sortOrder"> & {
|
|
16
|
-
sortOrder?: "asc" | "desc" | undefined;
|
|
17
|
-
}, import("../api/cloudServices.js").CostOverview>;
|
|
18
|
-
/**
|
|
19
|
-
* Gets a CSV file with the data of `costOverview`.
|
|
20
|
-
*/
|
|
21
|
-
downloadCostOverviewCSV: import("../network/types.js").MutationObject<{
|
|
22
|
-
year: number;
|
|
23
|
-
month: number;
|
|
24
|
-
}, import("../api/cloudServices.js").AttachmentBase64>;
|
|
25
|
-
/**
|
|
26
|
-
* Gets the alerts in a workspace and environment (paginated).
|
|
27
|
-
*/
|
|
28
|
-
alerts: import("../network/types.js").InfiniteQueryObject<{
|
|
29
|
-
workspace: string;
|
|
30
|
-
env: string;
|
|
31
|
-
pillar?: "SECURITY" | "COST_OPTIMIZATION" | "RELIABILITY";
|
|
32
|
-
severity?: "LOW" | "MEDIUM" | "HIGH" | "MANDATORY";
|
|
33
|
-
status?: "PENDING" | "NOT_APPLICABLE" | "COMPLETED";
|
|
34
|
-
search?: string;
|
|
35
|
-
sort?: ("STATUS_ASC" | "STATUS_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PILLAR_ASC" | "PILLAR_DESC" | "SEVERITY_ASC" | "SEVERITY_DESC")[];
|
|
36
|
-
page?: number;
|
|
37
|
-
pageSize?: number;
|
|
38
|
-
}, import("../api/cloudServices.js").PaginatedResponseAlert, "data">;
|
|
39
|
-
/**
|
|
40
|
-
* Lists instances of a particular service resource running in a workspace.
|
|
41
|
-
*/
|
|
42
|
-
allInstancesOfResource: import("../network/types.js").QueryObject<{
|
|
43
|
-
workspaceId: string;
|
|
44
|
-
resourceId: string;
|
|
45
|
-
pageToken?: string;
|
|
46
|
-
search?: string;
|
|
47
|
-
}, import("../api/cloudServices.js").ManagedResourceList>;
|
|
48
|
-
/**
|
|
49
|
-
* Lists all managed services.
|
|
50
|
-
*/
|
|
51
|
-
allServices: import("../network/types.js").QueryObject<void, FixedManagedService[]>;
|
|
52
|
-
/**
|
|
53
|
-
* Gets the description of an instance.
|
|
54
|
-
*/
|
|
55
|
-
instance: import("../network/types.js").QueryObject<{
|
|
56
|
-
cloudAccountId: string;
|
|
57
|
-
resourceId: string;
|
|
58
|
-
instanceId: string;
|
|
59
|
-
}, string>;
|
|
60
|
-
/**
|
|
61
|
-
* Gets all Guard Rails.
|
|
62
|
-
*/
|
|
63
|
-
guardRails: import("../network/types.js").QueryObject<{
|
|
64
|
-
account: string;
|
|
65
|
-
workspace?: string;
|
|
66
|
-
env?: string;
|
|
67
|
-
}, import("../api/cloudServices.js").GroupedGuardrailResponse[]>;
|
|
68
|
-
/**
|
|
69
|
-
* Enables a Guard Rail in any level
|
|
70
|
-
*/
|
|
71
|
-
enableGuardRail: import("../network/types.js").MutationObject<{
|
|
72
|
-
account: string;
|
|
73
|
-
workspace?: string;
|
|
74
|
-
env?: string;
|
|
75
|
-
enable: boolean;
|
|
76
|
-
guardrailId: string;
|
|
77
|
-
}, unknown>;
|
|
78
|
-
/**
|
|
79
|
-
* Retrieves cost and usage metrics for the current account.
|
|
80
|
-
*/
|
|
81
|
-
costAllocation: import("../network/types.js").QueryObject<CostAllocationVariables, CostAllocationResult>;
|
|
82
|
-
/**
|
|
83
|
-
* Lists the filters related to the given type.
|
|
84
|
-
*/
|
|
85
|
-
costAllocationFilters: import("../network/types.js").QueryObject<{
|
|
86
|
-
$type: "SUB_ACCOUNT_ID" | "REGION";
|
|
87
|
-
}, string[]>;
|
|
88
|
-
/**
|
|
89
|
-
* Gets a CSV file with the data of `costAllocation`.
|
|
90
|
-
*/
|
|
91
|
-
downloadCostAllocationCSV: import("../network/types.js").QueryObject<{
|
|
92
|
-
stackspotAccountId: string;
|
|
93
|
-
masterAccount: string;
|
|
94
|
-
startDate: string;
|
|
95
|
-
endDate: string;
|
|
96
|
-
}, import("../api/cloudServices.js").AttachmentBase64>;
|
|
97
|
-
/**
|
|
98
|
-
* Lists all tags.
|
|
99
|
-
*/
|
|
100
|
-
allTags: import("../network/types.js").QueryObject<{
|
|
101
|
-
stackspotAccountId: string;
|
|
102
|
-
}, string[]>;
|
|
103
|
-
/**
|
|
104
|
-
* Retrieves a summary for each billing account of the account with the id passed as parameter.
|
|
105
|
-
*/
|
|
106
|
-
billingAccounts: import("../network/types.js").QueryObject<{
|
|
107
|
-
stackSpotAccountId: string;
|
|
108
|
-
showDeleted?: boolean;
|
|
109
|
-
}, BillingAccountSummaryResponse[]>;
|
|
110
|
-
}
|
|
111
|
-
export declare const cloudServicesClient: CloudServicesClient;
|
|
112
|
-
export {};
|
|
113
|
-
//# sourceMappingURL=cloud-services.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-services.d.ts","sourceRoot":"","sources":["../../src/client/cloud-services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EACL,6BAA6B,EAI9B,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,mBAAmB,EAAiD,MAAM,SAAS,CAAA;AAG3I,cAAM,mBAAoB,SAAQ,uBAAuB;;IAKvD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAIlE;;OAEG;IACH,YAAY;;;;oBAA+F,KAAK,GAAG,MAAM;oDAAI;IAC7H;;OAEG;IACH,uBAAuB;;;wDAAkC;IACzD;;OAEG;IACH,MAAM;;;;;;;;;;sEAKJ;IACF;;OAEG;IACH,sBAAsB;;;;;2DAA4B;IAClD;;OAEG;IACH,WAAW,sEAAmG;IAC9G;;OAEG;IAKH,QAAQ;;;;eAMN;IACF;;OAEG;IACH,UAAU;;;;kEAA4B;IACtC;;OAEG;IACH,eAAe;;;;;;gBAAiC;IAChD;;OAEG;IACH,cAAc,wFAEb;IACD;;OAEG;IACH,qBAAqB;;iBAAuC;IAC5D;;OAEG;IACH,yBAAyB;;;;;wDAAmC;IAC5D;;OAEG;IACH,OAAO;;iBAAyB;IAChC;;OAEG;IACH,eAAe;;;wCAA2H;CAC3I;AAED,eAAO,MAAM,mBAAmB,qBAA4B,CAAA"}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { defaults, downloadCsvFiles, enableGuardrail, getAlerts, getAllocationCostCsv, getAllocationCostFilters, getAllTags, getCostOverview, getGuardrails, getInstanceDetails, listBillingAccounts, listInstances, listServices, processAllocationCostRequest, } from '../api/cloudServices.js';
|
|
2
|
-
import { DefaultAPIError } from '../error/DefaultAPIError.js';
|
|
3
|
-
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
4
|
-
import { getApiAddresses } from '../api-addresses.js';
|
|
5
|
-
class CloudServicesClient extends ReactQueryNetworkClient {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(getApiAddresses().cloudServices.url, defaults);
|
|
8
|
-
/**
|
|
9
|
-
* Gets overview of costs over the current month, last month and last 3 months.
|
|
10
|
-
*/
|
|
11
|
-
Object.defineProperty(this, "costOverview", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: this.query(getCostOverview)
|
|
16
|
-
});
|
|
17
|
-
/**
|
|
18
|
-
* Gets a CSV file with the data of `costOverview`.
|
|
19
|
-
*/
|
|
20
|
-
Object.defineProperty(this, "downloadCostOverviewCSV", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
configurable: true,
|
|
23
|
-
writable: true,
|
|
24
|
-
value: this.mutation(downloadCsvFiles)
|
|
25
|
-
});
|
|
26
|
-
/**
|
|
27
|
-
* Gets the alerts in a workspace and environment (paginated).
|
|
28
|
-
*/
|
|
29
|
-
Object.defineProperty(this, "alerts", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true,
|
|
33
|
-
value: this.infiniteQuery(getAlerts, {
|
|
34
|
-
accumulator: 'data',
|
|
35
|
-
defaultVariables: { pageSize: 40 },
|
|
36
|
-
initialPageParam: 1,
|
|
37
|
-
getNextPageParam: ({ lastPage }) => lastPage.nextPage,
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
/**
|
|
41
|
-
* Lists instances of a particular service resource running in a workspace.
|
|
42
|
-
*/
|
|
43
|
-
Object.defineProperty(this, "allInstancesOfResource", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
configurable: true,
|
|
46
|
-
writable: true,
|
|
47
|
-
value: this.query(listInstances)
|
|
48
|
-
});
|
|
49
|
-
/**
|
|
50
|
-
* Lists all managed services.
|
|
51
|
-
*/
|
|
52
|
-
Object.defineProperty(this, "allServices", {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
configurable: true,
|
|
55
|
-
writable: true,
|
|
56
|
-
value: this.query(listServices)
|
|
57
|
-
});
|
|
58
|
-
/**
|
|
59
|
-
* Gets the description of an instance.
|
|
60
|
-
*/
|
|
61
|
-
// we need a manual query here because the backend returns application/json in error responses and application/yaml in successful
|
|
62
|
-
// responses. Oazapfts will handle the request as JSON whenever at least one of the response types is JSON, which I think is wrong, but
|
|
63
|
-
// it is what it is. This manual query changes the accept header to */* and the return type to string, which is the fallback when Oazapfts
|
|
64
|
-
// can't parse what it expects to be a json.
|
|
65
|
-
Object.defineProperty(this, "instance", {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
configurable: true,
|
|
68
|
-
writable: true,
|
|
69
|
-
value: this.query({
|
|
70
|
-
name: 'instance',
|
|
71
|
-
request: (signal, variables) => {
|
|
72
|
-
return getInstanceDetails(variables, { signal, headers: { 'accept': '*/*' } });
|
|
73
|
-
},
|
|
74
|
-
permission: this.createPermissionFunctionFor(getInstanceDetails),
|
|
75
|
-
})
|
|
76
|
-
});
|
|
77
|
-
/**
|
|
78
|
-
* Gets all Guard Rails.
|
|
79
|
-
*/
|
|
80
|
-
Object.defineProperty(this, "guardRails", {
|
|
81
|
-
enumerable: true,
|
|
82
|
-
configurable: true,
|
|
83
|
-
writable: true,
|
|
84
|
-
value: this.query(getGuardrails)
|
|
85
|
-
});
|
|
86
|
-
/**
|
|
87
|
-
* Enables a Guard Rail in any level
|
|
88
|
-
*/
|
|
89
|
-
Object.defineProperty(this, "enableGuardRail", {
|
|
90
|
-
enumerable: true,
|
|
91
|
-
configurable: true,
|
|
92
|
-
writable: true,
|
|
93
|
-
value: this.mutation(enableGuardrail)
|
|
94
|
-
});
|
|
95
|
-
/**
|
|
96
|
-
* Retrieves cost and usage metrics for the current account.
|
|
97
|
-
*/
|
|
98
|
-
Object.defineProperty(this, "costAllocation", {
|
|
99
|
-
enumerable: true,
|
|
100
|
-
configurable: true,
|
|
101
|
-
writable: true,
|
|
102
|
-
value: this.query(processAllocationCostRequest)
|
|
103
|
-
});
|
|
104
|
-
/**
|
|
105
|
-
* Lists the filters related to the given type.
|
|
106
|
-
*/
|
|
107
|
-
Object.defineProperty(this, "costAllocationFilters", {
|
|
108
|
-
enumerable: true,
|
|
109
|
-
configurable: true,
|
|
110
|
-
writable: true,
|
|
111
|
-
value: this.query(getAllocationCostFilters)
|
|
112
|
-
});
|
|
113
|
-
/**
|
|
114
|
-
* Gets a CSV file with the data of `costAllocation`.
|
|
115
|
-
*/
|
|
116
|
-
Object.defineProperty(this, "downloadCostAllocationCSV", {
|
|
117
|
-
enumerable: true,
|
|
118
|
-
configurable: true,
|
|
119
|
-
writable: true,
|
|
120
|
-
value: this.query(getAllocationCostCsv)
|
|
121
|
-
});
|
|
122
|
-
/**
|
|
123
|
-
* Lists all tags.
|
|
124
|
-
*/
|
|
125
|
-
Object.defineProperty(this, "allTags", {
|
|
126
|
-
enumerable: true,
|
|
127
|
-
configurable: true,
|
|
128
|
-
writable: true,
|
|
129
|
-
value: this.query(getAllTags)
|
|
130
|
-
});
|
|
131
|
-
/**
|
|
132
|
-
* Retrieves a summary for each billing account of the account with the id passed as parameter.
|
|
133
|
-
*/
|
|
134
|
-
Object.defineProperty(this, "billingAccounts", {
|
|
135
|
-
enumerable: true,
|
|
136
|
-
configurable: true,
|
|
137
|
-
writable: true,
|
|
138
|
-
value: this.query(listBillingAccounts)
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
buildStackSpotError(error) {
|
|
142
|
-
return new DefaultAPIError(error.data, error.status, { en: {}, pt: {} }, error.headers);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
export const cloudServicesClient = new CloudServicesClient();
|
|
146
|
-
//# sourceMappingURL=cloud-services.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-services.js","sourceRoot":"","sources":["../../src/client/cloud-services.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,QAAQ,EAAE,gBAAgB,EAAE,eAAe,EAAE,SAAS,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,UAAU,EAClH,eAAe,EAAE,aAAa,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,aAAa,EAAE,YAAY,EACpG,4BAA4B,GAC7B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,EAAE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