@serve.zone/interfaces 32.72.0 → 32.74.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.
@@ -0,0 +1,119 @@
1
+ import * as plugins from '../plugins.js';
2
+ import type { ICluster } from '../data/cluster.js';
3
+ import type { TSha256Digest } from '../data/immutableimage.js';
4
+ import type {
5
+ ILocation,
6
+ ILocationView,
7
+ TLocationMemberKind,
8
+ TSetClusterLocationOutcome,
9
+ } from '../data/location.js';
10
+ import type { IIdentity } from '../data/user.js';
11
+
12
+ /*
13
+ * Location administration. Every request here is an administrator's alone: no delegated-admin
14
+ * scope admits one (`data.delegatedAdminTokenScopeRequests`). Every refusal is one of
15
+ * `data.locationRefusals` and changes nothing.
16
+ */
17
+
18
+ /** An administrator creates a location; refused `location-name-invalid` or `location-name-taken`. */
19
+ export interface IReq_Any_Cloudly_CreateLocation extends plugins.typedrequestInterfaces.implementsTR<
20
+ plugins.typedrequestInterfaces.ITypedRequest,
21
+ IReq_Any_Cloudly_CreateLocation
22
+ > {
23
+ method: 'createLocation';
24
+ request: {
25
+ identity: IIdentity;
26
+ /** `data.isLocationName`, unique among locations. */
27
+ name: string;
28
+ };
29
+ response: {
30
+ location: ILocation;
31
+ };
32
+ }
33
+
34
+ /**
35
+ * An administrator renames a location; its id and every reference stay. Renaming to the name it
36
+ * carries changes nothing. Refused `location-not-found`, `location-name-invalid` or
37
+ * `location-name-taken`.
38
+ */
39
+ export interface IReq_Any_Cloudly_RenameLocation extends plugins.typedrequestInterfaces.implementsTR<
40
+ plugins.typedrequestInterfaces.ITypedRequest,
41
+ IReq_Any_Cloudly_RenameLocation
42
+ > {
43
+ method: 'renameLocation';
44
+ request: {
45
+ identity: IIdentity;
46
+ locationId: string;
47
+ /** `data.isLocationName`, unique among locations. */
48
+ name: string;
49
+ };
50
+ response: {
51
+ location: ILocation;
52
+ };
53
+ }
54
+
55
+ /** Every location with its members, its membership digest and whether that membership is confirmed. */
56
+ export interface IReq_Any_Cloudly_GetLocations extends plugins.typedrequestInterfaces.implementsTR<
57
+ plugins.typedrequestInterfaces.ITypedRequest,
58
+ IReq_Any_Cloudly_GetLocations
59
+ > {
60
+ method: 'getLocations';
61
+ request: {
62
+ identity: IIdentity;
63
+ };
64
+ response: {
65
+ /** Sorted by location id; exactly one has `receivesUnnamedCreates`. */
66
+ locations: ILocationView[];
67
+ /**
68
+ * The member kinds this Cloudly records, in `data.locationMemberKinds` order; every view's
69
+ * digest covers them. A kind missing here has no members anywhere yet, so a confirmation
70
+ * cannot vouch for it.
71
+ */
72
+ recordedMemberKinds: TLocationMemberKind[];
73
+ };
74
+ }
75
+
76
+ /**
77
+ * An administrator moves a whole cluster to a location: every node of the cluster and the
78
+ * cluster's copy of each, in one transaction. A cluster without nodes stands nowhere, so the call
79
+ * moves nothing and answers `cluster-empty`. Refused `cluster-not-found`, `location-not-found` or
80
+ * `conflict`; never `cluster-spans-locations`, since the move also repairs a cluster whose nodes
81
+ * stand in more than one location.
82
+ */
83
+ export interface IReq_Any_Cloudly_SetClusterLocation extends plugins.typedrequestInterfaces.implementsTR<
84
+ plugins.typedrequestInterfaces.ITypedRequest,
85
+ IReq_Any_Cloudly_SetClusterLocation
86
+ > {
87
+ method: 'setClusterLocation';
88
+ request: {
89
+ identity: IIdentity;
90
+ clusterId: string;
91
+ locationId: string;
92
+ };
93
+ response: {
94
+ outcome: TSetClusterLocationOutcome;
95
+ /** The cluster as it now stands. */
96
+ cluster: ICluster;
97
+ };
98
+ }
99
+
100
+ /**
101
+ * An administrator confirms that a location holds everything it should, stating the
102
+ * `membershipDigest` of the view they read. Refused `membership-changed` when the location's
103
+ * membership is no longer that one, and `location-not-found`. The confirmation holds until the
104
+ * membership changes; nothing rewrites it then.
105
+ */
106
+ export interface IReq_Any_Cloudly_ConfirmLocationMembership extends plugins.typedrequestInterfaces.implementsTR<
107
+ plugins.typedrequestInterfaces.ITypedRequest,
108
+ IReq_Any_Cloudly_ConfirmLocationMembership
109
+ > {
110
+ method: 'confirmLocationMembership';
111
+ request: {
112
+ identity: IIdentity;
113
+ locationId: string;
114
+ membershipDigest: TSha256Digest;
115
+ };
116
+ response: {
117
+ location: ILocationView;
118
+ };
119
+ }
@@ -3,6 +3,7 @@ import type { IBareMetal } from '../data/baremetal.js';
3
3
  import type { ICluster } from '../data/cluster.js';
4
4
  import type { IClusterNode, INodeAction, INodeMetricsSample, TNodeActionName } from '../data/clusternode.js';
5
5
  import type { IDeployment } from '../data/deployment.js';
6
+ import type { ILocationScope } from '../data/location.js';
6
7
  import type { INodeActionConfirmation, INodeActionPreview } from '../data/nodeaction.js';
7
8
  import type { ISparkFleetTarget, ISparkFleetTargetChange, ISparkNodeTargetHold } from '../data/sparkfleettarget.js';
8
9
  import type { IIdentity } from '../data/user.js';
@@ -159,6 +160,14 @@ export interface IReq_Any_Cloudly_CreateNodeJumpCommand extends plugins.typedreq
159
160
  * its name is proposed from that (`data.proposeClusterNodeName`).
160
161
  */
161
162
  nodeName?: string;
163
+ /**
164
+ * The location the new node stands in. Named, the location must exist (`location-not-found`)
165
+ * and, when the cluster has nodes, be the cluster's (`location-mismatch`); the jump code keeps
166
+ * it and the claim checks it again against the cluster as it stands then. Absent, the claim
167
+ * places the node in the cluster's location, or for a cluster without nodes in the location
168
+ * that receives unnamed creates (the initial location).
169
+ */
170
+ locationId?: string;
162
171
  };
163
172
  response: {
164
173
  jumpCode: string;
@@ -177,9 +186,16 @@ export interface IReq_Any_Cloudly_GetNodes extends plugins.typedrequestInterface
177
186
  request: {
178
187
  identity: IIdentity;
179
188
  clusterId?: string;
189
+ /** Only the nodes whose `data.locationId` is this location. */
190
+ locationScope?: ILocationScope;
180
191
  };
181
192
  response: {
182
193
  nodes: IClusterNode[];
194
+ /**
195
+ * The scope Cloudly applied, echoing `locationScope`. Absent from a Cloudly that ignored the
196
+ * scope (one without locations): its list is unscoped and must not be shown as scoped.
197
+ */
198
+ appliedLocationScope?: ILocationScope;
183
199
  };
184
200
  }
185
201