findAll(connection)
create()
update()
delete()
getServerId()
getName()
getHost()
getActive()
getAuthId()
getCollectorId()
getEnvironmentId()
getLevel()
getPath()
getPublish()
getTestText()
getUpstate()
getError()
getManifest()
setName(serverName)
setHost(host)
setActive(isActive)
setAuthId(authId)
setCollectorId(collectorId)
setEnvironmentId(envGroupId)
setLevel(accessGroupId)
setPath(path)
setPublish(publish)
BuildForge::Services::DBO::Server
use BuildForge::Services;
$conn = new BuildForge::Services::Connection($hostname); $token = $conn->authUser($user, $pass); # Getting existing servers $allServers = BuildForge::Services::DBO::Server->findAll($conn); $oldserver1 = BuildForge::Services::DBO::Server->findById($conn, $serverId); $oldserver2 = BuildForge::Services::DBO::Server->findByName($conn, 'ServerName');
# Getter / setter functions $id = $oldserver1->getServerId(); $hostName = $oldserver1->getHost(); $name = $oldserver1->getName(); $isActive = $oldserver1->getActive(); $serverAuthId = $oldserver1->getAuthId(); $collectorId = $oldserver1->getCollectorId(); $environmentId = $oldserver1->getEnvironmentId(); $accessGroupId = $oldserver1->getLevel(); $path = $oldserver1->getPath(); $allowWhatOperations = $oldserver1->getPublish(); $testResults = $oldserver1->getTestText(); $currentState = $oldserver1->getUpstate(); $errorState = $oldserver1->getError(); $manifest = $oldserver1->getManifest();
$oldserver1->setName('New Name'); $oldserver1->setHost('hostname'); $oldserver1->setActive(1); $oldserver1->setAuthId($authId); $oldserver1->setCollectorId($collectorId); $oldserver1->setEnvironmentId($environmentId); $oldserver1->setLevel($accessGroupId); $oldserver1->setPath('/tmp'); $oldserver1->setPublish(ENUM_SERVER_PUBLISH->GET); $oldserver1->update(); # Server creation, updating, deletion $newserver = new BuildForge::Services::DBO::Server($conn); $newserver->setName('New Build Server'); $newserver->setLevel(1); # Guest access $newserver->create();
$newserver->setLevel($accessGroupId); $newserver->update(); $newserver->delete(); $conn->logout; $conn->close;
Server allows you to create, access, and delete BuildForge servers.
Returns a new instance of a Server object.
A connected BuildForge::Services::Connection object.
An optional reference to a hash containing any or all of the following fields.
The name of the server.
The access group ID (from $accessGroup->getLevel())
for the access group that the
server belongs to. Users who do not belong to this access group cannot view, edit,
or use the server.
The hostname of the server (with an optional port number separated by ':').
The path to the server's root directory on the remote server.
Determines which kinds of operations are allowed on the server. May be any of:
Allows neither get nor put operations.
Allows files to be gotten from the server.
Allows files to be loaded onto the server.
Allows both get and put operations.
The environment group ID (from $envGroup->getEnvironmentGroupId())
for the environment
applied to jobs run on the server.
The server authorization ID (from $serverAuth->getAuthId())
for the server authorization
that is used to log in to the server.
If this evaluates to true, the server is enabled. If this evaluates to false, the server is disabled and no jobs will be run on it.
The collector ID (from $collector->getCollectorName())
of the collector that operates
on the selector in order to get manifest properties.
findAll(connection)
Returns a reference to an array of BuildForge::Services::DBO::Server objects corresponding to all servers in the database that the user has access to.
A connected BuildForge::Services::Connection object.
Returns the BuildForge::Services::DBO::Server object corresponding to the given server ID, or undef if no such object exists.
A connected BuildForge::Services::Connection object.
The server ID (from $server->getServerId())
for the server to return.
Returns the BuildForge::Services::DBO::Server object corresponding to the given server name, or undef if no such object exists.
A connected BuildForge::Services::Connection object.
The server name (from $server->getName())
for the server to return.
create()
Creates the server record in the database.
update()
Updates the server record in the database.
delete()
Deletes the server record from the database.
getServerId()
Returns the ID of the server.
getName()
Returns the name of the server.
getHost()
Returns the hostname of the server.
getActive()
Returns 1 if the server is active and jobs can be run on it or 0 otherwise.
getAuthId()
Returns the server auth ID for the server authorization the server uses to authenticate when connecting.
getCollectorId()
Returns the collector ID for the collector that is used to gather manifest data about the server.
getEnvironmentId()
Returns the enviroment group ID for the environment group that is applied to jobs run on this server.
getLevel()
Returns the access group ID for the access group the server belongs to. Users who do not belong to this access group cannot view, edit, or use the server.
getPath()
Returns the path to the server base directory.
getPublish()
Returns which kinds of operations are allowed on the server. May be any of:
Allows neither get nor put operations.
Allows files to be gotten from the server.
Allows files to be loaded onto the server.
Allows both get and put operations.
getTestText()
Returns the output of the last time the server was tested.
getUpstate()
This will return 'UPDATING' if the server is currently being tested or 'READY' otherwise.
getError()
Returns 'TESTING' if the server is currently being tested, 'NO' if there is no error, or 'YES'
if there is an error and the server has been disabled. To find out the actual error, use
$server->getTestText()
for test details.
getManifest()
Returns the BuildForge::Services::DBO::Manifest object that holds the server's current manifest.
setName(serverName)
Sets the name of the server. $server->update()
must be run
before changes are replicated in the database.
The new server name.
setHost(host)
Sets the hostname of the server. $server->update()
must be run
before changes are replicated in the database.
The new server hostname.
setActive(isActive)
Sets whether or not the server is active. Inactive servers will not have jobs run
on them. $server->update()
must be run
before changes are replicated in the database.
If this evaluates to true, the server is activated. If not, the server is deactivated.
setAuthId(authId)
Sets the server auth that the engine uses to authenticate when contacting the
server. $server->update()
must be run
before changes are replicated in the database.
The server auth ID (from $serverAuth->getAuthId()).
setCollectorId(collectorId)
Sets the collector which is used to gather the server manifest. $server->update()
must be run
before changes are replicated in the database.
The collector ID (from $collector->getCollectorId()).
setEnvironmentId(envGroupId)
Sets the environment which is applied to any jobs that run on
this server. $server->update()
must be run
before changes are replicated in the database.
The environment group ID (from $envGroup->getEnvironmentGroupId()).
setLevel(accessGroupId)
Sets the access group which the server belongs to. Users that do not belong
to this access group cannot view, edit, or use the server. $server->update()
must be run
before changes are replicated in the database.
The access group's ID (from $accessGroup->getLevel()).
setPath(path)
Sets the path to the server's base directory. $server->update()
must be run
before changes are replicated in the database.
The new server path.
setPublish(publish)
Sets what operations are allowed on the server. $server->update()
must be run
before changes are replicated in the database.
May be any of:
Allows neither get nor put operations.
Allows files to be gotten from the server.
Allows files to be loaded onto the server.
Allows both get and put operations.
Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.