@camunda/ccma-api 5.18.0 → 5.20.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.
@@ -1,4 +1,4 @@
1
- import type { AlertSubscriptionDto, BackupDto, BackupScheduleDto, ByomClientDto, ByomStatus, ClusterBulkOperationAck, ClusterBulkOperationDto, ClusterBulkOperationPostContent, ClusterModificationConfigDto, ClusterModificationDto, ClusterPlanTypeDto, ClusterTtlDto, ClusterUsageMetadataDto, ClusterUsageMetricsData, ConsoleClusterDto, UniqueTaskUser, UpdateClusterTtlBody, ValueMetrics } from '@camunda/ccma-shared-types';
1
+ import type { AlertSubscriptionDto, BackupDto, BackupScheduleDto, ByomClientDto, ByomStatus, ClusterBulkOperationAck, ClusterBulkOperationDto, ClusterBulkOperationPostContent, ClusterModificationConfigDto, ClusterModificationDto, ClusterPlanTypeDto, ClusterTtlDto, ClusterUsageMetadataDto, ClusterUsageMetricsData, ConsoleClusterDto, UniqueTaskUser, UpdateClusterTtlBody, ValueMetrics, ZeebeRebalancingSetting } from '@camunda/ccma-shared-types';
2
2
  import type { RequestBaseParams } from '../../types/general.types.js';
3
3
  import type { OpenIncident } from '../incident-io/incident-io.service.js';
4
4
  import type { ConsoleClusterClientDto } from './console.cluster-clients.service.js';
@@ -331,6 +331,12 @@ export interface AdminClusterNonSpotNodesRequest extends RequestBaseParams {
331
331
  nonSpotNodesEnabled: boolean;
332
332
  };
333
333
  }
334
+ export interface AdminClusterZeebeRebalancingRequest extends RequestBaseParams {
335
+ params: {
336
+ clusterId: string;
337
+ };
338
+ body: ZeebeRebalancingSetting;
339
+ }
334
340
  /** What `GET api/admin/clusters/modifications` answers. */
335
341
  export interface ModificationsAnswer {
336
342
  clusters: ConsoleClusterDto[];
@@ -368,6 +374,13 @@ export declare class ConsoleAdminService {
368
374
  * `availabilityClass` of the spec.
369
375
  */
370
376
  static updateClusterNonSpotNodes(params: AdminClusterNonSpotNodesRequest): Promise<void>;
377
+ /**
378
+ * Set scheduled Zeebe leader rebalancing for a cluster. The body replaces the
379
+ * stored setting, and `enabled: false` keeps the schedule. The route answers
380
+ * 404 while the flag `console.zeebeRebalancing` is off, and 400 with field
381
+ * messages for a setting that `validateZeebeRebalancing` refuses.
382
+ */
383
+ static updateZeebeRebalancing(params: AdminClusterZeebeRebalancingRequest): Promise<ZeebeRebalancingSetting>;
371
384
  static signalSignup(params: SignalSignupRequest): Promise<void>;
372
385
  static unlinkClusterFromModification(params: {
373
386
  uuid: string;
@@ -423,10 +436,15 @@ export declare class ConsoleAdminService {
423
436
  static getApiClients(params: {
424
437
  orgId: string;
425
438
  } & RequestBaseParams): Promise<any[] | undefined>;
439
+ /**
440
+ * deleteApiClient deletes an API client of any org. The route needs the
441
+ * `apiClient.delete` console permission and no org membership. `clientUuid`
442
+ * is the `uuid` of the client, not its OAuth `clientId`.
443
+ */
426
444
  static deleteApiClient(params: {
427
445
  orgId: string;
428
- clientId: string;
429
- } & RequestBaseParams): Promise<void | undefined>;
446
+ clientUuid: string;
447
+ } & RequestBaseParams): Promise<void>;
430
448
  static wakeCluster(params: {
431
449
  clusterId: string;
432
450
  } & RequestBaseParams): Promise<void | undefined>;
@@ -235,6 +235,41 @@ class ConsoleAdminService {
235
235
  );
236
236
  }
237
237
  }
238
+ /**
239
+ * Set scheduled Zeebe leader rebalancing for a cluster. The body replaces the
240
+ * stored setting, and `enabled: false` keeps the schedule. The route answers
241
+ * 404 while the flag `console.zeebeRebalancing` is off, and 400 with field
242
+ * messages for a setting that `validateZeebeRebalancing` refuses.
243
+ */
244
+ static async updateZeebeRebalancing(params) {
245
+ const serviceContext = {
246
+ method: {
247
+ name: "ConsoleAdminService.updateZeebeRebalancing",
248
+ url: `api/admin/clusters/${params.params.clusterId}/zeebe-rebalancing`,
249
+ normalizedUrl: "api/admin/clusters/:clusterId/zeebe-rebalancing",
250
+ type: "patch"
251
+ },
252
+ source: params.config.metrics?.source || "unset",
253
+ target: { name: "console", type: "internal" }
254
+ };
255
+ const response = await request({
256
+ config: params.config,
257
+ base: { id: "console" },
258
+ url: serviceContext.method.url,
259
+ method: serviceContext.method.type,
260
+ metricsDetails: serviceContext,
261
+ responseType: "json",
262
+ body: params.body
263
+ });
264
+ if (!response.ok || !response.body) {
265
+ throw new HttpError(
266
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
267
+ response.status,
268
+ response.statusText
269
+ );
270
+ }
271
+ return response.body;
272
+ }
238
273
  static async signalSignup(params) {
239
274
  const serviceContext = {
240
275
  method: {
@@ -989,12 +1024,17 @@ class ConsoleAdminService {
989
1024
  }
990
1025
  return response.body;
991
1026
  }
1027
+ /**
1028
+ * deleteApiClient deletes an API client of any org. The route needs the
1029
+ * `apiClient.delete` console permission and no org membership. `clientUuid`
1030
+ * is the `uuid` of the client, not its OAuth `clientId`.
1031
+ */
992
1032
  static async deleteApiClient(params) {
993
1033
  const serviceContext = {
994
1034
  method: {
995
- name: `ConsoleAdminService.getBulkClusterPlanUpdate`,
996
- url: `api/admin/apiClients/${params.orgId}/clientId/${params.clientId}`,
997
- normalizedUrl: `api/apiClients/:orgId/clientId/:clientId`,
1035
+ name: `ConsoleAdminService.deleteApiClient`,
1036
+ url: `api/admin/apiClients/${params.orgId}/client/${params.clientUuid}`,
1037
+ normalizedUrl: `api/admin/apiClients/:orgId/client/:clientUuid`,
998
1038
  type: "delete"
999
1039
  },
1000
1040
  source: params.config.metrics?.source || "unset",
@@ -1005,7 +1045,7 @@ class ConsoleAdminService {
1005
1045
  base: {
1006
1046
  id: "console"
1007
1047
  },
1008
- responseType: "json",
1048
+ responseType: "none",
1009
1049
  url: serviceContext.method.url,
1010
1050
  method: serviceContext.method.type,
1011
1051
  metricsDetails: serviceContext
@@ -1017,7 +1057,6 @@ class ConsoleAdminService {
1017
1057
  response.statusText
1018
1058
  );
1019
1059
  }
1020
- return response.body;
1021
1060
  }
1022
1061
  static async wakeCluster(params) {
1023
1062
  const serviceContext = {