@serve.zone/interfaces 32.22.0 → 32.23.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 +46 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/corestorelegacyadoption.d.ts +178 -0
- package/dist_ts/data/corestorelegacyadoption.js +289 -0
- package/dist_ts/data/index.d.ts +2 -0
- package/dist_ts/data/index.js +3 -1
- package/dist_ts/data/networkprotection.d.ts +13 -0
- package/dist_ts/data/networkprotection.js +8 -2
- package/dist_ts/data/service.d.ts +15 -1
- package/dist_ts/data/service.js +1 -1
- package/dist_ts/data/serviceruntime.d.ts +8 -3
- package/dist_ts/data/serviceruntime.js +3 -2
- package/dist_ts/data/servicevolumeinitialization.d.ts +91 -0
- package/dist_ts/data/servicevolumeinitialization.js +93 -0
- package/dist_ts/platform/types.d.ts +45 -0
- package/dist_ts/platform/types.js +27 -2
- package/dist_ts/requests/corestore.d.ts +60 -0
- package/dist_ts/requests/corestore.js +1 -1
- package/dist_ts/requests/platform.d.ts +6 -1
- package/dist_ts/requests/service.d.ts +23 -0
- package/package.json +1 -1
- package/readme.md +133 -6
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/corestorelegacyadoption.ts +471 -0
- package/ts/data/index.ts +2 -0
- package/ts/data/networkprotection.ts +20 -1
- package/ts/data/service.ts +16 -0
- package/ts/data/serviceruntime.ts +8 -2
- package/ts/data/servicevolumeinitialization.ts +159 -0
- package/ts/platform/types.ts +75 -0
- package/ts/requests/corestore.ts +79 -0
- package/ts/requests/platform.ts +6 -0
- package/ts/requests/service.ts +28 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type { IRuntimeLocalStorageOwnership } from './runtimelocalstorageclaim.js';
|
|
2
|
+
import { runtimeLocalStorageClaimContract } from './runtimelocalstorageclaim.js';
|
|
3
|
+
import type { IServiceRuntimeProfile } from './serviceruntime.js';
|
|
4
|
+
import { hasExactKeys, isPlainRecord } from '../private/dataproperties.js';
|
|
5
|
+
import { isRuntimeIdentityNumber } from '../private/runtimepolicy.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Where an `import` volume's bytes come from.
|
|
9
|
+
*
|
|
10
|
+
* `docker-volume` is a Docker volume on the host the claim's node runs on, named exactly as Docker
|
|
11
|
+
* lists it; a Corestore-driver volume is named the same way. The operator copies its tree into the
|
|
12
|
+
* node's import directory; the node never reads this reference, and the local storage claim does
|
|
13
|
+
* not carry it.
|
|
14
|
+
*/
|
|
15
|
+
export type TServiceVolumeImportSource = { kind: 'docker-volume'; volumeName: string };
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The owner and permission bits an `empty` volume's root directory gets.
|
|
19
|
+
*
|
|
20
|
+
* `explicit` states the numeric owner. `run-as` takes the owner from the runtime spec's
|
|
21
|
+
* `profile.runAs` (user and group) when the claim is first issued; the mode is always stated,
|
|
22
|
+
* because no mode is right for every image.
|
|
23
|
+
*/
|
|
24
|
+
export type TServiceVolumeOwnership =
|
|
25
|
+
| { kind: 'explicit'; uid: number; gid: number; mode: number }
|
|
26
|
+
| { kind: 'run-as'; mode: number };
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* How a service volume's node-local claim starts: `empty` creates a fresh root with the stated
|
|
30
|
+
* ownership, `import` waits for the bytes of an existing volume.
|
|
31
|
+
*/
|
|
32
|
+
export type TServiceVolumeInitialization =
|
|
33
|
+
| { kind: 'empty'; ownership: TServiceVolumeOwnership }
|
|
34
|
+
| { kind: 'import'; source: TServiceVolumeImportSource };
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* What a volume's initialization derives for a local storage claim, or why it derives nothing.
|
|
38
|
+
*
|
|
39
|
+
* `volume-initialization-unknown` is a volume with no initialization: Cloudly never assumes
|
|
40
|
+
* `empty`, because an empty volume in front of a service whose data sits in a legacy volume would
|
|
41
|
+
* start that service without its data. `volume-ownership-unknown` is a `run-as` ownership while
|
|
42
|
+
* the runtime spec runs the image's own user (`runAs: null`), whose numeric identity Cloudly does
|
|
43
|
+
* not know.
|
|
44
|
+
*/
|
|
45
|
+
export type TServiceVolumeClaimInitialization =
|
|
46
|
+
| { status: 'derived'; initialization: 'empty'; initialOwnership: IRuntimeLocalStorageOwnership }
|
|
47
|
+
| { status: 'derived'; initialization: 'import'; initialOwnership: null }
|
|
48
|
+
| { status: 'refused'; reason: 'volume-initialization-unknown' | 'volume-ownership-unknown' };
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Why `setServiceVolumeInitialization` wrote nothing. `volume-not-found` names no declared volume
|
|
52
|
+
* at that mount path, `conflict` a stored initialization other than `expected`,
|
|
53
|
+
* `volume-initialization-invalid` a value this contract refuses, and
|
|
54
|
+
* `volume-initialization-bound` a change while a bound local storage claim of the volume exists:
|
|
55
|
+
* a claim keeps the initialization and ownership it was issued with for its whole life.
|
|
56
|
+
*/
|
|
57
|
+
export type TServiceVolumeInitializationRefusal =
|
|
58
|
+
| 'volume-not-found'
|
|
59
|
+
| 'conflict'
|
|
60
|
+
| 'volume-initialization-invalid'
|
|
61
|
+
| 'volume-initialization-bound';
|
|
62
|
+
|
|
63
|
+
/** The named refusal of `setServiceVolumeInitialization`, sent as `TypedResponseError.errorData`. */
|
|
64
|
+
export interface IServiceVolumeInitializationErrorData {
|
|
65
|
+
code: TServiceVolumeInitializationRefusal;
|
|
66
|
+
retryable: false;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const serviceVolumeInitializationContract = Object.freeze({
|
|
70
|
+
/** Every permission bit an ownership may state, the local storage claim's own bound. */
|
|
71
|
+
directoryModeBits: runtimeLocalStorageClaimContract.directoryModeBits,
|
|
72
|
+
maximumDockerVolumeNameLength: 255,
|
|
73
|
+
} as const);
|
|
74
|
+
|
|
75
|
+
/** Docker's own volume name grammar, `[a-zA-Z0-9][a-zA-Z0-9_.-]`, which needs two characters. */
|
|
76
|
+
const dockerVolumeNamePattern = /^[A-Za-z0-9][A-Za-z0-9_.-]+$/;
|
|
77
|
+
|
|
78
|
+
const isDirectoryMode = (valueArg: unknown): valueArg is number => Number.isSafeInteger(valueArg)
|
|
79
|
+
&& (valueArg as number) >= 0
|
|
80
|
+
&& ((valueArg as number) & ~serviceVolumeInitializationContract.directoryModeBits) === 0;
|
|
81
|
+
|
|
82
|
+
const validateOwnership = (valueArg: unknown, pathArg: string): string[] => {
|
|
83
|
+
if (!isPlainRecord(valueArg)) return [`${pathArg} must use its exact schema`];
|
|
84
|
+
if (valueArg.kind === 'explicit') {
|
|
85
|
+
if (!hasExactKeys(valueArg, ['kind', 'uid', 'gid', 'mode'])) return [`${pathArg} must use its exact schema`];
|
|
86
|
+
const errors: string[] = [];
|
|
87
|
+
if (!isRuntimeIdentityNumber(valueArg.uid) || !isRuntimeIdentityNumber(valueArg.gid)) {
|
|
88
|
+
errors.push(`${pathArg} uid and gid must be runtime identity numbers`);
|
|
89
|
+
}
|
|
90
|
+
if (!isDirectoryMode(valueArg.mode)) errors.push(`${pathArg} mode must hold directory permission bits only`);
|
|
91
|
+
return errors;
|
|
92
|
+
}
|
|
93
|
+
if (valueArg.kind === 'run-as') {
|
|
94
|
+
if (!hasExactKeys(valueArg, ['kind', 'mode'])) return [`${pathArg} must use its exact schema`];
|
|
95
|
+
return isDirectoryMode(valueArg.mode) ? [] : [`${pathArg} mode must hold directory permission bits only`];
|
|
96
|
+
}
|
|
97
|
+
return [`${pathArg} kind must be explicit or run-as`];
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const validateImportSource = (valueArg: unknown, pathArg: string): string[] => {
|
|
101
|
+
if (!isPlainRecord(valueArg) || valueArg.kind !== 'docker-volume'
|
|
102
|
+
|| !hasExactKeys(valueArg, ['kind', 'volumeName'])) {
|
|
103
|
+
return [`${pathArg} must be an exact docker-volume source`];
|
|
104
|
+
}
|
|
105
|
+
return typeof valueArg.volumeName === 'string'
|
|
106
|
+
&& valueArg.volumeName.length <= serviceVolumeInitializationContract.maximumDockerVolumeNameLength
|
|
107
|
+
&& dockerVolumeNamePattern.test(valueArg.volumeName)
|
|
108
|
+
? []
|
|
109
|
+
: [`${pathArg} volumeName must be a Docker volume name`];
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/** Validates one volume initialization and names every reason it is refused. */
|
|
113
|
+
export const validateServiceVolumeInitialization = (
|
|
114
|
+
valueArg: unknown,
|
|
115
|
+
pathArg = 'service volume initialization',
|
|
116
|
+
): string[] => {
|
|
117
|
+
if (!isPlainRecord(valueArg)) return [`${pathArg} must use its exact schema`];
|
|
118
|
+
if (valueArg.kind === 'empty') {
|
|
119
|
+
if (!hasExactKeys(valueArg, ['kind', 'ownership'])) return [`${pathArg} must use its exact schema`];
|
|
120
|
+
return validateOwnership(valueArg.ownership, `${pathArg} ownership`);
|
|
121
|
+
}
|
|
122
|
+
if (valueArg.kind === 'import') {
|
|
123
|
+
if (!hasExactKeys(valueArg, ['kind', 'source'])) return [`${pathArg} must use its exact schema`];
|
|
124
|
+
return validateImportSource(valueArg.source, `${pathArg} source`);
|
|
125
|
+
}
|
|
126
|
+
return [`${pathArg} kind must be empty or import`];
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The claim fields a volume's initialization derives under a runtime spec's `runAs`.
|
|
131
|
+
*
|
|
132
|
+
* Absent initialization refuses as `volume-initialization-unknown`; a `run-as` ownership under
|
|
133
|
+
* `runAs: null` refuses as `volume-ownership-unknown`. Nothing is defaulted. The answer is for the
|
|
134
|
+
* first generation of a claim only: later generations carry that claim's own initialization and
|
|
135
|
+
* ownership, whatever `runAs` says by then. A malformed initialization or `runAs` throws.
|
|
136
|
+
*/
|
|
137
|
+
export const deriveServiceVolumeClaimInitialization = (
|
|
138
|
+
initializationArg: TServiceVolumeInitialization | undefined,
|
|
139
|
+
runAsArg: IServiceRuntimeProfile['runAs'],
|
|
140
|
+
): TServiceVolumeClaimInitialization => {
|
|
141
|
+
if (initializationArg === undefined) return { status: 'refused', reason: 'volume-initialization-unknown' };
|
|
142
|
+
const errors = validateServiceVolumeInitialization(initializationArg);
|
|
143
|
+
if (errors.length > 0) throw new Error(errors[0]);
|
|
144
|
+
if (runAsArg !== null && !(isPlainRecord(runAsArg) && hasExactKeys(runAsArg, ['user', 'group'])
|
|
145
|
+
&& isRuntimeIdentityNumber(runAsArg.user) && isRuntimeIdentityNumber(runAsArg.group))) {
|
|
146
|
+
throw new Error('runAs must be null or an exact user and group');
|
|
147
|
+
}
|
|
148
|
+
if (initializationArg.kind === 'import') {
|
|
149
|
+
return { status: 'derived', initialization: 'import', initialOwnership: null };
|
|
150
|
+
}
|
|
151
|
+
const ownership = initializationArg.ownership;
|
|
152
|
+
if (ownership.kind === 'explicit') {
|
|
153
|
+
return { status: 'derived', initialization: 'empty',
|
|
154
|
+
initialOwnership: { uid: ownership.uid, gid: ownership.gid, mode: ownership.mode } };
|
|
155
|
+
}
|
|
156
|
+
if (runAsArg === null) return { status: 'refused', reason: 'volume-ownership-unknown' };
|
|
157
|
+
return { status: 'derived', initialization: 'empty',
|
|
158
|
+
initialOwnership: { uid: runAsArg.user, gid: runAsArg.group, mode: ownership.mode } };
|
|
159
|
+
};
|
package/ts/platform/types.ts
CHANGED
|
@@ -16,6 +16,60 @@ export type TPlatformCapability =
|
|
|
16
16
|
export type TPlatformAccessMode = 'rpc' | 'binding' | 'sidecar' | 'internal';
|
|
17
17
|
export type TPlatformBindingStatus = 'requested' | 'provisioning' | 'ready' | 'degraded' | 'failed' | 'disabled';
|
|
18
18
|
export type TPlatformDesiredState = 'enabled' | 'disabled';
|
|
19
|
+
|
|
20
|
+
export const platformBindingStatusReasons = [
|
|
21
|
+
'legacy-adoption-pending',
|
|
22
|
+
'legacy-adoption-conflict',
|
|
23
|
+
'legacy-adoption-mismatch',
|
|
24
|
+
] as const;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Why a binding holds the status it reports, where the status alone does not say.
|
|
28
|
+
*
|
|
29
|
+
* All three come from Corestore's refusal of a credential binding beside a legacy
|
|
30
|
+
* `/resources/provision` resource (`code` in its 409 body, read with
|
|
31
|
+
* `readCorestoreLegacyAdoptionRefusal`):
|
|
32
|
+
*
|
|
33
|
+
* - `legacy-adoption-pending` (status `provisioning`): the service owns a legacy resource of this
|
|
34
|
+
* capability that no offline adoption authorizes yet. It clears when the operator runs
|
|
35
|
+
* Corestore's adoption with the plan Cloudly produced.
|
|
36
|
+
* - `legacy-adoption-conflict` (status `failed`): the adoption authorizes another binding id, or
|
|
37
|
+
* it was already consumed.
|
|
38
|
+
* - `legacy-adoption-mismatch` (status `failed`): the legacy resource is no longer the one the
|
|
39
|
+
* adoption authorized, its database tenant is absent, or the binding's bucket or retention
|
|
40
|
+
* intent differs from the legacy bucket's.
|
|
41
|
+
*/
|
|
42
|
+
export type TPlatformBindingStatusReason = typeof platformBindingStatusReasons[number];
|
|
43
|
+
|
|
44
|
+
const platformBindingStatusOfReason: Readonly<Record<TPlatformBindingStatusReason, TPlatformBindingStatus>> =
|
|
45
|
+
Object.freeze({
|
|
46
|
+
'legacy-adoption-pending': 'provisioning',
|
|
47
|
+
'legacy-adoption-conflict': 'failed',
|
|
48
|
+
'legacy-adoption-mismatch': 'failed',
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
/** The one status each reason is reported with. */
|
|
52
|
+
export const getPlatformBindingStatusOfReason = (
|
|
53
|
+
reasonArg: TPlatformBindingStatusReason,
|
|
54
|
+
): TPlatformBindingStatus => platformBindingStatusOfReason[reasonArg];
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Validates a reported status and its optional reason: a reason must be a member of the
|
|
58
|
+
* vocabulary and come with its one status. An absent reason is valid with every status.
|
|
59
|
+
*/
|
|
60
|
+
export const validatePlatformBindingStatusReason = (
|
|
61
|
+
statusArg: unknown,
|
|
62
|
+
reasonArg: unknown,
|
|
63
|
+
pathArg = 'platform binding statusReason',
|
|
64
|
+
): string[] => {
|
|
65
|
+
if (reasonArg === undefined) return [];
|
|
66
|
+
if (!(platformBindingStatusReasons as readonly unknown[]).includes(reasonArg)) {
|
|
67
|
+
return [`${pathArg} must be a platform binding status reason`];
|
|
68
|
+
}
|
|
69
|
+
return platformBindingStatusOfReason[reasonArg as TPlatformBindingStatusReason] === statusArg
|
|
70
|
+
? []
|
|
71
|
+
: [`${pathArg} ${reasonArg as string} requires status ${platformBindingStatusOfReason[reasonArg as TPlatformBindingStatusReason]}`];
|
|
72
|
+
};
|
|
19
73
|
export type TPlatformEndpointProtocol =
|
|
20
74
|
| 'typedrequest'
|
|
21
75
|
| 'http'
|
|
@@ -55,6 +109,23 @@ export interface IPlatformServiceEndpoint {
|
|
|
55
109
|
port?: number;
|
|
56
110
|
}
|
|
57
111
|
|
|
112
|
+
/**
|
|
113
|
+
* The legacy Corestore resource an object-storage or database binding adopts.
|
|
114
|
+
*
|
|
115
|
+
* Server-managed: only `adoptCorestoreLegacyResources` writes it, in the same write that creates
|
|
116
|
+
* the binding, and Cloudly refuses it (and `objectstorageBucketName`) on `upsertPlatformBinding`.
|
|
117
|
+
* `nodeId` is the node whose Corestore holds the resource, so the binding is placed there and
|
|
118
|
+
* nowhere else; `resourceName` is the legacy database or bucket name; `inventorySha256` is the
|
|
119
|
+
* legacy inventory the adoption was checked against. An adopted bucket's
|
|
120
|
+
* `objectstorageBucketName` is the legacy bucket and its `objectstorageRetention.intent` the legacy
|
|
121
|
+
* intent exactly, or absent when the legacy bucket has none.
|
|
122
|
+
*/
|
|
123
|
+
export interface IPlatformBindingCorestoreLegacyAdoption {
|
|
124
|
+
nodeId: string;
|
|
125
|
+
resourceName: string;
|
|
126
|
+
inventorySha256: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
58
129
|
export interface IPlatformBinding {
|
|
59
130
|
id: string;
|
|
60
131
|
serviceId: string;
|
|
@@ -69,6 +140,10 @@ export interface IPlatformBinding {
|
|
|
69
140
|
objectstorageBucketName?: string;
|
|
70
141
|
/** Capability-specific value-free immutable-retention intent and evidence. */
|
|
71
142
|
objectstorageRetention?: IObjectStorageRetentionBinding;
|
|
143
|
+
/** Server-managed: the legacy Corestore resource this binding adopts. */
|
|
144
|
+
corestoreLegacyAdoption?: IPlatformBindingCorestoreLegacyAdoption;
|
|
145
|
+
/** Why the binding holds its status, as the responsible cluster reported it. */
|
|
146
|
+
statusReason?: TPlatformBindingStatusReason;
|
|
72
147
|
createdAt?: number;
|
|
73
148
|
updatedAt?: number;
|
|
74
149
|
}
|
package/ts/requests/corestore.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
2
|
import type { IIdentity } from '../data/user.js';
|
|
3
|
+
import type {
|
|
4
|
+
ICorestoreLegacyResourceAdoptionPlanEntry,
|
|
5
|
+
ICorestoreLegacyResourceSelection,
|
|
6
|
+
TClusterCorestoreLegacyResourceInventory,
|
|
7
|
+
} from '../data/corestorelegacyadoption.js';
|
|
8
|
+
import type { IPlatformBinding } from '../platform/types.js';
|
|
3
9
|
import { hasExactKeys } from '../private/dataproperties.js';
|
|
4
10
|
import { isClusterNodeId } from '../private/nodeidentifier.js';
|
|
5
11
|
|
|
@@ -277,3 +283,76 @@ extends plugins.typedrequestInterfaces.implementsTR<
|
|
|
277
283
|
inventory: ICorestoreNodeInventory;
|
|
278
284
|
};
|
|
279
285
|
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Cloudly asks the relay for one exact node's legacy Corestore resources.
|
|
289
|
+
*
|
|
290
|
+
* The relay reads Corestore's `corestoreLegacyAdoptionContract.inventoryPath` with the control
|
|
291
|
+
* token and answers `reachable: true` with its services, or `reachable: false` with the reason, never
|
|
292
|
+
* an empty list for a node it could not read.
|
|
293
|
+
*/
|
|
294
|
+
export interface IReq_Cloudly_Relay_GetClusterCorestoreLegacyResources
|
|
295
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
296
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
297
|
+
IReq_Cloudly_Relay_GetClusterCorestoreLegacyResources
|
|
298
|
+
> {
|
|
299
|
+
method: 'getClusterCorestoreLegacyResources';
|
|
300
|
+
request: {
|
|
301
|
+
nodeId: string;
|
|
302
|
+
};
|
|
303
|
+
response: {
|
|
304
|
+
inventory: TClusterCorestoreLegacyResourceInventory;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* An administrator reads one node's legacy Corestore resources through its cluster's relay, with
|
|
310
|
+
* the digest an adoption is checked against (`null` for an unreachable node).
|
|
311
|
+
*/
|
|
312
|
+
export interface IReq_Any_Cloudly_GetCorestoreLegacyResources
|
|
313
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
314
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
315
|
+
IReq_Any_Cloudly_GetCorestoreLegacyResources
|
|
316
|
+
> {
|
|
317
|
+
method: 'getCorestoreLegacyResources';
|
|
318
|
+
request: {
|
|
319
|
+
identity: IIdentity;
|
|
320
|
+
clusterId: string;
|
|
321
|
+
nodeId: string;
|
|
322
|
+
};
|
|
323
|
+
response: {
|
|
324
|
+
inventory: TClusterCorestoreLegacyResourceInventory;
|
|
325
|
+
inventorySha256: string | null;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* The only path that creates a binding carrying a legacy bucket name.
|
|
331
|
+
*
|
|
332
|
+
* Cloudly reads the node's legacy inventory again, requires `expectedInventorySha256`, and for
|
|
333
|
+
* each selected resource creates the adopting binding in one transaction: enabled, placed on
|
|
334
|
+
* `nodeId`, with `corestoreLegacyAdoption`, and for a bucket the legacy bucket name and retention
|
|
335
|
+
* intent (`validatePlatformBindingCorestoreLegacyAdoption`). A resource whose adopting binding
|
|
336
|
+
* already exists is answered unchanged. The response lists the adopting bindings and the plan
|
|
337
|
+
* (`createCorestoreLegacyResourceAdoptionPlan`) the operator hands to Corestore's offline
|
|
338
|
+
* `legacy-resource-adoption` migration. Refusals travel as `ICorestoreLegacyAdoptionErrorData`.
|
|
339
|
+
*/
|
|
340
|
+
export interface IReq_Any_Cloudly_AdoptCorestoreLegacyResources
|
|
341
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
342
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
343
|
+
IReq_Any_Cloudly_AdoptCorestoreLegacyResources
|
|
344
|
+
> {
|
|
345
|
+
method: 'adoptCorestoreLegacyResources';
|
|
346
|
+
request: {
|
|
347
|
+
identity: IIdentity;
|
|
348
|
+
clusterId: string;
|
|
349
|
+
nodeId: string;
|
|
350
|
+
expectedInventorySha256: string;
|
|
351
|
+
/** Sorted by service then capability (`validateCorestoreLegacyResourceSelections`). */
|
|
352
|
+
resources: ICorestoreLegacyResourceSelection[];
|
|
353
|
+
};
|
|
354
|
+
response: {
|
|
355
|
+
bindings: IPlatformBinding[];
|
|
356
|
+
plan: ICorestoreLegacyResourceAdoptionPlanEntry[];
|
|
357
|
+
};
|
|
358
|
+
}
|
package/ts/requests/platform.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
IPlatformCapability,
|
|
6
6
|
IPlatformProviderConfig,
|
|
7
7
|
TPlatformBindingStatus,
|
|
8
|
+
TPlatformBindingStatusReason,
|
|
8
9
|
} from '../platform/types.js';
|
|
9
10
|
|
|
10
11
|
export interface IReq_Any_Cloudly_GetPlatformDesiredState
|
|
@@ -162,6 +163,11 @@ extends plugins.typedrequestInterfaces.implementsTR<
|
|
|
162
163
|
endpoints?: IPlatformBinding['endpoints'];
|
|
163
164
|
/** Reports the exact provider-returned bucket for an objectstorage binding. */
|
|
164
165
|
objectstorageBucketName?: IPlatformBinding['objectstorageBucketName'];
|
|
166
|
+
/**
|
|
167
|
+
* Why the binding holds `status`; `validatePlatformBindingStatusReason` pairs each reason with
|
|
168
|
+
* its one status. Absent clears a stored reason.
|
|
169
|
+
*/
|
|
170
|
+
statusReason?: TPlatformBindingStatusReason;
|
|
165
171
|
errorText?: string;
|
|
166
172
|
};
|
|
167
173
|
response: {
|
package/ts/requests/service.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as plugins from '../plugins.js';
|
|
|
2
2
|
import type { IService } from '../data/service.js';
|
|
3
3
|
import type { TServiceUpdateWritableData, TServiceWritableData } from '../data/service.js';
|
|
4
4
|
import type { IServicePlacement } from '../data/service.js';
|
|
5
|
+
import type { TServiceVolumeInitialization } from '../data/servicevolumeinitialization.js';
|
|
5
6
|
import type { IRegistryTarget } from '../data/registry.js';
|
|
6
7
|
import type { IIdentity, IIdentityCredential } from '../data/user.js';
|
|
7
8
|
import type { IServiceRessources } from '../data/docker.js';
|
|
@@ -390,6 +391,33 @@ extends plugins.typedrequestInterfaces.implementsTR<
|
|
|
390
391
|
};
|
|
391
392
|
}
|
|
392
393
|
|
|
394
|
+
/**
|
|
395
|
+
* Sets how one declared volume's node-local storage claim starts, the only write of
|
|
396
|
+
* `IServiceVolume.initialization`.
|
|
397
|
+
*
|
|
398
|
+
* The volume is named by its exact declared `mountPath`. `expected` is the initialization the
|
|
399
|
+
* caller read, or `null` when the volume has none; any other stored value refuses as `conflict`.
|
|
400
|
+
* While a bound local storage claim of the volume exists, a different initialization refuses as
|
|
401
|
+
* `volume-initialization-bound`. Refusals travel as `IServiceVolumeInitializationErrorData`.
|
|
402
|
+
*/
|
|
403
|
+
export interface IRequest_Any_Cloudly_SetServiceVolumeInitialization
|
|
404
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
405
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
406
|
+
IRequest_Any_Cloudly_SetServiceVolumeInitialization
|
|
407
|
+
> {
|
|
408
|
+
method: 'setServiceVolumeInitialization';
|
|
409
|
+
request: {
|
|
410
|
+
identity: IIdentity;
|
|
411
|
+
serviceId: string;
|
|
412
|
+
mountPath: string;
|
|
413
|
+
expected: TServiceVolumeInitialization | null;
|
|
414
|
+
initialization: TServiceVolumeInitialization;
|
|
415
|
+
};
|
|
416
|
+
response: {
|
|
417
|
+
service: IService;
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
|
|
393
421
|
/**
|
|
394
422
|
* Writes the complete runtime spec of one service.
|
|
395
423
|
*
|