本文整理汇总了Java中com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription.setLoadBalancerName方法的典型用法代码示例。如果您正苦于以下问题:Java LoadBalancerDescription.setLoadBalancerName方法的具体用法?Java LoadBalancerDescription.setLoadBalancerName怎么用?Java LoadBalancerDescription.setLoadBalancerName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription
的用法示例。
在下文中一共展示了LoadBalancerDescription.setLoadBalancerName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeLoadBalancerDescription
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
/**
* Test helper - makes a fake LB description.
*/
private LoadBalancerDescription makeLoadBalancerDescription(String elbName, String... instanceIds)
{
LoadBalancerDescription loadBalancerDescription = new LoadBalancerDescription();
loadBalancerDescription.setLoadBalancerName(elbName);
List<Instance> instances = new ArrayList<Instance>();
if (instanceIds != null)
{
for (String instanceId : instanceIds)
{
Instance instance = new Instance();
instance.setInstanceId(instanceId);
instances.add(instance);
}
}
loadBalancerDescription.setInstances(instances);
return loadBalancerDescription;
}
示例2: makeDescribeLoadBalancersResult
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
/**
* Test helper - makes describe result with one or more named LBs.
*/
private DescribeLoadBalancersResult makeDescribeLoadBalancersResult(String... loadBalancerNames)
{
DescribeLoadBalancersResult result = new DescribeLoadBalancersResult();
if (ArrayUtils.isNotEmpty(loadBalancerNames))
{
List<LoadBalancerDescription> list = new ArrayList<LoadBalancerDescription>();
for (String loadBalancerName : loadBalancerNames)
{
LoadBalancerDescription loadBalancerDescription = new LoadBalancerDescription();
loadBalancerDescription.setLoadBalancerName(loadBalancerName);
list.add(loadBalancerDescription);
}
result.setLoadBalancerDescriptions(list);
}
return result;
}
示例3: foundCloudformationZookeeper
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
@Test
public void foundCloudformationZookeeper() {
LoadBalancerDescription loadBalancer = new LoadBalancerDescription();
List<ListenerDescription> listenerDescriptions = new ArrayList<>();
listenerDescriptions.add(new ListenerDescription());
loadBalancer.setListenerDescriptions(listenerDescriptions);
loadBalancer.setLoadBalancerName(ENVIRONMENT + "-Zookeeper-whatever");
Assert.assertTrue(filter.accept(loadBalancer));
}
示例4: foundInternalExhibitor
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
@Test
public void foundInternalExhibitor() {
LoadBalancerDescription loadBalancer = new LoadBalancerDescription();
List<ListenerDescription> listenerDescriptions = new ArrayList<>();
listenerDescriptions.add(new ListenerDescription());
loadBalancer.setListenerDescriptions(listenerDescriptions);
loadBalancer.setLoadBalancerName("exhibitor-" + ENVIRONMENT + "-internal");
Assert.assertTrue(filter.accept(loadBalancer));
}
示例5: externalExhibitor
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
@Test
public void externalExhibitor() {
LoadBalancerDescription loadBalancer = new LoadBalancerDescription();
List<ListenerDescription> listenerDescriptions = new ArrayList<>();
listenerDescriptions.add(new ListenerDescription());
loadBalancer.setListenerDescriptions(listenerDescriptions);
loadBalancer.setLoadBalancerName("exhibitor-" + ENVIRONMENT);
Assert.assertFalse(filter.accept(loadBalancer));
}
示例6: randomUnmatchedELB
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
@Test
public void randomUnmatchedELB() {
LoadBalancerDescription loadBalancer = new LoadBalancerDescription();
List<ListenerDescription> listenerDescriptions = new ArrayList<>();
listenerDescriptions.add(new ListenerDescription());
loadBalancer.setListenerDescriptions(listenerDescriptions);
loadBalancer.setLoadBalancerName(RandomStringUtils.random(5,"abcd"));
Assert.assertFalse(filter.accept(loadBalancer));
}
示例7: setUp
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
this.violationSinkMock = mock(ViolationSink.class);
this.clientProviderMock = mock(ClientProvider.class);
this.accountIdSupplierMock = mock(AccountIdSupplier.class);
this.jobsPropertiesMock = mock(JobsProperties.class);
this.portsChecker = mock(PortsChecker.class);
this.securityGroupsChecker = mock(SecurityGroupsChecker.class);
this.mockAwsELBClient = mock(AmazonElasticLoadBalancingClient.class);
this.mockAwsApplications = mock(AwsApplications.class);
this.mockViolationService = mock(ViolationService.class);
this.fetchTaupageYamlMock = mock(FetchTaupageYaml.class);
this.mockAmiDetailsProvider = mock(AmiDetailsProvider.class);
this.mockEC2InstanceProvider = mock(EC2InstanceProvider.class);
final Listener listener = new Listener("HTTPS", 80, 80);
final ListenerDescription listenerDescription = new ListenerDescription();
listenerDescription.setListener(listener);
final ArrayList<LoadBalancerDescription> elbs = newArrayList();
final ArrayList<TagDescription> tagDescriptions = newArrayList();
final LoadBalancerDescription publicELB = new LoadBalancerDescription();
publicELB.setScheme("internet-facing");
publicELB.setListenerDescriptions(newArrayList(listenerDescription));
publicELB.setCanonicalHostedZoneName("test.com");
publicELB.setInstances(asList(new Instance("i1"), new Instance("i2")));
publicELB.setLoadBalancerName("publicELB");
elbs.add(publicELB);
tagDescriptions.add(
new TagDescription()
.withLoadBalancerName("publicELB")
.withTags(newArrayList(
new Tag().withKey("someTag").withValue("someValue"))));
final LoadBalancerDescription privateELB = new LoadBalancerDescription();
privateELB.setScheme("internal");
privateELB.setCanonicalHostedZoneName("internal.org");
privateELB.setLoadBalancerName("privateELB");
elbs.add(privateELB);
for (int i = 1; i <= 20; i++) {
final String loadBalancerName = "kubeELB" + i;
final LoadBalancerDescription kubeELB = new LoadBalancerDescription();
kubeELB.setScheme("internet-facing");
kubeELB.setCanonicalHostedZoneName("test" + i + ".com");
kubeELB.setLoadBalancerName(loadBalancerName);
elbs.add(kubeELB);
tagDescriptions.add(
new TagDescription()
.withLoadBalancerName(loadBalancerName)
.withTags(newArrayList(
new Tag().withKey("someTag").withValue("someValue"),
new Tag().withKey("kubernetes.io/cluster/").withValue("owned"))));
}
mockDescribeELBResult = new DescribeLoadBalancersResult();
mockDescribeELBResult.setLoadBalancerDescriptions(elbs);
mockDescribeTagsResult = new DescribeTagsResult();
mockDescribeTagsResult.setTagDescriptions(tagDescriptions);
regions.add(REGION1);
when(clientProviderMock.getClient(any(), any(String.class), any(Region.class))).thenReturn(mockAwsELBClient);
when(mockEC2InstanceProvider.getById(anyString(), any(Region.class), anyString()))
.thenReturn(Optional.of(new com.amazonaws.services.ec2.model.Instance().withInstanceId("foo").withImageId("bar")));
when(mockAmiDetailsProvider.getAmiDetails(anyString(), any(Region.class), anyString()))
.thenReturn(ImmutableMap.of("ami_id", "bar"));
}
示例8: noMatchingEnvironment
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
@Test
public void noMatchingEnvironment() {
LoadBalancerDescription loadBalancer = new LoadBalancerDescription();
loadBalancer.setLoadBalancerName("foo-Zookeeper-whatever");
Assert.assertFalse(filter.accept(loadBalancer));
}
示例9: matchingEnvironmentNoMatchingName
import com.amazonaws.services.elasticloadbalancing.model.LoadBalancerDescription; //导入方法依赖的package包/类
@Test
public void matchingEnvironmentNoMatchingName() {
LoadBalancerDescription loadBalancer = new LoadBalancerDescription();
loadBalancer.setLoadBalancerName(ENVIRONMENT + "-Asgard-whatever");
Assert.assertFalse(filter.accept(loadBalancer));
}