Package org.jclouds.aws.ec2.domain

Examples of org.jclouds.aws.ec2.domain.PlacementGroup


   public PlacementGroup getResult() {
      String region = AWSUtils.findRegionInArgsOrNull(getRequest());
      if (region == null)
         region = defaultRegion.get();
      PlacementGroup returnVal = new PlacementGroup(region, name, strategy, state);
      this.name = null;
      this.strategy = "cluster";
      this.state = null;
      return returnVal;
   }
View Full Code Here


      String userSuppliedPlacementGroup = "myPlacementGroup";

      // create mocks
      CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions strategy = setupStrategy();
      AWSEC2TemplateOptions options = createMock(AWSEC2TemplateOptions.class);
      PlacementGroup placementGroup = createMock(PlacementGroup.class);

      // setup expectations
      expect(options.getPlacementGroup()).andReturn(userSuppliedPlacementGroup);

      // replay mocks
View Full Code Here

      // part!

      // create mocks
      CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions strategy = setupStrategy();
      AWSEC2TemplateOptions options = createMock(AWSEC2TemplateOptions.class);
      PlacementGroup placementGroup = createMock(PlacementGroup.class);

      // setup expectations
      expect(options.getPlacementGroup()).andReturn(userSuppliedPlacementGroup);
      expect(options.shouldAutomaticallyCreatePlacementGroup()).andReturn(shouldAutomaticallyCreatePlacementGroup);
View Full Code Here

@Test(groups = "unit", testName = "DescribePlacementGroupsResponseHandlerTest")
public class DescribePlacementGroupsResponseHandlerTest extends BaseEC2HandlerTest {
   public void testApplyInputStream() {
      InputStream is = getClass().getResourceAsStream("/describe_placement_groups.xml");

      PlacementGroup expected = new PlacementGroup(defaultRegion, "XYZ-cluster", "cluster",
               PlacementGroup.State.AVAILABLE);
      DescribePlacementGroupsResponseHandler handler = injector
               .getInstance(DescribePlacementGroupsResponseHandler.class);
      addDefaultRegionToHandler(handler);
      PlacementGroup result = getOnlyElement(factory.create(handler).parse(is));

      assertEquals(result, expected);
   }
View Full Code Here

      try {
         if (client.getPlacementGroupServices().describePlacementGroupsInRegion(region, placementGroup).size() > 0) {
            logger.debug(">> deleting placementGroup(%s)", placementGroup);
            try {
               client.getPlacementGroupServices().deletePlacementGroupInRegion(region, placementGroup);
               checkState(placementGroupDeleted.apply(new PlacementGroup(region, placementGroup, "cluster",
                        State.PENDING)), String.format("placementGroup region(%s) name(%s) failed to delete", region,
                        placementGroup));
               placementGroupMap.invalidate(new RegionAndName(region, placementGroup));
               logger.debug("<< deleted placementGroup(%s)", placementGroup);
            } catch (IllegalStateException e) {
View Full Code Here

      checkNotNull(name, "name");
      logger.debug(">> creating placementGroup region(%s) name(%s)", region, name);
      try {
         ec2Client.getPlacementGroupServices().createPlacementGroupInRegion(region, name);
         logger.debug("<< created placementGroup(%s)", name);
         checkState(placementGroupAvailable.apply(new PlacementGroup(region, name, "cluster", State.PENDING)), String
                  .format("placementGroup region(%s) name(%s) failed to become available", region, name));
      } catch (AWSResponseException e) {
         if (e.getError().getCode().equals("InvalidPlacementGroup.Duplicate")) {
            logger.debug("<< reused placementGroup(%s)", name);
         } else {
View Full Code Here

   public PlacementGroup getResult() {
      String region = AWSUtils.findRegionInArgsOrNull(getRequest());
      if (region == null)
         region = defaultRegion.get();
      PlacementGroup returnVal = new PlacementGroup(region, name, strategy, state);
      this.name = null;
      this.strategy = "cluster";
      this.state = null;
      return returnVal;
   }
View Full Code Here

      for (String region : supportedRegions) {
         SortedSet<PlacementGroup> allResults = newTreeSet(client.getPlacementGroupServices()
                  .describePlacementGroupsInRegion(region));
         assertNotNull(allResults);
         if (allResults.size() >= 1) {
            PlacementGroup group = allResults.last();
            SortedSet<PlacementGroup> result = newTreeSet(client.getPlacementGroupServices()
                     .describePlacementGroupsInRegion(region, group.getName()));
            assertNotNull(result);
            PlacementGroup compare = result.last();
            assertEquals(compare, group);
         }
      }

      for (String region : client.getAvailabilityZoneAndRegionServices().describeRegions().keySet()) {
View Full Code Here

         verifyPlacementGroup(region, groupName);
      }
   }

   private void verifyPlacementGroup(String region, String groupName) {
      assert availableTester.apply(new PlacementGroup(region, groupName, "cluster", State.PENDING)) : group;
      Set<PlacementGroup> oneResult = client.getPlacementGroupServices().describePlacementGroupsInRegion(region,
               groupName);
      assertNotNull(oneResult);
      assertEquals(oneResult.size(), 1);
      group = oneResult.iterator().next();
View Full Code Here

      String userSuppliedPlacementGroup = "myPlacementGroup";

      // create mocks
      CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions strategy = setupStrategy();
      AWSEC2TemplateOptions options = createMock(AWSEC2TemplateOptions.class);
      PlacementGroup placementGroup = createMock(PlacementGroup.class);

      // setup expectations
      expect(options.getPlacementGroup()).andReturn(userSuppliedPlacementGroup);

      // replay mocks
View Full Code Here

TOP

Related Classes of org.jclouds.aws.ec2.domain.PlacementGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.