feat: add platform api helpers

This commit is contained in:
2026-04-28 12:11:54 +00:00
parent baaeda3b57
commit b22f3b6d64
4 changed files with 179 additions and 7 deletions
+47
View File
@@ -8,6 +8,7 @@ import { Cluster } from './classes.cluster.js';
import { SecretBundle } from './classes.secretbundle.js';
import { SecretGroup } from './classes.secretgroup.js';
import { ExternalRegistry } from './classes.externalregistry.js';
import { Platform } from './classes.platform.js';
export class CloudlyApiClient {
private cloudlyUrl: string;
@@ -336,6 +337,52 @@ export class CloudlyApiClient {
}
}
public platform = {
getPlatformDesiredState: async () => {
return Platform.getPlatformDesiredState(this);
},
getPlatformCapabilities: async () => {
return Platform.getPlatformCapabilities(this);
},
getPlatformProviderConfigs: async (
capability?: plugins.servezoneInterfaces.platform.TPlatformCapability,
) => {
return Platform.getPlatformProviderConfigs(this, capability);
},
upsertPlatformProviderConfig: async (
providerConfig: plugins.servezoneInterfaces.platform.IPlatformProviderConfig,
) => {
return Platform.upsertPlatformProviderConfig(this, providerConfig);
},
deletePlatformProviderConfigById: async (providerConfigId: string) => {
return Platform.deletePlatformProviderConfigById(this, providerConfigId);
},
getPlatformBindings: async (
optionsArg: {
serviceId?: string;
capability?: plugins.servezoneInterfaces.platform.TPlatformCapability;
} = {},
) => {
return Platform.getPlatformBindings(this, optionsArg);
},
upsertPlatformBinding: async (
binding: plugins.servezoneInterfaces.platform.IPlatformBinding,
) => {
return Platform.upsertPlatformBinding(this, binding);
},
updatePlatformBindingStatus: async (
optionsArg: Omit<
plugins.servezoneInterfaces.requests.platform.IReq_Any_Cloudly_UpdatePlatformBindingStatus['request'],
'identity'
>,
) => {
return Platform.updatePlatformBindingStatus(this, optionsArg);
},
deletePlatformBindingById: async (bindingId: string) => {
return Platform.deletePlatformBindingById(this, bindingId);
},
}
// Settings API
public settings = {
getSettings: async (): Promise<{