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


Java AmazonRoute53类代码示例

本文整理汇总了Java中com.amazonaws.services.route53.AmazonRoute53的典型用法代码示例。如果您正苦于以下问题:Java AmazonRoute53类的具体用法?Java AmazonRoute53怎么用?Java AmazonRoute53使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: main

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
    Arguments arguments = new Arguments();
    CmdLineParser parser = new CmdLineParser(arguments);
    try {
        parser.parseArgument(args);
    } catch (CmdLineException e) {
        System.err.println("Usage: java -jar dyndns.jar <arguments>");
        parser.printUsage(System.err);
        System.exit(1);
    }

    AmazonRoute53 route53 = new AmazonRoute53Client(new DefaultAWSCredentialsProviderChain());

    UpdateDns updateDns = new UpdateDns(route53, arguments.hostedZoneId);
    updateDns.updateDns(arguments.recordSetName, arguments.force);
}
 
开发者ID:elprespufferfish,项目名称:route53-dynamic-dns,代码行数:17,代码来源:UpdateDns.java

示例2: attachDomainToEip

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
public static ChangeInfo attachDomainToEip(AmazonRoute53 route53, String publicIp, String domain) {
	String hostedZoneId = findHostedZoneForDomain(route53, domain);
	if (hostedZoneId != null) {
		System.out.println("Found HostedZone's Id(" + hostedZoneId + ")");
	} else {
		return null;
	}

	ResourceRecordSet resourceRecordSet = generateResourceRecordSetForARecord(publicIp, domain);
	ChangeInfo changeinfo = AwsRoute53Client.changeResourceRecordSet(route53, hostedZoneId, resourceRecordSet,
			ChangeAction.CREATE);
	return changeinfo;
}
 
开发者ID:betahikaru,项目名称:ec2-util,代码行数:14,代码来源:AwsRoute53Client.java

示例3: findHostedZoneForDomain

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
public static String findHostedZoneForDomain(AmazonRoute53 route53, String domain) {
	ListHostedZonesResult listHostedZonesResult = route53.listHostedZones();
	List<HostedZone> hostedZones = listHostedZonesResult.getHostedZones();
	String hostedZoneId = null;
	for (HostedZone hostedZone : hostedZones) {
		if (isRootDomain(domain, hostedZone)) {
			hostedZoneId = hostedZone.getId();
			break;
		}
	}
	return hostedZoneId;
}
 
开发者ID:betahikaru,项目名称:ec2-util,代码行数:13,代码来源:AwsRoute53Client.java

示例4: changeResourceRecordSet

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
public static ChangeInfo changeResourceRecordSet(AmazonRoute53 route53, String hostedZoneId,
		ResourceRecordSet resourceRecordSet, ChangeAction changeAction) {
	Change change = new Change(changeAction, resourceRecordSet);
	ChangeBatch changeBatch = new ChangeBatch().withChanges(change);
	ChangeResourceRecordSetsRequest changeResourceRecordSetsRequest = new ChangeResourceRecordSetsRequest(
			hostedZoneId, changeBatch);
	ChangeResourceRecordSetsResult changeResourceRecordSetsResult = route53
			.changeResourceRecordSets(changeResourceRecordSetsRequest);
	ChangeInfo changeinfo = changeResourceRecordSetsResult.getChangeInfo();
	return changeinfo;
}
 
开发者ID:betahikaru,项目名称:ec2-util,代码行数:12,代码来源:AwsRoute53Client.java

示例5: getAmazonRoute53Client

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
@Override
public AmazonRoute53 getAmazonRoute53Client() {
	return r53;
}
 
开发者ID:maroussil,项目名称:Ec2InstanceStarter,代码行数:5,代码来源:PropertyConfig.java

示例6: getRoute53

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
public static AmazonRoute53 getRoute53() {
	AmazonRoute53 route53 = new AmazonRoute53Client(ConfigProvider.getCredential());
	route53.setRegion(ConfigProvider.getDefaultRegion());
	return route53;
}
 
开发者ID:betahikaru,项目名称:ec2-util,代码行数:6,代码来源:AwsRoute53Client.java

示例7: startByName

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
private int startByName(Ec2CommandOptions options) throws FileNotFoundException {
	String name = options.getName();
	InputStream inputStream = new FileInputStream(new File(options.getCredentialsPath()));
	ConfigProvider.loadConfigure(inputStream);
	AmazonEC2 ec2 = AwsEc2Client.getEc2();

	// Check Exists Instance
	Instance instance = AwsEc2Client.findInstanceByName(ec2, name);
	if (instance == null) {
		System.err.println("Not exists instance (name = " + name + ").");
		return 2;
	}
	String instanceId = instance.getInstanceId();
	System.out.println("Exists instance (id = " + instanceId + ")");

	// Start Ec2 Instance
	InstanceStateChange stateChange = AwsEc2Client.startInstance(ec2, instanceId);
	AwsEc2Client.showStateChange(stateChange, "Starting Instance");

	// Allocate Address
	DomainType domainType = (instance.getVpcId() == null) ? DomainType.Standard : DomainType.Vpc;
	Address address = AwsEc2Client.allocateAddress(ec2, domainType);
	String publicIp = address.getPublicIp();
	System.out.println("Allocated Address(" + publicIp + ", " + address.getAllocationId() + ")");
	if (address != null) {
		// TODO: Wait for Starting Instance.
		waitForStartingInstance();

		try {
			// Associate Address
			String associateAddress = AwsEc2Client.associateAddress(ec2, address, instanceId);
			System.out.println("Associated Address(" + publicIp + ", " + associateAddress + ")");

			String domain = options.getDomain();
			if (domain != null) {
				// Attach Domain to EIP
				AmazonRoute53 route53 = AwsRoute53Client.getRoute53();
				ChangeInfo attachedResult = AwsRoute53Client.attachDomainToEip(route53, publicIp, domain);
				if (attachedResult != null) {
					System.out.println("Attached domain(" + domain + ")");
				} else {
					System.err.println("Not Found Available Hosted Zone for specified Domain(" + domain + ")");
				}
			}
		} catch (AmazonServiceException e) {
			AwsEc2Client.releaseAddress(ec2, address);
			System.out.println("Released Address (" + publicIp + ")");
			return 2;
		}
	}
	return 0;
}
 
开发者ID:betahikaru,项目名称:ec2-util,代码行数:53,代码来源:Ec2StartCommand.java

示例8: getAmazonClient

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
@Override
   public AmazonRoute53 getAmazonClient() {
return r53;
   }
 
开发者ID:renatodelgaudio,项目名称:awsroute53,代码行数:5,代码来源:PropertyConfig.java

示例9: UpdateDns

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
public UpdateDns(AmazonRoute53 route53, String hostedZoneId) {
    this.route53 = route53;
    this.hostedZoneId = hostedZoneId;
}
 
开发者ID:elprespufferfish,项目名称:route53-dynamic-dns,代码行数:5,代码来源:UpdateDns.java

示例10: newClient

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
private AmazonRoute53 newClient() {

		final AmazonRoute53 amazonClient = new AmazonRoute53Client(credentials);

		return amazonClient;

	}
 
开发者ID:jwrapper,项目名称:jwrapper-maven-plugin,代码行数:8,代码来源:CarrotRoute53.java

示例11: getAmazonRoute53Client

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
/**
 * 
 * @return
 */
AmazonRoute53 getAmazonRoute53Client();
 
开发者ID:maroussil,项目名称:Ec2InstanceStarter,代码行数:6,代码来源:Configuration.java

示例12: getAmazonClient

import com.amazonaws.services.route53.AmazonRoute53; //导入依赖的package包/类
/**
 * 
 * @return The amazon client
 */
AmazonRoute53 getAmazonClient();
 
开发者ID:renatodelgaudio,项目名称:awsroute53,代码行数:6,代码来源:Configuration.java


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