By using the Aruba WsDNS method
SetDnsRecords user can set Dns records of type (SOA, A, AAA, NS, TEXT, CNAME, ) in a specified input Dns zone owned by authenticated user.
Parameters
DNSServiceID
Type: int
id of DNS service.
DNSRecords
Type: DNSRecord
Array of DNSRecord object.
/// WsDns.SetDnsRecords and WsDns.SetDisableDNS Method (c# .NET)
public static string SetDnsRecords(WsDNSClient client,
int DNSServiceID, DNSRecord[] DNSRecords)
{
//specify the account login details
client.ClientCredentials.UserName.UserName = "ARU-0000 ";
client.ClientCredentials.UserName.Password = "0123456789";
StringBuilder stringBuilder = new StringBuilder();
try
{
// create the request object
SetDnsRecordsRequest request = new SetDnsRecordsRequest();
request.DNSServiceID = DNSServiceID;
request.DNSRecords = DNSRecords;
// call method SetDnsRecords
// obtaining a WsResult item
WsResultOfSetDnsRecordsResponse result =
client.SetDnsRecords(request);
//if the call is Success print history values
if (result.Success)
{
// get Value returned from server
stringBuilder.Append("Operation ends successfully\n");
stringBuilder.Append("\nJobID: ");
stringBuilder.Append(result.Value.JobID);
stringBuilder.Append("\nStatus : ");
stringBuilder.Append(result.Value.Status);
}
else
{
throw new ApplicationException(result.ResultMessage);
}
}
catch (Exception ex)
{
// re-run the error
throw new ApplicationException(ex.Message);
}
return stringBuilder.ToString();
}
/// WsDns.SetDnsRecords and WsDns.SetDisableDNS Method (JAVA)
public static String SetDnsRecords(IWsDNS client,
int DNSServiceID, ArrayOfDNSRecord DNSRecords)
{
//specify the account login details
((BindingProvider) client).getRequestContext()
.put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
((BindingProvider) client).getRequestContext()
.put(BindingProvider.PASSWORD_PROPERTY, "0123456789");
StringBuilder stringBuilder = new StringBuilder();
try {
// create the request object
SetDnsRecordsRequest request = new SetDnsRecordsRequest();
request.setDNSServiceID(DNSServiceID);
request.setDNSRecords(DNSRecords);
// call method SetDnsRecords
// obtaining a WsResult item
WsResultOfSetDnsRecordsResponse result = client.setDnsRecords(request);
//if the call is Success print history values
if (result.isSuccess()) {
// get Value returned from server
stringBuilder.append("Operation ends successfully\n");
stringBuilder.append("\nJobID: ");
stringBuilder.append(result.getValue().getJobID());
stringBuilder.append("\nStatus : ");
stringBuilder.append(result.getValue().getStatus());
} else {
throw new Exception(result.getResultMessage());
}
} catch (Exception ex) {
//show error
System.out.println(ex);
}
return stringBuilder.toString();
}
Versione
API: v2.8 URL:https://api.services.cloud.it/wsDns/v2.8/WsDns.svc?wsdl