@stack-spot/portal-network 0.64.2 → 0.65.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 +7 -0
- package/dist/api/cloudPlatform.d.ts +216 -250
- package/dist/api/cloudPlatform.d.ts.map +1 -1
- package/dist/api/cloudPlatform.js +128 -101
- package/dist/api/cloudPlatform.js.map +1 -1
- package/dist/api/cloudRuntimes.d.ts +14 -9
- package/dist/api/cloudRuntimes.d.ts.map +1 -1
- package/dist/api/cloudRuntimes.js +8 -10
- package/dist/api/cloudRuntimes.js.map +1 -1
- package/dist/client/cloud-platform.d.ts +50 -85
- package/dist/client/cloud-platform.d.ts.map +1 -1
- package/dist/client/cloud-platform.js +55 -118
- package/dist/client/cloud-platform.js.map +1 -1
- package/dist/client/cloud-runtimes.d.ts.map +1 -1
- package/dist/client/cloud-runtimes.js +2 -2
- package/dist/client/cloud-runtimes.js.map +1 -1
- package/package.json +1 -1
- package/src/api/cloudPlatform.ts +359 -372
- package/src/api/cloudRuntimes.ts +47 -43
- package/src/client/cloud-platform.ts +30 -65
- package/src/client/cloud-runtimes.ts +2 -2
package/src/api/cloudRuntimes.ts
CHANGED
|
@@ -14,6 +14,16 @@ const oazapfts = Oazapfts.runtime(defaults);
|
|
|
14
14
|
export const servers = {
|
|
15
15
|
generatedServerUrl: "https://cloud-cloud-runtime-api.dev.stackspot.com"
|
|
16
16
|
};
|
|
17
|
+
export type ScheduleRequest = {
|
|
18
|
+
applicationId: string;
|
|
19
|
+
runtimeId: string;
|
|
20
|
+
startDate: string;
|
|
21
|
+
endDate: string;
|
|
22
|
+
time: string;
|
|
23
|
+
repeats: "NEVER" | "DAILY" | "WEEKLY" | "MONTHLY";
|
|
24
|
+
action: "START" | "STOP" | "RESTART" | "DEPLOY";
|
|
25
|
+
};
|
|
26
|
+
export type StatusType = number;
|
|
17
27
|
export type EnvVar = {
|
|
18
28
|
key: string;
|
|
19
29
|
value: string;
|
|
@@ -45,7 +55,6 @@ export type CreateDeploymentRequestV2 = {
|
|
|
45
55
|
health?: string;
|
|
46
56
|
applicationURL?: string;
|
|
47
57
|
};
|
|
48
|
-
export type StatusType = number;
|
|
49
58
|
export type SetAutoscalingRequest = {
|
|
50
59
|
deploymentId: string;
|
|
51
60
|
cpu: string;
|
|
@@ -333,6 +342,42 @@ export type GetApplicationByUlidResponse = {
|
|
|
333
342
|
createdAt?: string;
|
|
334
343
|
updatedAt?: string;
|
|
335
344
|
};
|
|
345
|
+
export function createSchedule({ scheduleRequest }: {
|
|
346
|
+
scheduleRequest: ScheduleRequest;
|
|
347
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
348
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
349
|
+
status: 200;
|
|
350
|
+
data: string;
|
|
351
|
+
} | {
|
|
352
|
+
status: 422;
|
|
353
|
+
data: {
|
|
354
|
+
instance?: string;
|
|
355
|
+
"type"?: string;
|
|
356
|
+
parameters?: {
|
|
357
|
+
[key: string]: object;
|
|
358
|
+
};
|
|
359
|
+
title?: string;
|
|
360
|
+
status?: StatusType;
|
|
361
|
+
detail?: string;
|
|
362
|
+
};
|
|
363
|
+
} | {
|
|
364
|
+
status: 500;
|
|
365
|
+
data: {
|
|
366
|
+
instance?: string;
|
|
367
|
+
"type"?: string;
|
|
368
|
+
parameters?: {
|
|
369
|
+
[key: string]: object;
|
|
370
|
+
};
|
|
371
|
+
title?: string;
|
|
372
|
+
status?: StatusType;
|
|
373
|
+
detail?: string;
|
|
374
|
+
};
|
|
375
|
+
}>("/v2/schedule", oazapfts.json({
|
|
376
|
+
...opts,
|
|
377
|
+
method: "POST",
|
|
378
|
+
body: scheduleRequest
|
|
379
|
+
})));
|
|
380
|
+
}
|
|
336
381
|
export function createDeployment({ authorization, createDeploymentRequestV2 }: {
|
|
337
382
|
authorization: string;
|
|
338
383
|
createDeploymentRequestV2: CreateDeploymentRequestV2;
|
|
@@ -373,7 +418,7 @@ export function createDeployment({ authorization, createDeploymentRequestV2 }: {
|
|
|
373
418
|
})
|
|
374
419
|
})));
|
|
375
420
|
}
|
|
376
|
-
export function
|
|
421
|
+
export function setAutoscaling({ authorization, setAutoscalingRequest }: {
|
|
377
422
|
authorization: string;
|
|
378
423
|
setAutoscalingRequest: SetAutoscalingRequest;
|
|
379
424
|
}, opts?: Oazapfts.RequestOpts) {
|
|
@@ -1350,47 +1395,6 @@ export function getLastDeploymentByRuntime({ applicationId }: {
|
|
|
1350
1395
|
...opts
|
|
1351
1396
|
}));
|
|
1352
1397
|
}
|
|
1353
|
-
export function schedule({ applicationId, runtimeId, day, month, minute }: {
|
|
1354
|
-
applicationId: string;
|
|
1355
|
-
runtimeId: string;
|
|
1356
|
-
day: number;
|
|
1357
|
-
month: number;
|
|
1358
|
-
minute: number;
|
|
1359
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
1360
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
1361
|
-
status: 200;
|
|
1362
|
-
} | {
|
|
1363
|
-
status: 422;
|
|
1364
|
-
data: {
|
|
1365
|
-
instance?: string;
|
|
1366
|
-
"type"?: string;
|
|
1367
|
-
parameters?: {
|
|
1368
|
-
[key: string]: object;
|
|
1369
|
-
};
|
|
1370
|
-
title?: string;
|
|
1371
|
-
status?: StatusType;
|
|
1372
|
-
detail?: string;
|
|
1373
|
-
};
|
|
1374
|
-
} | {
|
|
1375
|
-
status: 500;
|
|
1376
|
-
data: {
|
|
1377
|
-
instance?: string;
|
|
1378
|
-
"type"?: string;
|
|
1379
|
-
parameters?: {
|
|
1380
|
-
[key: string]: object;
|
|
1381
|
-
};
|
|
1382
|
-
title?: string;
|
|
1383
|
-
status?: StatusType;
|
|
1384
|
-
detail?: string;
|
|
1385
|
-
};
|
|
1386
|
-
}>(`/v2/applications/schedule/${encodeURIComponent(applicationId)}/${encodeURIComponent(runtimeId)}${QS.query(QS.explode({
|
|
1387
|
-
day,
|
|
1388
|
-
month,
|
|
1389
|
-
minute
|
|
1390
|
-
}))}`, {
|
|
1391
|
-
...opts
|
|
1392
|
-
}));
|
|
1393
|
-
}
|
|
1394
1398
|
export function listApplications1({ projectId, limit, offset }: {
|
|
1395
1399
|
projectId: string;
|
|
1396
1400
|
limit?: number;
|
|
@@ -1,34 +1,27 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
import
|
|
3
3
|
{
|
|
4
|
-
createApplication,
|
|
5
4
|
createCertificate,
|
|
6
5
|
createCidr,
|
|
7
|
-
|
|
6
|
+
createDnsRecord,
|
|
8
7
|
createDnsZone,
|
|
9
8
|
createFolder,
|
|
10
9
|
createFoundation,
|
|
10
|
+
createNetwork,
|
|
11
11
|
createProject,
|
|
12
|
+
createSubnet,
|
|
12
13
|
defaults,
|
|
13
|
-
getApplication,
|
|
14
|
-
getApplicationHistory,
|
|
15
14
|
getCertificate,
|
|
16
|
-
getDeployment,
|
|
17
|
-
getDeploymentHealth,
|
|
18
|
-
getDeploymentLogs,
|
|
19
|
-
getDeploymentStatus,
|
|
20
15
|
getFolder,
|
|
21
16
|
getFoundation,
|
|
22
17
|
getProject,
|
|
23
|
-
getRepositoryImages,
|
|
24
|
-
listApplications,
|
|
25
18
|
listCertificates,
|
|
26
19
|
listCidr,
|
|
27
|
-
|
|
20
|
+
listDnsRecord,
|
|
28
21
|
listDnsZone,
|
|
29
22
|
listFoundations,
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
listNetwork,
|
|
24
|
+
listSubnet,
|
|
32
25
|
providers,
|
|
33
26
|
} from '../api/cloudPlatform'
|
|
34
27
|
import apis from '../apis.json'
|
|
@@ -46,58 +39,6 @@ class CloudPlatformClient extends ReactQueryNetworkClient {
|
|
|
46
39
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
47
40
|
return new DefaultAPIError(error.data, error.status, cntDictionary, error.headers)
|
|
48
41
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Get list of applications
|
|
51
|
-
*/
|
|
52
|
-
listApplications = this.query(removeAuthorizationParam(listApplications))
|
|
53
|
-
/**
|
|
54
|
-
* Get an application by id
|
|
55
|
-
*/
|
|
56
|
-
application = this.query(removeAuthorizationParam(getApplication))
|
|
57
|
-
/**
|
|
58
|
-
* Get an application history
|
|
59
|
-
*/
|
|
60
|
-
applicationHistory = this.query(removeAuthorizationParam(getApplicationHistory))
|
|
61
|
-
/**
|
|
62
|
-
* Get list of application deployments
|
|
63
|
-
*/
|
|
64
|
-
listApplicationDeployments = this.query(removeAuthorizationParam(listDeployments))
|
|
65
|
-
/**
|
|
66
|
-
* Get an application deployment by id
|
|
67
|
-
*/
|
|
68
|
-
applicationDeployment = this.query(removeAuthorizationParam(getDeployment))
|
|
69
|
-
/**
|
|
70
|
-
* Get an application deployment status
|
|
71
|
-
*/
|
|
72
|
-
applicationDeploymentStatus = this.query(removeAuthorizationParam(getDeploymentStatus))
|
|
73
|
-
/**
|
|
74
|
-
* Get an application deployment health
|
|
75
|
-
*/
|
|
76
|
-
applicationDeploymentHealth = this.query(removeAuthorizationParam(getDeploymentHealth))
|
|
77
|
-
/**
|
|
78
|
-
* Get an application deployment logs
|
|
79
|
-
*/
|
|
80
|
-
applicationDeploymentLogs = this.query(removeAuthorizationParam(getDeploymentLogs))
|
|
81
|
-
/**
|
|
82
|
-
* Get an application runtimes
|
|
83
|
-
*/
|
|
84
|
-
listApplicationRuntimes = this.query(removeAuthorizationParam(listRuntimes))
|
|
85
|
-
/**
|
|
86
|
-
* Get list of repositories
|
|
87
|
-
*/
|
|
88
|
-
listRepositories = this.query(removeAuthorizationParam(listRepositories))
|
|
89
|
-
/**
|
|
90
|
-
* Get list of images from a repository
|
|
91
|
-
*/
|
|
92
|
-
listRepositoryImages = this.query(removeAuthorizationParam(getRepositoryImages))
|
|
93
|
-
/**
|
|
94
|
-
* Create a deploy of the application
|
|
95
|
-
*/
|
|
96
|
-
createDeployment = this.mutation(removeAuthorizationParam(createDeployment))
|
|
97
|
-
/**
|
|
98
|
-
* Create an application
|
|
99
|
-
*/
|
|
100
|
-
createApplication = this.mutation(removeAuthorizationParam(createApplication))
|
|
101
42
|
/**
|
|
102
43
|
* List foundations
|
|
103
44
|
*/
|
|
@@ -158,6 +99,30 @@ class CloudPlatformClient extends ReactQueryNetworkClient {
|
|
|
158
99
|
* Get a project by id
|
|
159
100
|
*/
|
|
160
101
|
getProjectById = this.query(removeAuthorizationParam(getProject))
|
|
102
|
+
/**
|
|
103
|
+
* Get a list of dns records
|
|
104
|
+
*/
|
|
105
|
+
listDnsRecords= this.query(removeAuthorizationParam(listDnsRecord))
|
|
106
|
+
/**
|
|
107
|
+
* Create a dns record
|
|
108
|
+
*/
|
|
109
|
+
createDnsRecord = this.mutation(removeAuthorizationParam(createDnsRecord))
|
|
110
|
+
/**
|
|
111
|
+
* Get a list of networks
|
|
112
|
+
*/
|
|
113
|
+
listNetworks= this.query(removeAuthorizationParam(listNetwork))
|
|
114
|
+
/**
|
|
115
|
+
* Create a network
|
|
116
|
+
*/
|
|
117
|
+
createNetwork = this.mutation(removeAuthorizationParam(createNetwork))
|
|
118
|
+
/**
|
|
119
|
+
* Get a list of subnets
|
|
120
|
+
*/
|
|
121
|
+
listSubnets= this.query(removeAuthorizationParam(listSubnet))
|
|
122
|
+
/**
|
|
123
|
+
* Create a subnet
|
|
124
|
+
*/
|
|
125
|
+
createSubnet = this.mutation(removeAuthorizationParam(createSubnet))
|
|
161
126
|
}
|
|
162
127
|
|
|
163
128
|
export const cloudPlatformClient = new CloudPlatformClient()
|
|
@@ -18,7 +18,7 @@ import
|
|
|
18
18
|
listDeployments,
|
|
19
19
|
listRepositories,
|
|
20
20
|
listRuntimes,
|
|
21
|
-
|
|
21
|
+
setAutoscaling,
|
|
22
22
|
startApplication,
|
|
23
23
|
stopApplication,
|
|
24
24
|
} from '../api/cloudRuntimes'
|
|
@@ -112,7 +112,7 @@ class CloudRuntimesClient extends ReactQueryNetworkClient {
|
|
|
112
112
|
/**
|
|
113
113
|
* Edit application instances
|
|
114
114
|
*/
|
|
115
|
-
editApplicationInstances = this.mutation(removeAuthorizationParam(
|
|
115
|
+
editApplicationInstances = this.mutation(removeAuthorizationParam(setAutoscaling))
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
|