We are using cloudbreak api to upscale the cluster with stackendpoint.put(stackId, InstanceGroupAdjustmentJson). Is there a way to know the ip addresses of newly created instances? like any other Synchronous API or REST API which returns the details of new ec2 instances created as part of upscaling?
stackendpoint.put() endpoint is just starts the upscale of the stack but it doesn't wait for the result. It happens asynchronously. There are no new ips at that time. So what you can do is:
- poll get endpoint and check for new nodes in the instance groups
- subscribe to evetns, and you will receive a message when Cloudbreak collected new metadata of the nodes on a websocket.
Thank you @rkovacs
just wondering is there any synchronous api available. Right now I am using stack response api (stackresponse.instancegroup.metadata.privateip) before and after and finding the difference in lists to know the new ip addresses.
We don't have. All of the operation are running in a reactive way in background. Cloudbreak has a non blocking async flow engine, which handle operations like upscale. But as i mentioned we have a subscriptions. You send a subscription request on that endpoint, and the system will send notifications about the state of the operations. Web UI works on the same way.