本文整理汇总了Java中com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription.getLoadBalancerName方法的典型用法代码示例。如果您正苦于以下问题:Java LoadBalancerDescription.getLoadBalancerName方法的具体用法?Java LoadBalancerDescription.getLoadBalancerName怎么用?Java LoadBalancerDescription.getLoadBalancerName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription
的用法示例。
在下文中一共展示了LoadBalancerDescription.getLoadBalancerName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkInstanceRemoval
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
/**
* Sanity checks the LB description, and checks for done-ness.
*/
private void checkInstanceRemoval(LoadBalancerDescription loadBalancerDescription)
{
if (!StringUtils.equals(elbName, loadBalancerDescription.getLoadBalancerName()))
{
throw new IllegalStateException(logContext + "We requested description of ELB '" + elbName
+ "' but response is for '" + loadBalancerDescription.getLoadBalancerName() + "'");
}
if (CollectionUtils.isEmpty(loadBalancerDescription.getInstances()))
{
throw new IllegalStateException("ELB '" + elbName + "' has zero instances");
}
if (instanceIsGoneFromList(loadBalancerDescription.getInstances()))
{
LOGGER.info("ELB '" + elbName + "' list of instances shows '" + ec2InstanceId + "' is gone");
done = true;
result = true;
}
}
示例2: checkForMatchingTag
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
private LoadBalancerDescription checkForMatchingTag(
List<LoadBalancerDescription> descriptions, String vpcID, String type) throws TooManyELBException {
List<LoadBalancerDescription> found = new LinkedList<LoadBalancerDescription>();
for(LoadBalancerDescription desc : descriptions) {
String loadBalancerName = desc.getLoadBalancerName();
logger.info(String.format("Checking LB for tag %s:%s, ELB name is %s", AwsFacade.TYPE_TAG, type, loadBalancerName));
List<Tag> tags = elbClient.getTagsFor(loadBalancerName);
if (containsCorrectTag(tags, type)) {
logger.info("LB matched " + loadBalancerName);
found.add(desc);
}
}
if (found.size()==1) {
return found.get(0);
}
throw new TooManyELBException(found.size(), String.format("Found too many elbs for vpc (%s) that matched tag %s",
vpcID,
AwsFacade.TYPE_TAG));
}
示例3: addInstancesThatMatchBuildAndType
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
private List<Instance> addInstancesThatMatchBuildAndType(ProjectAndEnv projAndEnv, String typeTag) throws CfnAssistException {
if (!projAndEnv.hasBuildNumber()) {
throw new MustHaveBuildNumber();
}
LoadBalancerDescription elb = findELBFor(projAndEnv, typeTag);
List<Instance> currentInstances = elb.getInstances();
String lbName = elb.getLoadBalancerName();
SearchCriteria criteria = new SearchCriteria(projAndEnv);
List<Instance> allMatchingInstances = cfnRepository.getAllInstancesMatchingType(criteria, typeTag);
List<Instance> instancesToAdd = filterBy(currentInstances, allMatchingInstances);
if (allMatchingInstances.size()==0) {
logger.warn(String.format("No instances matched %s and type tag %s (%s)", projAndEnv, typeTag, AwsFacade.TYPE_TAG));
} else {
logger.info(String.format("Regsister matching %s instances with the LB %s ", instancesToAdd.size(),lbName));
elbClient.registerInstances(instancesToAdd, lbName);
}
return instancesToAdd;
}
示例4: getExhibitorListenerDescription
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
private ListenerDescription getExhibitorListenerDescription(LoadBalancerDescription loadBalancer) {
for(ListenerDescription listenerDescription:loadBalancer.getListenerDescriptions()){
if(listenerDescription.getListener().getProtocol().toLowerCase().equals("http")){
return listenerDescription;
}
}
throw new BootstrapException("Unable to find any listeners which supports http on ELB " + loadBalancer.getLoadBalancerName());
}
示例5: removeInstances
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
private List<Instance> removeInstances(LoadBalancerDescription elb,
List<Instance> toRemove) {
String loadBalancerName = elb.getLoadBalancerName();
logger.info("Removing instances from ELB " + loadBalancerName);
return elbClient.degisterInstancesFromLB(toRemove,loadBalancerName);
}
示例6: buildLocalResourceState
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
@Override
protected DeferredResult<LocalStateHolder> buildLocalResourceState(
LoadBalancerDescription remoteResource,
LoadBalancerState existingLocalResourceState) {
LocalStateHolder stateHolder = new LocalStateHolder();
stateHolder.localState = new LoadBalancerState();
stateHolder.localState.name = remoteResource.getLoadBalancerName();
stateHolder.localState.address = remoteResource.getDNSName();
stateHolder.localState.endpointLink = this.request.original.endpointLink;
if (stateHolder.localState.endpointLinks == null) {
stateHolder.localState.endpointLinks = new HashSet<String>();
}
stateHolder.localState.endpointLinks.add(this.request.original.endpointLink);
stateHolder.localState.internetFacing = !"internal".equals(remoteResource.getScheme());
stateHolder.localState.computeHostLink = this.request.parentCompute.documentSelfLink;
stateHolder.localState.routes = getRouteConfigurations(remoteResource);
if (existingLocalResourceState == null) {
stateHolder.localState.regionId = this.regionId;
stateHolder.localState.instanceAdapterReference = AdapterUriUtil
.buildAdapterUri(this.service.getHost(), AWS_LOAD_BALANCER_ADAPTER);
stateHolder.localState.subnetLinks = remoteResource.getSubnets().stream()
.map(subnetId -> this.localSubNetworkStates.get(subnetId))
.filter(Objects::nonNull).collect(Collectors.toSet());
stateHolder.localState.securityGroupLinks = remoteResource.getSecurityGroups()
.stream()
.map(sgId -> this.localSecurityGroupStates.get(sgId))
.filter(Objects::nonNull)
.collect(Collectors.toList());
stateHolder.localState.computeLinks = remoteResource.getInstances().stream()
.map(instance -> this.localComputeStates.get(instance.getInstanceId()))
.filter(Objects::nonNull)
.collect(Collectors.toSet());
// Skip load balancers that do not have any instances attached
if (stateHolder.localState.computeLinks.isEmpty()) {
stateHolder.localState = SKIP;
return DeferredResult.completed(stateHolder);
}
} else {
ServiceStateCollectionUpdateRequest updateRequest = calculateDeltaForUpdateCollectionRequest(
remoteResource, existingLocalResourceState);
return this.service
.sendWithDeferredResult(Operation
.createPatch(this.service,
existingLocalResourceState.documentSelfLink)
.setBody(updateRequest)
)
.thenApply(ignore -> stateHolder);
}
return DeferredResult.completed(stateHolder);
}
示例7: addELB
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
public void addELB(LoadBalancerDescription elb) throws CfnAssistException {
String label = elb.getLoadBalancerName();
String id = elb.getDNSName();
networkDiagram.addLoadBalancer(id, label);
securityDiagram.addLoadBalancer(id, label);
}