feat: add platform api helpers
This commit is contained in:
@@ -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<{
|
||||
|
||||
Reference in New Issue
Block a user