final DefaultSSLContextFactoryConfig sslConfig = new ExampleDefaultSSLContextFactoryConfig();
final DefaultTransactionLogHandlerConfig logConfig = new ExampleDefaultTransactionLogHandlerConfig();
//Instantiate client instance from DNSAPIClientFactory
final DNSAPIClientFactory dnsapiClientFactory = new DNSAPIClientFactory();
DNSAPIClient client = null;
try {
client = dnsapiClientFactory.createInstanceFromDefaultProviders(config, sslConfig, logConfig);
} catch (final Exception e) {
e.printStackTrace();
System.exit(1);
}
//Create command
final ZoneCreateCommand command =
new ZoneCreateCommand.Builder()
.withName("myzone.com")
.withDnssecSigned(Boolean.FALSE)
.withBrandedNameServers(Boolean.TRUE)
.withGroup("mygroup")
.withNameServerSetId("<my-nss-id>")
.withPlanId("<my-plan-id>")
.build();
//Send command to server and receive response
try {
Response<ZoneCreateResponse> response = client.process(command);
System.out.println("== Successful response ==");
System.out.println("== Server transaction id: " + response.getServerTransactionId());
System.out.println("== Client transaction id: " + response.getClientTransactionId());
System.out.println("== Processing time: " + response.getTransactionProcessingTime() + "ms");