@serve.zone/interfaces 1.0.9 → 1.0.11
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/00_commitinfo_data.js +2 -2
- package/dist_ts/config/cluster.d.ts +3 -0
- package/dist_ts/data/server.d.ts +13 -0
- package/dist_ts/data/server.js +2 -0
- package/dist_ts/requests/server.d.ts +28 -2
- package/dist_ts/requests/server.js +1 -3
- package/package.json +1 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/config/cluster.ts +3 -0
- package/ts/data/server.ts +13 -0
- package/ts/requests/server.ts +34 -6
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@serve.zone/interfaces',
|
|
6
|
-
version: '1.0.
|
|
6
|
+
version: '1.0.11',
|
|
7
7
|
description: 'interfaces for working with containers'
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHdDQUF3QztDQUN0RCxDQUFBIn0=
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type IDockerRegistryInfo, type IServiceRessources } from './docker.js';
|
|
2
|
+
import type { IServerConfig } from './server.js';
|
|
2
3
|
export interface IClusterConfig {
|
|
4
|
+
id: string;
|
|
3
5
|
name: string;
|
|
4
6
|
zone: 'servezone' | 'gitzone' | 'shipzone' | 'umbrellazone' | 'trafficzone' | 'proxyzone';
|
|
5
7
|
type: 'cluster';
|
|
@@ -8,6 +10,7 @@ export interface IClusterConfig {
|
|
|
8
10
|
jumpCodeUsedAt: number;
|
|
9
11
|
manager_domain: string;
|
|
10
12
|
manager_ip: string;
|
|
13
|
+
servers: IServerConfig[];
|
|
11
14
|
containers: IClusterConfigContainer[];
|
|
12
15
|
acmeInfo: {
|
|
13
16
|
serverAddress: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface IServerMetrics {
|
|
2
|
+
serverId: string;
|
|
3
|
+
cpuUsageInPercent: number;
|
|
4
|
+
memoryUsageinMB: number;
|
|
5
|
+
memoryAvailableInMB: number;
|
|
6
|
+
containerCount: number;
|
|
7
|
+
containerMetrics: Array<{
|
|
8
|
+
containerId: string;
|
|
9
|
+
containerName: string;
|
|
10
|
+
cpuUsageInPercent: number;
|
|
11
|
+
memoryUsageInMB: number;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
@@ -1,6 +1,32 @@
|
|
|
1
|
+
import type { IServerMetrics } from '../data/server.js';
|
|
1
2
|
import * as plugins from '../plugins.js';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* This request can be used between any two players
|
|
5
|
+
* Examples:
|
|
6
|
+
* WebApp -> Cloudly (get metrics)
|
|
7
|
+
* Cloudly -> Webapp (send metrics)
|
|
8
|
+
* Cloudly -> Coreflow (get metrics)
|
|
9
|
+
* Coreflow -> Cloudly (send metrics)
|
|
10
|
+
*/
|
|
11
|
+
export interface IRequest_Any_Cloudly_ServerStatus extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IRequest_Any_Cloudly_ServerStatus> {
|
|
12
|
+
method: 'getOrSendServerMetrics';
|
|
13
|
+
request: {
|
|
14
|
+
getOrSend: 'get' | 'send';
|
|
15
|
+
serverMetrics?: IServerMetrics;
|
|
16
|
+
};
|
|
17
|
+
response: {
|
|
18
|
+
serverMetrics?: IServerMetrics;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* this request can be used between any two players
|
|
23
|
+
* Examples:
|
|
24
|
+
* WebApp -> Cloudly
|
|
25
|
+
* Cloudly -> Coreflow
|
|
26
|
+
* Cloudly -> HostingProvider
|
|
27
|
+
*/
|
|
28
|
+
export interface IRequest_TriggerServerAction extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IRequest_TriggerServerAction> {
|
|
29
|
+
method: 'triggerServerAction';
|
|
4
30
|
request: {
|
|
5
31
|
actionName: 'reboot' | 'rebuild';
|
|
6
32
|
payload: any;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
// link external types for reference
|
|
2
|
-
import {} from './config.js';
|
|
3
1
|
import * as plugins from '../plugins.js';
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvcmVxdWVzdHMvc2VydmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxPQUFPLE1BQU0sZUFBZSxDQUFDIn0=
|
package/package.json
CHANGED
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/config/cluster.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type IDockerRegistryInfo, type IServiceRessources } from './docker.js';
|
|
2
|
+
import type { IServerConfig } from './server.js';
|
|
2
3
|
|
|
3
4
|
export interface IClusterConfig {
|
|
5
|
+
id: string;
|
|
4
6
|
name: string;
|
|
5
7
|
zone: 'servezone' | 'gitzone' | 'shipzone' | 'umbrellazone' | 'trafficzone' | 'proxyzone';
|
|
6
8
|
type: 'cluster';
|
|
@@ -9,6 +11,7 @@ export interface IClusterConfig {
|
|
|
9
11
|
jumpCodeUsedAt: number;
|
|
10
12
|
manager_domain: string;
|
|
11
13
|
manager_ip: string;
|
|
14
|
+
servers: IServerConfig[];
|
|
12
15
|
containers: IClusterConfigContainer[];
|
|
13
16
|
acmeInfo: {
|
|
14
17
|
serverAddress: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface IServerMetrics {
|
|
2
|
+
serverId: string;
|
|
3
|
+
cpuUsageInPercent: number;
|
|
4
|
+
memoryUsageinMB: number;
|
|
5
|
+
memoryAvailableInMB: number;
|
|
6
|
+
containerCount: number;
|
|
7
|
+
containerMetrics: Array<{
|
|
8
|
+
containerId: string;
|
|
9
|
+
containerName: string;
|
|
10
|
+
cpuUsageInPercent: number;
|
|
11
|
+
memoryUsageInMB: number;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
package/ts/requests/server.ts
CHANGED
|
@@ -1,14 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
import { type IRequest_Any_Cloudly_GetServerConfig } from './config.js'
|
|
3
|
-
|
|
1
|
+
import type { IServerMetrics } from '../data/server.js';
|
|
4
2
|
import * as plugins from '../plugins.js';
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
/**
|
|
5
|
+
* This request can be used between any two players
|
|
6
|
+
* Examples:
|
|
7
|
+
* WebApp -> Cloudly (get metrics)
|
|
8
|
+
* Cloudly -> Webapp (send metrics)
|
|
9
|
+
* Cloudly -> Coreflow (get metrics)
|
|
10
|
+
* Coreflow -> Cloudly (send metrics)
|
|
11
|
+
*/
|
|
12
|
+
export interface IRequest_Any_Cloudly_ServerStatus
|
|
13
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
14
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
15
|
+
IRequest_Any_Cloudly_ServerStatus
|
|
16
|
+
> {
|
|
17
|
+
method: 'getOrSendServerMetrics',
|
|
18
|
+
request: {
|
|
19
|
+
getOrSend: 'get' | 'send';
|
|
20
|
+
serverMetrics?: IServerMetrics;
|
|
21
|
+
},
|
|
22
|
+
response: {
|
|
23
|
+
serverMetrics?: IServerMetrics;
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* this request can be used between any two players
|
|
29
|
+
* Examples:
|
|
30
|
+
* WebApp -> Cloudly
|
|
31
|
+
* Cloudly -> Coreflow
|
|
32
|
+
* Cloudly -> HostingProvider
|
|
33
|
+
*/
|
|
34
|
+
export interface IRequest_TriggerServerAction
|
|
7
35
|
extends plugins.typedrequestInterfaces.implementsTR<
|
|
8
36
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
9
|
-
|
|
37
|
+
IRequest_TriggerServerAction
|
|
10
38
|
> {
|
|
11
|
-
method: '
|
|
39
|
+
method: 'triggerServerAction';
|
|
12
40
|
request: {
|
|
13
41
|
actionName: 'reboot' | 'rebuild';
|
|
14
42
|
payload: any;
|