@serve.zone/interfaces 7.14.0 → 7.15.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 +9 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/index.d.ts +1 -0
- package/dist_ts/data/index.js +2 -1
- package/dist_ts/data/migration.d.ts +31 -0
- package/dist_ts/data/migration.js +2 -0
- package/dist_ts/data/service.d.ts +18 -0
- package/dist_ts/requests/index.d.ts +2 -1
- package/dist_ts/requests/index.js +3 -2
- package/dist_ts/requests/migration.d.ts +35 -0
- package/dist_ts/requests/migration.js +2 -0
- package/package.json +1 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/index.ts +1 -0
- package/ts/data/migration.ts +41 -0
- package/ts/data/service.ts +19 -0
- package/ts/requests/index.ts +2 -0
- package/ts/requests/migration.ts +50 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-06-10 - 7.15.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add service migration interfaces and requests (migration)
|
|
8
|
+
- Add service migration data models and export them from the data index
|
|
9
|
+
- Add TypedRequest contracts for starting, listing, and pushing service migration updates
|
|
10
|
+
- Add service placement metadata for pinned, replicated, and held services
|
|
11
|
+
|
|
3
12
|
## 2026-06-10 - 7.14.0
|
|
4
13
|
|
|
5
14
|
### Features
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@serve.zone/interfaces',
|
|
6
|
-
version: '7.
|
|
6
|
+
version: '7.15.0',
|
|
7
7
|
description: 'Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHVGQUF1RjtDQUNyRyxDQUFBIn0=
|
package/dist_ts/data/index.d.ts
CHANGED
package/dist_ts/data/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from './cloudlyconfig.js';
|
|
|
2
2
|
export * from './cluster.js';
|
|
3
3
|
export * from './config.js';
|
|
4
4
|
export * from './deployment.js';
|
|
5
|
+
export * from './migration.js';
|
|
5
6
|
export * from './dns.js';
|
|
6
7
|
export * from './docker.js';
|
|
7
8
|
export * from './domain.js';
|
|
@@ -25,4 +26,4 @@ export * from './taskexecution.js';
|
|
|
25
26
|
export * from './traffic.js';
|
|
26
27
|
export * from './user.js';
|
|
27
28
|
export * from './version.js';
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9kYXRhL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxhQUFhLENBQUM7QUFDNUIsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLGdCQUFnQixDQUFDO0FBQy9CLGNBQWMsVUFBVSxDQUFDO0FBQ3pCLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsWUFBWSxDQUFDO0FBQzNCLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLFlBQVksQ0FBQztBQUMzQixjQUFjLFdBQVcsQ0FBQztBQUMxQixjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsY0FBYyxDQUFDO0FBQzdCLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxjQUFjLENBQUMifQ==
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type TServiceMigrationStatus = 'running' | 'completed' | 'failed';
|
|
2
|
+
export type TServiceMigrationStepStatus = 'pending' | 'running' | 'completed' | 'failed' | 'skipped';
|
|
3
|
+
export type TServiceMigrationStepKey = 'validate' | 'stop-source' | 'snapshot' | 'restore' | 'deploy-target' | 'verify';
|
|
4
|
+
export interface IServiceMigrationStep {
|
|
5
|
+
key: TServiceMigrationStepKey;
|
|
6
|
+
label: string;
|
|
7
|
+
status: TServiceMigrationStepStatus;
|
|
8
|
+
startedAt?: number;
|
|
9
|
+
finishedAt?: number;
|
|
10
|
+
message?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A node-to-node service migration orchestrated by Cloudly:
|
|
14
|
+
* gracefully stop everywhere -> snapshot data on the source ->
|
|
15
|
+
* restore on the target -> deploy pinned to the target -> verify.
|
|
16
|
+
* On failure before deploy, placement rolls back to the source.
|
|
17
|
+
*/
|
|
18
|
+
export interface IServiceMigration {
|
|
19
|
+
id: string;
|
|
20
|
+
serviceId: string;
|
|
21
|
+
serviceName: string;
|
|
22
|
+
sourceNodeName: string;
|
|
23
|
+
targetNodeName: string;
|
|
24
|
+
/** Backup archive id used for the data move (migration-<id>). */
|
|
25
|
+
backupId?: string;
|
|
26
|
+
status: TServiceMigrationStatus;
|
|
27
|
+
steps: IServiceMigrationStep[];
|
|
28
|
+
startedAt: number;
|
|
29
|
+
finishedAt?: number;
|
|
30
|
+
error?: string;
|
|
31
|
+
}
|
|
@@ -17,6 +17,23 @@ export interface IServiceVolume {
|
|
|
17
17
|
/** Driver-specific options forwarded to Docker's VolumeDriver.Create request. */
|
|
18
18
|
options?: Record<string, string>;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Where a service is allowed to run.
|
|
22
|
+
* - absent or mode 'replicated': the service runs on every node (legacy
|
|
23
|
+
* full-replication behavior).
|
|
24
|
+
* - mode 'pinned' + nodeName: the service runs only on that swarm node;
|
|
25
|
+
* other nodes stop it but preserve local data (volumes, corestore
|
|
26
|
+
* resources) so a migration can move it safely.
|
|
27
|
+
* - hold: the service is stopped on all nodes with data preserved; used by
|
|
28
|
+
* the migration orchestrator between the stop and deploy phases.
|
|
29
|
+
*/
|
|
30
|
+
export interface IServicePlacement {
|
|
31
|
+
mode: 'pinned' | 'replicated';
|
|
32
|
+
/** Swarm node hostname for pinned mode. */
|
|
33
|
+
nodeName?: string;
|
|
34
|
+
/** When true, no node runs the service (data preserved everywhere). */
|
|
35
|
+
hold?: boolean;
|
|
36
|
+
}
|
|
20
37
|
export type TServiceReconciliationStatus = 'running' | 'ready' | 'degraded' | 'failed';
|
|
21
38
|
export interface IServiceReconciliationStageStatus {
|
|
22
39
|
stage: string;
|
|
@@ -47,6 +64,7 @@ export interface IService {
|
|
|
47
64
|
* and archived before a replacement deployment starts.
|
|
48
65
|
*/
|
|
49
66
|
rollingCapable?: boolean;
|
|
67
|
+
placement?: IServicePlacement;
|
|
50
68
|
appTemplateId?: string;
|
|
51
69
|
appTemplateVersion?: string;
|
|
52
70
|
appStoreUpgradePolicy?: 'manual' | 'notify' | 'auto';
|
|
@@ -18,6 +18,7 @@ import * as imageRequests from './image.js';
|
|
|
18
18
|
import * as informRequests from './inform.js';
|
|
19
19
|
import * as logRequests from './log.js';
|
|
20
20
|
import * as mailRequests from './mail.js';
|
|
21
|
+
import * as migrationRequests from './migration.js';
|
|
21
22
|
import * as networkRequests from './network.js';
|
|
22
23
|
import * as nodeRequests from './node.js';
|
|
23
24
|
import * as platformRequests from './platform.js';
|
|
@@ -30,7 +31,7 @@ import * as settingsRequests from './settings.js';
|
|
|
30
31
|
import * as statusRequests from './status.js';
|
|
31
32
|
import * as taskRequests from './task.js';
|
|
32
33
|
import * as versionRequests from './version.js';
|
|
33
|
-
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, certificateRequests as certificate, clusterRequests as cluster, configRequests as config, corestoreRequests as corestore, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, gatewayRequests as gateway, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, logRequests as log, mailRequests as mail, networkRequests as network, nodeRequests as node, platformRequests as platform, routingRequests as routing, secretBundleRequests as secretbundle, secretGroupRequests as secretgroup, serverRequests as server, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, };
|
|
34
|
+
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, certificateRequests as certificate, clusterRequests as cluster, configRequests as config, corestoreRequests as corestore, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, gatewayRequests as gateway, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, platformRequests as platform, routingRequests as routing, secretBundleRequests as secretbundle, secretGroupRequests as secretgroup, serverRequests as server, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, };
|
|
34
35
|
export * from './inform.js';
|
|
35
36
|
export * from './hostedapp.js';
|
|
36
37
|
export * from './mail.js';
|
|
@@ -19,6 +19,7 @@ import * as imageRequests from './image.js';
|
|
|
19
19
|
import * as informRequests from './inform.js';
|
|
20
20
|
import * as logRequests from './log.js';
|
|
21
21
|
import * as mailRequests from './mail.js';
|
|
22
|
+
import * as migrationRequests from './migration.js';
|
|
22
23
|
import * as networkRequests from './network.js';
|
|
23
24
|
import * as nodeRequests from './node.js';
|
|
24
25
|
import * as platformRequests from './platform.js';
|
|
@@ -31,8 +32,8 @@ import * as settingsRequests from './settings.js';
|
|
|
31
32
|
import * as statusRequests from './status.js';
|
|
32
33
|
import * as taskRequests from './task.js';
|
|
33
34
|
import * as versionRequests from './version.js';
|
|
34
|
-
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, certificateRequests as certificate, clusterRequests as cluster, configRequests as config, corestoreRequests as corestore, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, gatewayRequests as gateway, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, logRequests as log, mailRequests as mail, networkRequests as network, nodeRequests as node, platformRequests as platform, routingRequests as routing, secretBundleRequests as secretbundle, secretGroupRequests as secretgroup, serverRequests as server, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, };
|
|
35
|
+
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, certificateRequests as certificate, clusterRequests as cluster, configRequests as config, corestoreRequests as corestore, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, gatewayRequests as gateway, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, platformRequests as platform, routingRequests as routing, secretBundleRequests as secretbundle, secretGroupRequests as secretgroup, serverRequests as server, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, };
|
|
35
36
|
export * from './inform.js';
|
|
36
37
|
export * from './hostedapp.js';
|
|
37
38
|
export * from './mail.js';
|
|
38
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9yZXF1ZXN0cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQztBQUV6QyxPQUFPLEtBQUssYUFBYSxNQUFNLFlBQVksQ0FBQztBQUM1QyxPQUFPLEtBQUssZ0JBQWdCLE1BQU0sZUFBZSxDQUFDO0FBQ2xELE9BQU8sS0FBSyxpQkFBaUIsTUFBTSxnQkFBZ0IsQ0FBQztBQUNwRCxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssbUJBQW1CLE1BQU0sa0JBQWtCLENBQUM7QUFDeEQsT0FBTyxLQUFLLGVBQWUsTUFBTSxjQUFjLENBQUM7QUFDaEQsT0FBTyxLQUFLLGNBQWMsTUFBTSxhQUFhLENBQUM7QUFDOUMsT0FBTyxLQUFLLGlCQUFpQixNQUFNLGdCQUFnQixDQUFDO0FBQ3BELE9BQU8sS0FBSyxrQkFBa0IsTUFBTSxpQkFBaUIsQ0FBQztBQUN0RCxPQUFPLEtBQUssV0FBVy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ztBQUVGLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxXQUFXLENBQUMifQ==
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import type { IServiceMigration } from '../data/migration.js';
|
|
3
|
+
import type { IIdentity } from '../data/user.js';
|
|
4
|
+
export interface IReq_Any_Cloudly_MigrateServiceToNode extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_MigrateServiceToNode> {
|
|
5
|
+
method: 'migrateServiceToNode';
|
|
6
|
+
request: {
|
|
7
|
+
identity: IIdentity;
|
|
8
|
+
serviceId: string;
|
|
9
|
+
/** Swarm node hostname holding the authoritative data copy. */
|
|
10
|
+
sourceNodeName: string;
|
|
11
|
+
/** Swarm node hostname the service moves to. */
|
|
12
|
+
targetNodeName: string;
|
|
13
|
+
};
|
|
14
|
+
response: {
|
|
15
|
+
migration: IServiceMigration;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface IReq_Any_Cloudly_GetServiceMigrations extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_GetServiceMigrations> {
|
|
19
|
+
method: 'getServiceMigrations';
|
|
20
|
+
request: {
|
|
21
|
+
identity: IIdentity;
|
|
22
|
+
/** Limit to one service; absent returns all migrations. */
|
|
23
|
+
serviceId?: string;
|
|
24
|
+
};
|
|
25
|
+
response: {
|
|
26
|
+
migrations: IServiceMigration[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface IReq_Cloudly_Any_PushServiceMigrationUpdate extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Cloudly_Any_PushServiceMigrationUpdate> {
|
|
30
|
+
method: 'pushServiceMigrationUpdate';
|
|
31
|
+
request: {
|
|
32
|
+
migration: IServiceMigration;
|
|
33
|
+
};
|
|
34
|
+
response: Record<string, never>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlncmF0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvcmVxdWVzdHMvbWlncmF0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0sZUFBZSxDQUFDIn0=
|
package/package.json
CHANGED
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/data/index.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type TServiceMigrationStatus = 'running' | 'completed' | 'failed';
|
|
2
|
+
|
|
3
|
+
export type TServiceMigrationStepStatus = 'pending' | 'running' | 'completed' | 'failed' | 'skipped';
|
|
4
|
+
|
|
5
|
+
export type TServiceMigrationStepKey =
|
|
6
|
+
| 'validate'
|
|
7
|
+
| 'stop-source'
|
|
8
|
+
| 'snapshot'
|
|
9
|
+
| 'restore'
|
|
10
|
+
| 'deploy-target'
|
|
11
|
+
| 'verify';
|
|
12
|
+
|
|
13
|
+
export interface IServiceMigrationStep {
|
|
14
|
+
key: TServiceMigrationStepKey;
|
|
15
|
+
label: string;
|
|
16
|
+
status: TServiceMigrationStepStatus;
|
|
17
|
+
startedAt?: number;
|
|
18
|
+
finishedAt?: number;
|
|
19
|
+
message?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A node-to-node service migration orchestrated by Cloudly:
|
|
24
|
+
* gracefully stop everywhere -> snapshot data on the source ->
|
|
25
|
+
* restore on the target -> deploy pinned to the target -> verify.
|
|
26
|
+
* On failure before deploy, placement rolls back to the source.
|
|
27
|
+
*/
|
|
28
|
+
export interface IServiceMigration {
|
|
29
|
+
id: string;
|
|
30
|
+
serviceId: string;
|
|
31
|
+
serviceName: string;
|
|
32
|
+
sourceNodeName: string;
|
|
33
|
+
targetNodeName: string;
|
|
34
|
+
/** Backup archive id used for the data move (migration-<id>). */
|
|
35
|
+
backupId?: string;
|
|
36
|
+
status: TServiceMigrationStatus;
|
|
37
|
+
steps: IServiceMigrationStep[];
|
|
38
|
+
startedAt: number;
|
|
39
|
+
finishedAt?: number;
|
|
40
|
+
error?: string;
|
|
41
|
+
}
|
package/ts/data/service.ts
CHANGED
|
@@ -19,6 +19,24 @@ export interface IServiceVolume {
|
|
|
19
19
|
options?: Record<string, string>;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Where a service is allowed to run.
|
|
24
|
+
* - absent or mode 'replicated': the service runs on every node (legacy
|
|
25
|
+
* full-replication behavior).
|
|
26
|
+
* - mode 'pinned' + nodeName: the service runs only on that swarm node;
|
|
27
|
+
* other nodes stop it but preserve local data (volumes, corestore
|
|
28
|
+
* resources) so a migration can move it safely.
|
|
29
|
+
* - hold: the service is stopped on all nodes with data preserved; used by
|
|
30
|
+
* the migration orchestrator between the stop and deploy phases.
|
|
31
|
+
*/
|
|
32
|
+
export interface IServicePlacement {
|
|
33
|
+
mode: 'pinned' | 'replicated';
|
|
34
|
+
/** Swarm node hostname for pinned mode. */
|
|
35
|
+
nodeName?: string;
|
|
36
|
+
/** When true, no node runs the service (data preserved everywhere). */
|
|
37
|
+
hold?: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
22
40
|
export type TServiceReconciliationStatus = 'running' | 'ready' | 'degraded' | 'failed';
|
|
23
41
|
|
|
24
42
|
export interface IServiceReconciliationStageStatus {
|
|
@@ -53,6 +71,7 @@ export interface IService {
|
|
|
53
71
|
* and archived before a replacement deployment starts.
|
|
54
72
|
*/
|
|
55
73
|
rollingCapable?: boolean;
|
|
74
|
+
placement?: IServicePlacement;
|
|
56
75
|
appTemplateId?: string;
|
|
57
76
|
appTemplateVersion?: string;
|
|
58
77
|
appStoreUpgradePolicy?: 'manual' | 'notify' | 'auto';
|
package/ts/requests/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ import * as imageRequests from './image.js';
|
|
|
20
20
|
import * as informRequests from './inform.js';
|
|
21
21
|
import * as logRequests from './log.js';
|
|
22
22
|
import * as mailRequests from './mail.js';
|
|
23
|
+
import * as migrationRequests from './migration.js';
|
|
23
24
|
import * as networkRequests from './network.js';
|
|
24
25
|
import * as nodeRequests from './node.js';
|
|
25
26
|
import * as platformRequests from './platform.js';
|
|
@@ -54,6 +55,7 @@ export {
|
|
|
54
55
|
informRequests as inform,
|
|
55
56
|
logRequests as log,
|
|
56
57
|
mailRequests as mail,
|
|
58
|
+
migrationRequests as migration,
|
|
57
59
|
networkRequests as network,
|
|
58
60
|
nodeRequests as node,
|
|
59
61
|
platformRequests as platform,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import type { IServiceMigration } from '../data/migration.js';
|
|
3
|
+
import type { IIdentity } from '../data/user.js';
|
|
4
|
+
|
|
5
|
+
export interface IReq_Any_Cloudly_MigrateServiceToNode
|
|
6
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
7
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
8
|
+
IReq_Any_Cloudly_MigrateServiceToNode
|
|
9
|
+
> {
|
|
10
|
+
method: 'migrateServiceToNode';
|
|
11
|
+
request: {
|
|
12
|
+
identity: IIdentity;
|
|
13
|
+
serviceId: string;
|
|
14
|
+
/** Swarm node hostname holding the authoritative data copy. */
|
|
15
|
+
sourceNodeName: string;
|
|
16
|
+
/** Swarm node hostname the service moves to. */
|
|
17
|
+
targetNodeName: string;
|
|
18
|
+
};
|
|
19
|
+
response: {
|
|
20
|
+
migration: IServiceMigration;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface IReq_Any_Cloudly_GetServiceMigrations
|
|
25
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
26
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
27
|
+
IReq_Any_Cloudly_GetServiceMigrations
|
|
28
|
+
> {
|
|
29
|
+
method: 'getServiceMigrations';
|
|
30
|
+
request: {
|
|
31
|
+
identity: IIdentity;
|
|
32
|
+
/** Limit to one service; absent returns all migrations. */
|
|
33
|
+
serviceId?: string;
|
|
34
|
+
};
|
|
35
|
+
response: {
|
|
36
|
+
migrations: IServiceMigration[];
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface IReq_Cloudly_Any_PushServiceMigrationUpdate
|
|
41
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
42
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
43
|
+
IReq_Cloudly_Any_PushServiceMigrationUpdate
|
|
44
|
+
> {
|
|
45
|
+
method: 'pushServiceMigrationUpdate';
|
|
46
|
+
request: {
|
|
47
|
+
migration: IServiceMigration;
|
|
48
|
+
};
|
|
49
|
+
response: Record<string, never>;
|
|
50
|
+
}
|