Java 类com.amazonaws.services.autoscaling.model.DescribeLaunchConfigurationsRequest 实例源码

项目:cmn-project    文件:AutoScaling.java   
public Map<String, LaunchConfiguration> describeLaunchConfigs(List<String> launchConfigNames) {
    if (launchConfigNames.isEmpty()) throw new Error("launchConfigNames must not be empty");
    logger.info("describe launch configs, names={}", launchConfigNames);

    Map<String, LaunchConfiguration> results = Maps.newHashMap();

    autoScaling.describeLaunchConfigurations(new DescribeLaunchConfigurationsRequest()
        .withLaunchConfigurationNames(launchConfigNames))
               .getLaunchConfigurations()
               .forEach(config -> results.put(config.getLaunchConfigurationName(), config));

    if (results.size() != launchConfigNames.size())
        throw Exceptions.error("some launch config does not exist, foundNames={}", results.keySet());

    return results;
}
项目:scale.cloudpool    文件:GetLaunchConfiguration.java   
@Override
public LaunchConfiguration call() {
    DescribeLaunchConfigurationsRequest request = new DescribeLaunchConfigurationsRequest()
            .withLaunchConfigurationNames(this.launchConfigurationName);
    DescribeLaunchConfigurationsResult result = getClient().getApi().describeLaunchConfigurations(request);
    List<LaunchConfiguration> launchConfigurations = result.getLaunchConfigurations();
    if (launchConfigurations.isEmpty()) {
        throw new IllegalArgumentException(format("Launch Configuration '%s' doesn't exist in region '%s'.",
                this.launchConfigurationName, getClient().getRegion()));
    }
    return getOnlyElement(launchConfigurations);
}
项目:clouck    文件:AsWrapperImpl.java   
@Override
public List<AbstractResource<?>> describeLaunchConfigurations(Account account, Region region, DateTime dt) {
    AmazonAutoScaling as = findClient(account, region);

    DescribeLaunchConfigurationsRequest req = new DescribeLaunchConfigurationsRequest();
    log.debug("start describing instances for account:{} in region:{} via api", account.getId() + "=>" + account.getName(), region);
    DescribeLaunchConfigurationsResult res = as.describeLaunchConfigurations(req);

    return converter.toAsLaunchConfigurations(res.getLaunchConfigurations(), account.getId(), region, dt);
}
项目:cmn-project    文件:AutoScaling.java   
public LaunchConfiguration describeLaunchConfig(String launchConfigName) {
    logger.info("describe launch config, name={}", launchConfigName);
    return autoScaling.describeLaunchConfigurations(new DescribeLaunchConfigurationsRequest()
        .withLaunchConfigurationNames(launchConfigName))
                      .getLaunchConfigurations().get(0);
}