array domain_web_redir_list(string session, string domain)
Retrieve the web redirections of a domain.
The XML-RPC response will contain an array of web redirections (struct) or a fault describing the problem.
The returned value is a list of struct containing the following keys:
Possible faults are described in section Error Codes Format.
import pprint try: domain = "example.net" redir_array = proxy.domain_web_redir_list(session, domain) print "web redirections for '%s':" % domain pprint.pprint(redir_array) except xmlrpclib.Fault, e: print "could not get the list of web redirections of domain '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $msg = new xmlrpcmsg("domain_web_redir_list", array($session, new xmlrpcval($domain))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not get the list of web redirections of domain '%s' because: %s\n", $domain, $reply->faultString()); } else { printf("web redirections for '%s':\n", $domain); $val = php_xmlrpc_decode($reply->value()); print_r($val); }
my $domain = "example.net"; my $reply = $proxy->call("domain_web_redir_list", $session, $domain); my $redir_array = $reply->result(); unless (defined $redir_array) { printf "could not get the list of web redirections of domain '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "web redirections for '%s':\n", $domain; print Dumper($redir_array); }
int domain_web_redir_add(string session, string fqdn, string destination_url, string type)
Add a web redirection to a domain. All HTTP requests to http://fqdn/ will be redirected to 'destination_url' with a HTTP redirection 'type'
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.
fqdn = "example.net" url = "http://www.example.org/~johndoe/" try: opid = proxy.domain_web_redir_add(session, fqdn, url, "http302") print "adding the web redirection 'http://%s/' -> '%s' (http302) is Gandi operation #%d" % (fqdn, url, opid) except xmlrpclib.Fault, e: print "could not add the web redirection 'http://%s' -> '%s' because: %s" % (fqdn, url, e.faultString)
$fqdn = "example.net"; $url = "http://www.example.org/~johndoe/"; $msg = new xmlrpcmsg("domain_web_redir_add", array($session, new xmlrpcval($fqdn), new xmlrpcval($url), new xmlrpcval("http302"))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not add the web redirection 'http://%s' -> '%s' because: %s\n", $fqdn, $url, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("adding the web redirection 'http://%s' -> '%s' is Gandi operation #%d\n", $fqdn, $url, $val); }
my $fqdn = "example.net"; my $url = "http://www.example.org/~johndoe/"; my $reply = $proxy->call("domain_web_redir_add", $session, $fqdn, $url, "http302"); my $opid = $reply->result(); unless (defined $opid) { printf "could not add the web redirection 'http://%s' -> '%s' because: %s\n", $fqdn, $url, $reply->faultstring; } else { printf "adding the web redirection 'http://%s' -> '%s' is Gandi operation #%d\n", $fqdn, $url, $opid; }
int domain_web_redir_del(string session, string fqdn)
Delete the web redirection of the fully qualified domain name fqdn.
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.
fqdn = "example.net" try: opid = proxy.domain_web_redir_del(session, fqdn) print "deleting the web redirection 'http://%s' is Gandi operation #%d" % (fqdn, opid) except xmlrpclib.Fault, e: print "could not delete the web redirection 'http://%s' because: %s" % (fqdn, e.faultString)
$fqdn = "example.net"; $msg = new xmlrpcmsg("domain_web_redir_del", array($session, new xmlrpcval($fqdn))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not delete the web redirection 'http://%s' -> '%s' because: %s\n", $fqdn, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("deleting the web redirection 'http://%s -> $s' is Gandi operation #%d\n", $fqdn, $val); }
my $fqdn = "example.net"; my $reply = $proxy->call("domain_mail_redir_del", $session, $fqdn); my $opid = $reply->result(); unless (defined $opid) { printf "could not delete the web redirection '%s' because: %s\n", $fqdn, $reply->faultstring; } else { printf "deleting the web redirection '%s' is Gandi operation #%d\n", $fqdn, $opid; }
Dernière modification: le 04/12/2008 à 17:10 par Pierrick P. (Gandi)