@stack-spot/portal-network 0.48.0 → 0.50.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.
- package/CHANGELOG.md +14 -0
- package/dist/api/cloudPlatform.d.ts +204 -41
- package/dist/api/cloudPlatform.d.ts.map +1 -1
- package/dist/api/cloudPlatform.js +107 -2
- package/dist/api/cloudPlatform.js.map +1 -1
- package/dist/client/cloud-platform.d.ts +70 -0
- package/dist/client/cloud-platform.d.ts.map +1 -1
- package/dist/client/cloud-platform.js +91 -1
- package/dist/client/cloud-platform.js.map +1 -1
- package/dist/error/dictionary/workspace.d.ts +36 -0
- package/dist/error/dictionary/workspace.d.ts.map +1 -1
- package/dist/error/dictionary/workspace.js +36 -0
- package/dist/error/dictionary/workspace.js.map +1 -1
- package/package.json +1 -1
- package/src/api/cloudPlatform.ts +412 -43
- package/src/client/cloud-platform.ts +50 -0
- package/src/error/dictionary/workspace.ts +36 -0
package/src/api/cloudPlatform.ts
CHANGED
|
@@ -8,54 +8,32 @@ import * as Oazapfts from "@oazapfts/runtime";
|
|
|
8
8
|
import * as QS from "@oazapfts/runtime/query";
|
|
9
9
|
export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
|
|
10
10
|
headers: {},
|
|
11
|
-
baseUrl: "https://cloud-cloud-platform-api.
|
|
11
|
+
baseUrl: "https://cloud-cloud-platform-api.stg.stackspot.com",
|
|
12
12
|
};
|
|
13
13
|
const oazapfts = Oazapfts.runtime(defaults);
|
|
14
14
|
export const servers = {
|
|
15
|
-
generatedServerUrl: "https://cloud-cloud-platform-api.
|
|
15
|
+
generatedServerUrl: "https://cloud-cloud-platform-api.stg.stackspot.com"
|
|
16
16
|
};
|
|
17
|
-
export type
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
healthCheckPath?: string;
|
|
34
|
-
envVars?: EnvVar[];
|
|
35
|
-
imageUrl?: string;
|
|
36
|
-
tag?: string;
|
|
37
|
-
runtimeId?: string;
|
|
38
|
-
mem?: number;
|
|
39
|
-
cpu?: number;
|
|
40
|
-
replicaNum?: ReplicasConfigRequest;
|
|
17
|
+
export type Foundation = {
|
|
18
|
+
/** Unique identifier of the foundation */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Human-readable name of the foundation */
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
Provision status. All resources are provisioned in an asynchronous manner. They should be available
|
|
24
|
+
for further actions when the status is READY. */
|
|
25
|
+
status: "READY" | "NOT_READY";
|
|
26
|
+
description?: string;
|
|
27
|
+
/** Cloud provider */
|
|
28
|
+
cloudProvider: "AWS" | "ORACLE";
|
|
29
|
+
/** The region where the foundation is provisioned */
|
|
30
|
+
region: string;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
updatedAt: string;
|
|
41
33
|
};
|
|
42
|
-
export type
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
action: "DEPLOY" | "STOP" | "START" | "RESTART" | "REDEPLOY";
|
|
46
|
-
containerPort?: string;
|
|
47
|
-
healthCheckPath?: string;
|
|
48
|
-
envVars?: EnvVar[];
|
|
49
|
-
imageUrl?: string;
|
|
50
|
-
versionTag?: string;
|
|
51
|
-
health?: "HEALTH" | "UNHEALTH";
|
|
52
|
-
deploymentStatus?: "UP" | "STOPPED" | "DEPLOYING";
|
|
53
|
-
runtimeId?: string;
|
|
54
|
-
mem?: number;
|
|
55
|
-
cpu?: number;
|
|
56
|
-
replicaNum?: ReplicasConfigRequest;
|
|
57
|
-
awsAccount?: string;
|
|
58
|
-
idAwsAccount?: string;
|
|
34
|
+
export type OffsetPageFoundation = {
|
|
35
|
+
data: Foundation[];
|
|
36
|
+
total: number;
|
|
59
37
|
};
|
|
60
38
|
export type ErrorResponse = {
|
|
61
39
|
message: string;
|
|
@@ -102,6 +80,127 @@ export type ErrorResponse = {
|
|
|
102
80
|
localizedMessage?: string;
|
|
103
81
|
};
|
|
104
82
|
};
|
|
83
|
+
export type CreateFoundationRequest = {
|
|
84
|
+
/** Human-readable name for the foundation */
|
|
85
|
+
name: string;
|
|
86
|
+
/** A short description for the foundation */
|
|
87
|
+
description?: string;
|
|
88
|
+
/** Cloud provider */
|
|
89
|
+
cloudProvider: "AWS" | "ORACLE";
|
|
90
|
+
/** The region where the foundation will be provisioned */
|
|
91
|
+
region: string;
|
|
92
|
+
};
|
|
93
|
+
export type FolderContentResponse = {
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
"type": "FOLDER" | "PROJECT";
|
|
97
|
+
status: "NOT_READY" | "READY";
|
|
98
|
+
};
|
|
99
|
+
export type FolderResponse = {
|
|
100
|
+
stackSpotAccountId: string;
|
|
101
|
+
foundationId: string;
|
|
102
|
+
parentFolderId?: string;
|
|
103
|
+
folderId: string;
|
|
104
|
+
folderName: string;
|
|
105
|
+
status: "NOT_READY" | "READY";
|
|
106
|
+
createdAt: string;
|
|
107
|
+
updatedAt: string;
|
|
108
|
+
deletedAt?: string;
|
|
109
|
+
content: FolderContentResponse[];
|
|
110
|
+
};
|
|
111
|
+
export type CreateFolderRequest = {
|
|
112
|
+
name: string;
|
|
113
|
+
};
|
|
114
|
+
export type DnsZoneResponse = {
|
|
115
|
+
stackSpotAccountId: string;
|
|
116
|
+
foundationId: string;
|
|
117
|
+
dnsZoneId: string;
|
|
118
|
+
domain: string;
|
|
119
|
+
dnsZoneType: "PUBLIC";
|
|
120
|
+
status: "NOT_READY" | "READY";
|
|
121
|
+
createdAt: string;
|
|
122
|
+
updatedAt: string;
|
|
123
|
+
deletedAt?: string;
|
|
124
|
+
};
|
|
125
|
+
export type ListDnsZoneResponse = {
|
|
126
|
+
stackSpotAccountId: string;
|
|
127
|
+
foundationId: string;
|
|
128
|
+
status: "NOT_READY" | "READY";
|
|
129
|
+
content: DnsZoneResponse[];
|
|
130
|
+
};
|
|
131
|
+
export type CreateDnsZoneRequest = {
|
|
132
|
+
domain: string;
|
|
133
|
+
"type": "PUBLIC";
|
|
134
|
+
};
|
|
135
|
+
export type CidrResponse = {
|
|
136
|
+
stackSpotAccountId: string;
|
|
137
|
+
foundationId: string;
|
|
138
|
+
cidrId: string;
|
|
139
|
+
cidrNotation: string;
|
|
140
|
+
networkAddress: string;
|
|
141
|
+
netmask: string;
|
|
142
|
+
broadcastAddress: string;
|
|
143
|
+
lowAddress: string;
|
|
144
|
+
highAddress: string;
|
|
145
|
+
addressCount: number;
|
|
146
|
+
status: "NOT_READY" | "READY";
|
|
147
|
+
createdAt: string;
|
|
148
|
+
updatedAt: string;
|
|
149
|
+
deletedAt?: string;
|
|
150
|
+
};
|
|
151
|
+
export type ListCidrResponse = {
|
|
152
|
+
stackSpotAccountId: string;
|
|
153
|
+
foundationId: string;
|
|
154
|
+
status: "NOT_READY" | "READY";
|
|
155
|
+
content: CidrResponse[];
|
|
156
|
+
};
|
|
157
|
+
export type CreateCidrRequest = {
|
|
158
|
+
address: string;
|
|
159
|
+
prefix: number;
|
|
160
|
+
};
|
|
161
|
+
export type EnvVar = {
|
|
162
|
+
key: string;
|
|
163
|
+
value: string;
|
|
164
|
+
};
|
|
165
|
+
export type ReplicasConfigRequest = {
|
|
166
|
+
/** Minimum number of replicas */
|
|
167
|
+
min?: number;
|
|
168
|
+
/** Maximum number of replicas */
|
|
169
|
+
max?: number;
|
|
170
|
+
cpu?: number;
|
|
171
|
+
};
|
|
172
|
+
export type CreateDeploymentRequest = {
|
|
173
|
+
applicationId?: string;
|
|
174
|
+
applicationName: string;
|
|
175
|
+
action: "DEPLOY" | "STOP" | "START" | "RESTART" | "REDEPLOY";
|
|
176
|
+
containerPort?: string;
|
|
177
|
+
healthCheckPath?: string;
|
|
178
|
+
envVars?: EnvVar[];
|
|
179
|
+
imageUrl?: string;
|
|
180
|
+
tag?: string;
|
|
181
|
+
runtimeId?: string;
|
|
182
|
+
mem?: number;
|
|
183
|
+
cpu?: number;
|
|
184
|
+
replicaNum?: ReplicasConfigRequest;
|
|
185
|
+
};
|
|
186
|
+
export type CreateDeploymentResponse = {
|
|
187
|
+
deploymentId?: string;
|
|
188
|
+
applicationURL?: string;
|
|
189
|
+
action: "DEPLOY" | "STOP" | "START" | "RESTART" | "REDEPLOY";
|
|
190
|
+
containerPort?: string;
|
|
191
|
+
healthCheckPath?: string;
|
|
192
|
+
envVars?: EnvVar[];
|
|
193
|
+
imageUrl?: string;
|
|
194
|
+
versionTag?: string;
|
|
195
|
+
health?: "HEALTH" | "UNHEALTH";
|
|
196
|
+
deploymentStatus?: "UP" | "STOPPED" | "DEPLOYING";
|
|
197
|
+
runtimeId?: string;
|
|
198
|
+
mem?: number;
|
|
199
|
+
cpu?: number;
|
|
200
|
+
replicaNum?: ReplicasConfigRequest;
|
|
201
|
+
awsAccount?: string;
|
|
202
|
+
idAwsAccount?: string;
|
|
203
|
+
};
|
|
105
204
|
export type CreateApplicationRequest = {
|
|
106
205
|
/** The name of the application in kebab-case format. */
|
|
107
206
|
name: string;
|
|
@@ -174,6 +273,14 @@ export type ImageResponse = {
|
|
|
174
273
|
imageUri: string;
|
|
175
274
|
tags: string[];
|
|
176
275
|
};
|
|
276
|
+
export type GetProvisionAvailabilityResponse = {
|
|
277
|
+
available: boolean;
|
|
278
|
+
};
|
|
279
|
+
export type CloudProvider = {
|
|
280
|
+
/** Cloud provider */
|
|
281
|
+
"type": "AWS" | "ORACLE";
|
|
282
|
+
regions: string[];
|
|
283
|
+
};
|
|
177
284
|
export type DeploymentStatusResponse = {
|
|
178
285
|
status: "UP" | "STOPPED" | "DEPLOYING";
|
|
179
286
|
};
|
|
@@ -233,6 +340,178 @@ export type ListApplicationsResponse = {
|
|
|
233
340
|
limit: number;
|
|
234
341
|
offset: number;
|
|
235
342
|
};
|
|
343
|
+
/**
|
|
344
|
+
* List foundations
|
|
345
|
+
*/
|
|
346
|
+
export function listFoundations({ limit, offset }: {
|
|
347
|
+
limit?: number;
|
|
348
|
+
offset?: number;
|
|
349
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
350
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
351
|
+
status: 200;
|
|
352
|
+
data: OffsetPageFoundation;
|
|
353
|
+
} | {
|
|
354
|
+
status: 500;
|
|
355
|
+
data: ErrorResponse;
|
|
356
|
+
} | {
|
|
357
|
+
status: 503;
|
|
358
|
+
data: ErrorResponse;
|
|
359
|
+
}>(`/v1/foundations${QS.query(QS.explode({
|
|
360
|
+
limit,
|
|
361
|
+
offset
|
|
362
|
+
}))}`, {
|
|
363
|
+
...opts
|
|
364
|
+
}));
|
|
365
|
+
}
|
|
366
|
+
export function createFoundation({ createFoundationRequest }: {
|
|
367
|
+
createFoundationRequest: CreateFoundationRequest;
|
|
368
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
369
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
370
|
+
status: 200;
|
|
371
|
+
data: Foundation;
|
|
372
|
+
} | {
|
|
373
|
+
status: 500;
|
|
374
|
+
data: ErrorResponse;
|
|
375
|
+
} | {
|
|
376
|
+
status: 503;
|
|
377
|
+
data: ErrorResponse;
|
|
378
|
+
}>("/v1/foundations", oazapfts.json({
|
|
379
|
+
...opts,
|
|
380
|
+
method: "POST",
|
|
381
|
+
body: createFoundationRequest
|
|
382
|
+
})));
|
|
383
|
+
}
|
|
384
|
+
export function getFolder({ foundationId, authorization, folderId }: {
|
|
385
|
+
foundationId: string;
|
|
386
|
+
authorization: string;
|
|
387
|
+
folderId: string;
|
|
388
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
389
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
390
|
+
status: 200;
|
|
391
|
+
data: FolderResponse;
|
|
392
|
+
} | {
|
|
393
|
+
status: 500;
|
|
394
|
+
data: ErrorResponse;
|
|
395
|
+
} | {
|
|
396
|
+
status: 503;
|
|
397
|
+
data: ErrorResponse;
|
|
398
|
+
}>(`/v1/foundations/${encodeURIComponent(foundationId)}/folders/${encodeURIComponent(folderId)}`, {
|
|
399
|
+
...opts,
|
|
400
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
401
|
+
Authorization: authorization
|
|
402
|
+
})
|
|
403
|
+
}));
|
|
404
|
+
}
|
|
405
|
+
export function createFolder({ authorization, foundationId, folderId, createFolderRequest }: {
|
|
406
|
+
authorization: string;
|
|
407
|
+
foundationId: string;
|
|
408
|
+
folderId: string;
|
|
409
|
+
createFolderRequest: CreateFolderRequest;
|
|
410
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
411
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
412
|
+
status: 200;
|
|
413
|
+
data: FolderResponse;
|
|
414
|
+
} | {
|
|
415
|
+
status: 500;
|
|
416
|
+
data: ErrorResponse;
|
|
417
|
+
} | {
|
|
418
|
+
status: 503;
|
|
419
|
+
data: ErrorResponse;
|
|
420
|
+
}>(`/v1/foundations/${encodeURIComponent(foundationId)}/folders/${encodeURIComponent(folderId)}`, oazapfts.json({
|
|
421
|
+
...opts,
|
|
422
|
+
method: "POST",
|
|
423
|
+
body: createFolderRequest,
|
|
424
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
425
|
+
Authorization: authorization
|
|
426
|
+
})
|
|
427
|
+
})));
|
|
428
|
+
}
|
|
429
|
+
export function listDnsZone({ authorization, foundationId }: {
|
|
430
|
+
authorization: string;
|
|
431
|
+
foundationId: string;
|
|
432
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
433
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
434
|
+
status: 200;
|
|
435
|
+
data: ListDnsZoneResponse;
|
|
436
|
+
} | {
|
|
437
|
+
status: 500;
|
|
438
|
+
data: ErrorResponse;
|
|
439
|
+
} | {
|
|
440
|
+
status: 503;
|
|
441
|
+
data: ErrorResponse;
|
|
442
|
+
}>(`/v1/foundations/${encodeURIComponent(foundationId)}/dns-zones`, {
|
|
443
|
+
...opts,
|
|
444
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
445
|
+
Authorization: authorization
|
|
446
|
+
})
|
|
447
|
+
}));
|
|
448
|
+
}
|
|
449
|
+
export function createDnsZone({ authorization, foundationId, createDnsZoneRequest }: {
|
|
450
|
+
authorization: string;
|
|
451
|
+
foundationId: string;
|
|
452
|
+
createDnsZoneRequest: CreateDnsZoneRequest;
|
|
453
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
454
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
455
|
+
status: 200;
|
|
456
|
+
data: DnsZoneResponse;
|
|
457
|
+
} | {
|
|
458
|
+
status: 500;
|
|
459
|
+
data: ErrorResponse;
|
|
460
|
+
} | {
|
|
461
|
+
status: 503;
|
|
462
|
+
data: ErrorResponse;
|
|
463
|
+
}>(`/v1/foundations/${encodeURIComponent(foundationId)}/dns-zones`, oazapfts.json({
|
|
464
|
+
...opts,
|
|
465
|
+
method: "POST",
|
|
466
|
+
body: createDnsZoneRequest,
|
|
467
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
468
|
+
Authorization: authorization
|
|
469
|
+
})
|
|
470
|
+
})));
|
|
471
|
+
}
|
|
472
|
+
export function listCidr({ foundationId, authorization }: {
|
|
473
|
+
foundationId: string;
|
|
474
|
+
authorization: string;
|
|
475
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
476
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
477
|
+
status: 200;
|
|
478
|
+
data: ListCidrResponse;
|
|
479
|
+
} | {
|
|
480
|
+
status: 500;
|
|
481
|
+
data: ErrorResponse;
|
|
482
|
+
} | {
|
|
483
|
+
status: 503;
|
|
484
|
+
data: ErrorResponse;
|
|
485
|
+
}>(`/v1/foundations/${encodeURIComponent(foundationId)}/cidr`, {
|
|
486
|
+
...opts,
|
|
487
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
488
|
+
Authorization: authorization
|
|
489
|
+
})
|
|
490
|
+
}));
|
|
491
|
+
}
|
|
492
|
+
export function createCidr({ authorization, foundationId, createCidrRequest }: {
|
|
493
|
+
authorization: string;
|
|
494
|
+
foundationId: string;
|
|
495
|
+
createCidrRequest: CreateCidrRequest;
|
|
496
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
497
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
498
|
+
status: 200;
|
|
499
|
+
data: CidrResponse;
|
|
500
|
+
} | {
|
|
501
|
+
status: 500;
|
|
502
|
+
data: ErrorResponse;
|
|
503
|
+
} | {
|
|
504
|
+
status: 503;
|
|
505
|
+
data: ErrorResponse;
|
|
506
|
+
}>(`/v1/foundations/${encodeURIComponent(foundationId)}/cidr`, oazapfts.json({
|
|
507
|
+
...opts,
|
|
508
|
+
method: "POST",
|
|
509
|
+
body: createCidrRequest,
|
|
510
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
511
|
+
Authorization: authorization
|
|
512
|
+
})
|
|
513
|
+
})));
|
|
514
|
+
}
|
|
236
515
|
export function createDeployment({ authorization, createDeploymentRequest }: {
|
|
237
516
|
authorization: string;
|
|
238
517
|
createDeploymentRequest: CreateDeploymentRequest;
|
|
@@ -434,6 +713,96 @@ export function getRepositoryImages({ authorization, repositoryId }: {
|
|
|
434
713
|
})
|
|
435
714
|
}));
|
|
436
715
|
}
|
|
716
|
+
export function getFoundation({ foundationId }: {
|
|
717
|
+
foundationId: string;
|
|
718
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
719
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
720
|
+
status: 200;
|
|
721
|
+
data: Foundation;
|
|
722
|
+
} | {
|
|
723
|
+
status: 500;
|
|
724
|
+
data: ErrorResponse;
|
|
725
|
+
} | {
|
|
726
|
+
status: 503;
|
|
727
|
+
data: ErrorResponse;
|
|
728
|
+
}>(`/v1/foundations/${encodeURIComponent(foundationId)}`, {
|
|
729
|
+
...opts
|
|
730
|
+
}));
|
|
731
|
+
}
|
|
732
|
+
export function getDnsZone({ foundationId, authorization, dnsZoneId }: {
|
|
733
|
+
foundationId: string;
|
|
734
|
+
authorization: string;
|
|
735
|
+
dnsZoneId: string;
|
|
736
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
737
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
738
|
+
status: 200;
|
|
739
|
+
data: DnsZoneResponse;
|
|
740
|
+
} | {
|
|
741
|
+
status: 500;
|
|
742
|
+
data: ErrorResponse;
|
|
743
|
+
} | {
|
|
744
|
+
status: 503;
|
|
745
|
+
data: ErrorResponse;
|
|
746
|
+
}>(`/v1/foundations/${encodeURIComponent(foundationId)}/dns-zones/${encodeURIComponent(dnsZoneId)}`, {
|
|
747
|
+
...opts,
|
|
748
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
749
|
+
Authorization: authorization
|
|
750
|
+
})
|
|
751
|
+
}));
|
|
752
|
+
}
|
|
753
|
+
export function getCidr({ foundationId, authorization, cidrId }: {
|
|
754
|
+
foundationId: string;
|
|
755
|
+
authorization: string;
|
|
756
|
+
cidrId: string;
|
|
757
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
758
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
759
|
+
status: 200;
|
|
760
|
+
data: CidrResponse;
|
|
761
|
+
} | {
|
|
762
|
+
status: 500;
|
|
763
|
+
data: ErrorResponse;
|
|
764
|
+
} | {
|
|
765
|
+
status: 503;
|
|
766
|
+
data: ErrorResponse;
|
|
767
|
+
}>(`/v1/foundations/${encodeURIComponent(foundationId)}/cidr/${encodeURIComponent(cidrId)}`, {
|
|
768
|
+
...opts,
|
|
769
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
770
|
+
Authorization: authorization
|
|
771
|
+
})
|
|
772
|
+
}));
|
|
773
|
+
}
|
|
774
|
+
export function getProvisionAvailability({ cloudProvider }: {
|
|
775
|
+
cloudProvider: "AWS" | "ORACLE";
|
|
776
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
777
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
778
|
+
status: 200;
|
|
779
|
+
data: GetProvisionAvailabilityResponse;
|
|
780
|
+
} | {
|
|
781
|
+
status: 500;
|
|
782
|
+
data: ErrorResponse;
|
|
783
|
+
} | {
|
|
784
|
+
status: 503;
|
|
785
|
+
data: ErrorResponse;
|
|
786
|
+
}>(`/v1/foundations/provision-availability${QS.query(QS.explode({
|
|
787
|
+
cloudProvider
|
|
788
|
+
}))}`, {
|
|
789
|
+
...opts
|
|
790
|
+
}));
|
|
791
|
+
}
|
|
792
|
+
export function providers(opts?: Oazapfts.RequestOpts) {
|
|
793
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
794
|
+
status: 200;
|
|
795
|
+
data: CloudProvider[];
|
|
796
|
+
} | {
|
|
797
|
+
status: 500;
|
|
798
|
+
data: ErrorResponse;
|
|
799
|
+
} | {
|
|
800
|
+
status: 503;
|
|
801
|
+
data: ErrorResponse;
|
|
802
|
+
}>("/v1/foundations/providers", {
|
|
803
|
+
...opts
|
|
804
|
+
}));
|
|
805
|
+
}
|
|
437
806
|
export function getDeploymentStatus({ authorization, deploymentId }: {
|
|
438
807
|
authorization: string;
|
|
439
808
|
deploymentId: string;
|
|
@@ -6,7 +6,11 @@ import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
|
6
6
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
7
|
import {
|
|
8
8
|
createApplication,
|
|
9
|
+
createCidr,
|
|
9
10
|
createDeployment,
|
|
11
|
+
createDnsZone,
|
|
12
|
+
createFolder,
|
|
13
|
+
createFoundation,
|
|
10
14
|
defaults,
|
|
11
15
|
getApplication,
|
|
12
16
|
getApplicationHistory,
|
|
@@ -14,11 +18,17 @@ import {
|
|
|
14
18
|
getDeploymentHealth,
|
|
15
19
|
getDeploymentLogs,
|
|
16
20
|
getDeploymentStatus,
|
|
21
|
+
getFolder,
|
|
22
|
+
getFoundation,
|
|
17
23
|
getRepositoryImages,
|
|
18
24
|
listApplications,
|
|
25
|
+
listCidr,
|
|
19
26
|
listDeployments,
|
|
27
|
+
listDnsZone,
|
|
28
|
+
listFoundations,
|
|
20
29
|
listRepositories,
|
|
21
30
|
listRuntimes,
|
|
31
|
+
providers,
|
|
22
32
|
} from '../api/cloudPlatform'
|
|
23
33
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
24
34
|
|
|
@@ -82,6 +92,46 @@ class CloudPlatformClient extends ReactQueryNetworkClient {
|
|
|
82
92
|
* Create an application
|
|
83
93
|
*/
|
|
84
94
|
createApplication = this.mutation(removeAuthorizationParam(createApplication))
|
|
95
|
+
/**
|
|
96
|
+
* List foundations
|
|
97
|
+
*/
|
|
98
|
+
listFoundations = this.query(removeAuthorizationParam(listFoundations))
|
|
99
|
+
/**
|
|
100
|
+
* Get a foundation by id
|
|
101
|
+
*/
|
|
102
|
+
foundation = this.query(removeAuthorizationParam(getFoundation))
|
|
103
|
+
/**
|
|
104
|
+
* Get list of foundations folders or folder by id
|
|
105
|
+
*/
|
|
106
|
+
listFolders = this.query(removeAuthorizationParam(getFolder))
|
|
107
|
+
/**
|
|
108
|
+
* Get list of providers for a foundation
|
|
109
|
+
*/
|
|
110
|
+
listProviders = this.query(removeAuthorizationParam(providers))
|
|
111
|
+
/**
|
|
112
|
+
* Create a foundation
|
|
113
|
+
*/
|
|
114
|
+
createFoundation = this.mutation(removeAuthorizationParam(createFoundation))
|
|
115
|
+
/**
|
|
116
|
+
* Create a foundation folder
|
|
117
|
+
*/
|
|
118
|
+
createFolder = this.mutation(removeAuthorizationParam(createFolder))
|
|
119
|
+
/**
|
|
120
|
+
* Get a list of dns zones
|
|
121
|
+
*/
|
|
122
|
+
listDnsZones = this.query(removeAuthorizationParam(listDnsZone))
|
|
123
|
+
/**
|
|
124
|
+
* Create a dns zone
|
|
125
|
+
*/
|
|
126
|
+
createDnsZone = this.mutation(removeAuthorizationParam(createDnsZone))
|
|
127
|
+
/**
|
|
128
|
+
* Get a list of cidrs
|
|
129
|
+
*/
|
|
130
|
+
listCidrs = this.query(removeAuthorizationParam(listCidr))
|
|
131
|
+
/**
|
|
132
|
+
* Create a cidr
|
|
133
|
+
*/
|
|
134
|
+
createCidr = this.mutation(removeAuthorizationParam(createCidr))
|
|
85
135
|
}
|
|
86
136
|
|
|
87
137
|
export const cloudPlatformClient = new CloudPlatformClient()
|
|
@@ -2,6 +2,8 @@ import { Dictionary } from '@stack-spot/portal-translate'
|
|
|
2
2
|
|
|
3
3
|
export const workspaceDictionary = {
|
|
4
4
|
en: {
|
|
5
|
+
WKS_API_WORKSPACE_FORBIDDEN: 'Permission required',
|
|
6
|
+
WKS_WORKSPACE_NOT_FOUND: 'Workspace not found',
|
|
5
7
|
WKS_CONNECTION_INTERFACE_ALREADY_EXISTS_FOR_ACCOUNT: 'A Connection Interface with this name already exists for this account.',
|
|
6
8
|
WKS_WORKSPACE_ALREADY_EXISTS_FOR_ACCOUNT: 'A Workspace with this name already exists. Please try another.',
|
|
7
9
|
WKS_THERE_IS_A_SHARED_INFRA_WITH_THIS_STACK_DELETE_ERROR: 'A Infrastructure has already been created with this Stack, so the Stack cannot be deleted.',
|
|
@@ -48,8 +50,26 @@ export const workspaceDictionary = {
|
|
|
48
50
|
WKS_APPLICATION_STATUS_DOES_NOT_ALLOW_RECREATION: 'Execute again is not allowed. You can only execute Applications that are finished with an error status.',
|
|
49
51
|
WKS_SHARED_INFRA_STATUS_DOES_NOT_ALLOW_RECREATION: 'Reexecution not allowed. You can only execute Applications that finished with an error status.',
|
|
50
52
|
WKS_DEPLOY_RUNNING: 'There is a deployment in progress.',
|
|
53
|
+
WKS_WORKFLOW_ACTIONS_UNORDERED_ERROR: 'Make sure the Workflow Actions are in the right order.',
|
|
54
|
+
WKS_WORKFLOW_ACTIONS_DUPLICATED_ERROR: 'Each Workflow Action must be unique within its scope.',
|
|
55
|
+
WKS_WORKFLOW_CONTEXT_KEY_DUPLICATED_ERROR: 'Use a unique context key for each Action.',
|
|
56
|
+
WKS_WORKFLOW_CONTEXT_NOT_ALLOWED_ERROR: 'Context configuration is not allowed.',
|
|
57
|
+
WKS_WORKFLOW_ACTIONS_CREATE_REPO_DUPLICATED_ERROR: 'Only one CREATE_REPO Action is allowed per Workflow.',
|
|
58
|
+
WKS_WORKFLOW_CONTEXT_MUST_BE_INFORMED_FOR_ALL_ACTIONS_ERROR: 'Provide context for all Workflow Actions.',
|
|
59
|
+
WKS_WORKFLOW_ALREADY_EXISTS_ERROR: 'A Workflow with this name already exists. Choose a different name.',
|
|
60
|
+
WKS_WORKFLOW_API_MUST_BE_DEFAULT_ERROR: 'CREATE API Workflows must be set as default.',
|
|
61
|
+
WKS_WORKFLOW_API_WITH_STACKS_ERROR: 'CREATE API Workflows cannot be linked to Stacks.',
|
|
62
|
+
WKS_WORKFLOW_DEFAULT_ALREADY_EXIST_FOR_TYPE_ERROR: 'A default Workflow of this type already exists. Use a different type.',
|
|
63
|
+
WKS_WORKFLOW_DEFAULT_WITH_STACKS_ERROR: 'Default Workflows cannot be linked to Stacks.',
|
|
64
|
+
WKS_WORKFLOW_CONDITION_DUPLICATED_ERROR: 'There should be no duplicate conditions with the same value per identifier.',
|
|
65
|
+
WKS_WORKFLOW_AND_STACK_ARE_NOT_ASSOCIATED_ERROR: 'This Stack is not linked to the specified Workflow. Check the association.',
|
|
66
|
+
WKS_WORKFLOW_ACTIONS_ARE_NOT_ASSOCIATED_ERROR: 'Make sure all Actions are connected to the specified Workflow.',
|
|
67
|
+
WKS_WORKFLOW_ACTIONS_CONTEXT_NOT_ALLOWED_ERROR: 'The context in higher-level Actions cannot be replaced by the context in the Stack.',
|
|
68
|
+
WKS_WORKFLOW_NOT_FOUND_ERROR: 'The workflow was not found. Check the workflow name and try again.',
|
|
51
69
|
},
|
|
52
70
|
pt: {
|
|
71
|
+
WKS_API_WORKSPACE_FORBIDDEN: 'Permissão necessária',
|
|
72
|
+
WKS_WORKSPACE_NOT_FOUND: 'Workspace não encontrado',
|
|
53
73
|
WKS_CONNECTION_INTERFACE_ALREADY_EXISTS_FOR_ACCOUNT: 'Já existe uma Connection Interface com esse nome para esta conta.',
|
|
54
74
|
WKS_WORKSPACE_ALREADY_EXISTS_FOR_ACCOUNT: 'Já existe um Workspace com esse nome. Tente outro.',
|
|
55
75
|
WKS_THERE_IS_A_SHARED_INFRA_WITH_THIS_STACK_DELETE_ERROR: 'Já existe uma Infraestrutura criada com essa Stack, por isso a Stack não pode ser deletada.',
|
|
@@ -96,5 +116,21 @@ export const workspaceDictionary = {
|
|
|
96
116
|
WKS_APPLICATION_STATUS_DOES_NOT_ALLOW_RECREATION: 'Reexecução não permitida. Só é possível reexecutar Aplicações que finalizaram com status de erro.',
|
|
97
117
|
WKS_SHARED_INFRA_STATUS_DOES_NOT_ALLOW_RECREATION: 'Reexecução não permitida. Só é possível reexecutar Aplicações que finalizaram com status de erro.',
|
|
98
118
|
WKS_DEPLOY_RUNNING: 'Há um deploy em execução.',
|
|
119
|
+
WKS_WORKFLOW_ACTIONS_UNORDERED_ERROR: 'Verifique se as Actions do Workflow estão na ordem correta.',
|
|
120
|
+
WKS_WORKFLOW_ACTIONS_DUPLICATED_ERROR: 'Cada Action do Workflow deve ser única dentro do seu escopo.',
|
|
121
|
+
WKS_WORKFLOW_CONTEXT_KEY_DUPLICATED_ERROR: 'Use uma chave de contexto única para cada Action.',
|
|
122
|
+
WKS_WORKFLOW_CONTEXT_NOT_ALLOWED_ERROR: 'Não é permitido configurar o contexto.',
|
|
123
|
+
WKS_WORKFLOW_ACTIONS_CREATE_REPO_DUPLICATED_ERROR: 'Apenas uma Action CREATE_REPO é permitida por Workflow.',
|
|
124
|
+
WKS_WORKFLOW_CONTEXT_MUST_BE_INFORMED_FOR_ALL_ACTIONS_ERROR: 'Informe o contexto para todas as Actions do Workflow.',
|
|
125
|
+
WKS_WORKFLOW_ALREADY_EXISTS_ERROR: 'Já existe um Workflow com esse nome. Escolha um nome diferente.',
|
|
126
|
+
WKS_WORKFLOW_API_MUST_BE_DEFAULT_ERROR: 'Workflows de API CREATE devem ser padrão.',
|
|
127
|
+
WKS_WORKFLOW_API_WITH_STACKS_ERROR: 'Workflows de API CREATE não podem ser associados a Stacks.',
|
|
128
|
+
WKS_WORKFLOW_DEFAULT_ALREADY_EXIST_FOR_TYPE_ERROR: 'Um Workflow padrão desse tipo já existe. Use um tipo diferente.',
|
|
129
|
+
WKS_WORKFLOW_DEFAULT_WITH_STACKS_ERROR: 'Workflows padrão não podem ser associados a Stacks.',
|
|
130
|
+
WKS_WORKFLOW_CONDITION_DUPLICATED_ERROR: 'Não deve haver condições duplicadas com o mesmo valor por identificador.',
|
|
131
|
+
WKS_WORKFLOW_AND_STACK_ARE_NOT_ASSOCIATED_ERROR: 'Esta Stack não está associada ao Workflow especificado. Verifique a associação.',
|
|
132
|
+
WKS_WORKFLOW_ACTIONS_ARE_NOT_ASSOCIATED_ERROR: 'Verifique se todas as Actions estão associadas ao Workflow especificado.',
|
|
133
|
+
WKS_WORKFLOW_ACTIONS_CONTEXT_NOT_ALLOWED_ERROR: 'O contexto de nível superior nas Actions não pode ser substituído pelo contexto da Stack.',
|
|
134
|
+
WKS_WORKFLOW_NOT_FOUND_ERROR: 'Workflow não encontrado. Verifique o nome do Workflow e tente novamente.',
|
|
99
135
|
},
|
|
100
136
|
} satisfies Dictionary
|