array domain_ns_list(string session, string domain)
Retrieve the name servers list of a domain.
The XML-RPC response will contain an array of name servers (string) or a fault describing the problem. Possible faults are described in section Error Codes Format.
import pprint domain = "example.net" print "%s:" % domain try: ns_list = proxy.domain_ns_list(session, domain) pprint.pprint(ns_list) except xmlrpclib.Fault, e: print "could not retrieve domain '%s' name servers list because: %s" % (domain, e.faultString)
$domain = "example.net"; $msg = new xmlrpcmsg("domain_ns_list", array($session, new xmlrpcval($domain))); $reply = $proxy->send($msg); printf("%s:\n", domain); if ($reply->faultCode()) { printf("could not retrieve domain '%s' name servers list because: %s\n", $domain, $reply->faultString()); } else { $val = php_xmlrpc_decode($reply->value()); print_r($val); }
* Sample code (perl)
my $domain = "example.net"; my $reply = $proxy->call("domain_ns_list", $session, $domain); printf "%s:\n", $domain; my $ns_list = $reply->result(); unless (defined $ns_list) { printf "could not retrieve domain '%s' name servers list because: %s\n", $domain, $reply->faultstring; } else { print Dumper($ns_list); }
int domain_ns_add(string session, string domain, array ns_list)
Add the specified name servers to the name servers list of a domain.
The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.
domain = "example.net" ns_list = ["ns1.example.org", "ns2.example.org"] try: opid = proxy.domain_ns_add(session, domain, ns_list) print "adding the name servers is Gandi operation #%d" % opid except xmlrpclib.Fault, e: print "could not add name servers to '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $ns_list = php_xmlrpc_encode(array("ns1.example.org", "ns2.example.org")); $msg = new xmlrpcmsg("domain_ns_add", array($session, new xmlrpcval($domain), $ns_list)); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not add name servers to '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("adding the name servers is Gandi operation #%d\n", $val); }
my $domain = "example.net"; my $ns_list = ["ns1.example.org", "ns2.example.org"] my $reply = $proxy->call("domain_ns_add", $session, $domain, $ns_list); my $opid = $reply->result(); unless (defined $opid) { printf "could not add name servers to '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "adding the name servers is Gandi operation #%d\n", $opid; }
int domain_ns_del(string session, string domain, array ns_list)
Remove the specified name servers from the name servers list of a domain.
The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.
domain = "example.net" ns_list = ["ns1.example.org", "ns2.example.org"] try: opid = proxy.domain_ns_del(session, domain, ns_list) print "removing the name servers from '%s' is Gandi operation #%d" % (domain, opid) except xmlrpclib.Fault, e: print "could not remove name servers from '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $ns_list = php_xmlrpc_encode(array("ns1.example.org", "ns2.example.org")); $msg = new xmlrpcmsg("domain_ns_del", array($session, new xmlrpcval($domain), $ns_list)); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not remove name servers from '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("removing the name servers from '%s' is Gandi operation #%d\n", $domain, $val); }
my $domain = "example.net"; my $ns_list = ["ns1.example.org", "ns2.example.org"] my $reply = $proxy->call("domain_ns_del", $session, $domain, $ns_list); my $opid = $reply->result(); unless (defined $opid) { printf "could not remove name servers from '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "removing the name servers from '%s' is Gandi operation #%d\n", $domain, $opid; }
int domain_ns_set(string session, string domain, array ns_list)
Set a domain name servers list.
The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.
domain = "example.net" ns_list = ["ns1.example.org", "ns2.example.org"] try: opid = proxy.domain_ns_set(session, domain, ns_list) print "setting the nameservers of '%s' is Gandi operation #%d" % (domain, opid) except xmlrpclib.Fault, e: print "could not set the name servers list of '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $ns_list = php_xmlrpc_encode(array("ns1.example.org", "ns2.example.org")); $msg = new xmlrpcmsg("domain_ns_set", array($session, new xmlrpcval($domain), $ns_list)); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not set the name servers of '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("setting the nameservers is Gandi operation #%d\n", $val); }
my $domain = "example.net"; my $ns_list = ["ns1.example.org", "ns2.example.org"] my $reply = $proxy->call("domain_ns_set", $session, $domain, $ns_list); my $opid = $reply->result(); unless (defined $opid) { printf "could not set the name servers of '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "setting the nameservers of '%s' is Gandi operation #%d\n", $domain, $opid; }
Aucune question sur cette page et ses sous-pages.
Flux RSS des questions correspondant à ce filtre (Aide)Dernière modification: le 03/03/2008 à 15:36 par Nicolas L. (Gandi)