@stack-spot/portal-network 0.14.1 → 0.15.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 (43) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/cloudServices.d.ts +37 -656
  3. package/dist/api/cloudServices.d.ts.map +1 -1
  4. package/dist/api/cloudServices.js +26 -386
  5. package/dist/api/cloudServices.js.map +1 -1
  6. package/dist/client/cloud-services.d.ts +111 -0
  7. package/dist/client/cloud-services.d.ts.map +1 -0
  8. package/dist/client/cloud-services.js +136 -0
  9. package/dist/client/cloud-services.js.map +1 -0
  10. package/dist/client/types.d.ts +67 -1
  11. package/dist/client/types.d.ts.map +1 -1
  12. package/dist/client/workspace.d.ts +6 -5
  13. package/dist/client/workspace.d.ts.map +1 -1
  14. package/dist/client/workspace.js.map +1 -1
  15. package/dist/index.d.ts +3 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +1 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/network/AutoInfiniteQuery.d.ts +2 -2
  20. package/dist/network/AutoInfiniteQuery.d.ts.map +1 -1
  21. package/dist/network/AutoInfiniteQuery.js.map +1 -1
  22. package/dist/network/AutoQuery.d.ts +4 -4
  23. package/dist/network/AutoQuery.d.ts.map +1 -1
  24. package/dist/network/AutoQuery.js.map +1 -1
  25. package/dist/network/ManualInfiniteQuery.d.ts +2 -2
  26. package/dist/network/ManualInfiniteQuery.d.ts.map +1 -1
  27. package/dist/network/ManualInfiniteQuery.js.map +1 -1
  28. package/dist/network/ManualQuery.d.ts +4 -4
  29. package/dist/network/ManualQuery.d.ts.map +1 -1
  30. package/dist/network/ManualQuery.js.map +1 -1
  31. package/dist/network/types.d.ts +16 -5
  32. package/dist/network/types.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/src/api/cloudServices.ts +280 -1707
  35. package/src/client/cloud-services.ts +84 -0
  36. package/src/client/types.ts +85 -1
  37. package/src/client/workspace.ts +6 -5
  38. package/src/index.ts +4 -0
  39. package/src/network/AutoInfiniteQuery.ts +7 -3
  40. package/src/network/AutoQuery.ts +10 -10
  41. package/src/network/ManualInfiniteQuery.ts +3 -3
  42. package/src/network/ManualQuery.ts +8 -8
  43. package/src/network/types.ts +22 -9
@@ -14,108 +14,6 @@ const oazapfts = Oazapfts.runtime(defaults);
14
14
  export const servers = {
15
15
  generatedServerUrl: "https://cloud-services-cloud-services-api.dev.stackspot.com"
16
16
  };
17
- export type JwtToken = {
18
- rawToken: string;
19
- email: string;
20
- name: string;
21
- stackSpotAccountId: string;
22
- stackSpotAccountSlug: string;
23
- ipSource?: string;
24
- isServiceToken: boolean;
25
- };
26
- export type JwtTokenWrite = {
27
- authenticationHeader?: string;
28
- rawToken: string;
29
- email: string;
30
- name: string;
31
- stackSpotAccountId: string;
32
- stackSpotAccountSlug: string;
33
- ipSource?: string;
34
- isServiceToken: boolean;
35
- };
36
- export type Attachment = {
37
- id: string;
38
- filename: string;
39
- resourceUrl: string;
40
- contentType: string;
41
- };
42
- export type CaseComment = {
43
- /** Name of the author of the comment. */
44
- authorName: string;
45
- /** Email of the author of the comment. */
46
- authorEmail: string;
47
- /** URL to the author's avatar. */
48
- authorPhotoURL?: string;
49
- /** The comment text. */
50
- text: string;
51
- createdAt: string;
52
- attachments: Attachment[];
53
- };
54
- export type Case = {
55
- /** Unique identifier for the case. */
56
- id: string;
57
- /** The case type. */
58
- "type": "AccountAndBilling" | "Technical";
59
- /** The case status. An user may cancel a ticket if the status is 'open'. */
60
- status: string;
61
- /** The StackSpot service related to the case. */
62
- service: string;
63
- category: string;
64
- severity: string;
65
- /** The case subject. */
66
- subject?: string;
67
- /** The list of comments in the case. */
68
- comment: CaseComment[];
69
- createdAt: string;
70
- };
71
- export type ValidationDetails = {
72
- code: string;
73
- field?: string;
74
- details?: string;
75
- values?: string[];
76
- };
77
- export type CreateCaseComment = {
78
- /** The comment's text */
79
- text: string;
80
- attachmentIds: string[];
81
- };
82
- export type CaseUpdate = {
83
- /** Case severity */
84
- severity?: string;
85
- comment?: CreateCaseComment;
86
- /** Update the case status. The user may only update the status if the case is 'open'. */
87
- status?: string;
88
- };
89
- export type SavingPlanComment = {
90
- /** Name of the author of the comment. */
91
- authorName: string;
92
- /** Email of the author of the comment. */
93
- authorEmail: string;
94
- /** URL to the author's avatar. */
95
- authorPhotoURL?: string;
96
- /** The comment text. */
97
- text: string;
98
- createdAt: string;
99
- };
100
- export type SavingPlan = {
101
- /** Unique identifier for the saving plan. */
102
- id: number;
103
- /** The saving plan status. */
104
- status: string;
105
- /** The saving plan type. */
106
- savingPlanType: "SavingPlan" | "ReservedInstances";
107
- /** The list of comments in the saving plan. */
108
- comment: SavingPlanComment[];
109
- };
110
- export type CreateSavingPlanComment = {
111
- /** The comment's text */
112
- text: string;
113
- };
114
- export type SavingPlanUpdate = {
115
- comment?: CreateSavingPlanComment;
116
- /** Update saving plan status. */
117
- status?: string;
118
- };
119
17
  export type GuardrailUpdate = {
120
18
  /** The ID of GuardRail that will be updated */
121
19
  id: string;
@@ -134,6 +32,12 @@ export type GuardrailUpdate = {
134
32
  /** The type of GuardRail. [SCP, GUARDRAIL] */
135
33
  "type"?: "SCP" | "GUARDRAIL";
136
34
  };
35
+ export type ValidationDetails = {
36
+ code: string;
37
+ field?: string;
38
+ details?: string;
39
+ values?: string[];
40
+ };
137
41
  export type GuardrailRequest = {
138
42
  /** The baseline id that GuardRail belongs */
139
43
  baselineId: string;
@@ -232,7 +136,8 @@ export type ChargePeriod = {
232
136
  start: string;
233
137
  };
234
138
  export type AllocationCostRequest = {
235
- stackSpotAccountId: Ulid;
139
+ /** StackSpot's ULID identifier for each client. */
140
+ stackSpotAccountId: string;
236
141
  /** StackSpot-assigned ULID identifiers for a billing account. */
237
142
  billingAccountId: Ulid[];
238
143
  /** StackSpot-assigned ULID identifiers for a billing account. */
@@ -297,156 +202,12 @@ export type ProblemDetail = {
297
202
  [key: string]: object;
298
203
  };
299
204
  };
300
- export type CaseSummary = {
301
- /** Unique case identifier. */
302
- id: number;
303
- /** The case status. */
304
- status: string;
305
- /** The case severity. */
306
- severity: string;
307
- /** The case subject. */
308
- subject: string;
309
- createdAt: string;
310
- /** The requester email. */
311
- requesterEmail: string;
312
- };
313
- export type ListCasesResponse = {
314
- data: CaseSummary[];
315
- nextPage?: string;
316
- prevPage?: string;
317
- count: number;
318
- visibility: "AccountLevel" | "UserLevel";
319
- };
320
- export type CaseRequest = {
321
- /** The case type */
322
- "type": "AccountAndBilling" | "Technical";
323
- /** StackSpot managed service name that is related to the case */
324
- service: string;
325
- /** Case category */
326
- category: string;
327
- /** Case severity */
328
- severity: string;
329
- comment: CreateCaseComment;
330
- };
331
- export type AttachmentUpload = {
332
- upload: Blob;
333
- filename: string;
334
- contentType: string;
335
- };
336
- export type SavingPlanSummary = {
337
- /** Unique identifier for the saving plan. */
338
- id: number;
339
- /** The saving plan status. */
340
- status: string;
341
- /** The saving plan type. */
342
- savingPlanType: "SavingPlan" | "ReservedInstances";
343
- };
344
- export type PaginatedResourceSavingPlanSummary = {
345
- data: SavingPlanSummary[];
346
- nextPage?: number;
347
- prevPage?: number;
348
- count: number;
349
- };
350
- export type SavingPlanRequest = {
351
- /** The saving plan type. */
352
- savingPlanType: "SavingPlan" | "ReservedInstances";
353
- };
354
205
  export type RegisterOfferRequest = {
206
+ /** The Stackspot account ID to associate the offer with */
355
207
  stackspotAccountId: string;
208
+ /** The Cloud Offer type to be registered */
356
209
  cloudOffer: "Reseller" | "Managed" | "FullyManaged";
357
210
  };
358
- export type CloudAccountResponse = {
359
- /** Cloud Account ID */
360
- id: string;
361
- /** Workspace name */
362
- workspaceName: string;
363
- /** Environment name */
364
- environmentName: string;
365
- /** Cloud Provider */
366
- provider: "AWS" | "Azure";
367
- /** Cloud Account connection status */
368
- status: "Connecting" | "Connected" | "Disconnected" | "Failed" | "Unknown";
369
- /** Cloud Account type */
370
- "type": "CustomCloud" | "CloudServices";
371
- /** Number Of Ips */
372
- numberOfIps?: number;
373
- /** Network Type */
374
- networkType?: number;
375
- };
376
- export type PaginatedResourceCloudAccountResponse = {
377
- data: CloudAccountResponse[];
378
- nextPage?: number;
379
- prevPage?: number;
380
- totalPages: number;
381
- };
382
- export type CloudAccountCredential = object;
383
- export type ConnectAccountRequest = {
384
- /** Environment ID */
385
- environmentId: string;
386
- /** Workspace ID */
387
- workspaceId: string;
388
- /** Cloud Provider */
389
- provider: "AWS" | "Azure";
390
- credential?: CloudAccountCredential;
391
- /** IAM Role. Will be deprecated in future releases. */
392
- iamRole?: string;
393
- };
394
- export type CloudAccountDetails = {
395
- /** Cloud Account ID */
396
- id?: string;
397
- /** Workspace ID */
398
- workspaceId: string;
399
- /** Workspace name */
400
- workspaceName: string;
401
- /** Environment ID */
402
- environmentId: string;
403
- /** Environment name */
404
- environmentName: string;
405
- /** Environment description */
406
- environmentDescription: string;
407
- /** Cloud Provider */
408
- provider?: "AWS" | "Azure";
409
- /** Cloud Provider Account ID */
410
- providerAccountId?: string;
411
- /** Cloud Account connection status */
412
- status?: "Connecting" | "Connected" | "Disconnected" | "Failed" | "Unknown";
413
- /** Cloud Account type */
414
- "type"?: "CustomCloud" | "CloudServices";
415
- /** When not-null, it's the ID for a support case requesting the disconnection of this account */
416
- activeDisconnectSupportCaseId?: string;
417
- };
418
- export type ManagedAccountProvisionRequest = {
419
- workspaceId: Ulid;
420
- /**
421
- Network template ID to be setup in the provisioned accounts. See /cloud-account/managed-account/template for more info.
422
- */
423
- networkTypeId: number;
424
- /**
425
- Number of IPs to be allocated in the provisioned accounts. See /cloud-account/managed-account/template for more info.
426
- */
427
- numberOfIps: number;
428
- };
429
- export type DisconnectSupportCaseManagedAccountRequest = {
430
- supportCaseId: number;
431
- };
432
- export type DisconnectSupportCaseManagedAccountResponse = {
433
- cloudAccountId: Ulid;
434
- stackspotAccountId: Ulid;
435
- supportCaseId: number;
436
- };
437
- export type StackspotAccountTower = {
438
- id: string;
439
- stackspotAccountId: string;
440
- towerId: string;
441
- };
442
- export type StackspotAccountTowerRequest = {
443
- stackspotAccountId: string;
444
- towerId: string;
445
- };
446
- export type CommonCreatedResponse = {
447
- /** The created object ID */
448
- id: string;
449
- };
450
211
  export type CreateContractRequest = {
451
212
  stackSpotAccountId: Ulid;
452
213
  factor: number;
@@ -462,42 +223,6 @@ export type LinkResourceTypeToStackspotAccountRequest = {
462
223
  stackspotAccountId: Ulid;
463
224
  serviceIds: Ulid[];
464
225
  };
465
- export type UpdateManagedInfoRequest = {
466
- cloudAccountId: Ulid;
467
- stackspotAccountId: Ulid;
468
- /**
469
- Sets the AWS region for the account.
470
- */
471
- region?: string;
472
- /**
473
- Sets the foundation name for the account.
474
- */
475
- foundationName?: string;
476
- /**
477
- Sets the environment name for the account.
478
- */
479
- environmentName?: string;
480
- };
481
- export type UpdatedCloudAccountResponse = {
482
- cloudAccountId: Ulid;
483
- stackspotAccountId: Ulid;
484
- workspaceId: Ulid;
485
- environmentId: Ulid;
486
- cloudType: "CustomCloud" | "CloudServices";
487
- cloudStatus: "Connecting" | "Connected" | "Disconnected" | "Failed" | "Unknown";
488
- /**
489
- The region associated with the Cloud Account. This fields only exists for AWS accounts of CloudServices type.
490
- */
491
- providerRegion?: string;
492
- /**
493
- The account's name inside the Foundation's organization. This fields only exists for AWS accounts of CloudServices type.
494
- */
495
- foundationName: string;
496
- };
497
- export type DisconnectCloudAccountRequest = {
498
- cloudAccountId: Ulid;
499
- stackspotAccountId: Ulid;
500
- };
501
226
  export type BaselineResponse = {
502
227
  /** The ID of baseline that will be updated */
503
228
  id: string;
@@ -520,28 +245,6 @@ export type BaselineDetails = {
520
245
  /** The baseline ID */
521
246
  id: string;
522
247
  };
523
- export type SupportFormFieldOption = {
524
- name: string;
525
- value: string;
526
- };
527
- export type SupportFormFieldData = {
528
- service: SupportFormFieldOption[];
529
- category: SupportFormFieldOption[];
530
- };
531
- export type SupportFormFieldResponse = {
532
- accountAndBilling: SupportFormFieldData;
533
- technical: SupportFormFieldData;
534
- severity: SupportFormFieldOption[];
535
- };
536
- export type AttachmentBase64 = {
537
- filename: string;
538
- base64: string;
539
- contentType: string;
540
- };
541
- export type HealthComponent = {
542
- description?: string;
543
- status?: string;
544
- };
545
248
  export type GuardrailStatusResponse = {
546
249
  /** The baseline id that GuardRail belongs */
547
250
  baselineId: string;
@@ -589,6 +292,11 @@ export type CostOverview = {
589
292
  currentMonthDaily: DailyCostSummary[];
590
293
  costByWorkspace: CostByWorkspace[];
591
294
  };
295
+ export type AttachmentBase64 = {
296
+ filename: string;
297
+ base64: string;
298
+ contentType: string;
299
+ };
592
300
  export type AllocationCost = {
593
301
  name: string;
594
302
  costValue: number;
@@ -642,57 +350,10 @@ export type ManagedService = {
642
350
  /** List of resources. */
643
351
  resources: ServiceResource[];
644
352
  };
645
- export type CloudOfferResponse = {
353
+ export type AccountCloudOfferResponse = {
646
354
  stackspotAccountId: string;
647
355
  offer: "Reseller" | "Managed" | "FullyManaged";
648
356
  };
649
- export type CloudServicesAccountStatus = {
650
- /** Cloud Account ID */
651
- id: string;
652
- /** Environment name */
653
- environmentName: string;
654
- /** Environment ID */
655
- environmentId: string;
656
- /** Status of the account in the workflow */
657
- status: "Connecting" | "Connected" | "Disconnected" | "Failed" | "Unknown";
658
- provider: "AWS" | "Azure";
659
- /** Error code if the workflow for creating the account failed */
660
- errorCode?: string;
661
- };
662
- export type Workflow = {
663
- status: "UNDER_CHANGE" | "AVAILABLE" | "ERROR";
664
- accounts: CloudServicesAccountStatus[];
665
- supportCaseId?: string;
666
- };
667
- export type CloudAccountWithCredentialResponse = {
668
- /** Cloud Account ID */
669
- id: string;
670
- /** Workspace ID */
671
- workspaceId: string;
672
- /** Environment ID */
673
- environmentId: string;
674
- /** Cloud Provider */
675
- provider: "AWS" | "Azure";
676
- /** Cloud Account type */
677
- "type": "CustomCloud" | "CloudServices";
678
- /** Role */
679
- role: string;
680
- /** Cloud Account connection status */
681
- status: "Connecting" | "Connected" | "Disconnected" | "Failed" | "Unknown";
682
- /** Cloud Account credential identifier for Secret Manager */
683
- credentialSecretIdentifier?: string;
684
- };
685
- export type ManagedAccountTemplateResponse = {
686
- id: number;
687
- name: string;
688
- minCountIps: number;
689
- maxCountIps: number;
690
- availableIpRange?: number[];
691
- };
692
- export type ManagedAccountRegionResponse = {
693
- id: number;
694
- name: string;
695
- };
696
357
  export type Alert = {
697
358
  /** Auto id of the alert. */
698
359
  id: string;
@@ -731,191 +392,10 @@ export type ServiceSummary = {
731
392
  id: string;
732
393
  name: string;
733
394
  };
734
- export type AdminCloudAccountDetails = {
735
- /** Cloud Account ID */
736
- id: string;
737
- /** Stackspot Account ID */
738
- stackspotAccountId: string;
739
- /** Workspace ID */
740
- workspaceId: string;
741
- /** Environment ID */
742
- environmentId: string;
743
- /** Environment Name (only available in CloudServices accounts ) */
744
- environmentName?: string;
745
- /** Cloud Provider that Cloud Account represents */
746
- provider: "AWS" | "Azure";
747
- /** Type of the Cloud Account (Custom Cloud or Cloud Services) */
748
- "type": "CustomCloud" | "CloudServices";
749
- region?: string;
750
- /** AWS Role that can be used for connecting in account */
751
- role?: string;
752
- /** Status of this Cloud Account. Connected indicates it's ready to use, others status are self explained */
753
- status: "Connecting" | "Connected" | "Disconnected" | "Failed" | "Unknown";
754
- /** The ID this account have in Cloud Provider */
755
- cloudProviderAccountId?: string;
756
- /** The name given in Cloud Provider for this account (only available in CloudServices accounts) */
757
- cloudProviderAccountName?: string;
758
- /** Linked Account ID */
759
- linkedAccountId?: string;
760
- /** This Cloud Account credentials secret manager */
761
- credentialSecretIdentifier?: string;
762
- /** ID of the Control Tower that Cloud Account is connected */
763
- controlTowerId?: string;
764
- };
765
- export type PaginatedResponseAdminCloudAccountDetails = {
766
- data: AdminCloudAccountDetails[];
767
- nextPage?: string;
768
- prevPage?: string;
769
- count: number;
770
- };
771
- export type DeleteCloudAccountResponse = {
772
- cloudAccountId: Ulid;
773
- /** The type of the cloud account */
774
- cloudType: "CustomCloud" | "CloudServices";
775
- /** If the type is 'CloudServices', the delete operation opens a support case in order to delete the account */
776
- supportCaseId?: string;
777
- };
778
- /**
779
- * Get a single case
780
- */
781
- export function getCase({ jwtToken, id, pageNum, pageSize }: {
782
- jwtToken: JwtToken;
783
- id: number;
784
- pageNum?: number;
785
- pageSize?: number;
786
- }, opts?: Oazapfts.RequestOpts) {
787
- return oazapfts.ok(oazapfts.fetchJson<{
788
- status: 200;
789
- data: Case;
790
- } | {
791
- status: 422;
792
- data: {
793
- code: string;
794
- status: number;
795
- details: string;
796
- validationDetails?: ValidationDetails[];
797
- };
798
- } | {
799
- status: 500;
800
- data: {
801
- code: string;
802
- status: number;
803
- details: string;
804
- validationDetails?: ValidationDetails[];
805
- };
806
- }>(`/support/cases/${encodeURIComponent(id)}${QS.query(QS.explode({
807
- jwtToken,
808
- pageNum,
809
- pageSize
810
- }))}`, {
811
- ...opts
812
- }));
813
- }
814
- /**
815
- * Update a case
816
- */
817
- export function updateCase({ jwtToken, id, caseUpdate }: {
818
- jwtToken: JwtToken;
819
- id: number;
820
- caseUpdate: CaseUpdate;
821
- }, opts?: Oazapfts.RequestOpts) {
822
- return oazapfts.ok(oazapfts.fetchJson<{
823
- status: 200;
824
- data: Case;
825
- } | {
826
- status: 422;
827
- data: {
828
- code: string;
829
- status: number;
830
- details: string;
831
- validationDetails?: ValidationDetails[];
832
- };
833
- } | {
834
- status: 500;
835
- data: {
836
- code: string;
837
- status: number;
838
- details: string;
839
- validationDetails?: ValidationDetails[];
840
- };
841
- }>(`/support/cases/${encodeURIComponent(id)}${QS.query(QS.explode({
842
- jwtToken
843
- }))}`, oazapfts.json({
844
- ...opts,
845
- method: "PUT",
846
- body: caseUpdate
847
- })));
848
- }
849
- /**
850
- * Get a single saving plan
851
- */
852
- export function getSavingPlan({ id }: {
853
- id: number;
854
- }, opts?: Oazapfts.RequestOpts) {
855
- return oazapfts.ok(oazapfts.fetchJson<{
856
- status: 200;
857
- data: SavingPlan;
858
- } | {
859
- status: 422;
860
- data: {
861
- code: string;
862
- status: number;
863
- details: string;
864
- validationDetails?: ValidationDetails[];
865
- };
866
- } | {
867
- status: 500;
868
- data: {
869
- code: string;
870
- status: number;
871
- details: string;
872
- validationDetails?: ValidationDetails[];
873
- };
874
- }>(`/saving-plan/${encodeURIComponent(id)}${QS.query(QS.explode({
875
- id
876
- }))}`, {
877
- ...opts
878
- }));
879
- }
880
- /**
881
- * Update saving plan
882
- */
883
- export function updateSavingPlan({ id, savingPlanUpdate }: {
884
- id: number;
885
- savingPlanUpdate: SavingPlanUpdate;
886
- }, opts?: Oazapfts.RequestOpts) {
887
- return oazapfts.ok(oazapfts.fetchJson<{
888
- status: 200;
889
- data: SavingPlan;
890
- } | {
891
- status: 422;
892
- data: {
893
- code: string;
894
- status: number;
895
- details: string;
896
- validationDetails?: ValidationDetails[];
897
- };
898
- } | {
899
- status: 500;
900
- data: {
901
- code: string;
902
- status: number;
903
- details: string;
904
- validationDetails?: ValidationDetails[];
905
- };
906
- }>(`/saving-plan/${encodeURIComponent(id)}${QS.query(QS.explode({
907
- id
908
- }))}`, oazapfts.json({
909
- ...opts,
910
- method: "PUT",
911
- body: savingPlanUpdate
912
- })));
913
- }
914
395
  /**
915
396
  * Update a GuardRail
916
397
  */
917
- export function updateGuardrail({ jwtToken, guardrailUpdate }: {
918
- jwtToken: JwtToken;
398
+ export function updateGuardrail({ guardrailUpdate }: {
919
399
  guardrailUpdate: GuardrailUpdate;
920
400
  }, opts?: Oazapfts.RequestOpts) {
921
401
  return oazapfts.ok(oazapfts.fetchJson<{
@@ -936,9 +416,7 @@ export function updateGuardrail({ jwtToken, guardrailUpdate }: {
936
416
  details: string;
937
417
  validationDetails?: ValidationDetails[];
938
418
  };
939
- }>(`/admin/guardrail${QS.query(QS.explode({
940
- jwtToken
941
- }))}`, oazapfts.json({
419
+ }>("/admin/guardrail", oazapfts.json({
942
420
  ...opts,
943
421
  method: "PUT",
944
422
  body: guardrailUpdate
@@ -947,8 +425,7 @@ export function updateGuardrail({ jwtToken, guardrailUpdate }: {
947
425
  /**
948
426
  * Create a GuardRail
949
427
  */
950
- export function createGuardrail({ jwtToken, guardrailRequest }: {
951
- jwtToken: JwtToken;
428
+ export function createGuardrail({ guardrailRequest }: {
952
429
  guardrailRequest: GuardrailRequest;
953
430
  }, opts?: Oazapfts.RequestOpts) {
954
431
  return oazapfts.ok(oazapfts.fetchJson<{
@@ -970,9 +447,7 @@ export function createGuardrail({ jwtToken, guardrailRequest }: {
970
447
  details: string;
971
448
  validationDetails?: ValidationDetails[];
972
449
  };
973
- }>(`/admin/guardrail${QS.query(QS.explode({
974
- jwtToken
975
- }))}`, oazapfts.json({
450
+ }>("/admin/guardrail", oazapfts.json({
976
451
  ...opts,
977
452
  method: "POST",
978
453
  body: guardrailRequest
@@ -1012,8 +487,7 @@ export function updateBaseline({ baselineId, baselineUpdate }: {
1012
487
  /**
1013
488
  * Retrieves billing account summaries
1014
489
  */
1015
- export function listBillingAccounts({ jwtToken, stackSpotAccountId, showDeleted }: {
1016
- jwtToken: JwtToken;
490
+ export function listBillingAccounts({ stackSpotAccountId, showDeleted }: {
1017
491
  stackSpotAccountId: string;
1018
492
  showDeleted?: boolean;
1019
493
  }, opts?: Oazapfts.RequestOpts) {
@@ -1039,7 +513,6 @@ export function listBillingAccounts({ jwtToken, stackSpotAccountId, showDeleted
1039
513
  validationDetails?: ValidationDetails[];
1040
514
  };
1041
515
  }>(`/v2/finops/billing-accounts${QS.query(QS.explode({
1042
- jwtToken,
1043
516
  stackSpotAccountId,
1044
517
  showDeleted
1045
518
  }))}`, {
@@ -1049,8 +522,7 @@ export function listBillingAccounts({ jwtToken, stackSpotAccountId, showDeleted
1049
522
  /**
1050
523
  * Create new billing account
1051
524
  */
1052
- export function createBillingAccount({ jwtToken, billingAccountRequest }: {
1053
- jwtToken: JwtToken;
525
+ export function createBillingAccount({ billingAccountRequest }: {
1054
526
  billingAccountRequest: BillingAccountRequest;
1055
527
  }, opts?: Oazapfts.RequestOpts) {
1056
528
  return oazapfts.ok(oazapfts.fetchJson<{
@@ -1074,9 +546,7 @@ export function createBillingAccount({ jwtToken, billingAccountRequest }: {
1074
546
  details: string;
1075
547
  validationDetails?: ValidationDetails[];
1076
548
  };
1077
- }>(`/v2/finops/billing-accounts${QS.query(QS.explode({
1078
- jwtToken
1079
- }))}`, oazapfts.json({
549
+ }>("/v2/finops/billing-accounts", oazapfts.json({
1080
550
  ...opts,
1081
551
  method: "POST",
1082
552
  body: billingAccountRequest
@@ -1085,8 +555,7 @@ export function createBillingAccount({ jwtToken, billingAccountRequest }: {
1085
555
  /**
1086
556
  * Retrieves cost and usage metrics for your account.
1087
557
  */
1088
- export function processAllocationCostRequest({ jwtToken, allocationCostRequest }: {
1089
- jwtToken: JwtToken;
558
+ export function processAllocationCostRequest({ allocationCostRequest }: {
1090
559
  allocationCostRequest: AllocationCostRequest;
1091
560
  }, opts?: Oazapfts.RequestOpts) {
1092
561
  return oazapfts.ok(oazapfts.fetchJson<{
@@ -1114,29 +583,24 @@ export function processAllocationCostRequest({ jwtToken, allocationCostRequest }
1114
583
  details: string;
1115
584
  validationDetails?: ValidationDetails[];
1116
585
  };
1117
- }>(`/v2/finops/allocation-cost${QS.query(QS.explode({
1118
- jwtToken
1119
- }))}`, oazapfts.json({
586
+ }>("/v2/finops/allocation-cost", oazapfts.json({
1120
587
  ...opts,
1121
588
  method: "POST",
1122
589
  body: allocationCostRequest
1123
590
  })));
1124
591
  }
1125
592
  /**
1126
- * List support cases
593
+ * Enable a GuardRail in any level
1127
594
  */
1128
- export function listCases({ jwtToken, sortBy, sortOrder, search, page, pageSize, visibility }: {
1129
- jwtToken: JwtToken;
1130
- sortBy?: string;
1131
- sortOrder?: string;
1132
- search?: string;
1133
- page?: number;
1134
- pageSize?: number;
1135
- visibility?: "AccountLevel" | "UserLevel";
595
+ export function enableGuardrail({ account, workspace, env, enable, guardrailId }: {
596
+ account: string;
597
+ workspace?: string;
598
+ env?: string;
599
+ enable: boolean;
600
+ guardrailId: string;
1136
601
  }, opts?: Oazapfts.RequestOpts) {
1137
602
  return oazapfts.ok(oazapfts.fetchJson<{
1138
603
  status: 200;
1139
- data: ListCasesResponse;
1140
604
  } | {
1141
605
  status: 422;
1142
606
  data: {
@@ -1153,28 +617,25 @@ export function listCases({ jwtToken, sortBy, sortOrder, search, page, pageSize,
1153
617
  details: string;
1154
618
  validationDetails?: ValidationDetails[];
1155
619
  };
1156
- }>(`/support/cases${QS.query(QS.explode({
1157
- jwtToken,
1158
- sortBy,
1159
- sortOrder,
1160
- search,
1161
- page,
1162
- pageSize,
1163
- visibility
620
+ }>(`/guardrail/${encodeURIComponent(guardrailId)}${QS.query(QS.explode({
621
+ account,
622
+ workspace,
623
+ env,
624
+ enable
1164
625
  }))}`, {
1165
- ...opts
626
+ ...opts,
627
+ method: "POST"
1166
628
  }));
1167
629
  }
1168
630
  /**
1169
- * Create a support case
631
+ * Register a cloud offer for a Stackspot Account.
1170
632
  */
1171
- export function createCase({ jwtToken, caseRequest }: {
1172
- jwtToken: JwtToken;
1173
- caseRequest: CaseRequest;
633
+ export function registerOffer({ registerOfferRequest }: {
634
+ registerOfferRequest: RegisterOfferRequest;
1174
635
  }, opts?: Oazapfts.RequestOpts) {
1175
636
  return oazapfts.ok(oazapfts.fetchJson<{
1176
637
  status: 201;
1177
- data: Case;
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";
1178
639
  } | {
1179
640
  status: 422;
1180
641
  data: {
@@ -1191,24 +652,18 @@ export function createCase({ jwtToken, caseRequest }: {
1191
652
  details: string;
1192
653
  validationDetails?: ValidationDetails[];
1193
654
  };
1194
- }>(`/support/cases${QS.query(QS.explode({
1195
- jwtToken
1196
- }))}`, oazapfts.json({
655
+ }>("/cloud-offer", oazapfts.json({
1197
656
  ...opts,
1198
657
  method: "POST",
1199
- body: caseRequest
658
+ body: registerOfferRequest
1200
659
  })));
1201
660
  }
1202
- /**
1203
- * Upload an attachment
1204
- */
1205
- export function uploadAttachment({ jwtToken, attachmentUpload }: {
1206
- jwtToken: JwtToken;
1207
- attachmentUpload?: AttachmentUpload;
661
+ export function createNewContract({ createContractRequest }: {
662
+ createContractRequest: CreateContractRequest;
1208
663
  }, opts?: Oazapfts.RequestOpts) {
1209
664
  return oazapfts.ok(oazapfts.fetchJson<{
1210
665
  status: 201;
1211
- data: Attachment;
666
+ data: Contract;
1212
667
  } | {
1213
668
  status: 422;
1214
669
  data: {
@@ -1225,132 +680,20 @@ export function uploadAttachment({ jwtToken, attachmentUpload }: {
1225
680
  details: string;
1226
681
  validationDetails?: ValidationDetails[];
1227
682
  };
1228
- }>(`/support/attachment${QS.query(QS.explode({
1229
- jwtToken
1230
- }))}`, oazapfts.json({
1231
- ...opts,
1232
- method: "POST",
1233
- body: attachmentUpload
1234
- })));
1235
- }
1236
- /**
1237
- * Get list of saving plans
1238
- */
1239
- export function getListOfSavingPlans({ sortBy, sortOrder, filter, page, pageSize }: {
1240
- sortBy?: string;
1241
- sortOrder?: string;
1242
- filter?: string;
1243
- page?: number;
1244
- pageSize?: number;
1245
- }, opts?: Oazapfts.RequestOpts) {
1246
- return oazapfts.ok(oazapfts.fetchJson<{
1247
- status: 200;
1248
- data: PaginatedResourceSavingPlanSummary;
1249
- } | {
1250
- status: 422;
1251
- data: {
1252
- code: string;
1253
- status: number;
1254
- details: string;
1255
- validationDetails?: ValidationDetails[];
1256
- };
1257
- } | {
1258
- status: 500;
1259
- data: {
1260
- code: string;
1261
- status: number;
1262
- details: string;
1263
- validationDetails?: ValidationDetails[];
1264
- };
1265
- }>(`/saving-plan${QS.query(QS.explode({
1266
- sortBy,
1267
- sortOrder,
1268
- filter,
1269
- page,
1270
- pageSize
1271
- }))}`, {
1272
- ...opts
1273
- }));
1274
- }
1275
- /**
1276
- * Create saving plan
1277
- */
1278
- export function createSavingPlanByBudgetSaveType({ savingPlanRequest }: {
1279
- savingPlanRequest: SavingPlanRequest;
1280
- }, opts?: Oazapfts.RequestOpts) {
1281
- return oazapfts.ok(oazapfts.fetchJson<{
1282
- status: 201;
1283
- data: SavingPlan;
1284
- } | {
1285
- status: 422;
1286
- data: {
1287
- code: string;
1288
- status: number;
1289
- details: string;
1290
- validationDetails?: ValidationDetails[];
1291
- };
1292
- } | {
1293
- status: 500;
1294
- data: {
1295
- code: string;
1296
- status: number;
1297
- details: string;
1298
- validationDetails?: ValidationDetails[];
1299
- };
1300
- }>("/saving-plan", oazapfts.json({
683
+ }>("/admin/finops/contract", oazapfts.json({
1301
684
  ...opts,
1302
685
  method: "POST",
1303
- body: savingPlanRequest
686
+ body: createContractRequest
1304
687
  })));
1305
688
  }
1306
689
  /**
1307
- * Enable a GuardRail in any level
690
+ * Links services to a Stackspot account, allowing users from that account to see resources in CRE
1308
691
  */
1309
- export function enableGuardrail({ jwtToken, account, workspace, env, enable, guardrailId }: {
1310
- jwtToken: JwtToken;
1311
- account: string;
1312
- workspace?: string;
1313
- env?: string;
1314
- enable: boolean;
1315
- guardrailId: string;
692
+ export function linkResourceTypesToStackspotAccount({ linkResourceTypeToStackspotAccountRequest }: {
693
+ linkResourceTypeToStackspotAccountRequest: LinkResourceTypeToStackspotAccountRequest;
1316
694
  }, opts?: Oazapfts.RequestOpts) {
1317
695
  return oazapfts.ok(oazapfts.fetchJson<{
1318
696
  status: 200;
1319
- } | {
1320
- status: 422;
1321
- data: {
1322
- code: string;
1323
- status: number;
1324
- details: string;
1325
- validationDetails?: ValidationDetails[];
1326
- };
1327
- } | {
1328
- status: 500;
1329
- data: {
1330
- code: string;
1331
- status: number;
1332
- details: string;
1333
- validationDetails?: ValidationDetails[];
1334
- };
1335
- }>(`/guardrail/${encodeURIComponent(guardrailId)}${QS.query(QS.explode({
1336
- jwtToken,
1337
- account,
1338
- workspace,
1339
- env,
1340
- enable
1341
- }))}`, {
1342
- ...opts,
1343
- method: "POST"
1344
- }));
1345
- }
1346
- /**
1347
- * Register a cloud offer for a Stackspot Account.
1348
- */
1349
- export function registerOffer({ registerOfferRequest }: {
1350
- registerOfferRequest: RegisterOfferRequest;
1351
- }, opts?: Oazapfts.RequestOpts) {
1352
- return oazapfts.ok(oazapfts.fetchJson<{
1353
- status: 201;
1354
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";
1355
698
  } | {
1356
699
  status: 422;
@@ -1368,29 +711,19 @@ export function registerOffer({ registerOfferRequest }: {
1368
711
  details: string;
1369
712
  validationDetails?: ValidationDetails[];
1370
713
  };
1371
- }>("/cloud-offer", oazapfts.json({
714
+ }>("/admin/cloud-resource/link-service-to-stackspot-account", oazapfts.json({
1372
715
  ...opts,
1373
716
  method: "POST",
1374
- body: registerOfferRequest
717
+ body: linkResourceTypeToStackspotAccountRequest
1375
718
  })));
1376
719
  }
1377
720
  /**
1378
- * List all cloud accounts created for all workspaces
721
+ * Return all baseline registered
1379
722
  */
1380
- export function listCloudAccounts({ jwtToken, sortBy, sortOrder, filter, page, pageSize, $type, environment, status }: {
1381
- jwtToken: JwtToken;
1382
- sortBy?: string;
1383
- sortOrder?: string;
1384
- filter?: string;
1385
- page?: number;
1386
- pageSize?: number;
1387
- $type?: "CustomCloud" | "CloudServices";
1388
- environment?: string;
1389
- status?: "Connecting" | "Connected" | "Disconnected" | "Failed" | "Unknown";
1390
- }, opts?: Oazapfts.RequestOpts) {
723
+ export function getBaselines(opts?: Oazapfts.RequestOpts) {
1391
724
  return oazapfts.ok(oazapfts.fetchJson<{
1392
725
  status: 200;
1393
- data: PaginatedResourceCloudAccountResponse;
726
+ data: BaselineResponse[];
1394
727
  } | {
1395
728
  status: 422;
1396
729
  data: {
@@ -1407,64 +740,19 @@ export function listCloudAccounts({ jwtToken, sortBy, sortOrder, filter, page, p
1407
740
  details: string;
1408
741
  validationDetails?: ValidationDetails[];
1409
742
  };
1410
- }>(`/cloud-account${QS.query(QS.explode({
1411
- jwtToken,
1412
- sortBy,
1413
- sortOrder,
1414
- filter,
1415
- page,
1416
- pageSize,
1417
- "type": $type,
1418
- environment,
1419
- status
1420
- }))}`, {
743
+ }>("/admin/baseline", {
1421
744
  ...opts
1422
745
  }));
1423
746
  }
1424
747
  /**
1425
- * Connect a cloud account
1426
- */
1427
- export function createCloudAccount({ jwtToken, connectAccountRequest }: {
1428
- jwtToken: JwtToken;
1429
- connectAccountRequest: ConnectAccountRequest;
1430
- }, opts?: Oazapfts.RequestOpts) {
1431
- return oazapfts.ok(oazapfts.fetchJson<{
1432
- status: 201;
1433
- data: CloudAccountDetails;
1434
- } | {
1435
- status: 422;
1436
- data: {
1437
- code: string;
1438
- status: number;
1439
- details: string;
1440
- validationDetails?: ValidationDetails[];
1441
- };
1442
- } | {
1443
- status: 500;
1444
- data: {
1445
- code: string;
1446
- status: number;
1447
- details: string;
1448
- validationDetails?: ValidationDetails[];
1449
- };
1450
- }>(`/cloud-account${QS.query(QS.explode({
1451
- jwtToken
1452
- }))}`, oazapfts.json({
1453
- ...opts,
1454
- method: "POST",
1455
- body: connectAccountRequest
1456
- })));
1457
- }
1458
- /**
1459
- * Provision managed accounts in a workspace
748
+ * Create a baseline
1460
749
  */
1461
- export function provisionManagedAccountsForWorkspace({ jwtToken, managedAccountProvisionRequest }: {
1462
- jwtToken: JwtToken;
1463
- managedAccountProvisionRequest: ManagedAccountProvisionRequest;
750
+ export function createBaseline({ baselineRequest }: {
751
+ baselineRequest: BaselineRequest;
1464
752
  }, opts?: Oazapfts.RequestOpts) {
1465
753
  return oazapfts.ok(oazapfts.fetchJson<{
1466
754
  status: 201;
1467
- 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";
755
+ data: BaselineDetails;
1468
756
  } | {
1469
757
  status: 422;
1470
758
  data: {
@@ -1481,54 +769,26 @@ export function provisionManagedAccountsForWorkspace({ jwtToken, managedAccountP
1481
769
  details: string;
1482
770
  validationDetails?: ValidationDetails[];
1483
771
  };
1484
- }>(`/cloud-account/managed-account${QS.query(QS.explode({
1485
- jwtToken
1486
- }))}`, oazapfts.json({
772
+ }>("/admin/baseline", oazapfts.json({
1487
773
  ...opts,
1488
774
  method: "POST",
1489
- body: managedAccountProvisionRequest
775
+ body: baselineRequest
1490
776
  })));
1491
777
  }
1492
778
  /**
1493
- * Disconnect a Managed Account that was requested to disconnect via support case
779
+ * Retrieves details from a billing account
1494
780
  */
1495
- export function disconnectCloudAccountRequestedForDisconnect({ disconnectSupportCaseManagedAccountRequest }: {
1496
- disconnectSupportCaseManagedAccountRequest: DisconnectSupportCaseManagedAccountRequest;
781
+ export function getBillingAccountById({ stackSpotAccountId, billingAccountId }: {
782
+ stackSpotAccountId: string;
783
+ billingAccountId: string;
1497
784
  }, opts?: Oazapfts.RequestOpts) {
1498
785
  return oazapfts.ok(oazapfts.fetchJson<{
1499
786
  status: 200;
1500
- data: DisconnectSupportCaseManagedAccountResponse[];
787
+ data: BillingAccountDetailsResponse;
1501
788
  } | {
1502
- status: 422;
1503
- data: {
1504
- code: string;
1505
- status: number;
1506
- details: string;
1507
- validationDetails?: ValidationDetails[];
1508
- };
789
+ status: 401;
1509
790
  } | {
1510
- status: 500;
1511
- data: {
1512
- code: string;
1513
- status: number;
1514
- details: string;
1515
- validationDetails?: ValidationDetails[];
1516
- };
1517
- }>("/admin/managed-cloud/support-case/disconnect", oazapfts.json({
1518
- ...opts,
1519
- method: "POST",
1520
- body: disconnectSupportCaseManagedAccountRequest
1521
- })));
1522
- }
1523
- /**
1524
- * Get all relation between stackspot accounts and control towers
1525
- */
1526
- export function getAllAccountTower({ stackspotAccountId }: {
1527
- stackspotAccountId?: string;
1528
- }, opts?: Oazapfts.RequestOpts) {
1529
- return oazapfts.ok(oazapfts.fetchJson<{
1530
- status: 200;
1531
- data: StackspotAccountTower[];
791
+ status: 404;
1532
792
  } | {
1533
793
  status: 422;
1534
794
  data: {
@@ -1545,49 +805,26 @@ export function getAllAccountTower({ stackspotAccountId }: {
1545
805
  details: string;
1546
806
  validationDetails?: ValidationDetails[];
1547
807
  };
1548
- }>(`/admin/managed-cloud/control-tower${QS.query(QS.explode({
1549
- stackspotAccountId
808
+ }>(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
809
+ stackSpotAccountId
1550
810
  }))}`, {
1551
811
  ...opts
1552
812
  }));
1553
813
  }
1554
814
  /**
1555
- * Add a Control Tower ID to a Stackspot Account that will be used in creation of a Managed Cloud Account
815
+ * Delete a billing account
1556
816
  */
1557
- export function createAccountTower({ stackspotAccountTowerRequest }: {
1558
- stackspotAccountTowerRequest: StackspotAccountTowerRequest;
817
+ export function deleteBillingAccountById({ stackSpotAccountId, billingAccountId }: {
818
+ stackSpotAccountId: string;
819
+ billingAccountId: string;
1559
820
  }, opts?: Oazapfts.RequestOpts) {
1560
821
  return oazapfts.ok(oazapfts.fetchJson<{
1561
- status: 201;
1562
- data: CommonCreatedResponse;
822
+ status: 200;
823
+ data: BillingAccountDetailsResponse;
1563
824
  } | {
1564
- status: 422;
1565
- data: {
1566
- code: string;
1567
- status: number;
1568
- details: string;
1569
- validationDetails?: ValidationDetails[];
1570
- };
825
+ status: 401;
1571
826
  } | {
1572
- status: 500;
1573
- data: {
1574
- code: string;
1575
- status: number;
1576
- details: string;
1577
- validationDetails?: ValidationDetails[];
1578
- };
1579
- }>("/admin/managed-cloud/control-tower", oazapfts.json({
1580
- ...opts,
1581
- method: "POST",
1582
- body: stackspotAccountTowerRequest
1583
- })));
1584
- }
1585
- export function createNewContract({ createContractRequest }: {
1586
- createContractRequest: CreateContractRequest;
1587
- }, opts?: Oazapfts.RequestOpts) {
1588
- return oazapfts.ok(oazapfts.fetchJson<{
1589
- status: 201;
1590
- data: Contract;
827
+ status: 404;
1591
828
  } | {
1592
829
  status: 422;
1593
830
  data: {
@@ -1604,722 +841,24 @@ export function createNewContract({ createContractRequest }: {
1604
841
  details: string;
1605
842
  validationDetails?: ValidationDetails[];
1606
843
  };
1607
- }>("/admin/finops/contract", oazapfts.json({
844
+ }>(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
845
+ stackSpotAccountId
846
+ }))}`, {
1608
847
  ...opts,
1609
- method: "POST",
1610
- body: createContractRequest
1611
- })));
1612
- }
1613
- /**
1614
- * Links services to a Stackspot account, allowing users from that account to see resources in CRE
1615
- */
1616
- export function linkResourceTypesToStackspotAccount({ linkResourceTypeToStackspotAccountRequest }: {
1617
- linkResourceTypeToStackspotAccountRequest: LinkResourceTypeToStackspotAccountRequest;
1618
- }, opts?: Oazapfts.RequestOpts) {
1619
- return oazapfts.ok(oazapfts.fetchJson<{
1620
- status: 200;
1621
- 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";
1622
- } | {
1623
- status: 422;
1624
- data: {
1625
- code: string;
1626
- status: number;
1627
- details: string;
1628
- validationDetails?: ValidationDetails[];
1629
- };
1630
- } | {
1631
- status: 500;
1632
- data: {
1633
- code: string;
1634
- status: number;
1635
- details: string;
1636
- validationDetails?: ValidationDetails[];
1637
- };
1638
- }>("/admin/cloud-resource/link-service-to-stackspot-account", oazapfts.json({
1639
- ...opts,
1640
- method: "POST",
1641
- body: linkResourceTypeToStackspotAccountRequest
1642
- })));
1643
- }
1644
- /**
1645
- *
1646
- * Updates Managed Account related information. If the account is of CustomCloud type, it changes to CloudServices
1647
- * (managed account type).
1648
- *
1649
- */
1650
- export function updateManagedInfo({ updateManagedInfoRequest }: {
1651
- updateManagedInfoRequest: UpdateManagedInfoRequest;
1652
- }, opts?: Oazapfts.RequestOpts) {
1653
- return oazapfts.ok(oazapfts.fetchJson<{
1654
- status: 200;
1655
- data: UpdatedCloudAccountResponse;
1656
- } | {
1657
- status: 422;
1658
- data: {
1659
- code: string;
1660
- status: number;
1661
- details: string;
1662
- validationDetails?: ValidationDetails[];
1663
- };
1664
- } | {
1665
- status: 500;
1666
- data: {
1667
- code: string;
1668
- status: number;
1669
- details: string;
1670
- validationDetails?: ValidationDetails[];
1671
- };
1672
- }>("/admin/cloud-account/update-managed-account", oazapfts.json({
1673
- ...opts,
1674
- method: "POST",
1675
- body: updateManagedInfoRequest
1676
- })));
1677
- }
1678
- /**
1679
- * Disconnect a Cloud Account
1680
- */
1681
- export function disconnectCloudAccountById({ disconnectCloudAccountRequest }: {
1682
- disconnectCloudAccountRequest: DisconnectCloudAccountRequest;
1683
- }, opts?: Oazapfts.RequestOpts) {
1684
- return oazapfts.ok(oazapfts.fetchJson<{
1685
- status: 200;
1686
- data: UpdatedCloudAccountResponse;
1687
- } | {
1688
- status: 422;
1689
- data: {
1690
- code: string;
1691
- status: number;
1692
- details: string;
1693
- validationDetails?: ValidationDetails[];
1694
- };
1695
- } | {
1696
- status: 500;
1697
- data: {
1698
- code: string;
1699
- status: number;
1700
- details: string;
1701
- validationDetails?: ValidationDetails[];
1702
- };
1703
- }>("/admin/cloud-account/disconnect", oazapfts.json({
1704
- ...opts,
1705
- method: "POST",
1706
- body: disconnectCloudAccountRequest
1707
- })));
1708
- }
1709
- /**
1710
- * Return all baseline registered
1711
- */
1712
- export function getBaselines(opts?: Oazapfts.RequestOpts) {
1713
- return oazapfts.ok(oazapfts.fetchJson<{
1714
- status: 200;
1715
- data: BaselineResponse[];
1716
- } | {
1717
- status: 422;
1718
- data: {
1719
- code: string;
1720
- status: number;
1721
- details: string;
1722
- validationDetails?: ValidationDetails[];
1723
- };
1724
- } | {
1725
- status: 500;
1726
- data: {
1727
- code: string;
1728
- status: number;
1729
- details: string;
1730
- validationDetails?: ValidationDetails[];
1731
- };
1732
- }>("/admin/baseline", {
1733
- ...opts
1734
- }));
1735
- }
1736
- /**
1737
- * Create a baseline
1738
- */
1739
- export function createBaseline({ baselineRequest }: {
1740
- baselineRequest: BaselineRequest;
1741
- }, opts?: Oazapfts.RequestOpts) {
1742
- return oazapfts.ok(oazapfts.fetchJson<{
1743
- status: 201;
1744
- data: BaselineDetails;
1745
- } | {
1746
- status: 422;
1747
- data: {
1748
- code: string;
1749
- status: number;
1750
- details: string;
1751
- validationDetails?: ValidationDetails[];
1752
- };
1753
- } | {
1754
- status: 500;
1755
- data: {
1756
- code: string;
1757
- status: number;
1758
- details: string;
1759
- validationDetails?: ValidationDetails[];
1760
- };
1761
- }>("/admin/baseline", oazapfts.json({
1762
- ...opts,
1763
- method: "POST",
1764
- body: baselineRequest
1765
- })));
1766
- }
1767
- /**
1768
- * Retrieves details from a billing account
1769
- */
1770
- export function getBillingAccountById({ jwtToken, stackSpotAccountId, billingAccountId }: {
1771
- jwtToken: JwtToken;
1772
- stackSpotAccountId: string;
1773
- billingAccountId: string;
1774
- }, opts?: Oazapfts.RequestOpts) {
1775
- return oazapfts.ok(oazapfts.fetchJson<{
1776
- status: 200;
1777
- data: BillingAccountDetailsResponse;
1778
- } | {
1779
- status: 401;
1780
- } | {
1781
- status: 404;
1782
- } | {
1783
- status: 422;
1784
- data: {
1785
- code: string;
1786
- status: number;
1787
- details: string;
1788
- validationDetails?: ValidationDetails[];
1789
- };
1790
- } | {
1791
- status: 500;
1792
- data: {
1793
- code: string;
1794
- status: number;
1795
- details: string;
1796
- validationDetails?: ValidationDetails[];
1797
- };
1798
- }>(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
1799
- jwtToken,
1800
- stackSpotAccountId
1801
- }))}`, {
1802
- ...opts
1803
- }));
1804
- }
1805
- /**
1806
- * Delete a billing account
1807
- */
1808
- export function deleteBillingAccountById({ jwtToken, stackSpotAccountId, billingAccountId }: {
1809
- jwtToken: JwtToken;
1810
- stackSpotAccountId: string;
1811
- billingAccountId: string;
1812
- }, opts?: Oazapfts.RequestOpts) {
1813
- return oazapfts.ok(oazapfts.fetchJson<{
1814
- status: 200;
1815
- data: BillingAccountDetailsResponse;
1816
- } | {
1817
- status: 401;
1818
- } | {
1819
- status: 404;
1820
- } | {
1821
- status: 422;
1822
- data: {
1823
- code: string;
1824
- status: number;
1825
- details: string;
1826
- validationDetails?: ValidationDetails[];
1827
- };
1828
- } | {
1829
- status: 500;
1830
- data: {
1831
- code: string;
1832
- status: number;
1833
- details: string;
1834
- validationDetails?: ValidationDetails[];
1835
- };
1836
- }>(`/v2/finops/billing-accounts/${encodeURIComponent(billingAccountId)}${QS.query(QS.explode({
1837
- jwtToken,
1838
- stackSpotAccountId
1839
- }))}`, {
1840
- ...opts,
1841
- method: "DELETE"
1842
- }));
1843
- }
1844
- /**
1845
- * Get form fields and information
1846
- */
1847
- export function getFormField(opts?: Oazapfts.RequestOpts) {
1848
- return oazapfts.ok(oazapfts.fetchJson<{
1849
- status: 200;
1850
- data: SupportFormFieldResponse;
1851
- } | {
1852
- status: 422;
1853
- data: {
1854
- code: string;
1855
- status: number;
1856
- details: string;
1857
- validationDetails?: ValidationDetails[];
1858
- };
1859
- } | {
1860
- status: 500;
1861
- data: {
1862
- code: string;
1863
- status: number;
1864
- details: string;
1865
- validationDetails?: ValidationDetails[];
1866
- };
1867
- }>("/support/form/fields", {
1868
- ...opts
1869
- }));
1870
- }
1871
- /**
1872
- * Get an attachment file
1873
- */
1874
- export function getAttachment({ jwtToken, id }: {
1875
- jwtToken: JwtToken;
1876
- id: string;
1877
- }, opts?: Oazapfts.RequestOpts) {
1878
- return oazapfts.ok(oazapfts.fetchJson<{
1879
- status: 200;
1880
- data: AttachmentBase64;
1881
- } | {
1882
- status: 422;
1883
- data: {
1884
- code: string;
1885
- status: number;
1886
- details: string;
1887
- validationDetails?: ValidationDetails[];
1888
- };
1889
- } | {
1890
- status: 500;
1891
- data: {
1892
- code: string;
1893
- status: number;
1894
- details: string;
1895
- validationDetails?: ValidationDetails[];
1896
- };
1897
- }>(`/support/attachment/${encodeURIComponent(id)}${QS.query(QS.explode({
1898
- jwtToken
1899
- }))}`, {
1900
- ...opts
1901
- }));
1902
- }
1903
- export function healthz(opts?: Oazapfts.RequestOpts) {
1904
- return oazapfts.ok(oazapfts.fetchJson<{
1905
- status: 200;
1906
- data: HealthComponent;
1907
- } | {
1908
- status: 422;
1909
- data: {
1910
- code: string;
1911
- status: number;
1912
- details: string;
1913
- validationDetails?: ValidationDetails[];
1914
- };
1915
- } | {
1916
- status: 500;
1917
- data: {
1918
- code: string;
1919
- status: number;
1920
- details: string;
1921
- validationDetails?: ValidationDetails[];
1922
- };
1923
- }>("/healthz", {
1924
- ...opts
1925
- }));
848
+ method: "DELETE"
849
+ }));
1926
850
  }
1927
851
  /**
1928
852
  * Get all GuardRails
1929
853
  */
1930
- export function getGuardrails({ jwtToken, account, workspace, env }: {
1931
- jwtToken: JwtToken;
1932
- account: string;
1933
- workspace?: string;
1934
- env?: string;
1935
- }, opts?: Oazapfts.RequestOpts) {
1936
- return oazapfts.ok(oazapfts.fetchJson<{
1937
- status: 200;
1938
- data: GroupedGuardrailResponse[];
1939
- } | {
1940
- status: 422;
1941
- data: {
1942
- code: string;
1943
- status: number;
1944
- details: string;
1945
- validationDetails?: ValidationDetails[];
1946
- };
1947
- } | {
1948
- status: 500;
1949
- data: {
1950
- code: string;
1951
- status: number;
1952
- details: string;
1953
- validationDetails?: ValidationDetails[];
1954
- };
1955
- }>(`/guardrail${QS.query(QS.explode({
1956
- jwtToken,
1957
- account,
1958
- workspace,
1959
- env
1960
- }))}`, {
1961
- ...opts
1962
- }));
1963
- }
1964
- /**
1965
- * Get overview of costs, with current month, last month and three last month
1966
- */
1967
- export function getCostOverview({ jwtToken, sortBy, sortOrder }: {
1968
- jwtToken: JwtToken;
1969
- sortBy?: string;
1970
- sortOrder?: string;
1971
- }, opts?: Oazapfts.RequestOpts) {
1972
- return oazapfts.ok(oazapfts.fetchJson<{
1973
- status: 200;
1974
- data: CostOverview;
1975
- } | {
1976
- status: 422;
1977
- data: {
1978
- code: string;
1979
- status: number;
1980
- details: string;
1981
- validationDetails?: ValidationDetails[];
1982
- };
1983
- } | {
1984
- status: 500;
1985
- data: {
1986
- code: string;
1987
- status: number;
1988
- details: string;
1989
- validationDetails?: ValidationDetails[];
1990
- };
1991
- }>(`/finops/reports${QS.query(QS.explode({
1992
- jwtToken,
1993
- sortBy,
1994
- sortOrder
1995
- }))}`, {
1996
- ...opts
1997
- }));
1998
- }
1999
- export function downloadCsvFiles({ jwtToken, year, month }: {
2000
- jwtToken: JwtToken;
2001
- year: number;
2002
- month: number;
2003
- }, opts?: Oazapfts.RequestOpts) {
2004
- return oazapfts.ok(oazapfts.fetchJson<{
2005
- status: 200;
2006
- data: AttachmentBase64;
2007
- } | {
2008
- status: 422;
2009
- data: {
2010
- code: string;
2011
- status: number;
2012
- details: string;
2013
- validationDetails?: ValidationDetails[];
2014
- };
2015
- } | {
2016
- status: 500;
2017
- data: {
2018
- code: string;
2019
- status: number;
2020
- details: string;
2021
- validationDetails?: ValidationDetails[];
2022
- };
2023
- }>(`/finops/reports/download${QS.query(QS.explode({
2024
- jwtToken,
2025
- year,
2026
- month
2027
- }))}`, {
2028
- ...opts
2029
- }));
2030
- }
2031
- /**
2032
- * List all tags.
2033
- */
2034
- export function getAllTags({ stackspotAccountId }: {
2035
- stackspotAccountId: string;
2036
- }, opts?: Oazapfts.RequestOpts) {
2037
- return oazapfts.ok(oazapfts.fetchJson<{
2038
- status: 200;
2039
- data: string[];
2040
- } | {
2041
- status: 422;
2042
- data: {
2043
- code: string;
2044
- status: number;
2045
- details: string;
2046
- validationDetails?: ValidationDetails[];
2047
- };
2048
- } | {
2049
- status: 500;
2050
- data: {
2051
- code: string;
2052
- status: number;
2053
- details: string;
2054
- validationDetails?: ValidationDetails[];
2055
- };
2056
- }>(`/finops/allocation-cost-list-tags${QS.query(QS.explode({
2057
- stackspotAccountId
2058
- }))}`, {
2059
- ...opts
2060
- }));
2061
- }
2062
- /**
2063
- * lists all subTags of a given tag with their respective costs.
2064
- */
2065
- export function getAllocationCostTagValues({ jwtToken, masterAccount, tag, startDate, endDate, sort, page, pageSize }: {
2066
- jwtToken: JwtToken;
2067
- masterAccount: string;
2068
- tag: string;
2069
- startDate: string;
2070
- endDate: string;
2071
- sort?: ("NAME_ASC" | "NAME_DESC" | "COST_VALUE_ASC" | "COST_VALUE_DESC")[];
2072
- page?: number;
2073
- pageSize?: number;
2074
- }, opts?: Oazapfts.RequestOpts) {
2075
- return oazapfts.ok(oazapfts.fetchJson<{
2076
- status: 200;
2077
- data: PaginatedResponseAllocationCost;
2078
- } | {
2079
- status: 422;
2080
- data: {
2081
- code: string;
2082
- status: number;
2083
- details: string;
2084
- validationDetails?: ValidationDetails[];
2085
- };
2086
- } | {
2087
- status: 500;
2088
- data: {
2089
- code: string;
2090
- status: number;
2091
- details: string;
2092
- validationDetails?: ValidationDetails[];
2093
- };
2094
- }>(`/finops/allocation-cost-list-tag-values${QS.query(QS.explode({
2095
- jwtToken,
2096
- masterAccount,
2097
- tag,
2098
- startDate,
2099
- endDate,
2100
- sort,
2101
- page,
2102
- pageSize
2103
- }))}`, {
2104
- ...opts
2105
- }));
2106
- }
2107
- /**
2108
- * List all services of a subtag. Each service contains name and cost value.
2109
- */
2110
- export function getAllocationCostServices({ jwtToken, masterAccount, tag, tagValueName, startDate, endDate, sort, page, pageSize }: {
2111
- jwtToken: JwtToken;
2112
- masterAccount: string;
2113
- tag: string;
2114
- tagValueName: string;
2115
- startDate: string;
2116
- endDate: string;
2117
- sort?: ("NAME_ASC" | "NAME_DESC" | "COST_VALUE_ASC" | "COST_VALUE_DESC")[];
2118
- page?: number;
2119
- pageSize?: number;
2120
- }, opts?: Oazapfts.RequestOpts) {
2121
- return oazapfts.ok(oazapfts.fetchJson<{
2122
- status: 200;
2123
- data: PaginatedResponseAllocationCost;
2124
- } | {
2125
- status: 422;
2126
- data: {
2127
- code: string;
2128
- status: number;
2129
- details: string;
2130
- validationDetails?: ValidationDetails[];
2131
- };
2132
- } | {
2133
- status: 500;
2134
- data: {
2135
- code: string;
2136
- status: number;
2137
- details: string;
2138
- validationDetails?: ValidationDetails[];
2139
- };
2140
- }>(`/finops/allocation-cost-list-services${QS.query(QS.explode({
2141
- jwtToken,
2142
- masterAccount,
2143
- tag,
2144
- tagValueName,
2145
- startDate,
2146
- endDate,
2147
- sort,
2148
- page,
2149
- pageSize
2150
- }))}`, {
2151
- ...opts
2152
- }));
2153
- }
2154
- /**
2155
- * list service details
2156
- */
2157
- export function getAllocationCostServiceDetails({ jwtToken, masterAccount, tag, tagValueName, serviceName, startDate, endDate, $type, filter, page, pageSize, sort }: {
2158
- jwtToken: JwtToken;
2159
- masterAccount: string;
2160
- tag: string;
2161
- tagValueName: string;
2162
- serviceName: string;
2163
- startDate: string;
2164
- endDate: string;
2165
- $type: string;
2166
- filter?: string[];
2167
- page?: number;
2168
- pageSize?: number;
2169
- sort?: ("NAME_ASC" | "NAME_DESC" | "COST_VALUE_ASC" | "COST_VALUE_DESC")[];
2170
- }, opts?: Oazapfts.RequestOpts) {
2171
- return oazapfts.ok(oazapfts.fetchJson<{
2172
- status: 200;
2173
- data: PaginatedResponseAllocationCostDetails;
2174
- } | {
2175
- status: 422;
2176
- data: {
2177
- code: string;
2178
- status: number;
2179
- details: string;
2180
- validationDetails?: ValidationDetails[];
2181
- };
2182
- } | {
2183
- status: 500;
2184
- data: {
2185
- code: string;
2186
- status: number;
2187
- details: string;
2188
- validationDetails?: ValidationDetails[];
2189
- };
2190
- }>(`/finops/allocation-cost-list-service-details${QS.query(QS.explode({
2191
- jwtToken,
2192
- masterAccount,
2193
- tag,
2194
- tagValueName,
2195
- serviceName,
2196
- startDate,
2197
- endDate,
2198
- "type": $type,
2199
- filter,
2200
- page,
2201
- pageSize,
2202
- sort
2203
- }))}`, {
2204
- ...opts
2205
- }));
2206
- }
2207
- /**
2208
- * list all master accounts
2209
- */
2210
- export function getAllMasterAccount({ stackspotAccountId }: {
2211
- stackspotAccountId: string;
2212
- }, opts?: Oazapfts.RequestOpts) {
2213
- return oazapfts.ok(oazapfts.fetchJson<{
2214
- status: 200;
2215
- data: string[];
2216
- } | {
2217
- status: 422;
2218
- data: {
2219
- code: string;
2220
- status: number;
2221
- details: string;
2222
- validationDetails?: ValidationDetails[];
2223
- };
2224
- } | {
2225
- status: 500;
2226
- data: {
2227
- code: string;
2228
- status: number;
2229
- details: string;
2230
- validationDetails?: ValidationDetails[];
2231
- };
2232
- }>(`/finops/allocation-cost-list-master-accounts${QS.query(QS.explode({
2233
- stackspotAccountId
2234
- }))}`, {
2235
- ...opts
2236
- }));
2237
- }
2238
- /**
2239
- * list filters related to the type
2240
- */
2241
- export function getAllocationCostFilters({ jwtToken, $type }: {
2242
- jwtToken: JwtToken;
2243
- $type: "SUB_ACCOUNT_ID" | "REGION";
2244
- }, opts?: Oazapfts.RequestOpts) {
2245
- return oazapfts.ok(oazapfts.fetchJson<{
2246
- status: 200;
2247
- data: string[];
2248
- } | {
2249
- status: 422;
2250
- data: {
2251
- code: string;
2252
- status: number;
2253
- details: string;
2254
- validationDetails?: ValidationDetails[];
2255
- };
2256
- } | {
2257
- status: 500;
2258
- data: {
2259
- code: string;
2260
- status: number;
2261
- details: string;
2262
- validationDetails?: ValidationDetails[];
2263
- };
2264
- }>(`/finops/allocation-cost-filters${QS.query(QS.explode({
2265
- jwtToken,
2266
- "type": $type
2267
- }))}`, {
2268
- ...opts
2269
- }));
2270
- }
2271
- /**
2272
- * returns the detailed csv with the masterAccount CUR information
2273
- */
2274
- export function getAllocationCostCsv({ jwtToken, stackspotAccountId, masterAccount, startDate, endDate }: {
2275
- jwtToken: JwtToken;
2276
- stackspotAccountId: string;
2277
- masterAccount: string;
2278
- startDate: string;
2279
- endDate: string;
2280
- }, opts?: Oazapfts.RequestOpts) {
2281
- return oazapfts.ok(oazapfts.fetchJson<{
2282
- status: 200;
2283
- data: AttachmentBase64;
2284
- } | {
2285
- status: 422;
2286
- data: {
2287
- code: string;
2288
- status: number;
2289
- details: string;
2290
- validationDetails?: ValidationDetails[];
2291
- };
2292
- } | {
2293
- status: 500;
2294
- data: {
2295
- code: string;
2296
- status: number;
2297
- details: string;
2298
- validationDetails?: ValidationDetails[];
2299
- };
2300
- }>(`/finops/allocation-cost-csv${QS.query(QS.explode({
2301
- jwtToken,
2302
- stackspotAccountId,
2303
- masterAccount,
2304
- startDate,
2305
- endDate
2306
- }))}`, {
2307
- ...opts
2308
- }));
2309
- }
2310
- /**
2311
- * List Instances of a particular Service Resource running in a Workspace
2312
- */
2313
- export function listInstances({ jwtToken, workspaceId, resourceId, pageToken, search }: {
2314
- jwtToken: JwtToken;
2315
- workspaceId: string;
2316
- resourceId: string;
2317
- pageToken?: string;
2318
- search?: string;
854
+ export function getGuardrails({ account, workspace, env }: {
855
+ account: string;
856
+ workspace?: string;
857
+ env?: string;
2319
858
  }, opts?: Oazapfts.RequestOpts) {
2320
859
  return oazapfts.ok(oazapfts.fetchJson<{
2321
860
  status: 200;
2322
- data: ManagedResourceList;
861
+ data: GroupedGuardrailResponse[];
2323
862
  } | {
2324
863
  status: 422;
2325
864
  data: {
@@ -2336,23 +875,24 @@ export function listInstances({ jwtToken, workspaceId, resourceId, pageToken, se
2336
875
  details: string;
2337
876
  validationDetails?: ValidationDetails[];
2338
877
  };
2339
- }>(`/cloud-resource/workspace/${encodeURIComponent(workspaceId)}/resource/${encodeURIComponent(resourceId)}/instance${QS.query(QS.explode({
2340
- jwtToken,
2341
- pageToken,
2342
- search
878
+ }>(`/guardrail${QS.query(QS.explode({
879
+ account,
880
+ workspace,
881
+ env
2343
882
  }))}`, {
2344
883
  ...opts
2345
884
  }));
2346
885
  }
2347
886
  /**
2348
- * List Managed Services
887
+ * Get overview of costs, with current month, last month and three last month
2349
888
  */
2350
- export function listServices({ jwtToken }: {
2351
- jwtToken: JwtToken;
889
+ export function getCostOverview({ sortBy, sortOrder }: {
890
+ sortBy?: string;
891
+ sortOrder?: string;
2352
892
  }, opts?: Oazapfts.RequestOpts) {
2353
893
  return oazapfts.ok(oazapfts.fetchJson<{
2354
894
  status: 200;
2355
- data: ManagedService[];
895
+ data: CostOverview;
2356
896
  } | {
2357
897
  status: 422;
2358
898
  data: {
@@ -2369,24 +909,20 @@ export function listServices({ jwtToken }: {
2369
909
  details: string;
2370
910
  validationDetails?: ValidationDetails[];
2371
911
  };
2372
- }>(`/cloud-resource/service${QS.query(QS.explode({
2373
- jwtToken
912
+ }>(`/finops/reports${QS.query(QS.explode({
913
+ sortBy,
914
+ sortOrder
2374
915
  }))}`, {
2375
916
  ...opts
2376
917
  }));
2377
918
  }
2378
- /**
2379
- * A detailed description of a particular Instance
2380
- */
2381
- export function getInstanceDetails({ jwtToken, cloudAccountId, resourceId, instanceId }: {
2382
- jwtToken: JwtToken;
2383
- cloudAccountId: string;
2384
- resourceId: string;
2385
- instanceId: string;
919
+ export function downloadCsvFiles({ year, month }: {
920
+ year: number;
921
+ month: number;
2386
922
  }, opts?: Oazapfts.RequestOpts) {
2387
923
  return oazapfts.ok(oazapfts.fetchJson<{
2388
924
  status: 200;
2389
- data: object;
925
+ data: AttachmentBase64;
2390
926
  } | {
2391
927
  status: 422;
2392
928
  data: {
@@ -2403,21 +939,22 @@ export function getInstanceDetails({ jwtToken, cloudAccountId, resourceId, insta
2403
939
  details: string;
2404
940
  validationDetails?: ValidationDetails[];
2405
941
  };
2406
- }>(`/cloud-resource/cloud-account/${encodeURIComponent(cloudAccountId)}/resource/${encodeURIComponent(resourceId)}/instance/${encodeURIComponent(instanceId)}${QS.query(QS.explode({
2407
- jwtToken
942
+ }>(`/finops/reports/download${QS.query(QS.explode({
943
+ year,
944
+ month
2408
945
  }))}`, {
2409
946
  ...opts
2410
947
  }));
2411
948
  }
2412
949
  /**
2413
- * Get the cloud offer of a Stackspot Account.
950
+ * List all tags.
2414
951
  */
2415
- export function getOfferOfAccount({ id }: {
2416
- id: string;
952
+ export function getAllTags({ stackspotAccountId }: {
953
+ stackspotAccountId: string;
2417
954
  }, opts?: Oazapfts.RequestOpts) {
2418
955
  return oazapfts.ok(oazapfts.fetchJson<{
2419
956
  status: 200;
2420
- data: CloudOfferResponse;
957
+ data: string[];
2421
958
  } | {
2422
959
  status: 422;
2423
960
  data: {
@@ -2434,19 +971,27 @@ export function getOfferOfAccount({ id }: {
2434
971
  details: string;
2435
972
  validationDetails?: ValidationDetails[];
2436
973
  };
2437
- }>(`/cloud-offer/account/${encodeURIComponent(id)}`, {
974
+ }>(`/finops/allocation-cost-list-tags${QS.query(QS.explode({
975
+ stackspotAccountId
976
+ }))}`, {
2438
977
  ...opts
2439
978
  }));
2440
979
  }
2441
980
  /**
2442
- * Get the external-id for the given Cloud Account ID.
981
+ * lists all subTags of a given tag with their respective costs.
2443
982
  */
2444
- export function getCloudAccountExternalId({ cloudAccountId }: {
2445
- cloudAccountId: string;
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;
2446
991
  }, opts?: Oazapfts.RequestOpts) {
2447
992
  return oazapfts.ok(oazapfts.fetchJson<{
2448
993
  status: 200;
2449
- data: string;
994
+ data: PaginatedResponseAllocationCost;
2450
995
  } | {
2451
996
  status: 422;
2452
997
  data: {
@@ -2463,20 +1008,34 @@ export function getCloudAccountExternalId({ cloudAccountId }: {
2463
1008
  details: string;
2464
1009
  validationDetails?: ValidationDetails[];
2465
1010
  };
2466
- }>(`/cloud-account/${encodeURIComponent(cloudAccountId)}/external-id`, {
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
+ }))}`, {
2467
1020
  ...opts
2468
1021
  }));
2469
1022
  }
2470
1023
  /**
2471
- * Get the cloud account workflow of a workspace environment
1024
+ * List all services of a subtag. Each service contains name and cost value.
2472
1025
  */
2473
- export function getProvisionWorkflowInWorkspace({ jwtToken, workspaceId }: {
2474
- jwtToken: JwtToken;
2475
- workspaceId: string;
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;
2476
1035
  }, opts?: Oazapfts.RequestOpts) {
2477
1036
  return oazapfts.ok(oazapfts.fetchJson<{
2478
1037
  status: 200;
2479
- data: Workflow;
1038
+ data: PaginatedResponseAllocationCost;
2480
1039
  } | {
2481
1040
  status: 422;
2482
1041
  data: {
@@ -2493,23 +1052,38 @@ export function getProvisionWorkflowInWorkspace({ jwtToken, workspaceId }: {
2493
1052
  details: string;
2494
1053
  validationDetails?: ValidationDetails[];
2495
1054
  };
2496
- }>(`/cloud-account/workspace/${encodeURIComponent(workspaceId)}/workflow${QS.query(QS.explode({
2497
- jwtToken
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
2498
1064
  }))}`, {
2499
1065
  ...opts
2500
1066
  }));
2501
1067
  }
2502
1068
  /**
2503
- * Get a cloud account connected to a workspace environment
1069
+ * list service details
2504
1070
  */
2505
- export function getCloudAccountByEnvironment({ accountId, workspaceId, environmentId }: {
2506
- accountId: string;
2507
- workspaceId: string;
2508
- environmentId: string;
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")[];
2509
1083
  }, opts?: Oazapfts.RequestOpts) {
2510
1084
  return oazapfts.ok(oazapfts.fetchJson<{
2511
1085
  status: 200;
2512
- data: CloudAccountWithCredentialResponse;
1086
+ data: PaginatedResponseAllocationCostDetails;
2513
1087
  } | {
2514
1088
  status: 422;
2515
1089
  data: {
@@ -2526,24 +1100,31 @@ export function getCloudAccountByEnvironment({ accountId, workspaceId, environme
2526
1100
  details: string;
2527
1101
  validationDetails?: ValidationDetails[];
2528
1102
  };
2529
- }>(`/cloud-account/workspace/${encodeURIComponent(workspaceId)}/environment/${encodeURIComponent(environmentId)}`, {
2530
- ...opts,
2531
- headers: oazapfts.mergeHeaders(opts?.headers, {
2532
- accountId
2533
- })
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
2534
1117
  }));
2535
1118
  }
2536
1119
  /**
2537
- * Get a list of cloud accounts connected to a workspace
1120
+ * list all master accounts
2538
1121
  */
2539
- export function getCloudAccountByWorkspace({ jwtToken, accountId, id }: {
2540
- jwtToken: JwtToken;
2541
- accountId?: string;
2542
- id: string;
1122
+ export function getAllMasterAccount({ stackspotAccountId }: {
1123
+ stackspotAccountId: string;
2543
1124
  }, opts?: Oazapfts.RequestOpts) {
2544
1125
  return oazapfts.ok(oazapfts.fetchJson<{
2545
1126
  status: 200;
2546
- data: CloudAccountDetails[];
1127
+ data: string[];
2547
1128
  } | {
2548
1129
  status: 422;
2549
1130
  data: {
@@ -2560,22 +1141,21 @@ export function getCloudAccountByWorkspace({ jwtToken, accountId, id }: {
2560
1141
  details: string;
2561
1142
  validationDetails?: ValidationDetails[];
2562
1143
  };
2563
- }>(`/cloud-account/workspace/${encodeURIComponent(id)}${QS.query(QS.explode({
2564
- jwtToken
1144
+ }>(`/finops/allocation-cost-list-master-accounts${QS.query(QS.explode({
1145
+ stackspotAccountId
2565
1146
  }))}`, {
2566
- ...opts,
2567
- headers: oazapfts.mergeHeaders(opts?.headers, {
2568
- accountId
2569
- })
1147
+ ...opts
2570
1148
  }));
2571
1149
  }
2572
1150
  /**
2573
- * Get all available templates for Managed Cloud
1151
+ * list filters related to the type
2574
1152
  */
2575
- export function getManagedCloudTemplate(opts?: Oazapfts.RequestOpts) {
1153
+ export function getAllocationCostFilters({ $type }: {
1154
+ $type: "SUB_ACCOUNT_ID" | "REGION";
1155
+ }, opts?: Oazapfts.RequestOpts) {
2576
1156
  return oazapfts.ok(oazapfts.fetchJson<{
2577
1157
  status: 200;
2578
- data: ManagedAccountTemplateResponse[];
1158
+ data: string[];
2579
1159
  } | {
2580
1160
  status: 422;
2581
1161
  data: {
@@ -2592,17 +1172,24 @@ export function getManagedCloudTemplate(opts?: Oazapfts.RequestOpts) {
2592
1172
  details: string;
2593
1173
  validationDetails?: ValidationDetails[];
2594
1174
  };
2595
- }>("/cloud-account/managed-account/template", {
1175
+ }>(`/finops/allocation-cost-filters${QS.query(QS.explode({
1176
+ "type": $type
1177
+ }))}`, {
2596
1178
  ...opts
2597
1179
  }));
2598
1180
  }
2599
1181
  /**
2600
- * Get all available regions for Managed Cloud
1182
+ * returns the detailed csv with the masterAccount CUR information
2601
1183
  */
2602
- export function getManagedCloudRegion(opts?: Oazapfts.RequestOpts) {
1184
+ export function getAllocationCostCsv({ stackspotAccountId, masterAccount, startDate, endDate }: {
1185
+ stackspotAccountId: string;
1186
+ masterAccount: string;
1187
+ startDate: string;
1188
+ endDate: string;
1189
+ }, opts?: Oazapfts.RequestOpts) {
2603
1190
  return oazapfts.ok(oazapfts.fetchJson<{
2604
1191
  status: 200;
2605
- data: ManagedAccountRegionResponse[];
1192
+ data: AttachmentBase64;
2606
1193
  } | {
2607
1194
  status: 422;
2608
1195
  data: {
@@ -2619,28 +1206,27 @@ export function getManagedCloudRegion(opts?: Oazapfts.RequestOpts) {
2619
1206
  details: string;
2620
1207
  validationDetails?: ValidationDetails[];
2621
1208
  };
2622
- }>("/cloud-account/managed-account/region", {
1209
+ }>(`/finops/allocation-cost-csv${QS.query(QS.explode({
1210
+ stackspotAccountId,
1211
+ masterAccount,
1212
+ startDate,
1213
+ endDate
1214
+ }))}`, {
2623
1215
  ...opts
2624
1216
  }));
2625
1217
  }
2626
1218
  /**
2627
- * Get pages alerts from workspace and environment. That alerts can be filtered
1219
+ * List Instances of a particular Service Resource running in a Workspace
2628
1220
  */
2629
- export function getAlerts({ jwtToken, workspace, env, pillar, severity, status, search, sort, page, pageSize }: {
2630
- jwtToken: JwtToken;
2631
- workspace: string;
2632
- env: string;
2633
- pillar?: "SECURITY" | "COST_OPTIMIZATION" | "RELIABILITY";
2634
- severity?: "LOW" | "MEDIUM" | "HIGH" | "MANDATORY";
2635
- status?: "PENDING" | "NOT_APPLICABLE" | "COMPLETED";
1221
+ export function listInstances({ workspaceId, resourceId, pageToken, search }: {
1222
+ workspaceId: string;
1223
+ resourceId: string;
1224
+ pageToken?: string;
2636
1225
  search?: string;
2637
- sort?: ("STATUS_ASC" | "STATUS_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PILLAR_ASC" | "PILLAR_DESC" | "SEVERITY_ASC" | "SEVERITY_DESC")[];
2638
- page?: number;
2639
- pageSize?: number;
2640
1226
  }, opts?: Oazapfts.RequestOpts) {
2641
1227
  return oazapfts.ok(oazapfts.fetchJson<{
2642
1228
  status: 200;
2643
- data: PaginatedResponseAlert;
1229
+ data: ManagedResourceList;
2644
1230
  } | {
2645
1231
  status: 422;
2646
1232
  data: {
@@ -2657,29 +1243,20 @@ export function getAlerts({ jwtToken, workspace, env, pillar, severity, status,
2657
1243
  details: string;
2658
1244
  validationDetails?: ValidationDetails[];
2659
1245
  };
2660
- }>(`/alerts${QS.query(QS.explode({
2661
- jwtToken,
2662
- workspace,
2663
- env,
2664
- pillar,
2665
- severity,
2666
- status,
2667
- search,
2668
- sort,
2669
- page,
2670
- pageSize
1246
+ }>(`/cloud-resource/workspace/${encodeURIComponent(workspaceId)}/resource/${encodeURIComponent(resourceId)}/instance${QS.query(QS.explode({
1247
+ pageToken,
1248
+ search
2671
1249
  }))}`, {
2672
1250
  ...opts
2673
1251
  }));
2674
1252
  }
2675
- export function downloadDataByAccountId({ stackspotAccountId, year, month }: {
2676
- stackspotAccountId: string;
2677
- year: number;
2678
- month: number;
2679
- }, opts?: Oazapfts.RequestOpts) {
1253
+ /**
1254
+ * List Managed Services
1255
+ */
1256
+ export function listServices(opts?: Oazapfts.RequestOpts) {
2680
1257
  return oazapfts.ok(oazapfts.fetchJson<{
2681
1258
  status: 200;
2682
- data: AttachmentBase64;
1259
+ data: ManagedService[];
2683
1260
  } | {
2684
1261
  status: 422;
2685
1262
  data: {
@@ -2696,21 +1273,21 @@ export function downloadDataByAccountId({ stackspotAccountId, year, month }: {
2696
1273
  details: string;
2697
1274
  validationDetails?: ValidationDetails[];
2698
1275
  };
2699
- }>(`/admin/finops/reports/download${QS.query(QS.explode({
2700
- stackspot_account_id: stackspotAccountId,
2701
- year,
2702
- month
2703
- }))}`, {
1276
+ }>("/cloud-resource/service", {
2704
1277
  ...opts
2705
1278
  }));
2706
1279
  }
2707
1280
  /**
2708
- * List available services
1281
+ * A detailed description of a particular Instance
2709
1282
  */
2710
- export function listServices1(opts?: Oazapfts.RequestOpts) {
1283
+ export function getInstanceDetails({ cloudAccountId, resourceId, instanceId }: {
1284
+ cloudAccountId: string;
1285
+ resourceId: string;
1286
+ instanceId: string;
1287
+ }, opts?: Oazapfts.RequestOpts) {
2711
1288
  return oazapfts.ok(oazapfts.fetchJson<{
2712
1289
  status: 200;
2713
- data: ServiceSummary[];
1290
+ data: object;
2714
1291
  } | {
2715
1292
  status: 422;
2716
1293
  data: {
@@ -2727,24 +1304,19 @@ export function listServices1(opts?: Oazapfts.RequestOpts) {
2727
1304
  details: string;
2728
1305
  validationDetails?: ValidationDetails[];
2729
1306
  };
2730
- }>("/admin/cloud-resource/service", {
1307
+ }>(`/cloud-resource/cloud-account/${encodeURIComponent(cloudAccountId)}/resource/${encodeURIComponent(resourceId)}/instance/${encodeURIComponent(instanceId)}`, {
2731
1308
  ...opts
2732
1309
  }));
2733
1310
  }
2734
1311
  /**
2735
- * Get Cloud Account data with details
1312
+ * Get the cloud offer of a Stackspot Account.
2736
1313
  */
2737
- export function getCloudAccount({ stackspotAccountId, workspaceId, environmentId, provider, $type, status }: {
2738
- stackspotAccountId?: string;
2739
- workspaceId?: string;
2740
- environmentId?: string;
2741
- provider?: "AWS" | "Azure";
2742
- $type?: "CustomCloud" | "CloudServices";
2743
- status?: "Connecting" | "Connected" | "Disconnected" | "Failed" | "Unknown";
1314
+ export function getOfferOfAccount({ id }: {
1315
+ id: string;
2744
1316
  }, opts?: Oazapfts.RequestOpts) {
2745
1317
  return oazapfts.ok(oazapfts.fetchJson<{
2746
1318
  status: 200;
2747
- data: PaginatedResponseAdminCloudAccountDetails;
1319
+ data: AccountCloudOfferResponse;
2748
1320
  } | {
2749
1321
  status: 422;
2750
1322
  data: {
@@ -2761,27 +1333,27 @@ export function getCloudAccount({ stackspotAccountId, workspaceId, environmentId
2761
1333
  details: string;
2762
1334
  validationDetails?: ValidationDetails[];
2763
1335
  };
2764
- }>(`/admin/cloud-account${QS.query(QS.explode({
2765
- stackspotAccountId,
2766
- workspaceId,
2767
- environmentId,
2768
- provider,
2769
- "type": $type,
2770
- status
2771
- }))}`, {
1336
+ }>(`/cloud-offer/account/${encodeURIComponent(id)}`, {
2772
1337
  ...opts
2773
1338
  }));
2774
1339
  }
2775
1340
  /**
2776
- * Delete a cloud account.
1341
+ * Get pages alerts from workspace and environment. That alerts can be filtered
2777
1342
  */
2778
- export function deleteCloudAccountFromEnvironment({ jwtToken, id }: {
2779
- jwtToken: JwtToken;
2780
- id: string;
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;
2781
1353
  }, opts?: Oazapfts.RequestOpts) {
2782
1354
  return oazapfts.ok(oazapfts.fetchJson<{
2783
1355
  status: 200;
2784
- data: DeleteCloudAccountResponse;
1356
+ data: PaginatedResponseAlert;
2785
1357
  } | {
2786
1358
  status: 422;
2787
1359
  data: {
@@ -2798,25 +1370,28 @@ export function deleteCloudAccountFromEnvironment({ jwtToken, id }: {
2798
1370
  details: string;
2799
1371
  validationDetails?: ValidationDetails[];
2800
1372
  };
2801
- }>(`/cloud-account/${encodeURIComponent(id)}${QS.query(QS.explode({
2802
- jwtToken
1373
+ }>(`/alerts${QS.query(QS.explode({
1374
+ workspace,
1375
+ env,
1376
+ pillar,
1377
+ severity,
1378
+ status,
1379
+ search,
1380
+ sort,
1381
+ page,
1382
+ pageSize
2803
1383
  }))}`, {
2804
- ...opts,
2805
- method: "DELETE"
1384
+ ...opts
2806
1385
  }));
2807
1386
  }
2808
- /**
2809
- *
2810
- * Delete all accounts in a workspace.
2811
- *
2812
- */
2813
- export function deleteManagedAccountsFromWorkspace({ jwtToken, workspaceId }: {
2814
- jwtToken: JwtToken;
2815
- workspaceId: string;
1387
+ export function downloadDataByAccountId({ stackspotAccountId, year, month }: {
1388
+ stackspotAccountId: string;
1389
+ year: number;
1390
+ month: number;
2816
1391
  }, opts?: Oazapfts.RequestOpts) {
2817
1392
  return oazapfts.ok(oazapfts.fetchJson<{
2818
1393
  status: 200;
2819
- data: DeleteCloudAccountResponse;
1394
+ data: AttachmentBase64;
2820
1395
  } | {
2821
1396
  status: 422;
2822
1397
  data: {
@@ -2833,22 +1408,21 @@ export function deleteManagedAccountsFromWorkspace({ jwtToken, workspaceId }: {
2833
1408
  details: string;
2834
1409
  validationDetails?: ValidationDetails[];
2835
1410
  };
2836
- }>(`/cloud-account/workspace/${encodeURIComponent(workspaceId)}${QS.query(QS.explode({
2837
- jwtToken
1411
+ }>(`/admin/finops/reports/download${QS.query(QS.explode({
1412
+ stackspot_account_id: stackspotAccountId,
1413
+ year,
1414
+ month
2838
1415
  }))}`, {
2839
- ...opts,
2840
- method: "DELETE"
1416
+ ...opts
2841
1417
  }));
2842
1418
  }
2843
1419
  /**
2844
- * Delete a relation between control tower and stackspot account
1420
+ * List available services
2845
1421
  */
2846
- export function deleteAccountTower({ id }: {
2847
- id: string;
2848
- }, opts?: Oazapfts.RequestOpts) {
1422
+ export function listServices1(opts?: Oazapfts.RequestOpts) {
2849
1423
  return oazapfts.ok(oazapfts.fetchJson<{
2850
1424
  status: 200;
2851
- 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";
1425
+ data: ServiceSummary[];
2852
1426
  } | {
2853
1427
  status: 422;
2854
1428
  data: {
@@ -2865,8 +1439,7 @@ export function deleteAccountTower({ id }: {
2865
1439
  details: string;
2866
1440
  validationDetails?: ValidationDetails[];
2867
1441
  };
2868
- }>(`/admin/managed-cloud/control-tower/${encodeURIComponent(id)}`, {
2869
- ...opts,
2870
- method: "DELETE"
1442
+ }>("/admin/cloud-resource/service", {
1443
+ ...opts
2871
1444
  }));
2872
1445
  }