@serve.zone/interfaces 5.0.4 → 5.3.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/dist_ts_interfaces/data/baremetal.d.ts +61 -0
- package/dist_ts_interfaces/data/baremetal.js +2 -0
- package/dist_ts_interfaces/data/cloudlyconfig.d.ts +0 -2
- package/dist_ts_interfaces/data/cluster.d.ts +7 -3
- package/dist_ts_interfaces/data/clusternode.d.ts +59 -0
- package/dist_ts_interfaces/data/clusternode.js +2 -0
- package/dist_ts_interfaces/data/deployment.d.ts +42 -2
- package/dist_ts_interfaces/data/index.d.ts +3 -1
- package/dist_ts_interfaces/data/index.js +4 -2
- package/dist_ts_interfaces/data/service.d.ts +24 -0
- package/dist_ts_interfaces/data/settings.d.ts +34 -0
- package/dist_ts_interfaces/data/settings.js +2 -0
- package/dist_ts_interfaces/requests/baremetal.d.ts +19 -0
- package/dist_ts_interfaces/requests/baremetal.js +2 -0
- package/dist_ts_interfaces/requests/cluster.d.ts +1 -0
- package/dist_ts_interfaces/requests/deployment.d.ts +96 -0
- package/dist_ts_interfaces/requests/deployment.js +2 -0
- package/dist_ts_interfaces/requests/index.d.ts +4 -1
- package/dist_ts_interfaces/requests/index.js +5 -2
- package/dist_ts_interfaces/requests/node.d.ts +29 -0
- package/dist_ts_interfaces/requests/node.js +2 -0
- package/dist_ts_interfaces/requests/settings.d.ts +49 -0
- package/dist_ts_interfaces/requests/settings.js +2 -0
- package/package.json +2 -2
- package/readme.md +301 -133
- package/ts_interfaces/data/baremetal.ts +73 -0
- package/ts_interfaces/data/cloudlyconfig.ts +0 -2
- package/ts_interfaces/data/cluster.ts +8 -3
- package/ts_interfaces/data/clusternode.ts +71 -0
- package/ts_interfaces/data/deployment.ts +52 -2
- package/ts_interfaces/data/index.ts +4 -2
- package/ts_interfaces/data/service.ts +29 -0
- package/ts_interfaces/data/settings.ts +56 -0
- package/ts_interfaces/readme.md +301 -133
- package/ts_interfaces/requests/baremetal.ts +22 -0
- package/ts_interfaces/requests/cluster.ts +1 -0
- package/ts_interfaces/requests/deployment.ts +141 -0
- package/ts_interfaces/requests/index.ts +6 -0
- package/ts_interfaces/requests/node.ts +33 -0
- package/ts_interfaces/requests/settings.ts +59 -0
package/ts_interfaces/readme.md
CHANGED
|
@@ -1,207 +1,375 @@
|
|
|
1
|
-
# @serve.zone/interfaces
|
|
1
|
+
# @serve.zone/interfaces 📋
|
|
2
2
|
|
|
3
|
-
interfaces for
|
|
3
|
+
**TypeScript interfaces for the Cloudly ecosystem.** Type-safe contracts for multi-cloud infrastructure management.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 🎯 What is @serve.zone/interfaces?
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This package provides the complete set of TypeScript interfaces that power the Cloudly platform. It ensures type safety and consistency across all components - from API requests to data models, from service definitions to infrastructure configurations.
|
|
8
|
+
|
|
9
|
+
## ✨ Features
|
|
10
|
+
|
|
11
|
+
- **🔒 Type Safety** - Comprehensive TypeScript interfaces for all Cloudly operations
|
|
12
|
+
- **📦 Modular Structure** - Organized by domain for easy navigation
|
|
13
|
+
- **🔄 Version Compatibility** - Interfaces versioned with the platform
|
|
14
|
+
- **📚 Well Documented** - Each interface includes JSDoc comments
|
|
15
|
+
- **🎭 Multi-Purpose** - Used by API clients, CLI tools, and web interfaces
|
|
16
|
+
- **✅ Validation Ready** - Compatible with runtime type checking libraries
|
|
17
|
+
|
|
18
|
+
## 🚀 Installation
|
|
8
19
|
|
|
9
20
|
```bash
|
|
10
|
-
|
|
21
|
+
pnpm add @serve.zone/interfaces
|
|
11
22
|
```
|
|
12
23
|
|
|
13
|
-
|
|
24
|
+
## 🏗️ Interface Categories
|
|
14
25
|
|
|
15
|
-
|
|
26
|
+
### 📡 Request/Response Interfaces
|
|
16
27
|
|
|
17
|
-
|
|
28
|
+
Typed contracts for API communication:
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
```typescript
|
|
31
|
+
import {
|
|
32
|
+
IRequest_GetAllImages,
|
|
33
|
+
IRequest_CreateCluster,
|
|
34
|
+
IRequest_DeployService
|
|
35
|
+
} from '@serve.zone/interfaces';
|
|
36
|
+
|
|
37
|
+
// Type-safe request
|
|
38
|
+
const request: IRequest_GetAllImages['request'] = {
|
|
39
|
+
identity: userIdentity,
|
|
40
|
+
filters: {
|
|
41
|
+
tag: 'production'
|
|
42
|
+
}
|
|
43
|
+
};
|
|
20
44
|
|
|
21
|
-
|
|
45
|
+
// Type-safe response
|
|
46
|
+
const response: IRequest_GetAllImages['response'] = {
|
|
47
|
+
images: [...]
|
|
48
|
+
};
|
|
49
|
+
```
|
|
22
50
|
|
|
23
|
-
|
|
51
|
+
### 📦 Data Models
|
|
24
52
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- **TypeScript**: Your environment should support TypeScript, as this module leverages strong typing offered by TypeScript.
|
|
28
|
-
|
|
29
|
-
- **Cloud Account Access**: Some of the interfaces interact with live cloud services; thus, ensure you have necessary credentials (like API tokens) available for testing or integration.
|
|
53
|
+
Core data structures for Cloudly entities:
|
|
30
54
|
|
|
31
|
-
|
|
55
|
+
```typescript
|
|
56
|
+
import {
|
|
57
|
+
ICluster,
|
|
58
|
+
IService,
|
|
59
|
+
IImage,
|
|
60
|
+
ISecret,
|
|
61
|
+
IServer
|
|
62
|
+
} from '@serve.zone/interfaces';
|
|
63
|
+
|
|
64
|
+
// Define a service
|
|
65
|
+
const service: IService = {
|
|
66
|
+
id: 'service-123',
|
|
67
|
+
data: {
|
|
68
|
+
name: 'api-service',
|
|
69
|
+
imageId: 'image-456',
|
|
70
|
+
imageVersion: '2.0.0',
|
|
71
|
+
environment: {
|
|
72
|
+
NODE_ENV: 'production'
|
|
73
|
+
},
|
|
74
|
+
scaleFactor: 3,
|
|
75
|
+
balancingStrategy: 'round-robin',
|
|
76
|
+
ports: {
|
|
77
|
+
web: 80,
|
|
78
|
+
metrics: 9090
|
|
79
|
+
},
|
|
80
|
+
domains: [
|
|
81
|
+
{ name: 'api.example.com' }
|
|
82
|
+
],
|
|
83
|
+
deploymentIds: [],
|
|
84
|
+
deploymentDirectiveIds: []
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
```
|
|
32
88
|
|
|
33
|
-
|
|
89
|
+
### 🔐 Authentication & Identity
|
|
34
90
|
|
|
35
|
-
|
|
91
|
+
Identity management interfaces:
|
|
36
92
|
|
|
37
93
|
```typescript
|
|
38
|
-
import {
|
|
94
|
+
import {
|
|
95
|
+
IIdentity,
|
|
96
|
+
IServiceToken,
|
|
97
|
+
IPermission
|
|
98
|
+
} from '@serve.zone/interfaces';
|
|
99
|
+
|
|
100
|
+
const identity: IIdentity = {
|
|
101
|
+
id: 'user-789',
|
|
102
|
+
name: 'service-account',
|
|
103
|
+
type: 'service',
|
|
104
|
+
permissions: ['cluster:read', 'service:write'],
|
|
105
|
+
tokenHash: 'hashed-token',
|
|
106
|
+
metadata: {
|
|
107
|
+
createdAt: new Date(),
|
|
108
|
+
lastAccess: new Date()
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
```
|
|
39
112
|
|
|
40
|
-
|
|
41
|
-
private cloudlyClient;
|
|
113
|
+
### 🌐 Network Configuration
|
|
42
114
|
|
|
43
|
-
|
|
44
|
-
this.cloudlyClient = cloudlyClient;
|
|
45
|
-
}
|
|
115
|
+
Networking and routing interfaces:
|
|
46
116
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
117
|
+
```typescript
|
|
118
|
+
import {
|
|
119
|
+
IReverseProxyConfig,
|
|
120
|
+
IDomainConfig,
|
|
121
|
+
ILoadBalancerConfig
|
|
122
|
+
} from '@serve.zone/interfaces';
|
|
123
|
+
|
|
124
|
+
const proxyConfig: IReverseProxyConfig = {
|
|
125
|
+
domain: 'app.example.com',
|
|
126
|
+
path: '/api',
|
|
127
|
+
serviceAddress: 'http://api-service:3000',
|
|
128
|
+
ssl: true,
|
|
129
|
+
headers: {
|
|
130
|
+
'X-Real-IP': '$remote_addr'
|
|
53
131
|
}
|
|
54
|
-
}
|
|
132
|
+
};
|
|
55
133
|
```
|
|
56
134
|
|
|
57
|
-
|
|
135
|
+
### 📊 Monitoring & Metrics
|
|
58
136
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
Logging is a crucial aspect of cloud applications. The module provides interfaces to assist in integrating logging systems like `@push.rocks/smartlog-interfaces`.
|
|
137
|
+
Observability interfaces:
|
|
62
138
|
|
|
63
139
|
```typescript
|
|
64
|
-
import {
|
|
140
|
+
import {
|
|
141
|
+
IServerMetrics,
|
|
142
|
+
IServiceMetrics,
|
|
143
|
+
IClusterHealth
|
|
144
|
+
} from '@serve.zone/interfaces';
|
|
145
|
+
|
|
146
|
+
const metrics: IServerMetrics = {
|
|
147
|
+
serverId: 'server-001',
|
|
148
|
+
cpuUsageInPercent: 65,
|
|
149
|
+
memoryUsageinMB: 3072,
|
|
150
|
+
memoryAvailableInMB: 8192,
|
|
151
|
+
diskUsageInPercent: 40,
|
|
152
|
+
networkInMbps: 100,
|
|
153
|
+
networkOutMbps: 150,
|
|
154
|
+
containerCount: 12,
|
|
155
|
+
containerMetrics: [...]
|
|
156
|
+
};
|
|
157
|
+
```
|
|
65
158
|
|
|
66
|
-
|
|
67
|
-
private logger: ILogger;
|
|
159
|
+
### 🔒 Secret Management
|
|
68
160
|
|
|
69
|
-
|
|
70
|
-
this.logger = new SmartLogger(logConfig);
|
|
71
|
-
}
|
|
161
|
+
Security and credential interfaces:
|
|
72
162
|
|
|
73
|
-
|
|
74
|
-
|
|
163
|
+
```typescript
|
|
164
|
+
import {
|
|
165
|
+
ISecretGroup,
|
|
166
|
+
ISecretBundle,
|
|
167
|
+
IEncryptedData
|
|
168
|
+
} from '@serve.zone/interfaces';
|
|
169
|
+
|
|
170
|
+
const secretGroup: ISecretGroup = {
|
|
171
|
+
id: 'secrets-123',
|
|
172
|
+
name: 'database-credentials',
|
|
173
|
+
secrets: [
|
|
174
|
+
{
|
|
175
|
+
key: 'DB_HOST',
|
|
176
|
+
value: 'encrypted-value',
|
|
177
|
+
encrypted: true
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
key: 'DB_PASSWORD',
|
|
181
|
+
value: 'encrypted-value',
|
|
182
|
+
encrypted: true
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
metadata: {
|
|
186
|
+
environment: 'production',
|
|
187
|
+
service: 'api'
|
|
75
188
|
}
|
|
76
|
-
}
|
|
189
|
+
};
|
|
77
190
|
```
|
|
78
191
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
#### 3. Container Service Management
|
|
192
|
+
## 📚 Common Usage Patterns
|
|
82
193
|
|
|
83
|
-
|
|
194
|
+
### Creating Type-Safe API Clients
|
|
84
195
|
|
|
85
196
|
```typescript
|
|
86
|
-
import {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
197
|
+
import {
|
|
198
|
+
IRequest_CreateService,
|
|
199
|
+
IService
|
|
200
|
+
} from '@serve.zone/interfaces';
|
|
201
|
+
|
|
202
|
+
class ServiceClient {
|
|
203
|
+
async createService(
|
|
204
|
+
serviceData: IService['data']
|
|
205
|
+
): Promise<IService> {
|
|
206
|
+
const request: IRequest_CreateService['request'] = {
|
|
207
|
+
identity: this.identity,
|
|
208
|
+
serviceData
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
const response = await this.client.send<IRequest_CreateService>(
|
|
212
|
+
'createService',
|
|
213
|
+
request
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
return response.service;
|
|
217
|
+
}
|
|
105
218
|
}
|
|
106
219
|
```
|
|
107
220
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
#### 4. Network Configuration and Routing
|
|
111
|
-
|
|
112
|
-
Networking is integral to cloud-native applications. Interfaces in `@serve.zone/interfaces` help shape network interaction patterns.
|
|
221
|
+
### Validating Incoming Data
|
|
113
222
|
|
|
114
223
|
```typescript
|
|
115
|
-
import {
|
|
224
|
+
import { ICluster } from '@serve.zone/interfaces';
|
|
225
|
+
import { validateType } from 'your-validation-library';
|
|
116
226
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
function configureProxy() {
|
|
125
|
-
// Logic to apply the proxyConfig, potentially using Typedi, Smartclient, or similar libraries.
|
|
227
|
+
function validateClusterData(data: unknown): ICluster {
|
|
228
|
+
if (!validateType<ICluster>(data)) {
|
|
229
|
+
throw new Error('Invalid cluster data');
|
|
230
|
+
}
|
|
231
|
+
return data;
|
|
126
232
|
}
|
|
127
233
|
```
|
|
128
234
|
|
|
129
|
-
|
|
235
|
+
### Building Configuration Objects
|
|
130
236
|
|
|
131
|
-
|
|
237
|
+
```typescript
|
|
238
|
+
import {
|
|
239
|
+
ICloudlyConfig,
|
|
240
|
+
IMongoDescriptor
|
|
241
|
+
} from '@serve.zone/interfaces';
|
|
242
|
+
|
|
243
|
+
const config: ICloudlyConfig = {
|
|
244
|
+
cfToken: process.env.CF_TOKEN!,
|
|
245
|
+
hetznerToken: process.env.HETZNER_TOKEN!,
|
|
246
|
+
environment: 'production',
|
|
247
|
+
letsEncryptEmail: 'certs@example.com',
|
|
248
|
+
publicUrl: 'cloudly.example.com',
|
|
249
|
+
publicPort: 443,
|
|
250
|
+
mongoDescriptor: {
|
|
251
|
+
mongoDbUrl: process.env.MONGO_URL!,
|
|
252
|
+
mongoDbName: 'cloudly',
|
|
253
|
+
mongoDbUser: process.env.MONGO_USER!,
|
|
254
|
+
mongoDbPass: process.env.MONGO_PASS!
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
```
|
|
132
258
|
|
|
133
|
-
|
|
259
|
+
## 🎯 Advanced Features
|
|
134
260
|
|
|
135
|
-
|
|
261
|
+
### Generic Request Handler
|
|
136
262
|
|
|
137
263
|
```typescript
|
|
138
|
-
import {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
264
|
+
import { ITypedRequest } from '@serve.zone/interfaces';
|
|
265
|
+
|
|
266
|
+
class RequestHandler {
|
|
267
|
+
async handle<T extends ITypedRequest>(
|
|
268
|
+
request: T['request']
|
|
269
|
+
): Promise<T['response']> {
|
|
270
|
+
// Type-safe request handling
|
|
271
|
+
return this.processRequest(request);
|
|
272
|
+
}
|
|
143
273
|
}
|
|
144
|
-
|
|
145
|
-
const sampleMetrics: IServerMetrics = {
|
|
146
|
-
serverId: 'server-123',
|
|
147
|
-
cpuUsageInPercent: 45,
|
|
148
|
-
memoryUsageinMB: 2048,
|
|
149
|
-
memoryAvailableInMB: 4096,
|
|
150
|
-
containerCount: 10,
|
|
151
|
-
containerMetrics: [],
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
reportMetrics(sampleMetrics);
|
|
155
274
|
```
|
|
156
275
|
|
|
157
|
-
|
|
276
|
+
### Discriminated Unions
|
|
158
277
|
|
|
159
|
-
|
|
278
|
+
```typescript
|
|
279
|
+
import { IDeploymentStatus } from '@serve.zone/interfaces';
|
|
280
|
+
|
|
281
|
+
function handleStatus(status: IDeploymentStatus) {
|
|
282
|
+
switch (status.type) {
|
|
283
|
+
case 'pending':
|
|
284
|
+
console.log('Deployment pending...');
|
|
285
|
+
break;
|
|
286
|
+
case 'running':
|
|
287
|
+
console.log(`Running on ${status.serverId}`);
|
|
288
|
+
break;
|
|
289
|
+
case 'failed':
|
|
290
|
+
console.log(`Failed: ${status.error}`);
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
```
|
|
160
295
|
|
|
161
|
-
|
|
296
|
+
### Extending Interfaces
|
|
162
297
|
|
|
163
298
|
```typescript
|
|
164
|
-
import {
|
|
299
|
+
import { IService } from '@serve.zone/interfaces';
|
|
165
300
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
301
|
+
interface IExtendedService extends IService {
|
|
302
|
+
customMetadata: {
|
|
303
|
+
team: string;
|
|
304
|
+
costCenter: string;
|
|
305
|
+
sla: 'standard' | 'premium';
|
|
171
306
|
};
|
|
172
|
-
|
|
173
|
-
return await cloudlyClient.typedsocketClient.fireTypedRequest<IRequest_Any_Cloudly_GetCertificateForDomain>(request);
|
|
174
307
|
}
|
|
175
308
|
```
|
|
176
309
|
|
|
177
|
-
|
|
310
|
+
## 🔄 Version Compatibility
|
|
178
311
|
|
|
179
|
-
|
|
312
|
+
| @serve.zone/interfaces | @serve.zone/cloudly | @serve.zone/api | @serve.zone/cli |
|
|
313
|
+
|------------------------|---------------------|-----------------|-----------------|
|
|
314
|
+
| 5.x | 5.x | 5.x | 5.x |
|
|
315
|
+
| 4.x | 4.x | 4.x | 4.x |
|
|
316
|
+
| 3.x | 3.x | 3.x | 3.x |
|
|
180
317
|
|
|
181
|
-
|
|
318
|
+
## 📖 Interface Documentation
|
|
182
319
|
|
|
183
|
-
|
|
184
|
-
import { IRequest_SendEmail } from '@serve.zone/interfaces/platformservice/mta';
|
|
185
|
-
|
|
186
|
-
async function sendNotification(emailClient: any) {
|
|
187
|
-
const emailRequest: IRequest_SendEmail['request'] = {
|
|
188
|
-
title: 'Welcome to ServeZone!',
|
|
189
|
-
from: 'service@company.com',
|
|
190
|
-
to: 'user@example.com',
|
|
191
|
-
body: '<h1>Congratulations</h1><p>Your account has been created successfully.</p>',
|
|
192
|
-
};
|
|
320
|
+
All interfaces include comprehensive JSDoc comments:
|
|
193
321
|
|
|
194
|
-
|
|
322
|
+
```typescript
|
|
323
|
+
/**
|
|
324
|
+
* Represents a cluster configuration
|
|
325
|
+
* @interface ICluster
|
|
326
|
+
*/
|
|
327
|
+
export interface ICluster {
|
|
328
|
+
/**
|
|
329
|
+
* Unique identifier for the cluster
|
|
330
|
+
* @type {string}
|
|
331
|
+
*/
|
|
332
|
+
id: string;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Cluster configuration data
|
|
336
|
+
* @type {IClusterData}
|
|
337
|
+
*/
|
|
338
|
+
data: IClusterData;
|
|
195
339
|
}
|
|
196
340
|
```
|
|
197
341
|
|
|
198
|
-
|
|
342
|
+
## 🛠️ Development Tips
|
|
199
343
|
|
|
200
|
-
###
|
|
344
|
+
### Import Organization
|
|
201
345
|
|
|
202
|
-
|
|
346
|
+
```typescript
|
|
347
|
+
// Group imports by category
|
|
348
|
+
import {
|
|
349
|
+
// Data models
|
|
350
|
+
ICluster,
|
|
351
|
+
IService,
|
|
352
|
+
IImage,
|
|
353
|
+
|
|
354
|
+
// Requests
|
|
355
|
+
IRequest_CreateCluster,
|
|
356
|
+
IRequest_DeployService,
|
|
357
|
+
|
|
358
|
+
// Configuration
|
|
359
|
+
ICloudlyConfig,
|
|
360
|
+
IReverseProxyConfig
|
|
361
|
+
} from '@serve.zone/interfaces';
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### Type Guards
|
|
203
365
|
|
|
204
|
-
|
|
366
|
+
```typescript
|
|
367
|
+
import { IService, ICluster } from '@serve.zone/interfaces';
|
|
368
|
+
|
|
369
|
+
function isService(entity: IService | ICluster): entity is IService {
|
|
370
|
+
return 'imageId' in entity.data;
|
|
371
|
+
}
|
|
372
|
+
```
|
|
205
373
|
|
|
206
374
|
## License and Legal Information
|
|
207
375
|
|
|
@@ -220,4 +388,4 @@ Registered at District court Bremen HRB 35230 HB, Germany
|
|
|
220
388
|
|
|
221
389
|
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
|
222
390
|
|
|
223
|
-
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
|
391
|
+
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import type { IBareMetal } from '../data/baremetal.js';
|
|
3
|
+
|
|
4
|
+
export interface IRequest_Any_Cloudly_GetBaremetalServers {
|
|
5
|
+
method: 'getBaremetalServers';
|
|
6
|
+
request: {};
|
|
7
|
+
response: {
|
|
8
|
+
baremetals: IBareMetal[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface IRequest_Any_Cloudly_ControlBaremetal {
|
|
13
|
+
method: 'controlBaremetal';
|
|
14
|
+
request: {
|
|
15
|
+
baremetalId: string;
|
|
16
|
+
action: 'powerOn' | 'powerOff' | 'reset';
|
|
17
|
+
};
|
|
18
|
+
response: {
|
|
19
|
+
success: boolean;
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -41,6 +41,7 @@ export interface IRequest_CreateCluster extends plugins.typedrequestInterfaces.i
|
|
|
41
41
|
request: {
|
|
42
42
|
identity: userInterfaces.IIdentity;
|
|
43
43
|
clusterName: string;
|
|
44
|
+
setupMode?: 'manual' | 'hetzner' | 'aws' | 'digitalocean';
|
|
44
45
|
};
|
|
45
46
|
response: {
|
|
46
47
|
cluster: clusterInterfaces.ICluster;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import type { IDeployment } from '../data/deployment.js';
|
|
3
|
+
import type { IIdentity } from '../data/user.js';
|
|
4
|
+
|
|
5
|
+
export interface IReq_Any_Cloudly_GetDeploymentById
|
|
6
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
7
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
8
|
+
IReq_Any_Cloudly_GetDeploymentById
|
|
9
|
+
> {
|
|
10
|
+
method: 'getDeploymentById';
|
|
11
|
+
request: {
|
|
12
|
+
identity: IIdentity;
|
|
13
|
+
deploymentId: string;
|
|
14
|
+
};
|
|
15
|
+
response: {
|
|
16
|
+
deployment: IDeployment;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface IReq_Any_Cloudly_GetDeployments
|
|
21
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
22
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
23
|
+
IReq_Any_Cloudly_GetDeployments
|
|
24
|
+
> {
|
|
25
|
+
method: 'getDeployments';
|
|
26
|
+
request: {
|
|
27
|
+
identity: IIdentity;
|
|
28
|
+
};
|
|
29
|
+
response: {
|
|
30
|
+
deployments: IDeployment[];
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IReq_Any_Cloudly_GetDeploymentsByService
|
|
35
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
36
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
37
|
+
IReq_Any_Cloudly_GetDeploymentsByService
|
|
38
|
+
> {
|
|
39
|
+
method: 'getDeploymentsByService';
|
|
40
|
+
request: {
|
|
41
|
+
identity: IIdentity;
|
|
42
|
+
serviceId: string;
|
|
43
|
+
};
|
|
44
|
+
response: {
|
|
45
|
+
deployments: IDeployment[];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface IReq_Any_Cloudly_GetDeploymentsByNode
|
|
50
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
51
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
52
|
+
IReq_Any_Cloudly_GetDeploymentsByNode
|
|
53
|
+
> {
|
|
54
|
+
method: 'getDeploymentsByNode';
|
|
55
|
+
request: {
|
|
56
|
+
identity: IIdentity;
|
|
57
|
+
nodeId: string;
|
|
58
|
+
};
|
|
59
|
+
response: {
|
|
60
|
+
deployments: IDeployment[];
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface IReq_Any_Cloudly_CreateDeployment
|
|
65
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
66
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
67
|
+
IReq_Any_Cloudly_CreateDeployment
|
|
68
|
+
> {
|
|
69
|
+
method: 'createDeployment';
|
|
70
|
+
request: {
|
|
71
|
+
identity: IIdentity;
|
|
72
|
+
deploymentData: Partial<IDeployment>;
|
|
73
|
+
};
|
|
74
|
+
response: {
|
|
75
|
+
deployment: IDeployment;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface IReq_Any_Cloudly_UpdateDeployment
|
|
80
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
81
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
82
|
+
IReq_Any_Cloudly_UpdateDeployment
|
|
83
|
+
> {
|
|
84
|
+
method: 'updateDeployment';
|
|
85
|
+
request: {
|
|
86
|
+
identity: IIdentity;
|
|
87
|
+
deploymentId: string;
|
|
88
|
+
deploymentData: Partial<IDeployment>;
|
|
89
|
+
};
|
|
90
|
+
response: {
|
|
91
|
+
deployment: IDeployment;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface IReq_Any_Cloudly_DeleteDeploymentById
|
|
96
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
97
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
98
|
+
IReq_Any_Cloudly_DeleteDeploymentById
|
|
99
|
+
> {
|
|
100
|
+
method: 'deleteDeploymentById';
|
|
101
|
+
request: {
|
|
102
|
+
identity: IIdentity;
|
|
103
|
+
deploymentId: string;
|
|
104
|
+
};
|
|
105
|
+
response: {
|
|
106
|
+
success: boolean;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface IReq_Any_Cloudly_RestartDeployment
|
|
111
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
112
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
113
|
+
IReq_Any_Cloudly_RestartDeployment
|
|
114
|
+
> {
|
|
115
|
+
method: 'restartDeployment';
|
|
116
|
+
request: {
|
|
117
|
+
identity: IIdentity;
|
|
118
|
+
deploymentId: string;
|
|
119
|
+
};
|
|
120
|
+
response: {
|
|
121
|
+
success: boolean;
|
|
122
|
+
deployment: IDeployment;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface IReq_Any_Cloudly_ScaleDeployment
|
|
127
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
128
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
129
|
+
IReq_Any_Cloudly_ScaleDeployment
|
|
130
|
+
> {
|
|
131
|
+
method: 'scaleDeployment';
|
|
132
|
+
request: {
|
|
133
|
+
identity: IIdentity;
|
|
134
|
+
deploymentId: string;
|
|
135
|
+
replicas: number;
|
|
136
|
+
};
|
|
137
|
+
response: {
|
|
138
|
+
success: boolean;
|
|
139
|
+
deployment: IDeployment;
|
|
140
|
+
};
|
|
141
|
+
}
|