Skip to content

Instantly share code, notes, and snippets.

@kenperkins
Created April 19, 2013 18:52
Show Gist options
  • Save kenperkins/5422390 to your computer and use it in GitHub Desktop.
Save kenperkins/5422390 to your computer and use it in GitHub Desktop.
function updateNodeStatus(nodeId, condition, callback) {
client.getLoadBalancer(id, function(err, loadBalancer) {
if (err) {
callback(err);
return;
}
loadBalancer.getNodes(function(err) {
if (err) {
callback(err);
return;
}
loadBalancer.nodes.forEach(function(node) {
if (node.id == nodeId) {
node.condition = condition;
node.update(callback);
}
});
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment