-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Milestone
Description
It would be neat if you could import an SDK to control your Defang provisioned infrastructure from within your application.
For example something very loosely along these lines:
import defang from '@defang/sdk';
function myMonitoringService(){
const workerService = defang.getService('worker');
const instanceCount = workerService.getInstanceCount();
const customMetric = myPrivateFunctionThatGivesMeARelevantMetric();
if(customMetric > 0.8 && instanceCount < 10) {
workerService.setInstanceCount(instanceCount + 1);
}
if(customMetric < 0.4 && instanceCount > 2){
workerService.setInstanceCount(instanceCount - 1);
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels