feat(api-client): Add advanced cluster creation method and refactor login actions to use API client

This commit is contained in:
2025-09-10 20:23:12 +00:00
parent 124c4ca46f
commit dc0d128892
2 changed files with 105 additions and 126 deletions

View File

@@ -271,6 +271,14 @@ export class CloudlyApiClient {
},
createCluster: async (optionsArg: Parameters<typeof Cluster.createCluster>[1]) => {
return Cluster.createCluster(this, optionsArg);
},
createClusterAdvanced: async (clusterName: string, setupMode?: 'manual' | 'hetzner' | 'aws' | 'digitalocean') => {
const op = 'createCluster';
const payload: any = { identity: this.identity, clusterName };
if (setupMode) payload.setupMode = setupMode;
const wsReq = this.createWsRequest<plugins.servezoneInterfaces.requests.cluster.IRequest_CreateCluster>(op);
if (wsReq) return wsReq.fire(payload);
return this.createHttpRequest<plugins.servezoneInterfaces.requests.cluster.IRequest_CreateCluster>(op).fire(payload);
}
}