@serve.zone/interfaces 7.14.0 → 7.16.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 +18 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/backup.d.ts +22 -0
- 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/data/settings.d.ts +3 -0
- package/dist_ts/requests/backup.d.ts +12 -1
- 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/backup.ts +24 -0
- package/ts/data/index.ts +1 -0
- package/ts/data/migration.ts +41 -0
- package/ts/data/service.ts +19 -0
- package/ts/data/settings.ts +12 -0
- package/ts/requests/backup.ts +18 -0
- package/ts/requests/index.ts +2 -0
- package/ts/requests/migration.ts +50 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-06-10 - 7.16.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add archive pruning and external backup tier interfaces (backup)
|
|
8
|
+
- Add backup record metadata for cache/external tiers and offload timestamps
|
|
9
|
+
- Define archive retention/prune result interfaces and coreflowPruneNodeArchive typed request
|
|
10
|
+
- Add settings for external backup targets and node cache retention
|
|
11
|
+
|
|
12
|
+
## 2026-06-10 - 7.15.0
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- add service migration interfaces and requests (migration)
|
|
17
|
+
- Add service migration data models and export them from the data index
|
|
18
|
+
- Add TypedRequest contracts for starting, listing, and pushing service migration updates
|
|
19
|
+
- Add service placement metadata for pinned, replicated, and held services
|
|
20
|
+
|
|
3
21
|
## 2026-06-10 - 7.14.0
|
|
4
22
|
|
|
5
23
|
### Features
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@serve.zone/interfaces',
|
|
6
|
-
version: '7.
|
|
6
|
+
version: '7.16.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/backup.d.ts
CHANGED
|
@@ -62,6 +62,14 @@ export interface IBackupRecord {
|
|
|
62
62
|
trigger: TBackupTrigger;
|
|
63
63
|
snapshots: TBackupSnapshot[];
|
|
64
64
|
replication?: IBackupReplicationResult;
|
|
65
|
+
/**
|
|
66
|
+
* Storage tier of the replicated archive: 'cache' = the platform S3
|
|
67
|
+
* binding next to cloudly; 'external' = the configured long-term target
|
|
68
|
+
* (external S3, NFS path, SMB). Offload moves cache -> external and then
|
|
69
|
+
* deletes the cache copy.
|
|
70
|
+
*/
|
|
71
|
+
tier?: 'cache' | 'external';
|
|
72
|
+
offloadedAt?: number;
|
|
65
73
|
createdAt: number;
|
|
66
74
|
updatedAt: number;
|
|
67
75
|
completedAt?: number;
|
|
@@ -70,3 +78,17 @@ export interface IBackupRecord {
|
|
|
70
78
|
restoreHistory?: IBackupRestoreEvent[];
|
|
71
79
|
tags?: Record<string, string>;
|
|
72
80
|
}
|
|
81
|
+
/** Retention policy understood by containerarchive prune. */
|
|
82
|
+
export interface IArchiveRetentionPolicy {
|
|
83
|
+
keepLast?: number;
|
|
84
|
+
keepDays?: number;
|
|
85
|
+
keepWeeks?: number;
|
|
86
|
+
keepMonths?: number;
|
|
87
|
+
}
|
|
88
|
+
export interface IArchivePruneResult {
|
|
89
|
+
removedSnapshots: number;
|
|
90
|
+
removedPacks: number;
|
|
91
|
+
rewrittenPacks: number;
|
|
92
|
+
freedBytes: number;
|
|
93
|
+
dryRun: boolean;
|
|
94
|
+
}
|
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';
|
|
@@ -6,6 +6,9 @@ export interface ICloudlySettings {
|
|
|
6
6
|
hetznerToken?: string;
|
|
7
7
|
cloudflareToken?: string;
|
|
8
8
|
deploymentArchiveRetentionDays?: string;
|
|
9
|
+
backupExternalTargetType?: string;
|
|
10
|
+
backupExternalTargetConfig?: string;
|
|
11
|
+
backupNodeCacheKeepDays?: string;
|
|
9
12
|
baseosJoinToken?: string;
|
|
10
13
|
corebuildWorkerUrl?: string;
|
|
11
14
|
corebuildWorkerToken?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
-
import type { IBackupArchiveManifest, IBackupArchiveObject, IBackupRecord, IBackupReplicationResult, TBackupSnapshot } from '../data/backup.js';
|
|
2
|
+
import type { IArchivePruneResult, IArchiveRetentionPolicy, IBackupArchiveManifest, IBackupArchiveObject, IBackupRecord, IBackupReplicationResult, TBackupSnapshot } from '../data/backup.js';
|
|
3
3
|
import type { IService } from '../data/service.js';
|
|
4
4
|
import type { IIdentity } from '../data/user.js';
|
|
5
5
|
export interface IReq_Any_Cloudly_CreateServiceBackup extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_CreateServiceBackup> {
|
|
@@ -135,3 +135,14 @@ export interface IReq_Coreflow_Cloudly_DownloadBackupArchiveObject extends plugi
|
|
|
135
135
|
contentsBase64: string;
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
+
export interface IReq_Cloudly_Coreflow_PruneNodeArchive extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Cloudly_Coreflow_PruneNodeArchive> {
|
|
139
|
+
method: 'coreflowPruneNodeArchive';
|
|
140
|
+
request: {
|
|
141
|
+
retention: IArchiveRetentionPolicy;
|
|
142
|
+
dryRun?: boolean;
|
|
143
|
+
};
|
|
144
|
+
response: {
|
|
145
|
+
found: boolean;
|
|
146
|
+
result?: IArchivePruneResult;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9yZXF1ZXN0cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQztBQUV6QyxPQUFPLEtBQUssYUFBYSxNQUFNLFlBQVksQ0FBQztBQUM1QyxPQUFPLEtBQUssZ0JBQWdCLE1BQU0sZUFBZSxDQUFDO0FBQ2xELE9BQU8sS0FBSyxpQkFBaUIsTUFBTSxnQkFBZ0IsQ0FBQztBQUNwRCxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssbUJBQW1CLE1BQU0sa0JBQWtCLENBQUM7QUFDeEQsT0FBTyxLQUFLLGVBQWUsTUFBTSxjQUFjLENBQUM7QUFDaEQsT0FBTyxLQUFLLGNBQWMsTUFBTSxhQUFhLENBQUM7QUFDOUMsT0FBTyxLQU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FnQixJQUFJLFFBQVEsRUFDNUIsY0FBYyxJQUFJLE1BQU0sRUFDeEIsWUFBWSxJQUFJLElBQUksRUFDcEIsZUFBZSxJQUFJLE9BQU8sR0FDM0IsQ0FBQztBQUVGLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxXQUFXLENBQUMifQ==
|
|
@@ -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/backup.ts
CHANGED
|
@@ -86,6 +86,14 @@ export interface IBackupRecord {
|
|
|
86
86
|
trigger: TBackupTrigger;
|
|
87
87
|
snapshots: TBackupSnapshot[];
|
|
88
88
|
replication?: IBackupReplicationResult;
|
|
89
|
+
/**
|
|
90
|
+
* Storage tier of the replicated archive: 'cache' = the platform S3
|
|
91
|
+
* binding next to cloudly; 'external' = the configured long-term target
|
|
92
|
+
* (external S3, NFS path, SMB). Offload moves cache -> external and then
|
|
93
|
+
* deletes the cache copy.
|
|
94
|
+
*/
|
|
95
|
+
tier?: 'cache' | 'external';
|
|
96
|
+
offloadedAt?: number;
|
|
89
97
|
createdAt: number;
|
|
90
98
|
updatedAt: number;
|
|
91
99
|
completedAt?: number;
|
|
@@ -94,3 +102,19 @@ export interface IBackupRecord {
|
|
|
94
102
|
restoreHistory?: IBackupRestoreEvent[];
|
|
95
103
|
tags?: Record<string, string>;
|
|
96
104
|
}
|
|
105
|
+
|
|
106
|
+
/** Retention policy understood by containerarchive prune. */
|
|
107
|
+
export interface IArchiveRetentionPolicy {
|
|
108
|
+
keepLast?: number;
|
|
109
|
+
keepDays?: number;
|
|
110
|
+
keepWeeks?: number;
|
|
111
|
+
keepMonths?: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface IArchivePruneResult {
|
|
115
|
+
removedSnapshots: number;
|
|
116
|
+
removedPacks: number;
|
|
117
|
+
rewrittenPacks: number;
|
|
118
|
+
freedBytes: number;
|
|
119
|
+
dryRun: boolean;
|
|
120
|
+
}
|
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/data/settings.ts
CHANGED
|
@@ -12,6 +12,18 @@ export interface ICloudlySettings {
|
|
|
12
12
|
// Retention for archived deployment records in days (default 90)
|
|
13
13
|
deploymentArchiveRetentionDays?: string;
|
|
14
14
|
|
|
15
|
+
// Long-term backup target. Type 's3' | 'nfs' | 'smb'; config is a JSON
|
|
16
|
+
// object string with the matching connection fields (s3: endpoint,
|
|
17
|
+
// accessKey, secretKey, bucket, port?, useSsl?, region?; nfs: path
|
|
18
|
+
// mounted into the cloudly container; smb: host, share, username?,
|
|
19
|
+
// password?, domain?, port?). Absent = no offload, backups stay on the
|
|
20
|
+
// cache tier.
|
|
21
|
+
backupExternalTargetType?: string;
|
|
22
|
+
backupExternalTargetConfig?: string;
|
|
23
|
+
|
|
24
|
+
// Node-local archive cache retention in days (corestore prune; default 30)
|
|
25
|
+
backupNodeCacheKeepDays?: string;
|
|
26
|
+
|
|
15
27
|
// BaseOS enrollment
|
|
16
28
|
baseosJoinToken?: string;
|
|
17
29
|
|
package/ts/requests/backup.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
2
|
import type {
|
|
3
|
+
IArchivePruneResult,
|
|
4
|
+
IArchiveRetentionPolicy,
|
|
3
5
|
IBackupArchiveManifest,
|
|
4
6
|
IBackupArchiveObject,
|
|
5
7
|
IBackupRecord,
|
|
@@ -196,3 +198,19 @@ extends plugins.typedrequestInterfaces.implementsTR<
|
|
|
196
198
|
contentsBase64: string;
|
|
197
199
|
};
|
|
198
200
|
}
|
|
201
|
+
|
|
202
|
+
export interface IReq_Cloudly_Coreflow_PruneNodeArchive
|
|
203
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
204
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
205
|
+
IReq_Cloudly_Coreflow_PruneNodeArchive
|
|
206
|
+
> {
|
|
207
|
+
method: 'coreflowPruneNodeArchive';
|
|
208
|
+
request: {
|
|
209
|
+
retention: IArchiveRetentionPolicy;
|
|
210
|
+
dryRun?: boolean;
|
|
211
|
+
};
|
|
212
|
+
response: {
|
|
213
|
+
found: boolean;
|
|
214
|
+
result?: IArchivePruneResult;
|
|
215
|
+
};
|
|
216
|
+
}
|
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
|
+
}
|