Java 类com.amazonaws.services.ec2.model.CreatePlacementGroupRequest 实例源码

项目:dohko    文件:EC2.java   
public void createPlacementGroupsIfDoNotExist(org.excalibur.core.cloud.api.Placement... groups)
{
    if (groups != null)
    {
        ListeningExecutorService executor = newListeningDynamicScalingThreadPool(String.format("create-groups-%s", credentials_
                .getRegion().getName()));

        List<Callable<Void>> tasks = newArrayList();

        for (final org.excalibur.core.cloud.api.Placement placement : groups)
        {
            tasks.add(new Callable<Void>()
            {
                @Override
                public Void call() throws Exception
                {
                    if (placement != null && !isNullOrEmpty(placement.getGroupName()))
                    {
                        try
                        {
                            new AmazonEC2Client(awsCredentials_).describePlacementGroups(new DescribePlacementGroupsRequest().withGroupNames(placement.getGroupName()));
                        }
                        catch (AmazonClientException exception)
                        {
                            LOG.debug("The group {} is unknown! Provider message: {}", placement.getGroupName(), exception.getMessage());
                            ec2_.createPlacementGroup(new CreatePlacementGroupRequest()
                                .withGroupName(placement.getGroupName()).withStrategy(PlacementStrategy.Cluster));
                        }
                    }
                    return null;
                }
            });
        }

        invokeAllAndShutdownWhenFinish(tasks, executor);
    }
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public PlacementGroup createPlacementGroup(CreatePlacementGroupRequest
        request, ResultCapture<Void> extractor) {

    ActionResult result = service.performAction("CreatePlacementGroup",
            request, extractor);

    if (result == null) return null;
    return new PlacementGroupImpl(result.getResource());
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public PlacementGroup createPlacementGroup(String groupName, String strategy
        , ResultCapture<Void> extractor) {

    CreatePlacementGroupRequest request = new CreatePlacementGroupRequest()
        .withGroupName(groupName)
        .withStrategy(strategy);
    return createPlacementGroup(request, extractor);
}
项目:elasticsearch_my    文件:AmazonEC2Mock.java   
@Override
public void createPlacementGroup(CreatePlacementGroupRequest createPlacementGroupRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public PlacementGroup createPlacementGroup(CreatePlacementGroupRequest
        request) {

    return createPlacementGroup(request, null);
}
项目:aws-sdk-java-resources    文件:EC2.java   
/**
 * Performs the <code>CreatePlacementGroup</code> action.
 *
 * <p>
 *
 * @return The <code>PlacementGroup</code> resource object associated with
 *         the result of this action.
 * @see CreatePlacementGroupRequest
 */
com.amazonaws.resources.ec2.PlacementGroup createPlacementGroup(
        CreatePlacementGroupRequest request);
项目:aws-sdk-java-resources    文件:EC2.java   
/**
 * Performs the <code>CreatePlacementGroup</code> action and use a
 * ResultCapture to retrieve the low-level client response.
 *
 * <p>
 *
 * @return The <code>PlacementGroup</code> resource object associated with
 *         the result of this action.
 * @see CreatePlacementGroupRequest
 */
com.amazonaws.resources.ec2.PlacementGroup createPlacementGroup(
        CreatePlacementGroupRequest request, ResultCapture<Void> extractor);