Created
June 19, 2014 19:30
-
-
Save hub-cap/13908a5903f6cfd40b0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LBClient.prototype._provisionChildLoadBalancer = function (state, callback) { | |
console.log("_provisionChildLoadBalancer"); | |
var client = createPkgCloudClient(); | |
var remoteLoadBalancer = { | |
name: 'dbaas-proxy-child', | |
protocol: {name:"TCP", port: state.childLoadBalancer.port}, | |
virtualIps: [{ | |
id: state.parentLoadBalancer.virtualIP | |
}], | |
nodes: [{ | |
address: state.childLoadBalancer.privateIP, | |
port: state.childLoadBalancer.privatePort, | |
condition: 'ENABLED', | |
}] | |
}; | |
// util.retryCall(10, client, client.createLoadBalancer, | |
client.createLoadBalancer( | |
remoteLoadBalancer, | |
function(err, pkgCloudLB) { | |
state.remoteLoadBalancer = pkgCloudLB; | |
callback(err); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
function createPkgCloudClient() {
return pkgcloud.loadbalancer.createClient({
provider: 'rackspace',
username: AUTH_CRED.LBaaSUser,
apiKey: AUTH_CRED.LBaaSPassword,
authUrl: AUTH_CRED.endpoint,
region: AUTH_CRED.region
});
}