Important:
¡Ayúdanos con el español!
Esta página todavía no ha sido traducida (o sólo parcialmente) en español. Si hablas francés o inglés, puedes ayudarnos.
Aquí encontrarás la versión FR de esta página, que podrás editar sólo con identificarte (con tu usuario Gandi).
Si prefieres traducir a partir de la versión EN, sólo tienes que abrir una nueva ventana, copiar-pegar la URL de la página y hacer clic en la bandera (arriba a la derecha) del idioma correspondiente. Si la página existe, aparecerá en el idioma deseado.
Gracias de antemano por ayudarnos con el español :)
string login(string login, string password [, boolean safe])
Log in to the XML-RPC interface and retrieve a session id.
Note:
Sessions ID are sensitive information and therefore must be kept secret. If a session ID was to be disclosed a malicious user would be able to execute commands with your credentials during 12 hours.The XML-RPC response will contain a session id (string) if the login procedure is successful or a fault describing the problem. Possible faults are described in section Error Codes Format.
import sys import xmlrpclib proxy = xmlrpclib.ServerProxy("https://api.gandi.net/xmlrpc/") try: session = proxy.login("AA1234-GANDI", "mypassword", True) except xmlrpclib.Fault, e: print "could not login because: " + e.faultString sys.exit(67)
<?php require_once("xmlrpc.inc"); $proxy = new xmlrpc_client("https://api.gandi.net/xmlrpc/"); $msg = new xmlrpcmsg( "login", array(new xmlrpcval("AA1234-GANDI"), new xmlrpcval("mypassword"), new xmlrpcval(True, "boolean")) ); $reply = $proxy->send($msg); if ($reply->faultCode()) { echo "could not login because: " . $reply->faultString() . "\n"; exit(67); } $session = $reply->value(); ?>
my $safe_mode = XMLRPC::Data->type('boolean')->value(1); my $proxy = XMLRPC::Lite->proxy("https://api.gandi.net/xmlrpc/"); my $reply = $proxy->call("login", "AA1234-GANDI", "mypassword", $safe_mode); my $session = $reply->result(); die "could not login because: " . $reply->faultstring . "\n" unless defined $session;
string su(string session, string handle)
Temporarily limit your rights to the rights of user "handle". cf. safe mode.
Note:
Sessions ID are sensitive information and therefore must be kept secret. If a session ID was to be disclosed a malicious user would be able to execute commands with your credentials during 12 hours.The XML-RPC response will contain a new session id (string) if the "su" is successful or a fault describing the problem. Possible faults are described in section Error Codes Format.
try: session = proxy.su(session, "AA4321-GANDI") except xmlrpclib.Fault, e: print "could not su to user AA4321-GANDI because: " + e.faultString sys.exit(67)
<?php $msg = new xmlrpcmsg( "su", array($session, new xmlrpcval("AA4321-GANDI")) ); $reply = $proxy->send($msg); if ($reply->faultCode()) { echo "could not su to user AA4321-GANDI because: " . $reply->faultString() . "\n"; exit(67); } $session = $reply->value(); ?>
my $reply = $proxy->call("su", $session, "AA4321-GANDI"); my $session = $reply->result(); die "could not su to user AA4321-GANDI because: " . $reply->faultstring . "\n" unless defined $session;
boolean password(string session, string password)
Change the XML-RPC API password of the account used during the login procedure.
The XML-RPC response will return True if the password method is successful or a fault describing the problem. Possible faults are described in section Error Codes Format
try: proxy.password(session, "mynewpassword") except xmlrpclib.Fault, e: print "could not change the password because: " + e.faultString sys.exit(67)
<?php $msg = new xmlrpcmsg( "password", array($session, new xmlrpcval("mynewpassword")) ); $reply = $proxy->send($msg); if ($reply->faultCode()) { echo "could not change the password because: " . $reply->faultString() . "\n"; exit(67); } ?>
my $reply = $proxy->call("password", $session, "mynewpassword"); my $result = $reply->result(); die "could not change the password because: " . $reply->faultstring . "\n" unless defined $result;
No question on this page and its children.
RSS feed for questions matching this filter (Help)Última modificación: Europe/BerlinTuesday 27/04/2010 a Tuesdaypm06 12:16 (editor externo)