當前位置: 首頁>>代碼示例>>Java>>正文


Java AmazonEC2.setRegion方法代碼示例

本文整理匯總了Java中com.amazonaws.services.ec2.AmazonEC2.setRegion方法的典型用法代碼示例。如果您正苦於以下問題:Java AmazonEC2.setRegion方法的具體用法?Java AmazonEC2.setRegion怎麽用?Java AmazonEC2.setRegion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.amazonaws.services.ec2.AmazonEC2的用法示例。


在下文中一共展示了AmazonEC2.setRegion方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import com.amazonaws.services.ec2.AmazonEC2; //導入方法依賴的package包/類
public static void main(String... args) throws IOException {
    AWSCredentialsProvider credentials = CredentialsUtils.getAwsCredentials();

    AmazonS3 storage = new AmazonS3Client(credentials);
    storage.setRegion(Region.getRegion(Regions.EU_WEST_1));

    AmazonSQS queue = new AmazonSQSClient(credentials);
    queue.setRegion(Region.getRegion(Regions.EU_WEST_1));

    AmazonEC2 machines = new AmazonEC2Client(credentials);
    machines.setRegion(Region.getRegion(Regions.EU_WEST_1));

    AmazonIdentityManagement identityManagement = new AmazonIdentityManagementClient(credentials);
    identityManagement.setRegion(Region.getRegion(Regions.EU_WEST_1));

    if ("launch".equals(args[0])) {
        setup(storage, queue, machines, identityManagement);

        manageAnswers(queue);
    } else if ("run".equals(args[0])) {
        run(storage, queue);
    } else {
        System.out.println("Huh hoh! Don't know what you intended to do...");
    }
}
 
開發者ID:mathieubolla,項目名稱:aws-sdk-first-steps,代碼行數:26,代碼來源:Launcher.java

示例2: readResolve

import com.amazonaws.services.ec2.AmazonEC2; //導入方法依賴的package包/類
protected Object readResolve() {
    _filters = parseFilters(_filterString);
    _amazonEC2 = newArrayList();

    for (Region region : parseRegions(_regionString)) {
        AmazonEC2 ec2 = new AmazonEC2Client();
        ec2.setRegion(region);
        LOG.log(FINER, "Region enabled: {0}", region);
        _amazonEC2.add(ec2);
    }

    return this;
}
 
開發者ID:dump247,項目名稱:jenkins-docker-build-plugin,代碼行數:14,代碼來源:EC2DockerHostProvider.java

示例3: findClient

import com.amazonaws.services.ec2.AmazonEC2; //導入方法依賴的package包/類
private AmazonEC2 findClient(Account account, Region region) {
    // TODO: need to config client config parameter. ignore it for now.
    // TODO: need a cached version based on account and region as key
    AWSCredentials credential = new BasicAWSCredentials(account.getAccessKeyId(), account.getSecretAccessKey());
    AmazonEC2 ec2 = new AmazonEC2Client(credential);
    ec2.setRegion(com.amazonaws.regions.Region.getRegion(region.getRegions()));
    return ec2;
}
 
開發者ID:veyronfei,項目名稱:clouck,代碼行數:9,代碼來源:Ec2WrapperImpl.java

示例4: ec2

import com.amazonaws.services.ec2.AmazonEC2; //導入方法依賴的package包/類
@Bean
public AmazonEC2 ec2() {
    final AmazonEC2 client = new AmazonEC2Client();
    client.setRegion(region);
    return client;
}
 
開發者ID:aws-samples,項目名稱:aws-codedeploy-sample-tomcat,代碼行數:7,代碼來源:MvcConfiguration.java

示例5: getEc2

import com.amazonaws.services.ec2.AmazonEC2; //導入方法依賴的package包/類
public static AmazonEC2 getEc2() {
	AmazonEC2 ec2 = new AmazonEC2Client(ConfigProvider.getCredential());
	ec2.setRegion(ConfigProvider.getDefaultRegion());
	return ec2;
}
 
開發者ID:betahikaru,項目名稱:ec2-util,代碼行數:6,代碼來源:AwsEc2Client.java


注:本文中的com.amazonaws.services.ec2.AmazonEC2.setRegion方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。