当前位置: 首页>>代码示例>>Java>>正文


Java LoadBalancerDescription.getLoadBalancerName方法代码示例

本文整理汇总了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;
  }
}
 
开发者ID:Nike-Inc,项目名称:bluegreen-manager,代码行数:22,代码来源:ElbInstanceGoneProgressChecker.java

示例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));
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:22,代码来源:ELBRepository.java

示例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;
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:20,代码来源:ELBRepository.java

示例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());
}
 
开发者ID:Kixeye,项目名称:chassis,代码行数:10,代码来源:ServerInstanceContext.java

示例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);

}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:9,代码来源:ELBRepository.java

示例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);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:61,代码来源:AWSLoadBalancerEnumerationAdapterService.java

示例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);
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:7,代码来源:VPCDiagramBuilder.java


注:本文中的com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription.getLoadBalancerName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。