本文整理汇总了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);
}
示例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()));
}
示例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;
}
示例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;
}