feat(services): Add service management functionalities
This commit is contained in:
@ -6,7 +6,6 @@ import * as plugins from '../plugins.js';
|
||||
*/
|
||||
export interface IDeployment {
|
||||
id: string;
|
||||
deploymentDirectiveId: string;
|
||||
affectedServiceIds: string[];
|
||||
usedImageId: string;
|
||||
deploymentLog: string[];
|
||||
|
@ -4,6 +4,7 @@ export interface IService {
|
||||
id: string;
|
||||
data: {
|
||||
name: string;
|
||||
description: string;
|
||||
imageId: string;
|
||||
imageVersion: string;
|
||||
environment: { [key: string]: string };
|
||||
|
@ -11,6 +11,7 @@ import * as networkRequests from './network.js';
|
||||
import * as routingRequests from './routing.js';
|
||||
import * as secretRequests from './secret.js';
|
||||
import * as serverRequests from './server.js';
|
||||
import * as serviceRequests from './service.js';
|
||||
import * as statusRequests from './status.js';
|
||||
import * as versionRequests from './version.js';
|
||||
|
||||
@ -26,6 +27,7 @@ export {
|
||||
routingRequests as routing,
|
||||
secretRequests as secret,
|
||||
serverRequests as server,
|
||||
serviceRequests as service,
|
||||
statusRequests as status,
|
||||
versionRequests as version,
|
||||
};
|
||||
|
113
ts_interfaces/requests/service.ts
Normal file
113
ts_interfaces/requests/service.ts
Normal file
@ -0,0 +1,113 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import type { IService } from '../data/service.js';
|
||||
import type { IIdentity } from '../data/user.js';
|
||||
import type { IServiceRessources } from '../data/docker.js';
|
||||
|
||||
export interface IRequest_Any_Cloudly_GetServiceById
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IRequest_Any_Cloudly_GetServiceById
|
||||
> {
|
||||
method: 'getServiceById';
|
||||
request: {
|
||||
identity: IIdentity;
|
||||
serviceId: string;
|
||||
};
|
||||
response: {
|
||||
service: IService;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IRequest_Any_Cloudly_GetServices
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IRequest_Any_Cloudly_GetServices
|
||||
> {
|
||||
method: 'getServices';
|
||||
request: {
|
||||
identity: IIdentity;
|
||||
};
|
||||
response: {
|
||||
services: IService[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IRequest_Any_Cloudly_CreateService
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IRequest_Any_Cloudly_CreateService
|
||||
> {
|
||||
method: 'createService';
|
||||
request: {
|
||||
identity: IIdentity;
|
||||
name: string;
|
||||
description: string;
|
||||
imageId: string;
|
||||
imageVersion: string;
|
||||
environment: { [key: string]: string };
|
||||
secretBundleId: string;
|
||||
scaleFactor: number;
|
||||
balancingStrategy: 'round-robin' | 'least-connections';
|
||||
ports: {
|
||||
web: number;
|
||||
custom?: { [domain: string]: string };
|
||||
};
|
||||
resources?: IServiceRessources;
|
||||
domains: {
|
||||
name: string;
|
||||
port?: number;
|
||||
protocol?: 'http' | 'https' | 'ssh';
|
||||
}[];
|
||||
};
|
||||
response: {
|
||||
service: IService;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IRequest_Any_Cloudly_UpdateService
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IRequest_Any_Cloudly_UpdateService
|
||||
> {
|
||||
method: 'updateService';
|
||||
request: {
|
||||
identity: IIdentity;
|
||||
serviceId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
imageId: string;
|
||||
imageVersion: string;
|
||||
environment: { [key: string]: string };
|
||||
secretBundleId: string;
|
||||
scaleFactor: number;
|
||||
balancingStrategy: 'round-robin' | 'least-connections';
|
||||
ports: {
|
||||
web: number;
|
||||
custom?: { [domain: string]: string };
|
||||
};
|
||||
resources?: IServiceRessources;
|
||||
domains: {
|
||||
name: string;
|
||||
port?: number;
|
||||
protocol?: 'http' | 'https' | 'ssh';
|
||||
}[];
|
||||
};
|
||||
response: {
|
||||
service: IService;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IRequest_Any_Cloudly_DeleteService
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IRequest_Any_Cloudly_DeleteService
|
||||
> {
|
||||
method: 'deleteService';
|
||||
request: {
|
||||
identity: IIdentity;
|
||||
serviceId: string;
|
||||
};
|
||||
response: {
|
||||
success: boolean;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user