Skip to content

Enhanced support for associating NICs with Load Balancers#1101

Merged
martinsawicki merged 10 commits into
Azure:masterfrom
martinsawicki:martin-networking
Sep 26, 2016
Merged

Enhanced support for associating NICs with Load Balancers#1101
martinsawicki merged 10 commits into
Azure:masterfrom
martinsawicki:martin-networking

Conversation

@martinsawicki

@martinsawicki martinsawicki commented Sep 23, 2016

Copy link
Copy Markdown

Backend: simple usage to associate an existing NIC (primary IP config) with an existing LB backend:

nic.update()  
    .withExistingLoadBalancerBackend(lb, "backend1")  
    .apply();

same idea for NIC definition.

NAT rule:

nic.update()
    .withExistingLoadBalancerInboundNatRule(lb,  "natrule1")
    .apply();

@azuresdkci

Copy link
Copy Markdown
Contributor

Can one of the admins verify this patch?

@azuresdkci

Copy link
Copy Markdown
Contributor

Runtime changes detected. pull request created. CI running: Build Status

@azuresdkci

Copy link
Copy Markdown
Contributor

Runtime changes detected. pull request created. CI running: Build Status

@azuresdkci

Copy link
Copy Markdown
Contributor

Runtime changes detected. pull request created. CI running: Build Status

}
}

return null;

@anuchandy anuchandy Sep 24, 2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should return this here right? otherwise null ptr exception while running the next stage wither?

same with withExistingLoadBalancerInboundNatRule as well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null is returned because the user cannot proceed here - the user is pointing at a Backend that does not exist, so the logic should fail fast here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...so to make their error checking robust, the user code should fist ensure that the backend exists:

if (!lb.backends().contains(backendName)) {
    // Missing backend
} else {
    // Call the code in question
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok. I do have similar situation in VMSS, there i just throw ArgumentException with a message so that user knows whats wrong, returning null seems fine.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason I figured returning null would be ok in scenarios involving the passing of a child's name as an argument is because it seems equivalent to trying to access LoadBalancer.backends().get(backendName) and similar child access scenarios, where children are returned as a Map. The Map doesn't throw in the case of a bad name.

@azuresdkci

Copy link
Copy Markdown
Contributor

Runtime changes detected. pull request created. CI running: Build Status

@martinsawicki martinsawicki merged commit 56bba66 into Azure:master Sep 26, 2016
jianghaolu pushed a commit to jianghaolu/azure-sdk-for-java that referenced this pull request Feb 27, 2017
remerging - for some reason it's still showing up as open...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants