feat(api-client): Add advanced cluster creation method and refactor login actions to use API client
This commit is contained in:
		| @@ -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); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user