lock()
unlock()
purge()
cancel()
getBuildId()
getBuildClass()
getCancellation()
getDuration()
getEngineId()
getEnvText()
getFired()
getGeoId()
getPassChainId()
getFailChainId()
getChainedBuildId()
getLevel()
getProcess()
getResult()
getSelectorId()
getStage()
getStartTime()
getState()
getTag()
getTargetId()
getUserId()
getResults()
BuildForge::Services::DBO::Build
use BuildForge::Services;
$conn = new BuildForge::Services::Connection($hostname); $token = $conn->authUser($user, $pass); # Getting existing adaptor links $project = new BuildForge::Services::DBO::Project($conn); $project->setName('Test Project'); $project->create(); $allBuilds = BuildForge::Services::DBO::Build->findAll($conn); $projectBuilds = BuildForge::Services::DBO::Build->findByProjectId($conn, $project->getProjectId()); $waitingBuilds = BuildForge::Services::DBO::Build->findByState($conn, 'WAITING'); $waitingBuilds2 = BuildForge::Services::DBO::Build->findWaiting($conn); $runningBuilds = BuildForge::Services::DBO::Build->findRunning($conn); $completedBuilds = BuildForge::Services::DBO::Build->findCompleted($conn); $lockedBuilds = BuildForge::Services::DBO::Build->findLocked($conn); $archivedBuilds = BuildForge::Services::DBO::Build->findArchived($conn); $build = BuildForge::Services::DBO::Build->findById($conn, $buildid);
# Getter functions $id = $build->getBuildId(); $class = $build->getBuildClass(); $wasCancelled = $build->getCancellation(); $durationInSecs = $build->getDuration(); $engineId = $build->getEngineId(); $environmentBlock = $build->getEnvText(); $firedTimestamp = $build->getFired(); $accessGroupId = $build->getLevel(); $typeOfBuild = $build->getProcess(); $result = $build->getResult(); $selectorId = $build->getSelectorId(); $currentStage = $build->getStage(); $startedTimestamp = $build->getStartTime(); $currentState = $build->getState(); $tag = $build->getTag(); $projectOrBuildId = $build->getTargetId(); $owningUserId = $build->getUserId(); $geoId = $build->getGeoId(); $passChainId = $build->getPassChainId(); $failChainId = $build->getFailChainId(); $chainedBuildId = $build->getChainedBuildId(); $geoId = $build->getGeoId(); $buildResults = $build->getResults(); # Kicking off, modifying, and purging a build $newBuild = BuildForge::Services::DBO::Build->fire($conn, $project->getProjectId()); $newBuild2 = BuildForge::Services::DBO::Build->fire($conn, $project->getProjectId(), $selectorId, $class, 1); $newBuild->lock(); $newBuild->unlock(); $newBuild->cancel(); $newBuild->purge(); $conn->logout; $conn->close;
A Build object can be used to access the various build queues, to kick off new builds, and to perform actions on running and historic builds.
Returns a reference to an array of all builds in the database that the logged in user has access to.
A connected BuildForge::Services::Connection object.
If this evaluates to true, the returned builds have the environments they were created with included. Otherwise, the environments are not included.
Returns a reference to an array of all builds of the specified project in the database that the logged in user has access to.
A connected BuildForge::Services::Connection object.
The ID of the project, from $project->getProjectId().
If this evaluates to true, the returned builds have the environments they were created with included. Otherwise, the environments are not included.
Returns a reference to an array of all builds in the database that the logged in user has access to that are of the specified state.
A connected BuildForge::Services::Connection object.
Which builds to return. This may be one of 'WAITING', 'PENDING', 'RUNNING', 'COMPLETED', 'LOCKED', or 'ARCHIVED'.
If this evaluates to true, the returned builds have the environments they were created with included. Otherwise, the environments are not included.
Returns a reference to an array of all builds in the database that the logged in user has access to that have not yet started executing. It's a wrapper for BuildForge::Services::DBO::Build->findByState(connection, 'WAITING', withEnvironment).
A connected BuildForge::Services::Connection object.
If this evaluates to true, the returned builds have the environments they were created with included. Otherwise, the environments are not included.
Returns a reference to an array of all builds in the database that the logged in user has access to that are currently running. It's a wrapper for BuildForge::Services::DBO::Build->findByState(connection, 'RUNNING', withEnvironment).
A connected BuildForge::Services::Connection object.
If this evaluates to true, the returned builds have the environments they were created with included. Otherwise, the environments are not included.
Returns a reference to an array of all builds in the database that the logged in user has access to that have finished running. It's a wrapper for BuildForge::Services::DBO::Build->findByState(connection, 'COMPLETED', withEnvironment).
A connected BuildForge::Services::Connection object.
If this evaluates to true, the returned builds have the environments they were created with included. Otherwise, the environments are not included.
Returns a reference to an array of all builds in the database that the logged in user has access to that have been completed and locked. It's a wrapper for BuildForge::Services::DBO::Build->findByState(connection, 'LOCKED', withEnvironment).
A connected BuildForge::Services::Connection object.
If this evaluates to true, the returned builds have the environments they were created with included. Otherwise, the environments are not included.
Returns a reference to an array of all builds in the database that the logged in user has access to that have been archived. It's a wrapper for BuildForge::Services::DBO::Build->findByState(connection, 'ARCHIVED', withEnvironment).
A connected BuildForge::Services::Connection object.
If this evaluates to true, the returned builds have the environments they were created with included. Otherwise, the environments are not included.
Returns a reference to an array of all builds in the database that the logged in user has access to.
A connected BuildForge::Services::Connection object.
The ID of the build to get (from $build->getBuildId()).
If this evaluates to true, the returned build has the environment it was created with included. Otherwise, the environment is not included.
lock()
Locks the build. Locked builds can't be deleted until they are unlocked.
unlock()
Unlocks the build.
purge()
Purges the build according to the settings of the build's class.
Starts a build of the specified project.
A connected BuildForge::Services::Connection object.
The ID of the project to start off, from $project->getProjectId().
The ID of the selector to use with the build, from $selector->getSelectorId(). If unset, uses the selector of the specified project.
The ID of the class to use with the build, from $class->getName(). If unset, uses the class of the specified project.
If this evaluates to true, if the project has an adaptor link associated with it, the build will kick off with the appropriate adaptor link. If this evaluates to false or is unset, no such adaptor link will be run.
cancel()
Cancels a currently running build.
getBuildId()
Returns the ID of the build.
getBuildClass()
Returns the ID of the class of the build.
getCancellation()
Returns the cancellation state of the build - 'N' if it isn't being cancelled / hasn't been cancelled or 'Y' if it has been / is being cancelled.
getDuration()
Returns the current duration of the build in seconds.
getEngineId()
Returns the ID of the engine the build ran on.
getEnvText()
Returns the text of the environment the build was started with. Only returns a value if the build was gotten with its environment - for example, if BuildForge::Services::DBO::Build->findById($connection, $buildId, $withEnvironment) was called with $withEnvironment set to 1.
getFired()
Returns the timestamp for when the build was created.
getGeoId()
For GDD-aware consoles, this returns the geo ID for the console on which the build has / will run. For non-GDD-aware consoles, this returns an empty string.
getPassChainId()
Returns the identifier of the Project to be executed in the event this Build succeeds, or 0 for none.
getFailChainId()
Returns the identifier of the Project to be executed in the event this Build fails, or 0 for none.
getChainedBuildId()
Returns the identifier of the Build that was executed by this Build due to pass or fail chaining, or 0 for none.
getLevel()
Returns the access group ID for the build.
getProcess()
Returns the type of build this is. This will be one of:
A normal build.
A build purge.
A project clobber purge.
getResult()
Returns the build success. This will be:
If the build hasn't started running yet.
If the build is currently running.
If the build passed.
If the build finished in Warning state because of a Warning filter match.
If the build finished in Warning state because of a step failing with Continue On Fail set.
If the build failed.
getSelectorId()
Returns the ID of the selector for the build.
getStage()
Returns a description string describing what the build is currently doing.
getStartTime()
Returns a timestamp for the time an engine started executing the build.
getState()
Returns the state of the build. This may be one of 'WAITING', 'PENDING', 'RUNNING', 'COMPLETED', 'LOCKED', or 'ARCHIVED'.
getTag()
Returns the build tag string.
getTargetId()
If this is a normal project build or a project clobber build, this will return the project ID. If this is a build c
getUserId()
Returns the user ID of the user who started this build.
getResults()
Returns a reference to an array of BuildForge::Services::DBO::Result objects containing the individual step results records for this build.
Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.