Smart Control
delete(optional Boolean forceFlag)
Description:
Delete this server. Can only be used on a server instance object which has been retrieved using
si::getByName()
,and it must not have been modified since the last time that it was retrieved. If the server
instance is in use by another object in the system, the flag
forceFlag
must be set to ‘
TRUE
’ in order for it to
be deleted.
Returns:
Map containing message string with a status code. Status code will be 0 if the deletion was successful and non-
zero otherwise.
Example:
$sp = srvpool::getByName(“sp00”);
$si = si::getByName($sp, "sv00");
// Try to delete it, if it fails, force the deletion.
$value = $si->delete();
if ($value[“status”] != 0) {
// Print out the reason for the failure, accessible using ‘lastrun’ command
echo “Failed to delete because: “, $value[“message”];
$value = $si->delete(TRUE);
}
commit()
Description:
Push the changes to this server instance into the permanent configuration. If this server object was created
using
getByName()
, this operation is treated as a modify. If it was created using the new keyword, it is
treated as an addition.
Returns:
Map containing message string with a
status
code. Status code will be 0 if the commit was successful and
non-zero otherwise.
Example:
// Create a new server, then modify it
$sp = srvpool::getByName(“sp00”);
$si = new si;
$si->sp = $sp;
$si->name = “sv00”;
$si->weight = 10;
$si->commit();
// If we don’t do getByName(), the commit() below would fail with ‘object already
exists’ error because the system will try to add this object instead of modify it.
// The server pool must be re-fetched also since it was modified when we added a
server instance.
$sp = srvpool::getByName(“sp00”);
$si = $si = si::getByName($sp, "sv00");
$si->weight = 100;
$si->commit();
694
Copyright © 2014 Coyote Point Systems, A Subsidiary of Fortinet, Inc.
Summary of Contents for Equalizer GX Series
Page 18: ......
Page 32: ...Overview 32 Copyright 2014 Coyote Point Systems A Subsidiary of Fortinet Inc ...
Page 42: ......
Page 52: ......
Page 64: ......
Page 72: ......
Page 76: ......
Page 228: ......
Page 238: ......
Page 476: ......
Page 492: ......
Page 530: ......
Page 614: ......
Page 626: ......
Page 638: ......
Page 678: ......
Page 732: ...Using SNMP Traps 732 Copyright 2014 Coyote Point Systems A Subsidiary of Fortinet Inc ...
Page 754: ......
Page 790: ......
Page 804: ......
Page 842: ......
Page 866: ......