@stack-spot/portal-network 0.184.0-beta.1 → 0.184.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 (151) hide show
  1. package/CHANGELOG.md +2412 -2431
  2. package/dist/api/account.js +1 -1
  3. package/dist/api/agent-tools.js +1 -1
  4. package/dist/api/agent.js +1 -1
  5. package/dist/api/ai.js +1 -1
  6. package/dist/api/apiManagement.js +1 -1
  7. package/dist/api/apiRuntime.js +1 -1
  8. package/dist/api/cloudAccount.js +1 -1
  9. package/dist/api/cloudPlatform.js +1 -1
  10. package/dist/api/cloudPlatformHorizon.js +1 -1
  11. package/dist/api/cloudRuntimes.js +1 -1
  12. package/dist/api/cloudServices.js +1 -1
  13. package/dist/api/codeShift.d.ts +4 -76
  14. package/dist/api/codeShift.d.ts.map +1 -1
  15. package/dist/api/codeShift.js +1 -14
  16. package/dist/api/codeShift.js.map +1 -1
  17. package/dist/api/content.js +1 -1
  18. package/dist/api/dataIntegration.js +1 -1
  19. package/dist/api/discover.js +1 -1
  20. package/dist/api/genAiInference.js +1 -1
  21. package/dist/api/insights.js +1 -1
  22. package/dist/api/notification.js +1 -1
  23. package/dist/api/secrets.js +1 -1
  24. package/dist/api/serviceCatalog.js +1 -1
  25. package/dist/api/workspace-ai.js +1 -1
  26. package/dist/api/workspace.js +1 -1
  27. package/dist/api/workspaceManager.d.ts +16 -10
  28. package/dist/api/workspaceManager.d.ts.map +1 -1
  29. package/dist/api/workspaceManager.js +11 -1
  30. package/dist/api/workspaceManager.js.map +1 -1
  31. package/dist/api/workspaceSearchEngine.js +1 -1
  32. package/dist/client/ai.d.ts.map +1 -1
  33. package/dist/client/ai.js +14 -84
  34. package/dist/client/ai.js.map +1 -1
  35. package/dist/client/code-shift.d.ts +0 -30
  36. package/dist/client/code-shift.d.ts.map +1 -1
  37. package/dist/client/code-shift.js +1 -37
  38. package/dist/client/code-shift.js.map +1 -1
  39. package/dist/client/types.d.ts +6 -26
  40. package/dist/client/types.d.ts.map +1 -1
  41. package/dist/client/workspace-manager.d.ts +6 -0
  42. package/dist/client/workspace-manager.d.ts.map +1 -1
  43. package/dist/client/workspace-manager.js +10 -1
  44. package/dist/client/workspace-manager.js.map +1 -1
  45. package/package.json +1 -1
  46. package/readme.md +1 -1
  47. package/scripts/generate-apis.ts +134 -134
  48. package/src/api/account.ts +8367 -8368
  49. package/src/api/agent-tools.ts +2169 -2172
  50. package/src/api/agent.ts +1083 -1085
  51. package/src/api/ai.ts +3388 -3388
  52. package/src/api/apiManagement.ts +570 -570
  53. package/src/api/apiRuntime.ts +2103 -2103
  54. package/src/api/cloudAccount.ts +1239 -1239
  55. package/src/api/cloudPlatform.ts +927 -927
  56. package/src/api/cloudPlatformHorizon.ts +2655 -2655
  57. package/src/api/cloudRuntimes.ts +2043 -2043
  58. package/src/api/cloudServices.ts +1445 -1445
  59. package/src/api/codeShift.ts +3481 -3580
  60. package/src/api/content.ts +9785 -9785
  61. package/src/api/dataIntegration.ts +1657 -1657
  62. package/src/api/discover.ts +435 -435
  63. package/src/api/eventBus.ts +171 -171
  64. package/src/api/genAiInference.ts +603 -603
  65. package/src/api/insights.ts +310 -310
  66. package/src/api/notification.ts +334 -336
  67. package/src/api/secrets.ts +342 -342
  68. package/src/api/serviceCatalog.ts +2908 -2908
  69. package/src/api/workflows.ts +1669 -1669
  70. package/src/api/workspace-ai.ts +677 -677
  71. package/src/api/workspace.ts +5889 -5889
  72. package/src/api/workspaceManager.ts +2951 -2936
  73. package/src/api/workspaceSearchEngine.ts +153 -153
  74. package/src/api-addresses.ts +120 -120
  75. package/src/apis-itau.json +225 -225
  76. package/src/apis.json +225 -225
  77. package/src/client/account.ts +902 -902
  78. package/src/client/agent-tools.ts +210 -210
  79. package/src/client/agent.ts +81 -81
  80. package/src/client/ai.ts +395 -469
  81. package/src/client/api-management.ts +40 -40
  82. package/src/client/cloud-account.ts +70 -70
  83. package/src/client/cloud-platform-horizon.ts +113 -113
  84. package/src/client/cloud-platform.ts +163 -163
  85. package/src/client/cloud-runtimes.ts +129 -129
  86. package/src/client/cloud-services.ts +94 -94
  87. package/src/client/code-shift.ts +349 -371
  88. package/src/client/content.ts +538 -538
  89. package/src/client/data-integration.ts +191 -191
  90. package/src/client/discover.ts +89 -89
  91. package/src/client/event-bus.ts +84 -84
  92. package/src/client/gen-ai-inference.ts +65 -65
  93. package/src/client/insights.ts +28 -28
  94. package/src/client/notification.ts +32 -32
  95. package/src/client/runtime-manager.ts +76 -76
  96. package/src/client/secrets.ts +60 -60
  97. package/src/client/types.ts +377 -398
  98. package/src/client/workflow.ts +83 -83
  99. package/src/client/workspace-ai.ts +191 -191
  100. package/src/client/workspace-manager.ts +564 -560
  101. package/src/client/workspace-search.ts +39 -39
  102. package/src/client/workspace.ts +480 -480
  103. package/src/error/DefaultAPIError.ts +151 -151
  104. package/src/error/FileUploadError.ts +18 -18
  105. package/src/error/IgnoredErrorCodes.ts +3 -3
  106. package/src/error/StackspotAPIError.ts +101 -101
  107. package/src/error/StreamCanceledError.ts +10 -10
  108. package/src/error/StreamError.ts +7 -7
  109. package/src/error/StreamJsonError.ts +10 -10
  110. package/src/error/dictionary/account.ts +58 -58
  111. package/src/error/dictionary/action-details.ts +20 -20
  112. package/src/error/dictionary/action.ts +211 -211
  113. package/src/error/dictionary/agent-tools.ts +75 -75
  114. package/src/error/dictionary/ai-inference.ts +28 -28
  115. package/src/error/dictionary/base.ts +22 -22
  116. package/src/error/dictionary/cloud-platform.ts +82 -82
  117. package/src/error/dictionary/cnt-fields.ts +14 -14
  118. package/src/error/dictionary/cnt.ts +103 -103
  119. package/src/error/dictionary/code-shift.ts +12 -12
  120. package/src/error/dictionary/rte.ts +24 -24
  121. package/src/error/dictionary/rtm.ts +10 -10
  122. package/src/error/dictionary/secrets.ts +14 -14
  123. package/src/error/dictionary/workspace-ai.ts +10 -10
  124. package/src/error/dictionary/workspace-details.ts +15 -15
  125. package/src/error/dictionary/workspace-fields.ts +10 -10
  126. package/src/error/dictionary/workspace.ts +209 -209
  127. package/src/error/types.ts +21 -21
  128. package/src/index.ts +43 -43
  129. package/src/network/AutoInfiniteQuery.ts +115 -115
  130. package/src/network/AutoMutation.ts +27 -27
  131. package/src/network/AutoOperation.ts +73 -73
  132. package/src/network/AutoQuery.ts +75 -75
  133. package/src/network/ManualInfiniteQuery.ts +95 -95
  134. package/src/network/ManualMutation.ts +40 -40
  135. package/src/network/ManualOperation.ts +52 -52
  136. package/src/network/ManualQuery.ts +82 -82
  137. package/src/network/NetworkClient.ts +167 -167
  138. package/src/network/ReactQueryNetworkClient.ts +312 -312
  139. package/src/network/react-query-client.ts +14 -14
  140. package/src/network/types.ts +294 -294
  141. package/src/types.ts +1 -1
  142. package/src/utils/StreamedArray.tsx +146 -146
  143. package/src/utils/StreamedJson.tsx +166 -166
  144. package/src/utils/remove-authorization-param.ts +6 -6
  145. package/src/utils/string.ts +19 -19
  146. package/src/utils/use-extended-list.ts +80 -80
  147. package/src/utils/use-streamed-array.ts +17 -17
  148. package/tsconfig.build.json +4 -4
  149. package/tsconfig.json +10 -10
  150. package/logs/simple-failure/01JBER7AWKACEC3Y1NF7M6PHFF/job_id_1.log +0 -3
  151. package/logs/simple-suspend/01JBEMQG94ADPT99MSZ7EJKGXZ/job_id_1.log +0 -5
@@ -1,1445 +1,1445 @@
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: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
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
- export type GuardrailUpdate = {
18
- /** The ID of GuardRail that will be updated */
19
- id: string;
20
- /** The GuardRail title */
21
- title?: string;
22
- /** A description explaining what GuardRail do */
23
- description?: string;
24
- /** Indicates if GuardRail is active to users use it */
25
- active?: boolean;
26
- /** Indicates if GuardRail is configurable for user */
27
- configurable?: boolean;
28
- /** Type of implementation */
29
- implementation?: "RECOMENDATION" | "MANDATORY";
30
- /** Type of action taken by GuardRail */
31
- action?: "REMEDIATION" | "NOTIFICATION" | "NOT_IMPLEMENTED";
32
- /** The type of GuardRail. [SCP, GUARDRAIL] */
33
- "type"?: "SCP" | "GUARDRAIL";
34
- };
35
- export type ValidationDetails = {
36
- code: string;
37
- field?: string;
38
- details?: string;
39
- values?: string[];
40
- };
41
- export type GuardrailRequest = {
42
- /** The baseline id that GuardRail belongs */
43
- baselineId: string;
44
- /** The GuardRail title */
45
- title: string;
46
- /** A description explaining what GuardRail do */
47
- description: string;
48
- /** Indicates if GuardRail is active to users use it */
49
- active: boolean;
50
- /** Indicates if GuardRail is configurable for user */
51
- configurable: boolean;
52
- /** Type of implementation */
53
- implementation: "RECOMENDATION" | "MANDATORY";
54
- /** Type of action taken by GuardRail */
55
- action: "REMEDIATION" | "NOTIFICATION" | "NOT_IMPLEMENTED";
56
- /** The type of GuardRail. [SCP, GUARDRAIL] */
57
- "type": "SCP" | "GUARDRAIL";
58
- };
59
- export type GuardrailDetails = {
60
- /** The guardrail ID */
61
- id: string;
62
- };
63
- export type BaselineUpdate = {
64
- /** The baseline title */
65
- title: string;
66
- /** The date when that Baseline was published */
67
- publishedAt?: string;
68
- /** Status of the baseline, if it's published or a draft */
69
- status?: string;
70
- };
71
- export type BillingAccountSummaryResponse = {
72
- /** ULID identifier for each billing account. */
73
- id: string;
74
- /** Slug identifier for each billing account. */
75
- name: string;
76
- /** StackSpot's ULID identifier for each client. */
77
- stackSpotAccountId: string;
78
- };
79
- export type BillingAccountRequest = {
80
- /** Slug identifier for each billing account. */
81
- name: string;
82
- /** StackSpot's ULID identifier for each client. */
83
- stackSpotAccountId: string;
84
- /** The AWS S3 bucket name used for CUR (Cost and Usage Report). */
85
- awsCurBucketName: string;
86
- /** The AWS region where the CUR bucket is located. */
87
- awsCurBucketRegion: string;
88
- /** The name of the AWS CUR report. */
89
- awsCurReportName: string;
90
- /** The prefix used in the AWS CUR bucket for reports. */
91
- awsCurPrefix: string;
92
- /** The AWS IAM Role ARN with permissions to access CUR data. */
93
- awsRoleArn: string;
94
- /** The AWS Secret Manager secret ARN containing the External ID. */
95
- awsSecretIdArn: string;
96
- };
97
- export type BillingAccountDetailsResponse = {
98
- /** ULID identifier for each billing account. */
99
- id: string;
100
- /** Slug identifier for each billing account. */
101
- name: string;
102
- /** StackSpot's ULID identifier for each client. */
103
- stackSpotAccountId: string;
104
- /** The AWS S3 bucket name used for CUR (Cost and Usage Report). */
105
- awsCurBucketName: string;
106
- /** The AWS region where the CUR bucket is located. */
107
- awsCurBucketRegion: string;
108
- /** The name of the AWS CUR report. */
109
- awsCurReportName: string;
110
- /** The prefix used in the AWS CUR bucket for reports. */
111
- awsCurPrefix: string;
112
- /** The AWS IAM Role ARN with permissions to access CUR data. */
113
- awsRoleArn: string;
114
- /** The AWS Secret Manager secret ARN containing the External ID. */
115
- awsSecretIdArn?: string;
116
- /** Timestamp of when the billing account was marked as deleted. */
117
- deletedAt?: string;
118
- /** Timestamp of when the billing account was created. */
119
- createdAt: string;
120
- /** Timestamp of the last update to the billing account. */
121
- updatedAt: string;
122
- };
123
- export type Ulid = {
124
- value: string;
125
- };
126
- export type Filter = {
127
- /** A categorical attribute for context or categorization in billing data. */
128
- "type": "REGION" | "SERVICE_NAME" | "SUB_ACCOUNT_ID" | "TAG_KEY" | "TAG_VALUE";
129
- /** Defines the exact value the filter will look for within the specified type. */
130
- value: string;
131
- };
132
- export type ChargePeriod = {
133
- /** Represents the end date of the charge period. */
134
- end: string;
135
- /** Represents the end date of the charge period. */
136
- start: string;
137
- };
138
- export type AllocationCostRequest = {
139
- /** StackSpot's ULID identifier for each client. */
140
- stackSpotAccountId: string;
141
- /** StackSpot-assigned ULID identifiers for a billing account. */
142
- billingAccountId: Ulid[];
143
- /** StackSpot-assigned ULID identifiers for a billing account. */
144
- filter: Filter[];
145
- /** Defines the row's time-based granularity. */
146
- granularity: "PERIOD" | "MONTH";
147
- /** A categorical attribute that provides context or categorization to billing data. */
148
- dimension: "SERVICE_NAME" | "TAG" | "USAGE_UNIT";
149
- chargePeriod: ChargePeriod;
150
- };
151
- export type ServiceNameResponse = GetCostAndUsageData & {
152
- chargePeriod?: ChargePeriod;
153
- /** Represents an offering that can be purchased from a cloud provider. */
154
- serviceName?: string;
155
- /** Effective cost post discounts and amortizations. */
156
- effectiveCost?: number;
157
- };
158
- export type TagResponse = GetCostAndUsageData & {
159
- chargePeriod?: ChargePeriod;
160
- /** Tag key: Identifies a grouping attribute or category for resources or constructs. */
161
- tagKey?: string;
162
- /** Tag value: Specifies the group or category detail that the resource or construct belongs to. */
163
- tagValue?: string;
164
- /** Effective cost post discounts and amortizations. */
165
- effectiveCost?: number;
166
- };
167
- export type UsageUnitResponse = GetCostAndUsageData & {
168
- chargePeriod?: ChargePeriod;
169
- /** Represents an offering that can be purchased from a cloud provider. */
170
- serviceName?: string;
171
- /** Represents the volume of a given resource or service used or purchased based on the Usage Unit. */
172
- usageQuantity?: number;
173
- /** Defines the unit of measurement for the resource or service. */
174
- usageUnit?: string;
175
- /** Effective cost post discounts and amortizations. */
176
- effectiveCost?: number;
177
- };
178
- export type GetCostAndUsageData = ({
179
- "type": "ServiceNameResponse";
180
- } & ServiceNameResponse) | ({
181
- "type": "TagResponse";
182
- } & TagResponse) | ({
183
- "type": "UsageUnitResponse";
184
- } & UsageUnitResponse);
185
- export type AllocationCostResponse = {
186
- /** Unique identifier for the task, used for tracking and retrieval. */
187
- id: string;
188
- /** Current status of the task, indicating its lifecycle phase. */
189
- status: "PROCESSING" | "SUCCESS" | "ERROR";
190
- /** Contains processed data, available when status is SUCCESS. */
191
- data: GetCostAndUsageData[];
192
- /** Optional details on processing status, providing task insights or error explanations. */
193
- message: string;
194
- };
195
- export type ProblemDetail = {
196
- "type"?: string;
197
- title?: string;
198
- status?: number;
199
- detail?: string;
200
- instance?: string;
201
- properties?: {
202
- [key: string]: object;
203
- };
204
- };
205
- export type RegisterOfferRequest = {
206
- /** The Stackspot account ID to associate the offer with */
207
- stackspotAccountId: string;
208
- /** The Cloud Offer type to be registered */
209
- cloudOffer: "Reseller" | "Managed" | "FullyManaged";
210
- };
211
- export type CreateContractRequest = {
212
- stackSpotAccountId: Ulid;
213
- factor: number;
214
- startDate: string;
215
- };
216
- export type Contract = {
217
- id: string;
218
- stackSpotAccountId: string;
219
- factor: number;
220
- startDate: string;
221
- };
222
- export type LinkResourceTypeToStackspotAccountRequest = {
223
- stackspotAccountId: Ulid;
224
- serviceIds: Ulid[];
225
- };
226
- export type BaselineResponse = {
227
- /** The ID of baseline that will be updated */
228
- id: string;
229
- /** The baseline title */
230
- title: string;
231
- /** The date when that Baseline was published */
232
- publishedAt?: string;
233
- /** Status of the baseline, if it's published or a draft */
234
- status?: string;
235
- };
236
- export type BaselineRequest = {
237
- /** The baseline title */
238
- title: string;
239
- /** The date when that Baseline was published */
240
- publishedAt?: string;
241
- /** Status of the baseline, if it's published or a draft */
242
- status?: string;
243
- };
244
- export type BaselineDetails = {
245
- /** The baseline ID */
246
- id: string;
247
- };
248
- export type GuardrailStatusResponse = {
249
- /** The baseline id that GuardRail belongs */
250
- baselineId: string;
251
- /** The guardrail id */
252
- guardrailId: string;
253
- /** The GuardRail title */
254
- title: string;
255
- /** A description explaining what GuardRail do */
256
- description: string;
257
- /** Indicates if GuardRail is configurable for user */
258
- configurable: boolean;
259
- /** Implementation type of Guardrail */
260
- implementation: "RECOMENDATION" | "MANDATORY";
261
- /** Action taken by the Guardrail */
262
- action: "REMEDIATION" | "NOTIFICATION" | "NOT_IMPLEMENTED";
263
- /** Indicates if GuardRail is enabled */
264
- enabled: boolean;
265
- };
266
- export type GroupedGuardrailResponse = {
267
- /** The baseline id that GuardRail belongs */
268
- baselineId: string;
269
- /** The baseline title that GuardRail belongs */
270
- baselineTitle: string;
271
- /** All GuardRails attached to a Baseline */
272
- guardrails: GuardrailStatusResponse[];
273
- };
274
- export type DailyCostSummary = {
275
- date: string;
276
- cost: number;
277
- };
278
- export type CostByWorkspace = {
279
- /** Title of the workspace. */
280
- workspaceName: string;
281
- /** Cost associated with the workspace. */
282
- cost: number;
283
- };
284
- export type CostOverview = {
285
- /** Costs from the current month. */
286
- currentMonth: number;
287
- /** Costs from the last month. */
288
- lastMonth: number;
289
- /** Costs from the past three months. */
290
- lastThreeMonths: number;
291
- currentMonthAverage: number;
292
- currentMonthDaily: DailyCostSummary[];
293
- costByWorkspace: CostByWorkspace[];
294
- };
295
- export type AttachmentBase64 = {
296
- filename: string;
297
- base64: string;
298
- contentType: string;
299
- };
300
- export type AllocationCost = {
301
- name: string;
302
- costValue: number;
303
- };
304
- export type PaginatedResponseAllocationCost = {
305
- data: AllocationCost[];
306
- nextPage?: string;
307
- prevPage?: string;
308
- count: number;
309
- };
310
- export type AllocationCostDetails = {
311
- serviceName: string;
312
- stackSpotUsageType: string;
313
- quantity: number;
314
- costValue: number;
315
- };
316
- export type PaginatedResponseAllocationCostDetails = {
317
- data: AllocationCostDetails[];
318
- nextPage?: string;
319
- prevPage?: string;
320
- count: number;
321
- };
322
- export type ManagedResource = {
323
- /** Unique identifier. */
324
- id: string;
325
- /** The resource name. */
326
- name: string;
327
- cloudAccountId: string;
328
- cloudProviderRegion: string;
329
- /** The environment type. */
330
- environmentName: string;
331
- /** Created at. */
332
- createdAt?: string;
333
- /** The resource status. */
334
- status?: "Up" | "Down" | "Starting" | "Unknown";
335
- };
336
- export type ManagedResourceList = {
337
- data: ManagedResource[];
338
- pageToken?: string;
339
- };
340
- export type ServiceResource = {
341
- id: Ulid;
342
- /** The service resource name */
343
- name: string;
344
- };
345
- export type ManagedService = {
346
- /** Unique identifier. */
347
- id: string;
348
- /** The service name. */
349
- name: string;
350
- /** List of resources. */
351
- resources: ServiceResource[];
352
- };
353
- export type AccountCloudOfferResponse = {
354
- stackspotAccountId: string;
355
- offer: "Reseller" | "Managed" | "FullyManaged";
356
- };
357
- export type Alert = {
358
- /** Auto id of the alert. */
359
- id: string;
360
- /** Describe the pillar of the alert. It can be security, reliability or cost optimization. */
361
- pillar: "SECURITY" | "COST_OPTIMIZATION" | "RELIABILITY";
362
- /** Describe the environment of the alert. It can be production, staging or development. */
363
- environment: string;
364
- /** Workspace of the alert. */
365
- workspace: string;
366
- /** Describe the severity of the alert. It can be mandatory, high, medium or low. */
367
- severity: "LOW" | "MEDIUM" | "HIGH" | "MANDATORY";
368
- /** Describe the title of the alert. */
369
- title: string;
370
- /** Description of the alert. */
371
- description: string;
372
- /** Short description about what can be done in order to resolve the issue. */
373
- remediationText: string;
374
- /** Url that contains a detailed documentation to resolve the issue. */
375
- remediationUrl: string;
376
- /** Policy of the issue that created the alert. */
377
- awsPolicy: string;
378
- /** Id of the alert in AWS. */
379
- sourceAlertId: string;
380
- /** Id of the resource. */
381
- resourceId?: string;
382
- /** Status of the alert. It can be pending, completed or not applicable. */
383
- status: "PENDING" | "NOT_APPLICABLE" | "COMPLETED";
384
- };
385
- export type PaginatedResponseAlert = {
386
- data: Alert[];
387
- nextPage?: string;
388
- prevPage?: string;
389
- count: number;
390
- };
391
- export type ServiceSummary = {
392
- id: string;
393
- name: string;
394
- };
395
- /**
396
- * Update a GuardRail
397
- */
398
- export function updateGuardrail({ guardrailUpdate }: {
399
- guardrailUpdate: GuardrailUpdate;
400
- }, opts?: Oazapfts.RequestOpts) {
401
- return oazapfts.ok(oazapfts.fetchJson<{
402
- status: 200;
403
- } | {
404
- status: 422;
405
- data: {
406
- code: string;
407
- status: number;
408
- details: string;
409
- validationDetails?: ValidationDetails[];
410
- };
411
- } | {
412
- status: 500;
413
- data: {
414
- code: string;
415
- status: number;
416
- details: string;
417
- validationDetails?: ValidationDetails[];
418
- };
419
- }>("/admin/guardrail", oazapfts.json({
420
- ...opts,
421
- method: "PUT",
422
- body: guardrailUpdate
423
- })));
424
- }
425
- /**
426
- * Create a GuardRail
427
- */
428
- export function createGuardrail({ guardrailRequest }: {
429
- guardrailRequest: GuardrailRequest;
430
- }, opts?: Oazapfts.RequestOpts) {
431
- return oazapfts.ok(oazapfts.fetchJson<{
432
- status: 201;
433
- data: GuardrailDetails;
434
- } | {
435
- status: 422;
436
- data: {
437
- code: string;
438
- status: number;
439
- details: string;
440
- validationDetails?: ValidationDetails[];
441
- };
442
- } | {
443
- status: 500;
444
- data: {
445
- code: string;
446
- status: number;
447
- details: string;
448
- validationDetails?: ValidationDetails[];
449
- };
450
- }>("/admin/guardrail", oazapfts.json({
451
- ...opts,
452
- method: "POST",
453
- body: guardrailRequest
454
- })));
455
- }
456
- /**
457
- * Update a baseline
458
- */
459
- export function updateBaseline({ baselineId, baselineUpdate }: {
460
- baselineId: string;
461
- baselineUpdate: BaselineUpdate;
462
- }, opts?: Oazapfts.RequestOpts) {
463
- return oazapfts.ok(oazapfts.fetchJson<{
464
- status: 200;
465
- } | {
466
- status: 422;
467
- data: {
468
- code: string;
469
- status: number;
470
- details: string;
471
- validationDetails?: ValidationDetails[];
472
- };
473
- } | {
474
- status: 500;
475
- data: {
476
- code: string;
477
- status: number;
478
- details: string;
479
- validationDetails?: ValidationDetails[];
480
- };
481
- }>(`/admin/baseline/${encodeURIComponent(baselineId)}`, oazapfts.json({
482
- ...opts,
483
- method: "PUT",
484
- body: baselineUpdate
485
- })));
486
- }
487
- /**
488
- * Retrieves billing account summaries
489
- */
490
- export function listBillingAccounts({ stackSpotAccountId, showDeleted }: {
491
- stackSpotAccountId: string;
492
- showDeleted?: boolean;
493
- }, opts?: Oazapfts.RequestOpts) {
494
- return oazapfts.ok(oazapfts.fetchJson<{
495
- status: 200;
496
- data: BillingAccountSummaryResponse;
497
- } | {
498
- status: 401;
499
- } | {
500
- status: 422;
501
- data: {
502
- code: string;
503
- status: number;
504
- details: string;
505
- validationDetails?: ValidationDetails[];
506
- };
507
- } | {
508
- status: 500;
509
- data: {
510
- code: string;
511
- status: number;
512
- details: string;
513
- validationDetails?: ValidationDetails[];
514
- };
515
- }>(`/v2/finops/billing-accounts${QS.query(QS.explode({
516
- stackSpotAccountId,
517
- showDeleted
518
- }))}`, {
519
- ...opts
520
- }));
521
- }
522
- /**
523
- * Create new billing account
524
- */
525
- export function createBillingAccount({ billingAccountRequest }: {
526
- billingAccountRequest: BillingAccountRequest;
527
- }, opts?: Oazapfts.RequestOpts) {
528
- return oazapfts.ok(oazapfts.fetchJson<{
529
- status: 200;
530
- data: BillingAccountDetailsResponse;
531
- } | {
532
- status: 401;
533
- } | {
534
- status: 422;
535
- data: {
536
- code: string;
537
- status: number;
538
- details: string;
539
- validationDetails?: ValidationDetails[];
540
- };
541
- } | {
542
- status: 500;
543
- data: {
544
- code: string;
545
- status: number;
546
- details: string;
547
- validationDetails?: ValidationDetails[];
548
- };
549
- }>("/v2/finops/billing-accounts", oazapfts.json({
550
- ...opts,
551
- method: "POST",
552
- body: billingAccountRequest
553
- })));
554
- }
555
- /**
556
- * Retrieves cost and usage metrics for your account.
557
- */
558
- export function processAllocationCostRequest({ allocationCostRequest }: {
559
- allocationCostRequest: AllocationCostRequest;
560
- }, opts?: Oazapfts.RequestOpts) {
561
- return oazapfts.ok(oazapfts.fetchJson<{
562
- status: 200;
563
- data: AllocationCostResponse;
564
- } | {
565
- status: 202;
566
- data: AllocationCostResponse;
567
- } | {
568
- status: 400;
569
- data: ProblemDetail;
570
- } | {
571
- status: 422;
572
- data: {
573
- code: string;
574
- status: number;
575
- details: string;
576
- validationDetails?: ValidationDetails[];
577
- };
578
- } | {
579
- status: 500;
580
- data: {
581
- code: string;
582
- status: number;
583
- details: string;
584
- validationDetails?: ValidationDetails[];
585
- };
586
- }>("/v2/finops/allocation-cost", oazapfts.json({
587
- ...opts,
588
- method: "POST",
589
- body: allocationCostRequest
590
- })));
591
- }
592
- /**
593
- * Enable a GuardRail in any level
594
- */
595
- export function enableGuardrail({ account, workspace, env, enable, guardrailId }: {
596
- account: string;
597
- workspace?: string;
598
- env?: string;
599
- enable: boolean;
600
- guardrailId: string;
601
- }, opts?: Oazapfts.RequestOpts) {
602
- return oazapfts.ok(oazapfts.fetchJson<{
603
- status: 200;
604
- } | {
605
- status: 422;
606
- data: {
607
- code: string;
608
- status: number;
609
- details: string;
610
- validationDetails?: ValidationDetails[];
611
- };
612
- } | {
613
- status: 500;
614
- data: {
615
- code: string;
616
- status: number;
617
- details: string;
618
- validationDetails?: ValidationDetails[];
619
- };
620
- }>(`/guardrail/${encodeURIComponent(guardrailId)}${QS.query(QS.explode({
621
- account,
622
- workspace,
623
- env,
624
- enable
625
- }))}`, {
626
- ...opts,
627
- method: "POST"
628
- }));
629
- }
630
- /**
631
- * Register a cloud offer for a Stackspot Account.
632
- */
633
- export function registerOffer({ registerOfferRequest }: {
634
- registerOfferRequest: RegisterOfferRequest;
635
- }, opts?: Oazapfts.RequestOpts) {
636
- return oazapfts.ok(oazapfts.fetchJson<{
637
- status: 201;
638
- data: "100 CONTINUE" | "101 SWITCHING_PROTOCOLS" | "102 PROCESSING" | "103 EARLY_HINTS" | "103 CHECKPOINT" | "200 OK" | "201 CREATED" | "202 ACCEPTED" | "203 NON_AUTHORITATIVE_INFORMATION" | "204 NO_CONTENT" | "205 RESET_CONTENT" | "206 PARTIAL_CONTENT" | "207 MULTI_STATUS" | "208 ALREADY_REPORTED" | "226 IM_USED" | "300 MULTIPLE_CHOICES" | "301 MOVED_PERMANENTLY" | "302 FOUND" | "302 MOVED_TEMPORARILY" | "303 SEE_OTHER" | "304 NOT_MODIFIED" | "305 USE_PROXY" | "307 TEMPORARY_REDIRECT" | "308 PERMANENT_REDIRECT" | "400 BAD_REQUEST" | "401 UNAUTHORIZED" | "402 PAYMENT_REQUIRED" | "403 FORBIDDEN" | "404 NOT_FOUND" | "405 METHOD_NOT_ALLOWED" | "406 NOT_ACCEPTABLE" | "407 PROXY_AUTHENTICATION_REQUIRED" | "408 REQUEST_TIMEOUT" | "409 CONFLICT" | "410 GONE" | "411 LENGTH_REQUIRED" | "412 PRECONDITION_FAILED" | "413 PAYLOAD_TOO_LARGE" | "413 REQUEST_ENTITY_TOO_LARGE" | "414 URI_TOO_LONG" | "414 REQUEST_URI_TOO_LONG" | "415 UNSUPPORTED_MEDIA_TYPE" | "416 REQUESTED_RANGE_NOT_SATISFIABLE" | "417 EXPECTATION_FAILED" | "418 I_AM_A_TEAPOT" | "419 INSUFFICIENT_SPACE_ON_RESOURCE" | "420 METHOD_FAILURE" | "421 DESTINATION_LOCKED" | "422 UNPROCESSABLE_ENTITY" | "423 LOCKED" | "424 FAILED_DEPENDENCY" | "425 TOO_EARLY" | "426 UPGRADE_REQUIRED" | "428 PRECONDITION_REQUIRED" | "429 TOO_MANY_REQUESTS" | "431 REQUEST_HEADER_FIELDS_TOO_LARGE" | "451 UNAVAILABLE_FOR_LEGAL_REASONS" | "500 INTERNAL_SERVER_ERROR" | "501 NOT_IMPLEMENTED" | "502 BAD_GATEWAY" | "503 SERVICE_UNAVAILABLE" | "504 GATEWAY_TIMEOUT" | "505 HTTP_VERSION_NOT_SUPPORTED" | "506 VARIANT_ALSO_NEGOTIATES" | "507 INSUFFICIENT_STORAGE" | "508 LOOP_DETECTED" | "509 BANDWIDTH_LIMIT_EXCEEDED" | "510 NOT_EXTENDED" | "511 NETWORK_AUTHENTICATION_REQUIRED";
639
- } | {
640
- status: 422;
641
- data: {
642
- code: string;
643
- status: number;
644
- details: string;
645
- validationDetails?: ValidationDetails[];
646
- };
647
- } | {
648
- status: 500;
649
- data: {
650
- code: string;
651
- status: number;
652
- details: string;
653
- validationDetails?: ValidationDetails[];
654
- };
655
- }>("/cloud-offer", oazapfts.json({
656
- ...opts,
657
- method: "POST",
658
- body: registerOfferRequest
659
- })));
660
- }
661
- export function createNewContract({ createContractRequest }: {
662
- createContractRequest: CreateContractRequest;
663
- }, opts?: Oazapfts.RequestOpts) {
664
- return oazapfts.ok(oazapfts.fetchJson<{
665
- status: 201;
666
- data: Contract;
667
- } | {
668
- status: 422;
669
- data: {
670
- code: string;
671
- status: number;
672
- details: string;
673
- validationDetails?: ValidationDetails[];
674
- };
675
- } | {
676
- status: 500;
677
- data: {
678
- code: string;
679
- status: number;
680
- details: string;
681
- validationDetails?: ValidationDetails[];
682
- };
683
- }>("/admin/finops/contract", oazapfts.json({
684
- ...opts,
685
- method: "POST",
686
- body: createContractRequest
687
- })));
688
- }
689
- /**
690
- * Links services to a Stackspot account, allowing users from that account to see resources in CRE
691
- */
692
- export function linkResourceTypesToStackspotAccount({ linkResourceTypeToStackspotAccountRequest }: {
693
- linkResourceTypeToStackspotAccountRequest: LinkResourceTypeToStackspotAccountRequest;
694
- }, opts?: Oazapfts.RequestOpts) {
695
- return oazapfts.ok(oazapfts.fetchJson<{
696
- status: 200;
697
- data: "100 CONTINUE" | "101 SWITCHING_PROTOCOLS" | "102 PROCESSING" | "103 EARLY_HINTS" | "103 CHECKPOINT" | "200 OK" | "201 CREATED" | "202 ACCEPTED" | "203 NON_AUTHORITATIVE_INFORMATION" | "204 NO_CONTENT" | "205 RESET_CONTENT" | "206 PARTIAL_CONTENT" | "207 MULTI_STATUS" | "208 ALREADY_REPORTED" | "226 IM_USED" | "300 MULTIPLE_CHOICES" | "301 MOVED_PERMANENTLY" | "302 FOUND" | "302 MOVED_TEMPORARILY" | "303 SEE_OTHER" | "304 NOT_MODIFIED" | "305 USE_PROXY" | "307 TEMPORARY_REDIRECT" | "308 PERMANENT_REDIRECT" | "400 BAD_REQUEST" | "401 UNAUTHORIZED" | "402 PAYMENT_REQUIRED" | "403 FORBIDDEN" | "404 NOT_FOUND" | "405 METHOD_NOT_ALLOWED" | "406 NOT_ACCEPTABLE" | "407 PROXY_AUTHENTICATION_REQUIRED" | "408 REQUEST_TIMEOUT" | "409 CONFLICT" | "410 GONE" | "411 LENGTH_REQUIRED" | "412 PRECONDITION_FAILED" | "413 PAYLOAD_TOO_LARGE" | "413 REQUEST_ENTITY_TOO_LARGE" | "414 URI_TOO_LONG" | "414 REQUEST_URI_TOO_LONG" | "415 UNSUPPORTED_MEDIA_TYPE" | "416 REQUESTED_RANGE_NOT_SATISFIABLE" | "417 EXPECTATION_FAILED" | "418 I_AM_A_TEAPOT" | "419 INSUFFICIENT_SPACE_ON_RESOURCE" | "420 METHOD_FAILURE" | "421 DESTINATION_LOCKED" | "422 UNPROCESSABLE_ENTITY" | "423 LOCKED" | "424 FAILED_DEPENDENCY" | "425 TOO_EARLY" | "426 UPGRADE_REQUIRED" | "428 PRECONDITION_REQUIRED" | "429 TOO_MANY_REQUESTS" | "431 REQUEST_HEADER_FIELDS_TOO_LARGE" | "451 UNAVAILABLE_FOR_LEGAL_REASONS" | "500 INTERNAL_SERVER_ERROR" | "501 NOT_IMPLEMENTED" | "502 BAD_GATEWAY" | "503 SERVICE_UNAVAILABLE" | "504 GATEWAY_TIMEOUT" | "505 HTTP_VERSION_NOT_SUPPORTED" | "506 VARIANT_ALSO_NEGOTIATES" | "507 INSUFFICIENT_STORAGE" | "508 LOOP_DETECTED" | "509 BANDWIDTH_LIMIT_EXCEEDED" | "510 NOT_EXTENDED" | "511 NETWORK_AUTHENTICATION_REQUIRED";
698
- } | {
699
- status: 422;
700
- data: {
701
- code: string;
702
- status: number;
703
- details: string;
704
- validationDetails?: ValidationDetails[];
705
- };
706
- } | {
707
- status: 500;
708
- data: {
709
- code: string;
710
- status: number;
711
- details: string;
712
- validationDetails?: ValidationDetails[];
713
- };
714
- }>("/admin/cloud-resource/link-service-to-stackspot-account", oazapfts.json({
715
- ...opts,
716
- method: "POST",
717
- body: linkResourceTypeToStackspotAccountRequest
718
- })));
719
- }
720
- /**
721
- * Return all baseline registered
722
- */
723
- export function getBaselines(opts?: Oazapfts.RequestOpts) {
724
- return oazapfts.ok(oazapfts.fetchJson<{
725
- status: 200;
726
- data: BaselineResponse[];
727
- } | {
728
- status: 422;
729
- data: {
730
- code: string;
731
- status: number;
732
- details: string;
733
- validationDetails?: ValidationDetails[];
734
- };
735
- } | {
736
- status: 500;
737
- data: {
738
- code: string;
739
- status: number;
740
- details: string;
741
- validationDetails?: ValidationDetails[];
742
- };
743
- }>("/admin/baseline", {
744
- ...opts
745
- }));
746
- }
747
- /**
748
- * Create a baseline
749
- */
750
- export function createBaseline({ baselineRequest }: {
751
- baselineRequest: BaselineRequest;
752
- }, opts?: Oazapfts.RequestOpts) {
753
- return oazapfts.ok(oazapfts.fetchJson<{
754
- status: 201;
755
- data: BaselineDetails;
756
- } | {
757
- status: 422;
758
- data: {
759
- code: string;
760
- status: number;
761
- details: string;
762
- validationDetails?: ValidationDetails[];
763
- };
764
- } | {
765
- status: 500;
766
- data: {
767
- code: string;
768
- status: number;
769
- details: string;
770
- validationDetails?: ValidationDetails[];
771
- };
772
- }>("/admin/baseline", oazapfts.json({
773
- ...opts,
774
- method: "POST",
775
- body: baselineRequest
776
- })));
777
- }
778
- /**
779
- * Retrieves details from a billing account
780
- */
781
- export function getBillingAccountById({ stackSpotAccountId, billingAccountId }: {
782
- stackSpotAccountId: string;
783
- billingAccountId: string;
784
- }, opts?: Oazapfts.RequestOpts) {
785
- return oazapfts.ok(oazapfts.fetchJson<{
786
- status: 200;
787
- data: BillingAccountDetailsResponse;
788
- } | {
789
- status: 401;
790
- } | {
791
- status: 404;
792
- } | {
793
- status: 422;
794
- data: {
795
- code: string;
796
- status: number;
797
- details: string;
798
- validationDetails?: ValidationDetails[];
799
- };
800
- } | {
801
- status: 500;
802
- data: {
803
- code: string;
804
- status: number;
805
- details: string;
806
- validationDetails?: ValidationDetails[];
807
- };
808
- }>(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
809
- stackSpotAccountId
810
- }))}`, {
811
- ...opts
812
- }));
813
- }
814
- /**
815
- * Delete a billing account
816
- */
817
- export function deleteBillingAccountById({ stackSpotAccountId, billingAccountId }: {
818
- stackSpotAccountId: string;
819
- billingAccountId: string;
820
- }, opts?: Oazapfts.RequestOpts) {
821
- return oazapfts.ok(oazapfts.fetchJson<{
822
- status: 200;
823
- data: BillingAccountDetailsResponse;
824
- } | {
825
- status: 401;
826
- } | {
827
- status: 404;
828
- } | {
829
- status: 422;
830
- data: {
831
- code: string;
832
- status: number;
833
- details: string;
834
- validationDetails?: ValidationDetails[];
835
- };
836
- } | {
837
- status: 500;
838
- data: {
839
- code: string;
840
- status: number;
841
- details: string;
842
- validationDetails?: ValidationDetails[];
843
- };
844
- }>(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
845
- stackSpotAccountId
846
- }))}`, {
847
- ...opts,
848
- method: "DELETE"
849
- }));
850
- }
851
- /**
852
- * Get all GuardRails
853
- */
854
- export function getGuardrails({ account, workspace, env }: {
855
- account: string;
856
- workspace?: string;
857
- env?: string;
858
- }, opts?: Oazapfts.RequestOpts) {
859
- return oazapfts.ok(oazapfts.fetchJson<{
860
- status: 200;
861
- data: GroupedGuardrailResponse[];
862
- } | {
863
- status: 422;
864
- data: {
865
- code: string;
866
- status: number;
867
- details: string;
868
- validationDetails?: ValidationDetails[];
869
- };
870
- } | {
871
- status: 500;
872
- data: {
873
- code: string;
874
- status: number;
875
- details: string;
876
- validationDetails?: ValidationDetails[];
877
- };
878
- }>(`/guardrail${QS.query(QS.explode({
879
- account,
880
- workspace,
881
- env
882
- }))}`, {
883
- ...opts
884
- }));
885
- }
886
- /**
887
- * Get overview of costs, with current month, last month and three last month
888
- */
889
- export function getCostOverview({ sortBy, sortOrder }: {
890
- sortBy?: string;
891
- sortOrder?: string;
892
- }, opts?: Oazapfts.RequestOpts) {
893
- return oazapfts.ok(oazapfts.fetchJson<{
894
- status: 200;
895
- data: CostOverview;
896
- } | {
897
- status: 422;
898
- data: {
899
- code: string;
900
- status: number;
901
- details: string;
902
- validationDetails?: ValidationDetails[];
903
- };
904
- } | {
905
- status: 500;
906
- data: {
907
- code: string;
908
- status: number;
909
- details: string;
910
- validationDetails?: ValidationDetails[];
911
- };
912
- }>(`/finops/reports${QS.query(QS.explode({
913
- sortBy,
914
- sortOrder
915
- }))}`, {
916
- ...opts
917
- }));
918
- }
919
- export function downloadCsvFiles({ year, month }: {
920
- year: number;
921
- month: number;
922
- }, opts?: Oazapfts.RequestOpts) {
923
- return oazapfts.ok(oazapfts.fetchJson<{
924
- status: 200;
925
- data: AttachmentBase64;
926
- } | {
927
- status: 422;
928
- data: {
929
- code: string;
930
- status: number;
931
- details: string;
932
- validationDetails?: ValidationDetails[];
933
- };
934
- } | {
935
- status: 500;
936
- data: {
937
- code: string;
938
- status: number;
939
- details: string;
940
- validationDetails?: ValidationDetails[];
941
- };
942
- }>(`/finops/reports/download${QS.query(QS.explode({
943
- year,
944
- month
945
- }))}`, {
946
- ...opts
947
- }));
948
- }
949
- /**
950
- * List all tags.
951
- */
952
- export function getAllTags({ stackspotAccountId }: {
953
- stackspotAccountId: string;
954
- }, opts?: Oazapfts.RequestOpts) {
955
- return oazapfts.ok(oazapfts.fetchJson<{
956
- status: 200;
957
- data: string[];
958
- } | {
959
- status: 422;
960
- data: {
961
- code: string;
962
- status: number;
963
- details: string;
964
- validationDetails?: ValidationDetails[];
965
- };
966
- } | {
967
- status: 500;
968
- data: {
969
- code: string;
970
- status: number;
971
- details: string;
972
- validationDetails?: ValidationDetails[];
973
- };
974
- }>(`/finops/allocation-cost-list-tags${QS.query(QS.explode({
975
- stackspotAccountId
976
- }))}`, {
977
- ...opts
978
- }));
979
- }
980
- /**
981
- * lists all subTags of a given tag with their respective costs.
982
- */
983
- export function getAllocationCostTagValues({ masterAccount, tag, startDate, endDate, sort, page, pageSize }: {
984
- masterAccount: string;
985
- tag: string;
986
- startDate: string;
987
- endDate: string;
988
- sort?: ("NAME_ASC" | "NAME_DESC" | "COST_VALUE_ASC" | "COST_VALUE_DESC")[];
989
- page?: number;
990
- pageSize?: number;
991
- }, opts?: Oazapfts.RequestOpts) {
992
- return oazapfts.ok(oazapfts.fetchJson<{
993
- status: 200;
994
- data: PaginatedResponseAllocationCost;
995
- } | {
996
- status: 422;
997
- data: {
998
- code: string;
999
- status: number;
1000
- details: string;
1001
- validationDetails?: ValidationDetails[];
1002
- };
1003
- } | {
1004
- status: 500;
1005
- data: {
1006
- code: string;
1007
- status: number;
1008
- details: string;
1009
- validationDetails?: ValidationDetails[];
1010
- };
1011
- }>(`/finops/allocation-cost-list-tag-values${QS.query(QS.explode({
1012
- masterAccount,
1013
- tag,
1014
- startDate,
1015
- endDate,
1016
- sort,
1017
- page,
1018
- pageSize
1019
- }))}`, {
1020
- ...opts
1021
- }));
1022
- }
1023
- /**
1024
- * List all services of a subtag. Each service contains name and cost value.
1025
- */
1026
- export function getAllocationCostServices({ masterAccount, tag, tagValueName, startDate, endDate, sort, page, pageSize }: {
1027
- masterAccount: string;
1028
- tag: string;
1029
- tagValueName: string;
1030
- startDate: string;
1031
- endDate: string;
1032
- sort?: ("NAME_ASC" | "NAME_DESC" | "COST_VALUE_ASC" | "COST_VALUE_DESC")[];
1033
- page?: number;
1034
- pageSize?: number;
1035
- }, opts?: Oazapfts.RequestOpts) {
1036
- return oazapfts.ok(oazapfts.fetchJson<{
1037
- status: 200;
1038
- data: PaginatedResponseAllocationCost;
1039
- } | {
1040
- status: 422;
1041
- data: {
1042
- code: string;
1043
- status: number;
1044
- details: string;
1045
- validationDetails?: ValidationDetails[];
1046
- };
1047
- } | {
1048
- status: 500;
1049
- data: {
1050
- code: string;
1051
- status: number;
1052
- details: string;
1053
- validationDetails?: ValidationDetails[];
1054
- };
1055
- }>(`/finops/allocation-cost-list-services${QS.query(QS.explode({
1056
- masterAccount,
1057
- tag,
1058
- tagValueName,
1059
- startDate,
1060
- endDate,
1061
- sort,
1062
- page,
1063
- pageSize
1064
- }))}`, {
1065
- ...opts
1066
- }));
1067
- }
1068
- /**
1069
- * list service details
1070
- */
1071
- export function getAllocationCostServiceDetails({ masterAccount, tag, tagValueName, serviceName, startDate, endDate, $type, filter, page, pageSize, sort }: {
1072
- masterAccount: string;
1073
- tag: string;
1074
- tagValueName: string;
1075
- serviceName: string;
1076
- startDate: string;
1077
- endDate: string;
1078
- $type: string;
1079
- filter?: string[];
1080
- page?: number;
1081
- pageSize?: number;
1082
- sort?: ("NAME_ASC" | "NAME_DESC" | "COST_VALUE_ASC" | "COST_VALUE_DESC")[];
1083
- }, opts?: Oazapfts.RequestOpts) {
1084
- return oazapfts.ok(oazapfts.fetchJson<{
1085
- status: 200;
1086
- data: PaginatedResponseAllocationCostDetails;
1087
- } | {
1088
- status: 422;
1089
- data: {
1090
- code: string;
1091
- status: number;
1092
- details: string;
1093
- validationDetails?: ValidationDetails[];
1094
- };
1095
- } | {
1096
- status: 500;
1097
- data: {
1098
- code: string;
1099
- status: number;
1100
- details: string;
1101
- validationDetails?: ValidationDetails[];
1102
- };
1103
- }>(`/finops/allocation-cost-list-service-details${QS.query(QS.explode({
1104
- masterAccount,
1105
- tag,
1106
- tagValueName,
1107
- serviceName,
1108
- startDate,
1109
- endDate,
1110
- "type": $type,
1111
- filter,
1112
- page,
1113
- pageSize,
1114
- sort
1115
- }))}`, {
1116
- ...opts
1117
- }));
1118
- }
1119
- /**
1120
- * list all master accounts
1121
- */
1122
- export function getAllMasterAccount({ stackspotAccountId }: {
1123
- stackspotAccountId: string;
1124
- }, opts?: Oazapfts.RequestOpts) {
1125
- return oazapfts.ok(oazapfts.fetchJson<{
1126
- status: 200;
1127
- data: string[];
1128
- } | {
1129
- status: 422;
1130
- data: {
1131
- code: string;
1132
- status: number;
1133
- details: string;
1134
- validationDetails?: ValidationDetails[];
1135
- };
1136
- } | {
1137
- status: 500;
1138
- data: {
1139
- code: string;
1140
- status: number;
1141
- details: string;
1142
- validationDetails?: ValidationDetails[];
1143
- };
1144
- }>(`/finops/allocation-cost-list-master-accounts${QS.query(QS.explode({
1145
- stackspotAccountId
1146
- }))}`, {
1147
- ...opts
1148
- }));
1149
- }
1150
- /**
1151
- * list filters related to the type
1152
- */
1153
- export function getAllocationCostFilters({ $type }: {
1154
- $type: "SUB_ACCOUNT_ID" | "REGION";
1155
- }, opts?: Oazapfts.RequestOpts) {
1156
- return oazapfts.ok(oazapfts.fetchJson<{
1157
- status: 200;
1158
- data: string[];
1159
- } | {
1160
- status: 422;
1161
- data: {
1162
- code: string;
1163
- status: number;
1164
- details: string;
1165
- validationDetails?: ValidationDetails[];
1166
- };
1167
- } | {
1168
- status: 500;
1169
- data: {
1170
- code: string;
1171
- status: number;
1172
- details: string;
1173
- validationDetails?: ValidationDetails[];
1174
- };
1175
- }>(`/finops/allocation-cost-filters${QS.query(QS.explode({
1176
- "type": $type
1177
- }))}`, {
1178
- ...opts
1179
- }));
1180
- }
1181
- /**
1182
- * returns the detailed csv with the masterAccount CUR information
1183
- */
1184
- export function getAllocationCostCsv({ stackspotAccountId, masterAccount, startDate, endDate }: {
1185
- stackspotAccountId: string;
1186
- masterAccount: string;
1187
- startDate: string;
1188
- endDate: string;
1189
- }, opts?: Oazapfts.RequestOpts) {
1190
- return oazapfts.ok(oazapfts.fetchJson<{
1191
- status: 200;
1192
- data: AttachmentBase64;
1193
- } | {
1194
- status: 422;
1195
- data: {
1196
- code: string;
1197
- status: number;
1198
- details: string;
1199
- validationDetails?: ValidationDetails[];
1200
- };
1201
- } | {
1202
- status: 500;
1203
- data: {
1204
- code: string;
1205
- status: number;
1206
- details: string;
1207
- validationDetails?: ValidationDetails[];
1208
- };
1209
- }>(`/finops/allocation-cost-csv${QS.query(QS.explode({
1210
- stackspotAccountId,
1211
- masterAccount,
1212
- startDate,
1213
- endDate
1214
- }))}`, {
1215
- ...opts
1216
- }));
1217
- }
1218
- /**
1219
- * List Instances of a particular Service Resource running in a Workspace
1220
- */
1221
- export function listInstances({ workspaceId, resourceId, pageToken, search }: {
1222
- workspaceId: string;
1223
- resourceId: string;
1224
- pageToken?: string;
1225
- search?: string;
1226
- }, opts?: Oazapfts.RequestOpts) {
1227
- return oazapfts.ok(oazapfts.fetchJson<{
1228
- status: 200;
1229
- data: ManagedResourceList;
1230
- } | {
1231
- status: 422;
1232
- data: {
1233
- code: string;
1234
- status: number;
1235
- details: string;
1236
- validationDetails?: ValidationDetails[];
1237
- };
1238
- } | {
1239
- status: 500;
1240
- data: {
1241
- code: string;
1242
- status: number;
1243
- details: string;
1244
- validationDetails?: ValidationDetails[];
1245
- };
1246
- }>(`/cloud-resource/workspace/${encodeURIComponent(workspaceId)}/resource/${encodeURIComponent(resourceId)}/instance${QS.query(QS.explode({
1247
- pageToken,
1248
- search
1249
- }))}`, {
1250
- ...opts
1251
- }));
1252
- }
1253
- /**
1254
- * List Managed Services
1255
- */
1256
- export function listServices(opts?: Oazapfts.RequestOpts) {
1257
- return oazapfts.ok(oazapfts.fetchJson<{
1258
- status: 200;
1259
- data: ManagedService[];
1260
- } | {
1261
- status: 422;
1262
- data: {
1263
- code: string;
1264
- status: number;
1265
- details: string;
1266
- validationDetails?: ValidationDetails[];
1267
- };
1268
- } | {
1269
- status: 500;
1270
- data: {
1271
- code: string;
1272
- status: number;
1273
- details: string;
1274
- validationDetails?: ValidationDetails[];
1275
- };
1276
- }>("/cloud-resource/service", {
1277
- ...opts
1278
- }));
1279
- }
1280
- /**
1281
- * A detailed description of a particular Instance
1282
- */
1283
- export function getInstanceDetails({ cloudAccountId, resourceId, instanceId }: {
1284
- cloudAccountId: string;
1285
- resourceId: string;
1286
- instanceId: string;
1287
- }, opts?: Oazapfts.RequestOpts) {
1288
- return oazapfts.ok(oazapfts.fetchJson<{
1289
- status: 200;
1290
- data: object;
1291
- } | {
1292
- status: 422;
1293
- data: {
1294
- code: string;
1295
- status: number;
1296
- details: string;
1297
- validationDetails?: ValidationDetails[];
1298
- };
1299
- } | {
1300
- status: 500;
1301
- data: {
1302
- code: string;
1303
- status: number;
1304
- details: string;
1305
- validationDetails?: ValidationDetails[];
1306
- };
1307
- }>(`/cloud-resource/cloud-account/${encodeURIComponent(cloudAccountId)}/resource/${encodeURIComponent(resourceId)}/instance/${encodeURIComponent(instanceId)}`, {
1308
- ...opts
1309
- }));
1310
- }
1311
- /**
1312
- * Get the cloud offer of a Stackspot Account.
1313
- */
1314
- export function getOfferOfAccount({ id }: {
1315
- id: string;
1316
- }, opts?: Oazapfts.RequestOpts) {
1317
- return oazapfts.ok(oazapfts.fetchJson<{
1318
- status: 200;
1319
- data: AccountCloudOfferResponse;
1320
- } | {
1321
- status: 422;
1322
- data: {
1323
- code: string;
1324
- status: number;
1325
- details: string;
1326
- validationDetails?: ValidationDetails[];
1327
- };
1328
- } | {
1329
- status: 500;
1330
- data: {
1331
- code: string;
1332
- status: number;
1333
- details: string;
1334
- validationDetails?: ValidationDetails[];
1335
- };
1336
- }>(`/cloud-offer/account/${encodeURIComponent(id)}`, {
1337
- ...opts
1338
- }));
1339
- }
1340
- /**
1341
- * Get pages alerts from workspace and environment. That alerts can be filtered
1342
- */
1343
- export function getAlerts({ workspace, env, pillar, severity, status, search, sort, page, pageSize }: {
1344
- workspace: string;
1345
- env: string;
1346
- pillar?: "SECURITY" | "COST_OPTIMIZATION" | "RELIABILITY";
1347
- severity?: "LOW" | "MEDIUM" | "HIGH" | "MANDATORY";
1348
- status?: "PENDING" | "NOT_APPLICABLE" | "COMPLETED";
1349
- search?: string;
1350
- sort?: ("STATUS_ASC" | "STATUS_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PILLAR_ASC" | "PILLAR_DESC" | "SEVERITY_ASC" | "SEVERITY_DESC")[];
1351
- page?: number;
1352
- pageSize?: number;
1353
- }, opts?: Oazapfts.RequestOpts) {
1354
- return oazapfts.ok(oazapfts.fetchJson<{
1355
- status: 200;
1356
- data: PaginatedResponseAlert;
1357
- } | {
1358
- status: 422;
1359
- data: {
1360
- code: string;
1361
- status: number;
1362
- details: string;
1363
- validationDetails?: ValidationDetails[];
1364
- };
1365
- } | {
1366
- status: 500;
1367
- data: {
1368
- code: string;
1369
- status: number;
1370
- details: string;
1371
- validationDetails?: ValidationDetails[];
1372
- };
1373
- }>(`/alerts${QS.query(QS.explode({
1374
- workspace,
1375
- env,
1376
- pillar,
1377
- severity,
1378
- status,
1379
- search,
1380
- sort,
1381
- page,
1382
- pageSize
1383
- }))}`, {
1384
- ...opts
1385
- }));
1386
- }
1387
- export function downloadDataByAccountId({ stackspotAccountId, year, month }: {
1388
- stackspotAccountId: string;
1389
- year: number;
1390
- month: number;
1391
- }, opts?: Oazapfts.RequestOpts) {
1392
- return oazapfts.ok(oazapfts.fetchJson<{
1393
- status: 200;
1394
- data: AttachmentBase64;
1395
- } | {
1396
- status: 422;
1397
- data: {
1398
- code: string;
1399
- status: number;
1400
- details: string;
1401
- validationDetails?: ValidationDetails[];
1402
- };
1403
- } | {
1404
- status: 500;
1405
- data: {
1406
- code: string;
1407
- status: number;
1408
- details: string;
1409
- validationDetails?: ValidationDetails[];
1410
- };
1411
- }>(`/admin/finops/reports/download${QS.query(QS.explode({
1412
- stackspot_account_id: stackspotAccountId,
1413
- year,
1414
- month
1415
- }))}`, {
1416
- ...opts
1417
- }));
1418
- }
1419
- /**
1420
- * List available services
1421
- */
1422
- export function listServices1(opts?: Oazapfts.RequestOpts) {
1423
- return oazapfts.ok(oazapfts.fetchJson<{
1424
- status: 200;
1425
- data: ServiceSummary[];
1426
- } | {
1427
- status: 422;
1428
- data: {
1429
- code: string;
1430
- status: number;
1431
- details: string;
1432
- validationDetails?: ValidationDetails[];
1433
- };
1434
- } | {
1435
- status: 500;
1436
- data: {
1437
- code: string;
1438
- status: number;
1439
- details: string;
1440
- validationDetails?: ValidationDetails[];
1441
- };
1442
- }>("/admin/cloud-resource/service", {
1443
- ...opts
1444
- }));
1445
- }
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: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
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
+ export type GuardrailUpdate = {
18
+ /** The ID of GuardRail that will be updated */
19
+ id: string;
20
+ /** The GuardRail title */
21
+ title?: string;
22
+ /** A description explaining what GuardRail do */
23
+ description?: string;
24
+ /** Indicates if GuardRail is active to users use it */
25
+ active?: boolean;
26
+ /** Indicates if GuardRail is configurable for user */
27
+ configurable?: boolean;
28
+ /** Type of implementation */
29
+ implementation?: "RECOMENDATION" | "MANDATORY";
30
+ /** Type of action taken by GuardRail */
31
+ action?: "REMEDIATION" | "NOTIFICATION" | "NOT_IMPLEMENTED";
32
+ /** The type of GuardRail. [SCP, GUARDRAIL] */
33
+ "type"?: "SCP" | "GUARDRAIL";
34
+ };
35
+ export type ValidationDetails = {
36
+ code: string;
37
+ field?: string;
38
+ details?: string;
39
+ values?: string[];
40
+ };
41
+ export type GuardrailRequest = {
42
+ /** The baseline id that GuardRail belongs */
43
+ baselineId: string;
44
+ /** The GuardRail title */
45
+ title: string;
46
+ /** A description explaining what GuardRail do */
47
+ description: string;
48
+ /** Indicates if GuardRail is active to users use it */
49
+ active: boolean;
50
+ /** Indicates if GuardRail is configurable for user */
51
+ configurable: boolean;
52
+ /** Type of implementation */
53
+ implementation: "RECOMENDATION" | "MANDATORY";
54
+ /** Type of action taken by GuardRail */
55
+ action: "REMEDIATION" | "NOTIFICATION" | "NOT_IMPLEMENTED";
56
+ /** The type of GuardRail. [SCP, GUARDRAIL] */
57
+ "type": "SCP" | "GUARDRAIL";
58
+ };
59
+ export type GuardrailDetails = {
60
+ /** The guardrail ID */
61
+ id: string;
62
+ };
63
+ export type BaselineUpdate = {
64
+ /** The baseline title */
65
+ title: string;
66
+ /** The date when that Baseline was published */
67
+ publishedAt?: string;
68
+ /** Status of the baseline, if it's published or a draft */
69
+ status?: string;
70
+ };
71
+ export type BillingAccountSummaryResponse = {
72
+ /** ULID identifier for each billing account. */
73
+ id: string;
74
+ /** Slug identifier for each billing account. */
75
+ name: string;
76
+ /** StackSpot's ULID identifier for each client. */
77
+ stackSpotAccountId: string;
78
+ };
79
+ export type BillingAccountRequest = {
80
+ /** Slug identifier for each billing account. */
81
+ name: string;
82
+ /** StackSpot's ULID identifier for each client. */
83
+ stackSpotAccountId: string;
84
+ /** The AWS S3 bucket name used for CUR (Cost and Usage Report). */
85
+ awsCurBucketName: string;
86
+ /** The AWS region where the CUR bucket is located. */
87
+ awsCurBucketRegion: string;
88
+ /** The name of the AWS CUR report. */
89
+ awsCurReportName: string;
90
+ /** The prefix used in the AWS CUR bucket for reports. */
91
+ awsCurPrefix: string;
92
+ /** The AWS IAM Role ARN with permissions to access CUR data. */
93
+ awsRoleArn: string;
94
+ /** The AWS Secret Manager secret ARN containing the External ID. */
95
+ awsSecretIdArn: string;
96
+ };
97
+ export type BillingAccountDetailsResponse = {
98
+ /** ULID identifier for each billing account. */
99
+ id: string;
100
+ /** Slug identifier for each billing account. */
101
+ name: string;
102
+ /** StackSpot's ULID identifier for each client. */
103
+ stackSpotAccountId: string;
104
+ /** The AWS S3 bucket name used for CUR (Cost and Usage Report). */
105
+ awsCurBucketName: string;
106
+ /** The AWS region where the CUR bucket is located. */
107
+ awsCurBucketRegion: string;
108
+ /** The name of the AWS CUR report. */
109
+ awsCurReportName: string;
110
+ /** The prefix used in the AWS CUR bucket for reports. */
111
+ awsCurPrefix: string;
112
+ /** The AWS IAM Role ARN with permissions to access CUR data. */
113
+ awsRoleArn: string;
114
+ /** The AWS Secret Manager secret ARN containing the External ID. */
115
+ awsSecretIdArn?: string;
116
+ /** Timestamp of when the billing account was marked as deleted. */
117
+ deletedAt?: string;
118
+ /** Timestamp of when the billing account was created. */
119
+ createdAt: string;
120
+ /** Timestamp of the last update to the billing account. */
121
+ updatedAt: string;
122
+ };
123
+ export type Ulid = {
124
+ value: string;
125
+ };
126
+ export type Filter = {
127
+ /** A categorical attribute for context or categorization in billing data. */
128
+ "type": "REGION" | "SERVICE_NAME" | "SUB_ACCOUNT_ID" | "TAG_KEY" | "TAG_VALUE";
129
+ /** Defines the exact value the filter will look for within the specified type. */
130
+ value: string;
131
+ };
132
+ export type ChargePeriod = {
133
+ /** Represents the end date of the charge period. */
134
+ end: string;
135
+ /** Represents the end date of the charge period. */
136
+ start: string;
137
+ };
138
+ export type AllocationCostRequest = {
139
+ /** StackSpot's ULID identifier for each client. */
140
+ stackSpotAccountId: string;
141
+ /** StackSpot-assigned ULID identifiers for a billing account. */
142
+ billingAccountId: Ulid[];
143
+ /** StackSpot-assigned ULID identifiers for a billing account. */
144
+ filter: Filter[];
145
+ /** Defines the row's time-based granularity. */
146
+ granularity: "PERIOD" | "MONTH";
147
+ /** A categorical attribute that provides context or categorization to billing data. */
148
+ dimension: "SERVICE_NAME" | "TAG" | "USAGE_UNIT";
149
+ chargePeriod: ChargePeriod;
150
+ };
151
+ export type ServiceNameResponse = GetCostAndUsageData & {
152
+ chargePeriod?: ChargePeriod;
153
+ /** Represents an offering that can be purchased from a cloud provider. */
154
+ serviceName?: string;
155
+ /** Effective cost post discounts and amortizations. */
156
+ effectiveCost?: number;
157
+ };
158
+ export type TagResponse = GetCostAndUsageData & {
159
+ chargePeriod?: ChargePeriod;
160
+ /** Tag key: Identifies a grouping attribute or category for resources or constructs. */
161
+ tagKey?: string;
162
+ /** Tag value: Specifies the group or category detail that the resource or construct belongs to. */
163
+ tagValue?: string;
164
+ /** Effective cost post discounts and amortizations. */
165
+ effectiveCost?: number;
166
+ };
167
+ export type UsageUnitResponse = GetCostAndUsageData & {
168
+ chargePeriod?: ChargePeriod;
169
+ /** Represents an offering that can be purchased from a cloud provider. */
170
+ serviceName?: string;
171
+ /** Represents the volume of a given resource or service used or purchased based on the Usage Unit. */
172
+ usageQuantity?: number;
173
+ /** Defines the unit of measurement for the resource or service. */
174
+ usageUnit?: string;
175
+ /** Effective cost post discounts and amortizations. */
176
+ effectiveCost?: number;
177
+ };
178
+ export type GetCostAndUsageData = ({
179
+ "type": "ServiceNameResponse";
180
+ } & ServiceNameResponse) | ({
181
+ "type": "TagResponse";
182
+ } & TagResponse) | ({
183
+ "type": "UsageUnitResponse";
184
+ } & UsageUnitResponse);
185
+ export type AllocationCostResponse = {
186
+ /** Unique identifier for the task, used for tracking and retrieval. */
187
+ id: string;
188
+ /** Current status of the task, indicating its lifecycle phase. */
189
+ status: "PROCESSING" | "SUCCESS" | "ERROR";
190
+ /** Contains processed data, available when status is SUCCESS. */
191
+ data: GetCostAndUsageData[];
192
+ /** Optional details on processing status, providing task insights or error explanations. */
193
+ message: string;
194
+ };
195
+ export type ProblemDetail = {
196
+ "type"?: string;
197
+ title?: string;
198
+ status?: number;
199
+ detail?: string;
200
+ instance?: string;
201
+ properties?: {
202
+ [key: string]: object;
203
+ };
204
+ };
205
+ export type RegisterOfferRequest = {
206
+ /** The Stackspot account ID to associate the offer with */
207
+ stackspotAccountId: string;
208
+ /** The Cloud Offer type to be registered */
209
+ cloudOffer: "Reseller" | "Managed" | "FullyManaged";
210
+ };
211
+ export type CreateContractRequest = {
212
+ stackSpotAccountId: Ulid;
213
+ factor: number;
214
+ startDate: string;
215
+ };
216
+ export type Contract = {
217
+ id: string;
218
+ stackSpotAccountId: string;
219
+ factor: number;
220
+ startDate: string;
221
+ };
222
+ export type LinkResourceTypeToStackspotAccountRequest = {
223
+ stackspotAccountId: Ulid;
224
+ serviceIds: Ulid[];
225
+ };
226
+ export type BaselineResponse = {
227
+ /** The ID of baseline that will be updated */
228
+ id: string;
229
+ /** The baseline title */
230
+ title: string;
231
+ /** The date when that Baseline was published */
232
+ publishedAt?: string;
233
+ /** Status of the baseline, if it's published or a draft */
234
+ status?: string;
235
+ };
236
+ export type BaselineRequest = {
237
+ /** The baseline title */
238
+ title: string;
239
+ /** The date when that Baseline was published */
240
+ publishedAt?: string;
241
+ /** Status of the baseline, if it's published or a draft */
242
+ status?: string;
243
+ };
244
+ export type BaselineDetails = {
245
+ /** The baseline ID */
246
+ id: string;
247
+ };
248
+ export type GuardrailStatusResponse = {
249
+ /** The baseline id that GuardRail belongs */
250
+ baselineId: string;
251
+ /** The guardrail id */
252
+ guardrailId: string;
253
+ /** The GuardRail title */
254
+ title: string;
255
+ /** A description explaining what GuardRail do */
256
+ description: string;
257
+ /** Indicates if GuardRail is configurable for user */
258
+ configurable: boolean;
259
+ /** Implementation type of Guardrail */
260
+ implementation: "RECOMENDATION" | "MANDATORY";
261
+ /** Action taken by the Guardrail */
262
+ action: "REMEDIATION" | "NOTIFICATION" | "NOT_IMPLEMENTED";
263
+ /** Indicates if GuardRail is enabled */
264
+ enabled: boolean;
265
+ };
266
+ export type GroupedGuardrailResponse = {
267
+ /** The baseline id that GuardRail belongs */
268
+ baselineId: string;
269
+ /** The baseline title that GuardRail belongs */
270
+ baselineTitle: string;
271
+ /** All GuardRails attached to a Baseline */
272
+ guardrails: GuardrailStatusResponse[];
273
+ };
274
+ export type DailyCostSummary = {
275
+ date: string;
276
+ cost: number;
277
+ };
278
+ export type CostByWorkspace = {
279
+ /** Title of the workspace. */
280
+ workspaceName: string;
281
+ /** Cost associated with the workspace. */
282
+ cost: number;
283
+ };
284
+ export type CostOverview = {
285
+ /** Costs from the current month. */
286
+ currentMonth: number;
287
+ /** Costs from the last month. */
288
+ lastMonth: number;
289
+ /** Costs from the past three months. */
290
+ lastThreeMonths: number;
291
+ currentMonthAverage: number;
292
+ currentMonthDaily: DailyCostSummary[];
293
+ costByWorkspace: CostByWorkspace[];
294
+ };
295
+ export type AttachmentBase64 = {
296
+ filename: string;
297
+ base64: string;
298
+ contentType: string;
299
+ };
300
+ export type AllocationCost = {
301
+ name: string;
302
+ costValue: number;
303
+ };
304
+ export type PaginatedResponseAllocationCost = {
305
+ data: AllocationCost[];
306
+ nextPage?: string;
307
+ prevPage?: string;
308
+ count: number;
309
+ };
310
+ export type AllocationCostDetails = {
311
+ serviceName: string;
312
+ stackSpotUsageType: string;
313
+ quantity: number;
314
+ costValue: number;
315
+ };
316
+ export type PaginatedResponseAllocationCostDetails = {
317
+ data: AllocationCostDetails[];
318
+ nextPage?: string;
319
+ prevPage?: string;
320
+ count: number;
321
+ };
322
+ export type ManagedResource = {
323
+ /** Unique identifier. */
324
+ id: string;
325
+ /** The resource name. */
326
+ name: string;
327
+ cloudAccountId: string;
328
+ cloudProviderRegion: string;
329
+ /** The environment type. */
330
+ environmentName: string;
331
+ /** Created at. */
332
+ createdAt?: string;
333
+ /** The resource status. */
334
+ status?: "Up" | "Down" | "Starting" | "Unknown";
335
+ };
336
+ export type ManagedResourceList = {
337
+ data: ManagedResource[];
338
+ pageToken?: string;
339
+ };
340
+ export type ServiceResource = {
341
+ id: Ulid;
342
+ /** The service resource name */
343
+ name: string;
344
+ };
345
+ export type ManagedService = {
346
+ /** Unique identifier. */
347
+ id: string;
348
+ /** The service name. */
349
+ name: string;
350
+ /** List of resources. */
351
+ resources: ServiceResource[];
352
+ };
353
+ export type AccountCloudOfferResponse = {
354
+ stackspotAccountId: string;
355
+ offer: "Reseller" | "Managed" | "FullyManaged";
356
+ };
357
+ export type Alert = {
358
+ /** Auto id of the alert. */
359
+ id: string;
360
+ /** Describe the pillar of the alert. It can be security, reliability or cost optimization. */
361
+ pillar: "SECURITY" | "COST_OPTIMIZATION" | "RELIABILITY";
362
+ /** Describe the environment of the alert. It can be production, staging or development. */
363
+ environment: string;
364
+ /** Workspace of the alert. */
365
+ workspace: string;
366
+ /** Describe the severity of the alert. It can be mandatory, high, medium or low. */
367
+ severity: "LOW" | "MEDIUM" | "HIGH" | "MANDATORY";
368
+ /** Describe the title of the alert. */
369
+ title: string;
370
+ /** Description of the alert. */
371
+ description: string;
372
+ /** Short description about what can be done in order to resolve the issue. */
373
+ remediationText: string;
374
+ /** Url that contains a detailed documentation to resolve the issue. */
375
+ remediationUrl: string;
376
+ /** Policy of the issue that created the alert. */
377
+ awsPolicy: string;
378
+ /** Id of the alert in AWS. */
379
+ sourceAlertId: string;
380
+ /** Id of the resource. */
381
+ resourceId?: string;
382
+ /** Status of the alert. It can be pending, completed or not applicable. */
383
+ status: "PENDING" | "NOT_APPLICABLE" | "COMPLETED";
384
+ };
385
+ export type PaginatedResponseAlert = {
386
+ data: Alert[];
387
+ nextPage?: string;
388
+ prevPage?: string;
389
+ count: number;
390
+ };
391
+ export type ServiceSummary = {
392
+ id: string;
393
+ name: string;
394
+ };
395
+ /**
396
+ * Update a GuardRail
397
+ */
398
+ export function updateGuardrail({ guardrailUpdate }: {
399
+ guardrailUpdate: GuardrailUpdate;
400
+ }, opts?: Oazapfts.RequestOpts) {
401
+ return oazapfts.ok(oazapfts.fetchJson<{
402
+ status: 200;
403
+ } | {
404
+ status: 422;
405
+ data: {
406
+ code: string;
407
+ status: number;
408
+ details: string;
409
+ validationDetails?: ValidationDetails[];
410
+ };
411
+ } | {
412
+ status: 500;
413
+ data: {
414
+ code: string;
415
+ status: number;
416
+ details: string;
417
+ validationDetails?: ValidationDetails[];
418
+ };
419
+ }>("/admin/guardrail", oazapfts.json({
420
+ ...opts,
421
+ method: "PUT",
422
+ body: guardrailUpdate
423
+ })));
424
+ }
425
+ /**
426
+ * Create a GuardRail
427
+ */
428
+ export function createGuardrail({ guardrailRequest }: {
429
+ guardrailRequest: GuardrailRequest;
430
+ }, opts?: Oazapfts.RequestOpts) {
431
+ return oazapfts.ok(oazapfts.fetchJson<{
432
+ status: 201;
433
+ data: GuardrailDetails;
434
+ } | {
435
+ status: 422;
436
+ data: {
437
+ code: string;
438
+ status: number;
439
+ details: string;
440
+ validationDetails?: ValidationDetails[];
441
+ };
442
+ } | {
443
+ status: 500;
444
+ data: {
445
+ code: string;
446
+ status: number;
447
+ details: string;
448
+ validationDetails?: ValidationDetails[];
449
+ };
450
+ }>("/admin/guardrail", oazapfts.json({
451
+ ...opts,
452
+ method: "POST",
453
+ body: guardrailRequest
454
+ })));
455
+ }
456
+ /**
457
+ * Update a baseline
458
+ */
459
+ export function updateBaseline({ baselineId, baselineUpdate }: {
460
+ baselineId: string;
461
+ baselineUpdate: BaselineUpdate;
462
+ }, opts?: Oazapfts.RequestOpts) {
463
+ return oazapfts.ok(oazapfts.fetchJson<{
464
+ status: 200;
465
+ } | {
466
+ status: 422;
467
+ data: {
468
+ code: string;
469
+ status: number;
470
+ details: string;
471
+ validationDetails?: ValidationDetails[];
472
+ };
473
+ } | {
474
+ status: 500;
475
+ data: {
476
+ code: string;
477
+ status: number;
478
+ details: string;
479
+ validationDetails?: ValidationDetails[];
480
+ };
481
+ }>(`/admin/baseline/${encodeURIComponent(baselineId)}`, oazapfts.json({
482
+ ...opts,
483
+ method: "PUT",
484
+ body: baselineUpdate
485
+ })));
486
+ }
487
+ /**
488
+ * Retrieves billing account summaries
489
+ */
490
+ export function listBillingAccounts({ stackSpotAccountId, showDeleted }: {
491
+ stackSpotAccountId: string;
492
+ showDeleted?: boolean;
493
+ }, opts?: Oazapfts.RequestOpts) {
494
+ return oazapfts.ok(oazapfts.fetchJson<{
495
+ status: 200;
496
+ data: BillingAccountSummaryResponse;
497
+ } | {
498
+ status: 401;
499
+ } | {
500
+ status: 422;
501
+ data: {
502
+ code: string;
503
+ status: number;
504
+ details: string;
505
+ validationDetails?: ValidationDetails[];
506
+ };
507
+ } | {
508
+ status: 500;
509
+ data: {
510
+ code: string;
511
+ status: number;
512
+ details: string;
513
+ validationDetails?: ValidationDetails[];
514
+ };
515
+ }>(`/v2/finops/billing-accounts${QS.query(QS.explode({
516
+ stackSpotAccountId,
517
+ showDeleted
518
+ }))}`, {
519
+ ...opts
520
+ }));
521
+ }
522
+ /**
523
+ * Create new billing account
524
+ */
525
+ export function createBillingAccount({ billingAccountRequest }: {
526
+ billingAccountRequest: BillingAccountRequest;
527
+ }, opts?: Oazapfts.RequestOpts) {
528
+ return oazapfts.ok(oazapfts.fetchJson<{
529
+ status: 200;
530
+ data: BillingAccountDetailsResponse;
531
+ } | {
532
+ status: 401;
533
+ } | {
534
+ status: 422;
535
+ data: {
536
+ code: string;
537
+ status: number;
538
+ details: string;
539
+ validationDetails?: ValidationDetails[];
540
+ };
541
+ } | {
542
+ status: 500;
543
+ data: {
544
+ code: string;
545
+ status: number;
546
+ details: string;
547
+ validationDetails?: ValidationDetails[];
548
+ };
549
+ }>("/v2/finops/billing-accounts", oazapfts.json({
550
+ ...opts,
551
+ method: "POST",
552
+ body: billingAccountRequest
553
+ })));
554
+ }
555
+ /**
556
+ * Retrieves cost and usage metrics for your account.
557
+ */
558
+ export function processAllocationCostRequest({ allocationCostRequest }: {
559
+ allocationCostRequest: AllocationCostRequest;
560
+ }, opts?: Oazapfts.RequestOpts) {
561
+ return oazapfts.ok(oazapfts.fetchJson<{
562
+ status: 200;
563
+ data: AllocationCostResponse;
564
+ } | {
565
+ status: 202;
566
+ data: AllocationCostResponse;
567
+ } | {
568
+ status: 400;
569
+ data: ProblemDetail;
570
+ } | {
571
+ status: 422;
572
+ data: {
573
+ code: string;
574
+ status: number;
575
+ details: string;
576
+ validationDetails?: ValidationDetails[];
577
+ };
578
+ } | {
579
+ status: 500;
580
+ data: {
581
+ code: string;
582
+ status: number;
583
+ details: string;
584
+ validationDetails?: ValidationDetails[];
585
+ };
586
+ }>("/v2/finops/allocation-cost", oazapfts.json({
587
+ ...opts,
588
+ method: "POST",
589
+ body: allocationCostRequest
590
+ })));
591
+ }
592
+ /**
593
+ * Enable a GuardRail in any level
594
+ */
595
+ export function enableGuardrail({ account, workspace, env, enable, guardrailId }: {
596
+ account: string;
597
+ workspace?: string;
598
+ env?: string;
599
+ enable: boolean;
600
+ guardrailId: string;
601
+ }, opts?: Oazapfts.RequestOpts) {
602
+ return oazapfts.ok(oazapfts.fetchJson<{
603
+ status: 200;
604
+ } | {
605
+ status: 422;
606
+ data: {
607
+ code: string;
608
+ status: number;
609
+ details: string;
610
+ validationDetails?: ValidationDetails[];
611
+ };
612
+ } | {
613
+ status: 500;
614
+ data: {
615
+ code: string;
616
+ status: number;
617
+ details: string;
618
+ validationDetails?: ValidationDetails[];
619
+ };
620
+ }>(`/guardrail/${encodeURIComponent(guardrailId)}${QS.query(QS.explode({
621
+ account,
622
+ workspace,
623
+ env,
624
+ enable
625
+ }))}`, {
626
+ ...opts,
627
+ method: "POST"
628
+ }));
629
+ }
630
+ /**
631
+ * Register a cloud offer for a Stackspot Account.
632
+ */
633
+ export function registerOffer({ registerOfferRequest }: {
634
+ registerOfferRequest: RegisterOfferRequest;
635
+ }, opts?: Oazapfts.RequestOpts) {
636
+ return oazapfts.ok(oazapfts.fetchJson<{
637
+ status: 201;
638
+ data: "100 CONTINUE" | "101 SWITCHING_PROTOCOLS" | "102 PROCESSING" | "103 EARLY_HINTS" | "103 CHECKPOINT" | "200 OK" | "201 CREATED" | "202 ACCEPTED" | "203 NON_AUTHORITATIVE_INFORMATION" | "204 NO_CONTENT" | "205 RESET_CONTENT" | "206 PARTIAL_CONTENT" | "207 MULTI_STATUS" | "208 ALREADY_REPORTED" | "226 IM_USED" | "300 MULTIPLE_CHOICES" | "301 MOVED_PERMANENTLY" | "302 FOUND" | "302 MOVED_TEMPORARILY" | "303 SEE_OTHER" | "304 NOT_MODIFIED" | "305 USE_PROXY" | "307 TEMPORARY_REDIRECT" | "308 PERMANENT_REDIRECT" | "400 BAD_REQUEST" | "401 UNAUTHORIZED" | "402 PAYMENT_REQUIRED" | "403 FORBIDDEN" | "404 NOT_FOUND" | "405 METHOD_NOT_ALLOWED" | "406 NOT_ACCEPTABLE" | "407 PROXY_AUTHENTICATION_REQUIRED" | "408 REQUEST_TIMEOUT" | "409 CONFLICT" | "410 GONE" | "411 LENGTH_REQUIRED" | "412 PRECONDITION_FAILED" | "413 PAYLOAD_TOO_LARGE" | "413 REQUEST_ENTITY_TOO_LARGE" | "414 URI_TOO_LONG" | "414 REQUEST_URI_TOO_LONG" | "415 UNSUPPORTED_MEDIA_TYPE" | "416 REQUESTED_RANGE_NOT_SATISFIABLE" | "417 EXPECTATION_FAILED" | "418 I_AM_A_TEAPOT" | "419 INSUFFICIENT_SPACE_ON_RESOURCE" | "420 METHOD_FAILURE" | "421 DESTINATION_LOCKED" | "422 UNPROCESSABLE_ENTITY" | "423 LOCKED" | "424 FAILED_DEPENDENCY" | "425 TOO_EARLY" | "426 UPGRADE_REQUIRED" | "428 PRECONDITION_REQUIRED" | "429 TOO_MANY_REQUESTS" | "431 REQUEST_HEADER_FIELDS_TOO_LARGE" | "451 UNAVAILABLE_FOR_LEGAL_REASONS" | "500 INTERNAL_SERVER_ERROR" | "501 NOT_IMPLEMENTED" | "502 BAD_GATEWAY" | "503 SERVICE_UNAVAILABLE" | "504 GATEWAY_TIMEOUT" | "505 HTTP_VERSION_NOT_SUPPORTED" | "506 VARIANT_ALSO_NEGOTIATES" | "507 INSUFFICIENT_STORAGE" | "508 LOOP_DETECTED" | "509 BANDWIDTH_LIMIT_EXCEEDED" | "510 NOT_EXTENDED" | "511 NETWORK_AUTHENTICATION_REQUIRED";
639
+ } | {
640
+ status: 422;
641
+ data: {
642
+ code: string;
643
+ status: number;
644
+ details: string;
645
+ validationDetails?: ValidationDetails[];
646
+ };
647
+ } | {
648
+ status: 500;
649
+ data: {
650
+ code: string;
651
+ status: number;
652
+ details: string;
653
+ validationDetails?: ValidationDetails[];
654
+ };
655
+ }>("/cloud-offer", oazapfts.json({
656
+ ...opts,
657
+ method: "POST",
658
+ body: registerOfferRequest
659
+ })));
660
+ }
661
+ export function createNewContract({ createContractRequest }: {
662
+ createContractRequest: CreateContractRequest;
663
+ }, opts?: Oazapfts.RequestOpts) {
664
+ return oazapfts.ok(oazapfts.fetchJson<{
665
+ status: 201;
666
+ data: Contract;
667
+ } | {
668
+ status: 422;
669
+ data: {
670
+ code: string;
671
+ status: number;
672
+ details: string;
673
+ validationDetails?: ValidationDetails[];
674
+ };
675
+ } | {
676
+ status: 500;
677
+ data: {
678
+ code: string;
679
+ status: number;
680
+ details: string;
681
+ validationDetails?: ValidationDetails[];
682
+ };
683
+ }>("/admin/finops/contract", oazapfts.json({
684
+ ...opts,
685
+ method: "POST",
686
+ body: createContractRequest
687
+ })));
688
+ }
689
+ /**
690
+ * Links services to a Stackspot account, allowing users from that account to see resources in CRE
691
+ */
692
+ export function linkResourceTypesToStackspotAccount({ linkResourceTypeToStackspotAccountRequest }: {
693
+ linkResourceTypeToStackspotAccountRequest: LinkResourceTypeToStackspotAccountRequest;
694
+ }, opts?: Oazapfts.RequestOpts) {
695
+ return oazapfts.ok(oazapfts.fetchJson<{
696
+ status: 200;
697
+ data: "100 CONTINUE" | "101 SWITCHING_PROTOCOLS" | "102 PROCESSING" | "103 EARLY_HINTS" | "103 CHECKPOINT" | "200 OK" | "201 CREATED" | "202 ACCEPTED" | "203 NON_AUTHORITATIVE_INFORMATION" | "204 NO_CONTENT" | "205 RESET_CONTENT" | "206 PARTIAL_CONTENT" | "207 MULTI_STATUS" | "208 ALREADY_REPORTED" | "226 IM_USED" | "300 MULTIPLE_CHOICES" | "301 MOVED_PERMANENTLY" | "302 FOUND" | "302 MOVED_TEMPORARILY" | "303 SEE_OTHER" | "304 NOT_MODIFIED" | "305 USE_PROXY" | "307 TEMPORARY_REDIRECT" | "308 PERMANENT_REDIRECT" | "400 BAD_REQUEST" | "401 UNAUTHORIZED" | "402 PAYMENT_REQUIRED" | "403 FORBIDDEN" | "404 NOT_FOUND" | "405 METHOD_NOT_ALLOWED" | "406 NOT_ACCEPTABLE" | "407 PROXY_AUTHENTICATION_REQUIRED" | "408 REQUEST_TIMEOUT" | "409 CONFLICT" | "410 GONE" | "411 LENGTH_REQUIRED" | "412 PRECONDITION_FAILED" | "413 PAYLOAD_TOO_LARGE" | "413 REQUEST_ENTITY_TOO_LARGE" | "414 URI_TOO_LONG" | "414 REQUEST_URI_TOO_LONG" | "415 UNSUPPORTED_MEDIA_TYPE" | "416 REQUESTED_RANGE_NOT_SATISFIABLE" | "417 EXPECTATION_FAILED" | "418 I_AM_A_TEAPOT" | "419 INSUFFICIENT_SPACE_ON_RESOURCE" | "420 METHOD_FAILURE" | "421 DESTINATION_LOCKED" | "422 UNPROCESSABLE_ENTITY" | "423 LOCKED" | "424 FAILED_DEPENDENCY" | "425 TOO_EARLY" | "426 UPGRADE_REQUIRED" | "428 PRECONDITION_REQUIRED" | "429 TOO_MANY_REQUESTS" | "431 REQUEST_HEADER_FIELDS_TOO_LARGE" | "451 UNAVAILABLE_FOR_LEGAL_REASONS" | "500 INTERNAL_SERVER_ERROR" | "501 NOT_IMPLEMENTED" | "502 BAD_GATEWAY" | "503 SERVICE_UNAVAILABLE" | "504 GATEWAY_TIMEOUT" | "505 HTTP_VERSION_NOT_SUPPORTED" | "506 VARIANT_ALSO_NEGOTIATES" | "507 INSUFFICIENT_STORAGE" | "508 LOOP_DETECTED" | "509 BANDWIDTH_LIMIT_EXCEEDED" | "510 NOT_EXTENDED" | "511 NETWORK_AUTHENTICATION_REQUIRED";
698
+ } | {
699
+ status: 422;
700
+ data: {
701
+ code: string;
702
+ status: number;
703
+ details: string;
704
+ validationDetails?: ValidationDetails[];
705
+ };
706
+ } | {
707
+ status: 500;
708
+ data: {
709
+ code: string;
710
+ status: number;
711
+ details: string;
712
+ validationDetails?: ValidationDetails[];
713
+ };
714
+ }>("/admin/cloud-resource/link-service-to-stackspot-account", oazapfts.json({
715
+ ...opts,
716
+ method: "POST",
717
+ body: linkResourceTypeToStackspotAccountRequest
718
+ })));
719
+ }
720
+ /**
721
+ * Return all baseline registered
722
+ */
723
+ export function getBaselines(opts?: Oazapfts.RequestOpts) {
724
+ return oazapfts.ok(oazapfts.fetchJson<{
725
+ status: 200;
726
+ data: BaselineResponse[];
727
+ } | {
728
+ status: 422;
729
+ data: {
730
+ code: string;
731
+ status: number;
732
+ details: string;
733
+ validationDetails?: ValidationDetails[];
734
+ };
735
+ } | {
736
+ status: 500;
737
+ data: {
738
+ code: string;
739
+ status: number;
740
+ details: string;
741
+ validationDetails?: ValidationDetails[];
742
+ };
743
+ }>("/admin/baseline", {
744
+ ...opts
745
+ }));
746
+ }
747
+ /**
748
+ * Create a baseline
749
+ */
750
+ export function createBaseline({ baselineRequest }: {
751
+ baselineRequest: BaselineRequest;
752
+ }, opts?: Oazapfts.RequestOpts) {
753
+ return oazapfts.ok(oazapfts.fetchJson<{
754
+ status: 201;
755
+ data: BaselineDetails;
756
+ } | {
757
+ status: 422;
758
+ data: {
759
+ code: string;
760
+ status: number;
761
+ details: string;
762
+ validationDetails?: ValidationDetails[];
763
+ };
764
+ } | {
765
+ status: 500;
766
+ data: {
767
+ code: string;
768
+ status: number;
769
+ details: string;
770
+ validationDetails?: ValidationDetails[];
771
+ };
772
+ }>("/admin/baseline", oazapfts.json({
773
+ ...opts,
774
+ method: "POST",
775
+ body: baselineRequest
776
+ })));
777
+ }
778
+ /**
779
+ * Retrieves details from a billing account
780
+ */
781
+ export function getBillingAccountById({ stackSpotAccountId, billingAccountId }: {
782
+ stackSpotAccountId: string;
783
+ billingAccountId: string;
784
+ }, opts?: Oazapfts.RequestOpts) {
785
+ return oazapfts.ok(oazapfts.fetchJson<{
786
+ status: 200;
787
+ data: BillingAccountDetailsResponse;
788
+ } | {
789
+ status: 401;
790
+ } | {
791
+ status: 404;
792
+ } | {
793
+ status: 422;
794
+ data: {
795
+ code: string;
796
+ status: number;
797
+ details: string;
798
+ validationDetails?: ValidationDetails[];
799
+ };
800
+ } | {
801
+ status: 500;
802
+ data: {
803
+ code: string;
804
+ status: number;
805
+ details: string;
806
+ validationDetails?: ValidationDetails[];
807
+ };
808
+ }>(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
809
+ stackSpotAccountId
810
+ }))}`, {
811
+ ...opts
812
+ }));
813
+ }
814
+ /**
815
+ * Delete a billing account
816
+ */
817
+ export function deleteBillingAccountById({ stackSpotAccountId, billingAccountId }: {
818
+ stackSpotAccountId: string;
819
+ billingAccountId: string;
820
+ }, opts?: Oazapfts.RequestOpts) {
821
+ return oazapfts.ok(oazapfts.fetchJson<{
822
+ status: 200;
823
+ data: BillingAccountDetailsResponse;
824
+ } | {
825
+ status: 401;
826
+ } | {
827
+ status: 404;
828
+ } | {
829
+ status: 422;
830
+ data: {
831
+ code: string;
832
+ status: number;
833
+ details: string;
834
+ validationDetails?: ValidationDetails[];
835
+ };
836
+ } | {
837
+ status: 500;
838
+ data: {
839
+ code: string;
840
+ status: number;
841
+ details: string;
842
+ validationDetails?: ValidationDetails[];
843
+ };
844
+ }>(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
845
+ stackSpotAccountId
846
+ }))}`, {
847
+ ...opts,
848
+ method: "DELETE"
849
+ }));
850
+ }
851
+ /**
852
+ * Get all GuardRails
853
+ */
854
+ export function getGuardrails({ account, workspace, env }: {
855
+ account: string;
856
+ workspace?: string;
857
+ env?: string;
858
+ }, opts?: Oazapfts.RequestOpts) {
859
+ return oazapfts.ok(oazapfts.fetchJson<{
860
+ status: 200;
861
+ data: GroupedGuardrailResponse[];
862
+ } | {
863
+ status: 422;
864
+ data: {
865
+ code: string;
866
+ status: number;
867
+ details: string;
868
+ validationDetails?: ValidationDetails[];
869
+ };
870
+ } | {
871
+ status: 500;
872
+ data: {
873
+ code: string;
874
+ status: number;
875
+ details: string;
876
+ validationDetails?: ValidationDetails[];
877
+ };
878
+ }>(`/guardrail${QS.query(QS.explode({
879
+ account,
880
+ workspace,
881
+ env
882
+ }))}`, {
883
+ ...opts
884
+ }));
885
+ }
886
+ /**
887
+ * Get overview of costs, with current month, last month and three last month
888
+ */
889
+ export function getCostOverview({ sortBy, sortOrder }: {
890
+ sortBy?: string;
891
+ sortOrder?: string;
892
+ }, opts?: Oazapfts.RequestOpts) {
893
+ return oazapfts.ok(oazapfts.fetchJson<{
894
+ status: 200;
895
+ data: CostOverview;
896
+ } | {
897
+ status: 422;
898
+ data: {
899
+ code: string;
900
+ status: number;
901
+ details: string;
902
+ validationDetails?: ValidationDetails[];
903
+ };
904
+ } | {
905
+ status: 500;
906
+ data: {
907
+ code: string;
908
+ status: number;
909
+ details: string;
910
+ validationDetails?: ValidationDetails[];
911
+ };
912
+ }>(`/finops/reports${QS.query(QS.explode({
913
+ sortBy,
914
+ sortOrder
915
+ }))}`, {
916
+ ...opts
917
+ }));
918
+ }
919
+ export function downloadCsvFiles({ year, month }: {
920
+ year: number;
921
+ month: number;
922
+ }, opts?: Oazapfts.RequestOpts) {
923
+ return oazapfts.ok(oazapfts.fetchJson<{
924
+ status: 200;
925
+ data: AttachmentBase64;
926
+ } | {
927
+ status: 422;
928
+ data: {
929
+ code: string;
930
+ status: number;
931
+ details: string;
932
+ validationDetails?: ValidationDetails[];
933
+ };
934
+ } | {
935
+ status: 500;
936
+ data: {
937
+ code: string;
938
+ status: number;
939
+ details: string;
940
+ validationDetails?: ValidationDetails[];
941
+ };
942
+ }>(`/finops/reports/download${QS.query(QS.explode({
943
+ year,
944
+ month
945
+ }))}`, {
946
+ ...opts
947
+ }));
948
+ }
949
+ /**
950
+ * List all tags.
951
+ */
952
+ export function getAllTags({ stackspotAccountId }: {
953
+ stackspotAccountId: string;
954
+ }, opts?: Oazapfts.RequestOpts) {
955
+ return oazapfts.ok(oazapfts.fetchJson<{
956
+ status: 200;
957
+ data: string[];
958
+ } | {
959
+ status: 422;
960
+ data: {
961
+ code: string;
962
+ status: number;
963
+ details: string;
964
+ validationDetails?: ValidationDetails[];
965
+ };
966
+ } | {
967
+ status: 500;
968
+ data: {
969
+ code: string;
970
+ status: number;
971
+ details: string;
972
+ validationDetails?: ValidationDetails[];
973
+ };
974
+ }>(`/finops/allocation-cost-list-tags${QS.query(QS.explode({
975
+ stackspotAccountId
976
+ }))}`, {
977
+ ...opts
978
+ }));
979
+ }
980
+ /**
981
+ * lists all subTags of a given tag with their respective costs.
982
+ */
983
+ export function getAllocationCostTagValues({ masterAccount, tag, startDate, endDate, sort, page, pageSize }: {
984
+ masterAccount: string;
985
+ tag: string;
986
+ startDate: string;
987
+ endDate: string;
988
+ sort?: ("NAME_ASC" | "NAME_DESC" | "COST_VALUE_ASC" | "COST_VALUE_DESC")[];
989
+ page?: number;
990
+ pageSize?: number;
991
+ }, opts?: Oazapfts.RequestOpts) {
992
+ return oazapfts.ok(oazapfts.fetchJson<{
993
+ status: 200;
994
+ data: PaginatedResponseAllocationCost;
995
+ } | {
996
+ status: 422;
997
+ data: {
998
+ code: string;
999
+ status: number;
1000
+ details: string;
1001
+ validationDetails?: ValidationDetails[];
1002
+ };
1003
+ } | {
1004
+ status: 500;
1005
+ data: {
1006
+ code: string;
1007
+ status: number;
1008
+ details: string;
1009
+ validationDetails?: ValidationDetails[];
1010
+ };
1011
+ }>(`/finops/allocation-cost-list-tag-values${QS.query(QS.explode({
1012
+ masterAccount,
1013
+ tag,
1014
+ startDate,
1015
+ endDate,
1016
+ sort,
1017
+ page,
1018
+ pageSize
1019
+ }))}`, {
1020
+ ...opts
1021
+ }));
1022
+ }
1023
+ /**
1024
+ * List all services of a subtag. Each service contains name and cost value.
1025
+ */
1026
+ export function getAllocationCostServices({ masterAccount, tag, tagValueName, startDate, endDate, sort, page, pageSize }: {
1027
+ masterAccount: string;
1028
+ tag: string;
1029
+ tagValueName: string;
1030
+ startDate: string;
1031
+ endDate: string;
1032
+ sort?: ("NAME_ASC" | "NAME_DESC" | "COST_VALUE_ASC" | "COST_VALUE_DESC")[];
1033
+ page?: number;
1034
+ pageSize?: number;
1035
+ }, opts?: Oazapfts.RequestOpts) {
1036
+ return oazapfts.ok(oazapfts.fetchJson<{
1037
+ status: 200;
1038
+ data: PaginatedResponseAllocationCost;
1039
+ } | {
1040
+ status: 422;
1041
+ data: {
1042
+ code: string;
1043
+ status: number;
1044
+ details: string;
1045
+ validationDetails?: ValidationDetails[];
1046
+ };
1047
+ } | {
1048
+ status: 500;
1049
+ data: {
1050
+ code: string;
1051
+ status: number;
1052
+ details: string;
1053
+ validationDetails?: ValidationDetails[];
1054
+ };
1055
+ }>(`/finops/allocation-cost-list-services${QS.query(QS.explode({
1056
+ masterAccount,
1057
+ tag,
1058
+ tagValueName,
1059
+ startDate,
1060
+ endDate,
1061
+ sort,
1062
+ page,
1063
+ pageSize
1064
+ }))}`, {
1065
+ ...opts
1066
+ }));
1067
+ }
1068
+ /**
1069
+ * list service details
1070
+ */
1071
+ export function getAllocationCostServiceDetails({ masterAccount, tag, tagValueName, serviceName, startDate, endDate, $type, filter, page, pageSize, sort }: {
1072
+ masterAccount: string;
1073
+ tag: string;
1074
+ tagValueName: string;
1075
+ serviceName: string;
1076
+ startDate: string;
1077
+ endDate: string;
1078
+ $type: string;
1079
+ filter?: string[];
1080
+ page?: number;
1081
+ pageSize?: number;
1082
+ sort?: ("NAME_ASC" | "NAME_DESC" | "COST_VALUE_ASC" | "COST_VALUE_DESC")[];
1083
+ }, opts?: Oazapfts.RequestOpts) {
1084
+ return oazapfts.ok(oazapfts.fetchJson<{
1085
+ status: 200;
1086
+ data: PaginatedResponseAllocationCostDetails;
1087
+ } | {
1088
+ status: 422;
1089
+ data: {
1090
+ code: string;
1091
+ status: number;
1092
+ details: string;
1093
+ validationDetails?: ValidationDetails[];
1094
+ };
1095
+ } | {
1096
+ status: 500;
1097
+ data: {
1098
+ code: string;
1099
+ status: number;
1100
+ details: string;
1101
+ validationDetails?: ValidationDetails[];
1102
+ };
1103
+ }>(`/finops/allocation-cost-list-service-details${QS.query(QS.explode({
1104
+ masterAccount,
1105
+ tag,
1106
+ tagValueName,
1107
+ serviceName,
1108
+ startDate,
1109
+ endDate,
1110
+ "type": $type,
1111
+ filter,
1112
+ page,
1113
+ pageSize,
1114
+ sort
1115
+ }))}`, {
1116
+ ...opts
1117
+ }));
1118
+ }
1119
+ /**
1120
+ * list all master accounts
1121
+ */
1122
+ export function getAllMasterAccount({ stackspotAccountId }: {
1123
+ stackspotAccountId: string;
1124
+ }, opts?: Oazapfts.RequestOpts) {
1125
+ return oazapfts.ok(oazapfts.fetchJson<{
1126
+ status: 200;
1127
+ data: string[];
1128
+ } | {
1129
+ status: 422;
1130
+ data: {
1131
+ code: string;
1132
+ status: number;
1133
+ details: string;
1134
+ validationDetails?: ValidationDetails[];
1135
+ };
1136
+ } | {
1137
+ status: 500;
1138
+ data: {
1139
+ code: string;
1140
+ status: number;
1141
+ details: string;
1142
+ validationDetails?: ValidationDetails[];
1143
+ };
1144
+ }>(`/finops/allocation-cost-list-master-accounts${QS.query(QS.explode({
1145
+ stackspotAccountId
1146
+ }))}`, {
1147
+ ...opts
1148
+ }));
1149
+ }
1150
+ /**
1151
+ * list filters related to the type
1152
+ */
1153
+ export function getAllocationCostFilters({ $type }: {
1154
+ $type: "SUB_ACCOUNT_ID" | "REGION";
1155
+ }, opts?: Oazapfts.RequestOpts) {
1156
+ return oazapfts.ok(oazapfts.fetchJson<{
1157
+ status: 200;
1158
+ data: string[];
1159
+ } | {
1160
+ status: 422;
1161
+ data: {
1162
+ code: string;
1163
+ status: number;
1164
+ details: string;
1165
+ validationDetails?: ValidationDetails[];
1166
+ };
1167
+ } | {
1168
+ status: 500;
1169
+ data: {
1170
+ code: string;
1171
+ status: number;
1172
+ details: string;
1173
+ validationDetails?: ValidationDetails[];
1174
+ };
1175
+ }>(`/finops/allocation-cost-filters${QS.query(QS.explode({
1176
+ "type": $type
1177
+ }))}`, {
1178
+ ...opts
1179
+ }));
1180
+ }
1181
+ /**
1182
+ * returns the detailed csv with the masterAccount CUR information
1183
+ */
1184
+ export function getAllocationCostCsv({ stackspotAccountId, masterAccount, startDate, endDate }: {
1185
+ stackspotAccountId: string;
1186
+ masterAccount: string;
1187
+ startDate: string;
1188
+ endDate: string;
1189
+ }, opts?: Oazapfts.RequestOpts) {
1190
+ return oazapfts.ok(oazapfts.fetchJson<{
1191
+ status: 200;
1192
+ data: AttachmentBase64;
1193
+ } | {
1194
+ status: 422;
1195
+ data: {
1196
+ code: string;
1197
+ status: number;
1198
+ details: string;
1199
+ validationDetails?: ValidationDetails[];
1200
+ };
1201
+ } | {
1202
+ status: 500;
1203
+ data: {
1204
+ code: string;
1205
+ status: number;
1206
+ details: string;
1207
+ validationDetails?: ValidationDetails[];
1208
+ };
1209
+ }>(`/finops/allocation-cost-csv${QS.query(QS.explode({
1210
+ stackspotAccountId,
1211
+ masterAccount,
1212
+ startDate,
1213
+ endDate
1214
+ }))}`, {
1215
+ ...opts
1216
+ }));
1217
+ }
1218
+ /**
1219
+ * List Instances of a particular Service Resource running in a Workspace
1220
+ */
1221
+ export function listInstances({ workspaceId, resourceId, pageToken, search }: {
1222
+ workspaceId: string;
1223
+ resourceId: string;
1224
+ pageToken?: string;
1225
+ search?: string;
1226
+ }, opts?: Oazapfts.RequestOpts) {
1227
+ return oazapfts.ok(oazapfts.fetchJson<{
1228
+ status: 200;
1229
+ data: ManagedResourceList;
1230
+ } | {
1231
+ status: 422;
1232
+ data: {
1233
+ code: string;
1234
+ status: number;
1235
+ details: string;
1236
+ validationDetails?: ValidationDetails[];
1237
+ };
1238
+ } | {
1239
+ status: 500;
1240
+ data: {
1241
+ code: string;
1242
+ status: number;
1243
+ details: string;
1244
+ validationDetails?: ValidationDetails[];
1245
+ };
1246
+ }>(`/cloud-resource/workspace/${encodeURIComponent(workspaceId)}/resource/${encodeURIComponent(resourceId)}/instance${QS.query(QS.explode({
1247
+ pageToken,
1248
+ search
1249
+ }))}`, {
1250
+ ...opts
1251
+ }));
1252
+ }
1253
+ /**
1254
+ * List Managed Services
1255
+ */
1256
+ export function listServices(opts?: Oazapfts.RequestOpts) {
1257
+ return oazapfts.ok(oazapfts.fetchJson<{
1258
+ status: 200;
1259
+ data: ManagedService[];
1260
+ } | {
1261
+ status: 422;
1262
+ data: {
1263
+ code: string;
1264
+ status: number;
1265
+ details: string;
1266
+ validationDetails?: ValidationDetails[];
1267
+ };
1268
+ } | {
1269
+ status: 500;
1270
+ data: {
1271
+ code: string;
1272
+ status: number;
1273
+ details: string;
1274
+ validationDetails?: ValidationDetails[];
1275
+ };
1276
+ }>("/cloud-resource/service", {
1277
+ ...opts
1278
+ }));
1279
+ }
1280
+ /**
1281
+ * A detailed description of a particular Instance
1282
+ */
1283
+ export function getInstanceDetails({ cloudAccountId, resourceId, instanceId }: {
1284
+ cloudAccountId: string;
1285
+ resourceId: string;
1286
+ instanceId: string;
1287
+ }, opts?: Oazapfts.RequestOpts) {
1288
+ return oazapfts.ok(oazapfts.fetchJson<{
1289
+ status: 200;
1290
+ data: object;
1291
+ } | {
1292
+ status: 422;
1293
+ data: {
1294
+ code: string;
1295
+ status: number;
1296
+ details: string;
1297
+ validationDetails?: ValidationDetails[];
1298
+ };
1299
+ } | {
1300
+ status: 500;
1301
+ data: {
1302
+ code: string;
1303
+ status: number;
1304
+ details: string;
1305
+ validationDetails?: ValidationDetails[];
1306
+ };
1307
+ }>(`/cloud-resource/cloud-account/${encodeURIComponent(cloudAccountId)}/resource/${encodeURIComponent(resourceId)}/instance/${encodeURIComponent(instanceId)}`, {
1308
+ ...opts
1309
+ }));
1310
+ }
1311
+ /**
1312
+ * Get the cloud offer of a Stackspot Account.
1313
+ */
1314
+ export function getOfferOfAccount({ id }: {
1315
+ id: string;
1316
+ }, opts?: Oazapfts.RequestOpts) {
1317
+ return oazapfts.ok(oazapfts.fetchJson<{
1318
+ status: 200;
1319
+ data: AccountCloudOfferResponse;
1320
+ } | {
1321
+ status: 422;
1322
+ data: {
1323
+ code: string;
1324
+ status: number;
1325
+ details: string;
1326
+ validationDetails?: ValidationDetails[];
1327
+ };
1328
+ } | {
1329
+ status: 500;
1330
+ data: {
1331
+ code: string;
1332
+ status: number;
1333
+ details: string;
1334
+ validationDetails?: ValidationDetails[];
1335
+ };
1336
+ }>(`/cloud-offer/account/${encodeURIComponent(id)}`, {
1337
+ ...opts
1338
+ }));
1339
+ }
1340
+ /**
1341
+ * Get pages alerts from workspace and environment. That alerts can be filtered
1342
+ */
1343
+ export function getAlerts({ workspace, env, pillar, severity, status, search, sort, page, pageSize }: {
1344
+ workspace: string;
1345
+ env: string;
1346
+ pillar?: "SECURITY" | "COST_OPTIMIZATION" | "RELIABILITY";
1347
+ severity?: "LOW" | "MEDIUM" | "HIGH" | "MANDATORY";
1348
+ status?: "PENDING" | "NOT_APPLICABLE" | "COMPLETED";
1349
+ search?: string;
1350
+ sort?: ("STATUS_ASC" | "STATUS_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PILLAR_ASC" | "PILLAR_DESC" | "SEVERITY_ASC" | "SEVERITY_DESC")[];
1351
+ page?: number;
1352
+ pageSize?: number;
1353
+ }, opts?: Oazapfts.RequestOpts) {
1354
+ return oazapfts.ok(oazapfts.fetchJson<{
1355
+ status: 200;
1356
+ data: PaginatedResponseAlert;
1357
+ } | {
1358
+ status: 422;
1359
+ data: {
1360
+ code: string;
1361
+ status: number;
1362
+ details: string;
1363
+ validationDetails?: ValidationDetails[];
1364
+ };
1365
+ } | {
1366
+ status: 500;
1367
+ data: {
1368
+ code: string;
1369
+ status: number;
1370
+ details: string;
1371
+ validationDetails?: ValidationDetails[];
1372
+ };
1373
+ }>(`/alerts${QS.query(QS.explode({
1374
+ workspace,
1375
+ env,
1376
+ pillar,
1377
+ severity,
1378
+ status,
1379
+ search,
1380
+ sort,
1381
+ page,
1382
+ pageSize
1383
+ }))}`, {
1384
+ ...opts
1385
+ }));
1386
+ }
1387
+ export function downloadDataByAccountId({ stackspotAccountId, year, month }: {
1388
+ stackspotAccountId: string;
1389
+ year: number;
1390
+ month: number;
1391
+ }, opts?: Oazapfts.RequestOpts) {
1392
+ return oazapfts.ok(oazapfts.fetchJson<{
1393
+ status: 200;
1394
+ data: AttachmentBase64;
1395
+ } | {
1396
+ status: 422;
1397
+ data: {
1398
+ code: string;
1399
+ status: number;
1400
+ details: string;
1401
+ validationDetails?: ValidationDetails[];
1402
+ };
1403
+ } | {
1404
+ status: 500;
1405
+ data: {
1406
+ code: string;
1407
+ status: number;
1408
+ details: string;
1409
+ validationDetails?: ValidationDetails[];
1410
+ };
1411
+ }>(`/admin/finops/reports/download${QS.query(QS.explode({
1412
+ stackspot_account_id: stackspotAccountId,
1413
+ year,
1414
+ month
1415
+ }))}`, {
1416
+ ...opts
1417
+ }));
1418
+ }
1419
+ /**
1420
+ * List available services
1421
+ */
1422
+ export function listServices1(opts?: Oazapfts.RequestOpts) {
1423
+ return oazapfts.ok(oazapfts.fetchJson<{
1424
+ status: 200;
1425
+ data: ServiceSummary[];
1426
+ } | {
1427
+ status: 422;
1428
+ data: {
1429
+ code: string;
1430
+ status: number;
1431
+ details: string;
1432
+ validationDetails?: ValidationDetails[];
1433
+ };
1434
+ } | {
1435
+ status: 500;
1436
+ data: {
1437
+ code: string;
1438
+ status: number;
1439
+ details: string;
1440
+ validationDetails?: ValidationDetails[];
1441
+ };
1442
+ }>("/admin/cloud-resource/service", {
1443
+ ...opts
1444
+ }));
1445
+ }