Gandi Wiki


Questions

host_delete

Signature

int host_delete(string session, string host)

Description

Delete a host.

Parameters

  • string session: the session id (returned by login)
  • string host: the host to delete

Returns

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.

Sample code

  • Sample code (python)
host  = "ns1.example.com"
try:
    opid  = proxy.host_delete(session, host)
    print "deletion of '%s' is Gandi operation #%d" % (host, opid)
except xmlrpclib.Fault, e:
    print "could not delete host '%s' because: %s" % (host, e.faultString)
  • Sample code (php)
$host  = "example.com";
$msg  = new xmlrpcmsg("host_delete", array($session, new xmlrpcval($host)));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not delete host '%s' because: %s\n", $host, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("deletion of host '%s' is Gandi operation #%d\n", $host, $val);
}
  • Sample code (perl)
my $host  = "example.com";
my $reply  = $proxy->call("host_delete", $session, $host);
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not delete host '%s' because: %s\n", $host, $reply->faultstring;
}
else {
    printf "deletion of host '%s' is Gandi operation #%d\n", $host, $opid;
}



Questions

No question on this page and its children.

RSS feed for questions matching this filter (Help)

Last modified: 03 Mar 2009 at 15:16 by Ryan A. (Gandi)