array domain_list(string session)
Returns an array of domains for which the logged user is the reseller or a contact (owner, administrative, billing or technical).
The XML-RPC response will contain an array of domains (string) or a fault describing the problem. Possible faults are described in section Error Codes Format.
import pprint try: domains = proxy.domain_list(session) print "domains:" pprint.pprint(domains) except xmlrpclib.Fault, e: print "could not retrieve the list of domains because: %s" % e.faultString
$msg = new xmlrpcmsg("domain_list", array($session)); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not retrieve the list of domains because: %s\n", $reply->faultString()); } else { $val = php_xmlrpc_decode($reply->value()); print_r($val); }
my $reply = $proxy->call("domain_list", $session); my $domains = $reply->result(); unless (defined $domains) { print "could not retrieve the list of domains because: " . $reply->faultstring . "\n"; } else { print Dumper($domains); }
struct domain_available(string session, array domains)
Check a domain availability.
The XML-RPC response will contain the availability (struct) of the domains or a fault describing the problem. Possible faults are described in section Error Codes Format.
import pprint domains = ["example.net", "example.org", "example.com"] try: availability = proxy.domain_available(session, domains) print "available domains:" pprint.pprint(availability) except xmlrpclib.Fault, e: print "could not check for availability because: %s" % e.faultString
$domains = array( new xmlrpcval("example.net"), new xmlrpcval("example.org"), new xmlrpcval("example.com") ); $msg = new xmlrpcmsg("domain_available", array($session, new xmlrpcval($domains, "array"))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not check for availability because: %s\n", $reply->faultString()); } else { $val = $reply->value(); $val->structreset(); print "available domains:\n"; while (list($key, $value) = $val->structeach()) { printf("%s : %s\n", $key, $value->scalarval() ? "True" : "False"); } }
my $domains = ["example.net", "example.org", "example.com"]; my $reply = $proxy->call("domain_available", $session, $domains); my $availability = $reply->result(); unless (defined $availability) { print "could not check for availability because: " . $reply->faultstring . "\n"; } else { while (($domain, $available) = each (%$availability)) { print $domain . " : " . ($available ? "True" : "False") . "\n"; } }
int domain_lock(string session, string domain)
Add a lock status (cf. domain_info) to avoid any fraudulent transfer.
Any domains except those ending with .FR, .EU or .BE.
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" try: opid = proxy.domain_lock(session, domain) print "locking of domain '%s' is Gandi operation #%d" % (domain, opid) except xmlrpclib.Fault, e: print "could not lock domain '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $msg = new xmlrpcmsg("domain_lock", array($session, new xmlrpcval($domain))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not lock domain '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("locking of domain '%s' is Gandi operation #%d\n", $domain, $val); }
my $domain = "example.net"; my $reply = $proxy->call("domain_lock", $session, $domain); my $opid = $reply->result(); unless (defined $opid) { printf "could not lock domain '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "locking of domain '%s' is Gandi operation #%d\n", $domain, $opid; }
int domain_unlock(string session, string domain)
Remove a lock status (cf. domain_info) to transfer the domain to another registrar.
Any domains except those ending with .FR, .EU or .BE.
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" try: opid = proxy.domain_unlock(session, domain) print "unlocking of domain '%s' is Gandi operation #%d" % (domain, opid) except xmlrpclib.Fault, e: print "could not unlock domain '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $msg = new xmlrpcmsg("domain_unlock", array($session, new xmlrpcval($domain))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not unlock domain '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("unlocking of domain '%s' is Gandi operation #%d\n", $domain, $val); }
my $domain = "example.net"; my $reply = $proxy->call("domain_unlock", $session, $domain); my $opid = $reply->result(); unless (defined $opid) { printf "could not unlock domain '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "unlocking of domain '%s' is Gandi operation #%d\n", $domain, $opid; }
struct domain_info(string session, string domain)
Retrieve the informations linked to this domain (contacts, nameservers, redirections, weblogs…). This method only works on domains handled by Gandi.
The XML-RPC response will contain the informations (struct) associated with the specified domain or a fault describing the problem.
The returned struct contains the following keys:
Possible faults are described in section Error Codes Format.
import pprint domain = "example.net" try: info = proxy.domain_info(session, domain) pprint.pprint(info) except xmlrpclib.Fault, e: print "could not get information for domain '%s': %s" % (domain, e.faultString)
$domain = "example.net"; $msg = new xmlrpcmsg("domain_info", array($session, new xmlrpcval($domain))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not get information for domain '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = php_xmlrpc_decode($reply->value()); print_r($val); }
my $domain = "example.net"; my $reply = $proxy->call("domain_info", $session, $domain); my $info = $reply->result(); unless (defined $opid) { printf "could not get information for domain '%s' because: %s\n", $domain, $reply->faultstring; } else { print Dumper($info); }
int domain_renew(string session, string domain, int period)
Renew a domain for a number of years.
The total number of years cannot exceed 10.
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" try: opid = proxy.domain_renew(session, domain, 4) print "renewal of '%s' is Gandi operation #%d" % (domain, opid) except xmlrpclib.Fault, e: print "could not renew domain '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $msg = new xmlrpcmsg("domain_renew", array($session, new xmlrpcval($domain), new xmlrpcval(4, "int"))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not renew domain '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("renewal of '%s' is Gandi operation #%d\n", $domain, $val); }
my $domain = "example.net"; my $reply = $proxy->call("domain_renew", $session, $domain, 4); my $opid = $reply->result(); unless (defined $opid) { printf "could not renew domain '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "renewal of domain '%s' is Gandi operation #%d\n", $domain, $opid; }
int domain_create(string session, string domain, int period, string owner_handle, string admin_handle, string tech_handle, string billing_handle, array nameservers [, string lang])
Register a domain with Gandi and associate it to a list of contacts.
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.org" period = 1 owner_handle = "AA1234-GANDI" admin_handle = "BB2345-GANDI" tech_handle = "CC3456-GANDI" billing_handle = "DD4567-GANDI" ns_list = ["ns1.example.net", "ns2.example.net", "ns1.example.com"] try: opid = proxy.domain_create(session, domain, period, owner_handle, admin_handle, tech_handle, billing_handle, ns_list) print "creation of domain '%s' is Gandi operation #%d" % (domain, opid) except xmlrpclib.Fault, e: print "could not create domain '%s' because: %s" % (domain, e.faultString)
$domain = "example.org"; $period = new xmlrpcval(1, "int"); $owner_handle = new xmlrpcval("AA1234-GANDI"); $admin_handle = new xmlrpcval("AA1234-GANDI"); $tech_handle = new xmlrpcval("CC3456-GANDI"); $billing_handle = new xmlrpcval("DD4567-GANDI"); $nameservers = php_xmlrpc_encode(array("ns1.example.net", "ns2.example.net", "ns1.example.com")); $msg = new xmlrpcmsg("domain_create", array($session, new xmlrpcval($domain), $period, $owner_handle, $admin_handle, $tech_handle, $billing_handle, $nameservers ) ); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not create domain '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("creation of domain '%s' is Gandi operation #%d\n", $domain, $val); }
my $domain = "example.org"; my $period = 1; my $owner_handle = "AA1234-GANDI"; my $admin_handle = "AA1234-GANDI"; my $tech_handle = "CC3456-GANDI"; my $billing_handle = "DD4567-GANDI"; my $nameservers = ["ns1.example.net", "ns2.example.net", "ns1.example.com"] my $reply = $proxy->call("domain_create", $session, $domain, $period, $owner_handle, $admin_handle, $tech_handle, $billing_handle, $nameservers); my $opid = $reply->result(); unless (defined $opid) { printf "could not create domain '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "creation of domain '%s' is Gandi operation #%d\n", $domain, $opid; }
int domain_restore(string session, string domain)
Get a domain out of its redemption period. See glossary, Restore.
This function is available for domains in .COM, .NET, .BE or .EU.
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" try: opid = proxy.domain_restore(session, domain) print "restoration domain '%s' is Gandi operation #%d" % (domain, opid) except xmlrpclib.Fault, e: print "could not restore domain '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $msg = new xmlrpcmsg("domain_restore", array($session, new xmlrpcval($domain))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not restore domain '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("restoration of '%s' is Gandi operation #%d\n", $domain, $val); }
my $domain = "example.net"; my $reply = $proxy->call("domain_restore", $session, $domain); my $opid = $reply->result(); unless (defined $opid) { printf "could not restore domain '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "restoration of domain '%s' is Gandi operation #%d\n", $domain, $opid; }
int domain_del(string session, string domain)
Delete a domain.
Note :
This function will be available in v1.10The 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.com" try: opid = proxy.domain_del(session, domain) print "deletion of '%s' is Gandi operation #%d" % (domain, opid) except xmlrpclib.Fault, e: print "could not delete domain '%s' because: %s" % (domain, e.faultString)
$domain = "example.com"; $msg = new xmlrpcmsg("domain_del", array($session, new xmlrpcval($domain))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not delete domain '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("deletion of '%s' is Gandi operation #%d\n", $domain, $val); }
my $domain = "example.com"; my $reply = $proxy->call("domain_delete", $session, $domain); my $opid = $reply->result(); unless (defined $opid) { printf "could not delete domain '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "deletion of domain '%s' is Gandi operation #%d\n", $domain, $opid; }
boolean domain_transfer_in_available(string session, string domain)
Check if a domain can be transfered from another registrar. See glossary, Transfer.
The XML-RPC response will contain this operation feasibility (boolean) or a fault describing the problem. Possible faults are described in section Error Codes Format.
domain = "example.net" try: result = proxy.domain_transfer_in_available(session, domain) print "could the domain '%s' be transfered to Gandi: %s" % (domain, result) except xmlrpclib.Fault, e: print "could not check for the transfer feasibility of the domain '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $msg = new xmlrpcmsg("domain_transfer_in_available", array($session, new xmlrpcval($domain))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not check for the transfer feasibility of the domain '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("could the domain '%s' be transfered to Gandi: %s\n", $domain, $val ? "True" : "False"); }
my $domain = "example.net"; my $reply = $proxy->call("domain_transfer_in_available", $session, $domain); my $val = $reply->result(); unless (defined $opid) { printf "could not check for the transfer feasibility of the domain '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "could the domain '%s' be transfered to Gandi: %s\n", $domain, $val ? "True" : "False"; }
int domain_transfer_in(string session, string domain, string owner_handle, string admin_handle, string tech_handle, string billing_handle, array nameservers [, string auth_code])
Transfer (see glossary, Transfer) a domain from another registrar to Gandi, or from a Gandi account to a Gandi reseller. If the domain is already at Gandi (internal transfer), owner_handle, admin_handle, tech_handle and billing_handle are maintained.
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.
ns_list = ["ns1.example.net", "ns2.example.net", "ns1.example.com"] try: opid = proxy.domain_transfer_in(session, "example.net", "AA1234-GANDI", "BB2345-GANDI", "BB2345-GANDI", "BB2345-GANDI", ns_list, "G0R7Y568B740DK27") print "transfer of '%s' to Gandi is Gandi operation #%d" % (domain, opid) except xmlrpclib.Fault, e: print "could not transfer domain '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $auth_code = new xmlrpcval("G0R7Y568B740DK27"); $owner_handle = new xmlrpcval("AA1234-GANDI"); $admin_handle = new xmlrpcval("BB2345-GANDI"); $tech_handle = new xmlrpcval("BB2345-GANDI"); $billing_handle = new xmlrpcval("BB2345-GANDI"); $nameservers = php_xmlrpc_encode(array("ns1.example.net", "ns2.example.net", "ns1.example.com")); $msg = new xmlrpcmsg("domain_transfer_in", array($session, new xmlrpcval($domain), $owner_handle, $admin_handle, $tech_handle, $billing_handle, $nameserver, $auth_code)); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not transfer the domain '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("transfer of '%s' to Gandi is Gandi operation #%d\n", $domain, $val); }
my $domain = "example.net"; my $auth_code = "G0R7Y568B740DK27"; my $owner_handle = "AA1234-GANDI"; my $admin_handle = "BB2345-GANDI"; my $tech_handle = "BB2345-GANDI"; my $billing_handle = "BB2345-GANDI"; my $nameservers = ["ns1.example.net", "ns2.example.net", "ns1.example.com"] my $reply = $proxy->call("domain_transfer_in", $session, $domain, $owner_handle, $admin_handle, $tech_handle, $billing_handle, $nameservers, $auth_code); my $opid = $reply->result(); unless (defined $opid) { printf "could not transfer the domain '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "transfer of domain '%s' to Gandi is Gandi operation #%d\n", $domain, $opid; }
boolean domain_transfer_out(string session, int opid, boolean allow)
Accept or deny a transfer of a domain from Gandi to another registrar. See glossary, Transfer.
Note :
This function will be available in v1.10The XML-RPC response will contain True (boolean) or a fault describing the problem. Possible faults are described in section Error Codes Format.
# opid = 1234, retrieved via operation_list try: proxy.domain_transfer_out(session, opid, True) except xmlrpclib.Fault, e: print "Invalid operation ID: #%d" % opid
# $opid = new xmlrpcval(1234); $ack = new xmlrpcval(True, "boolean"); $msg = new xmlrpcmsg("domain_transfer_out", array($session, $opid, $ack)); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("Invalid operation ID: #%d\n", $opid->scalarval()); }
# my $opid = 1234; my $reply = $proxy->call("domain_transfer_out", $session, $opid, XMLRPC::Data->type('boolean')->value(1)); my $opid = $reply->result(); unless (defined $opid) { printf "Invalid operation ID #%d\n", $opid; }
int domain_trade(string session, string domain, string owner_handle, string admin_handle, string tech_handle, string billing_handle [, string afnic_titularkey])
Start the trade of a domain from another registrar to Gandi.
Note :
This function will be available in v1.10The 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.
try: opid = proxy.trade(session, "example.net", "AA1234-GANDI", "BB2345-GANDI", "BB2345-GANDI", "BB2345-GANDI") print "trade of '%s' to Gandi is Gandi operation #%d" % (domain, opid) except xmlrpclib.Fault, e: print "could not trade domain '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $owner_handle = new xmlrpcval("AA1234-GANDI"); $admin_handle = new xmlrpcval("BB2345-GANDI"); $tech_handle = new xmlrpcval("BB2345-GANDI"); $billing_handle = new xmlrpcval("BB2345-GANDI"); $msg = new xmlrpcmsg("domain_trade", array($session, new xmlrpcval($domain), $owner_handle, $admin_handle, $tech_handle, $billing_handle)); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not trade the domain '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("trade of '%s' to Gandi is Gandi operation #%d\n", $domain, $val); }
my $domain = "example.net"; my $owner_handle = "AA1234-GANDI"; my $admin_handle = "BB2345-GANDI"; my $tech_handle = "BB2345-GANDI"; my $billing_handle = "BB2345-GANDI"; my $reply = $proxy->call("domain_trade", $session, $domain, $owner_handle, $admin_handle, $tech_handle, $billing_handle); my $opid = $reply->result(); unless (defined $opid) { printf "could not trade domain '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "trade of '%s' to Gandi is Gandi operation #%d\n", $domain, $opid; }
int domain_change_owner(string session, string domain, string new_owner [, string new_admin, string new_tech, string new_billing])
Change the owner of a domain registered with Gandi and, optionally, the admin, tech and billing contacts. See glossary, Change of Ownership.
Note :
This function will be available in v1.10The 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.
try: opid = proxy.domain_change_owner(session, "example.net", "AA9876-GANDI") print "changing owner of domain '%s' is Gandi operation #%d" % (domain, opid) except xmlrpclib.Fault, e: print "could not change the owner of domain '%s' because: %s" % (domain, e.faultString)
$domain = "example.net"; $owner = new xmlrpcval("AA9876-GANDI"); $msg = new xmlrpcmsg("domain_change_owner", array($session, new xmlrpcval($domain), $owner)); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not change the owner of domain '%s' because: %s\n", $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("changing owner of domain '%s' is Gandi operation #%d\n", $domain, $val) }
my $domain = "example.net"; my $owner = "AA9876-GANDI"; my $reply = $proxy->call("domain_change_owner", $session, $domain, $owner); my $opid = $reply->result(); unless (defined $opid) { printf "could not change the owner of domain '%s' because: %s\n", $domain, $reply->faultstring; } else { printf "changing owner of domain '%s' is Gandi operation #%d\n", $domain, $opid; }
int domain_change_contact(string session, string domain, string type, string new_contact)
Change a given contact of a domain registered with Gandi.
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" type = "billing" handle = "BL4444-GANDI" try: opid = proxy.domain_change_contact(session, domain, type, handle) print "changing %s contact of domain '%s' to '%s' is Gandi operation #%d" % (type, domain, handle, opid) except xmlrpclib.Fault, e: print "could not change the %s contact of domain '%s' because: %s" % (type, domain, e.faultString)
$domain = "example.net"; $type = "billing"; $handle = "BL4444-GANDI"; $msg = new xmlrpcmsg("domain_change_contact", array($session, new xmlrpcval($domain), new xmlrpcval($type), new xmlrpcval($handle))); $reply = $proxy->send($msg); if ($reply->faultCode()) { printf("could not change the %s contact of domain '%s' because: %s\n", $type, $domain, $reply->faultString()); } else { $val = $reply->value(); $val = $val->scalarval(); printf("changing %s contact of domain '%s' to '%s' is Gandi operation #%d\n", $type, $domain, $handle, $val); }
my $domain = "example.net"; my $handle = "BL4444-GANDI"; my $type = "billing" my $reply = $proxy->call("domain_change_contact", $session, $domain, $type, $handle); my $opid = $reply->result(); unless (defined $opid) { printf "could not change the %s contact of domain '%s' because: %s\n", $type, $domain, $reply->faultstring; } else { printf "changing %s contact of domain '%s' to '%s' is Gandi operation #%d\n", $type, $domain, $handle, $opid; }
Aucune question sur cette page et ses sous-pages.
Flux RSS des questions correspondant à ce filtre (Aide)Dernière modification: le 04/12/2008 à 16:42 par Nicolas L. (Gandi)