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


Java AmazonAutoScalingClient.setRegion方法代码示例

本文整理汇总了Java中com.amazonaws.services.autoscaling.AmazonAutoScalingClient.setRegion方法的典型用法代码示例。如果您正苦于以下问题:Java AmazonAutoScalingClient.setRegion方法的具体用法?Java AmazonAutoScalingClient.setRegion怎么用?Java AmazonAutoScalingClient.setRegion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amazonaws.services.autoscaling.AmazonAutoScalingClient的用法示例。


在下文中一共展示了AmazonAutoScalingClient.setRegion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AsgTagInstanceDiscovery

import com.amazonaws.services.autoscaling.AmazonAutoScalingClient; //导入方法依赖的package包/类
protected AsgTagInstanceDiscovery(AmazonAutoScalingClient asgClient, AmazonEC2Client ec2Client) {
    Preconditions.checkNotNull(asgClient);
    Preconditions.checkNotNull(ec2Client);
    Preconditions.checkState(!Strings.isNullOrEmpty(CLUSTER_TAG_KEY.get()), TAG_PROPERTY_NAME + " must be supplied!");
    this.asgClient = asgClient;
    this.ec2Client = ec2Client;

    String regionName = DynamicPropertyFactory.getInstance().getStringProperty("turbine.region", "").get();
    if(Strings.isNullOrEmpty(regionName)) {
        Region currentRegion = Regions.getCurrentRegion();
        if(currentRegion != null) {
            regionName = currentRegion.getName();
        } else {
            regionName = "us-east-1";
        }
    }
    Region region = Region.getRegion(Regions.fromName(regionName));
    ec2Client.setRegion(region);
    asgClient.setRegion(region);
    log.debug("Set the region to [{}]", region);
}
 
开发者ID:bbcom,项目名称:turbine-plugins,代码行数:22,代码来源:AsgTagInstanceDiscovery.java

示例2: AwsAutoScalingDeployUtils

import com.amazonaws.services.autoscaling.AmazonAutoScalingClient; //导入方法依赖的package包/类
public AwsAutoScalingDeployUtils(String region, DeployConfiguration activeConfiguration, Log log) {
    this.activeConfiguration = activeConfiguration;
    this.log = log;

    Region awsRegion = Region.getRegion(Regions.fromName(region));
    awsAsClient = new AmazonAutoScalingClient();
    awsAsClient.setRegion(awsRegion);

    awsElbClient = new AmazonElasticLoadBalancingClient();
    awsElbClient.setRegion(awsRegion);

    awsEc2Client = new AmazonEC2Client();
    awsEc2Client.setRegion(awsRegion);

    activeConfiguration.withAutoScalingGroup(matchAutoScalingGroupName(activeConfiguration.getAutoScalingGroupId()));

}
 
开发者ID:msoute,项目名称:vertx-deploy-tools,代码行数:18,代码来源:AwsAutoScalingDeployUtils.java

示例3: createAutoScalingClient

import com.amazonaws.services.autoscaling.AmazonAutoScalingClient; //导入方法依赖的package包/类
public AmazonAutoScalingClient createAutoScalingClient(AwsCredentialView awsCredential, String regionName) {
    AmazonAutoScalingClient client = isRoleAssumeRequired(awsCredential)
            ? new AmazonAutoScalingClient(credentialClient.retrieveCachedSessionCredentials(awsCredential))
            : new AmazonAutoScalingClient(createAwsCredentials(awsCredential));
    client.setRegion(RegionUtils.getRegion(regionName));
    return client;
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:8,代码来源:AwsClient.java

示例4: createAmazonAutoScalingClient

import com.amazonaws.services.autoscaling.AmazonAutoScalingClient; //导入方法依赖的package包/类
public AmazonAutoScalingClient createAmazonAutoScalingClient(AWSCredentials crendentials) {
	AmazonAutoScalingClient amazonEC2Client = new AmazonAutoScalingClient(new SimpleAWSCredentialsProvider(crendentials));
	amazonEC2Client.setRegion(region);
	return amazonEC2Client;
}
 
开发者ID:sequenceiq,项目名称:sequenceiq-samples,代码行数:6,代码来源:AmazonAutoScalingClientFactory.java


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