This section describes build management-related requests.
All database examples provided in this guide are specific to MySQL. If you use a different database, use syntax that is appropriate for your respective database. |
createBuildClass
Creates a build class.
Optional arguments
Field | Description |
---|---|
tagDefinition |
Format string that defines the resultant build name. The default is default_%GC%_%DATE%. This string generally consists of a generic build name appended with build-specific data that you construct from the following variables:
For information about constructing tag definitions, see Using Build Classes. |
annotationLevels |
Comma-separated list of values that indicates which levels of information to include in the annotation file. The possible values are basic, env, history, file, lookup, waiting, or registry (Windows only). An annotation file is not created until you specify at least one annotation level. Basic annotation includes annotation for the JobCache feature. (For more information see Job Caching. |
maxAgents |
Maximum number of agents that can be assigned to this build. The default is 64. |
minAgents |
Minimum number of agents required for this build to run. The default is 2. |
platform |
OS being used or supported. The possible values are Windows or Linux. If an OS is specified for a build class, builds from other operating systems cannot affiliate themselves with this class. The default is that no platforms are specified. |
priority |
Priority for builds in this class. You can use one of three levels of priority: high, normal, and low. The default is 120 (middle of the normal priority range). The priority can be adjusted up or down by 1-10 to “boost” the priority to give certain classes preference over other builds of the same priority level. Higher boost values mean greater preference. The value must be a number in one of the following three ranges:
|
annoUpload |
Specifies whether to upload the annotation file to the Cluster Manager. The possible values are Y, 1, or true (upload) or N, 0, or false (do not upload). The default is N. |
jobcacheAllowed |
Specifies whether the JobCache feature is allowed for this build class. The possible values are Y, 1, or true (allow) or N, 0, or false (do not allow). The default is N, except for the default build class and for build classes that exist when you upgrade to CloudBees Build Acceleration 8.0. For more information about JobCache, see Job Caching. |
resourceRequest |
Name of an existing resource. This requests a particular type of agent from the cloud provider. |
createBuildClassComment
Creates a new build class comment.
Required arguments
Field | Description |
---|---|
buildClassId |
A unique number assigned by the Cluster Manager for each build class. Use getBuildClasses to retrieve a list of build class IDs. |
text |
The comment text. |
createBuildComment
Creates a new build comment.
Required arguments
Field | Description |
---|---|
buildId |
A unique number assigned by the Cluster Manager for each build. Use the getBuilds command to retrieve a list of build IDs. |
text |
The comment text. |
deleteBuild
Deletes a build, including all dependent records.
Required arguments
Field | Description |
---|---|
buildId |
A unique number assigned by the Cluster Manager for each build. Use the getBuilds command to retrieve a list of build IDs. |
deleteBuildClass
Deletes a build class, including all dependent records.
Required arguments
Field | Description |
---|---|
buildClassId |
A unique number assigned by the Cluster Manager for each build class. Use the getBuildClasses command to retrieve a list of build class IDs. |
deleteBuildClasses
Deletes a set of build classes, including all dependent records.
Optional arguments
If no filter is provided, all build classes (except the default) will be deleted. |
Field | Description |
---|---|
filter |
A SQL query used to limit the result set. See the possible values below. For a list of possible SQL values, see the getBuildClasses command. |
deleteBuildClassComment
deleteBuildComment
Deletes a build comment.
Required arguments
Field | Description |
---|---|
buildId |
A unique number assigned by the Cluster Manager for each build. |
commentId |
The unique key that identifies a comment. Use the getBuildComments command to retrieve a list of comment IDs. |
deleteBuilds
Deletes a set of builds, including all dependent records.
It is important to remove build logs periodically so they do not fill up the Cluster Manager’s available disk space. Uploaded annotation is also considered part of build logs, so remember to clean up build logs regularly if annotation is frequently uploaded to the Cluster Manager.
You can also manage build logs using the Cluster Manager web interface. Select the Builds tab, and then create and run a “Builds by Date” filter to display the set of builds that you want to remove. Click Delete Filtered Builds to remove the build logs from disk and from the database.
Optional arguments
Field | Description |
---|---|
filter |
SQL query used to limit the result set. For a list of possible SQL values, see the getBuilds command. |
getBuild
Finds a build with full detail by the build’s ID number.
Required arguments
Field | Description |
---|---|
buildId |
A unique number assigned by the Cluster Manager for each build. Use the getBuilds command to retrieve a list of build IDs. |
Result tags
See the getBuilds command for descriptions.
|
|
getBuilds
Retrieves a list of builds.
Optional arguments
Field | Description | ||
---|---|---|---|
filter |
A SQL query used to limit the result set. See the possible values below.
|
||
maxResults |
The maximum number of elements to run from a query. |
||
firstResult |
The starting index for the query result set.
|
||
order |
A SQL order by clause. Used to specify ordering for the query result set. |
||
profile |
Can be details or info. This is the level of detail to return from a query; details gets all information and info gets a reduced information set.
|
Result tags and SQL query names
Field | Description | ||
---|---|---|---|
allocatedAgents |
The number of currently assigned agents for this build. SQL query name for |
||
availableResults |
This is a count of ’max’ or ’first’ results if |
||
buildClassId |
A unique number assigned by the Cluster Manager for each build class. SQL query name for |
||
buildClassName |
A name assigned by the user for the build class. SQL query name for |
||
buildId |
A unique number assigned by the Cluster Manager for each build. SQL query name for |
||
buildLogDir |
The directory containing uploaded build logs. SQL query name for |
||
buildName |
The build name that is the expanded build class tag. SQL query name for |
||
commandLine |
The original command-line invocation of eMake. SQL query name for |
||
conflicts |
The number of conflicts in the build. SQL query name for |
||
cwd |
The current working directory where eMake was invoked. SQL query name for |
||
duration |
The number of milli-seconds the build has been running.
|
||
effectiveAgentAlloc |
The effective agent allocation percentage. 100% means eMake had all the hosts it needed all the time, while a lesser percentage means eMake had the hosts it needed for that percent of time.
|
||
emakeVersion |
The eMake version used for this build. SQL query name for |
||
historyExists |
True means the history file existed and was used by the build. SQL query name for |
||
historyFile |
The name of the eMake history file. SQL query name for |
||
hostName |
The name of the machine where eMake was invoked. SQL query name for |
||
ipAddress |
The IP address of the machine where eMake was invoked. SQL query name for |
||
jobCount |
The total number of jobs that ran for the build.
|
||
lastRequestTime |
The last time eMake requested agents for this build. SQL query name for |
||
maxAgents |
The maximum number of agents to request for this build. SQL query name for |
||
minAgents |
The minimum number of agents required for this build to run. SQL query name for |
||
osUserName |
The OS-level name for the user who started eMake. SQL query name for |
||
platform |
The operating system being used/supported. If an OS is specified for a build class, builds from other operating systems cannot affiliate themselves with this class. SQL query name for |
||
priority |
The build priority level. When assigning resources, an optional priority boost value can be selected to give a build class preference over other builds of the same priority level. Higher boost values correspond to greater preference. SQL query name for |
||
resourceRequest |
A request to the cloud provider for a particular type of agent. SQL query name for |
||
result |
The build result code. -1 means the build is still running, 0-254 are actual exit codes, 256 means the build timed out, and 257 means the build was stopped. SQL query name for |
||
requestedAgents |
The number of agents eMake requested. SQL query name for |
||
startTime |
The time the build was started. SQL query name for |
||
userLabel |
The user-supplied label (via the eMake command-line), attached to the build. SQL query name for |
||
userName |
The unique name of the user. SQL query name for |
||
waitTime |
The number of seconds eMake was stalled because it had to wait for agents.
|
getBuildComments
Retrieves a list of related build comments.
Required arguments
Field | Description |
---|---|
buildId() |
A unique number assigned by the Cluster Manager for each build. Use the getBuilds command to retrieve a list of build IDs. |
getBuildClass
Finds a build class with full detail by its ID.
Required arguments
Field | Description |
---|---|
buildClassId |
A unique number assigned by the Cluster Manager for each build class. Use the getBuildClasses command to retrieve a list of build class IDs. |
Result tags
See the getBuildClasses command for descriptions.
annotationLevelsannoUploadbuildClassIdbuildClassName defaultClassmaxAgentsminAgentsnotifyOnBuildEnd platform priorityresourceRequesttagDefinition
getBuildClasses
Retrieves a list of build classes with limited detail.
Optional arguments
Field | Description | ||
---|---|---|---|
filter |
A SQL query used to limit the result set. See the possible values below.
|
||
maxResults |
The maximum number of elements to run from a query. |
||
firstResult |
The starting index for the query result set.
|
||
order |
SQL order by clause. Used to specify ordering for the query result set. |
||
profile |
Can be details or info. This is the level of detail to return from a query; details gets all information and info gets a reduced information set. |
Result tags and SQL query names
Field | Description |
---|---|
annotationLevels |
Annotation choices to include in the annotation file. Possible values are basic, history, file, lookup, and waiting. SQL query name for |
annoUpload |
If set to true, the annotation file is uploaded to Cluster Manager. SQL query name for |
availableResults |
This is a count of ’max’ or ’first’ results if |
buildClassId |
A unique number assigned by the Cluster Manager for each build class. SQL query name for |
buildClassName |
A name assigned by the user for the build class. SQL query name for |
defaultClass |
If set, this is the default build class and cannot be deleted. SQL query name for |
maxAgents |
The maximum number of agents to request for this build. SQL query name for |
minAgents |
The minimum number of agents required for this build to run. SQL query name for |
notifyOnBuildEnd |
If set to true, the currently logged-in user will receive an email when the build is finished. SQL query name for |
platform |
The operating system being used/supported. If an OS is specified for a build class, builds from other operating systems cannot affiliate themselves with this class. SQL query name for |
priority |
The build priority level. When assigning resources, an optional priority boost value can be selected to give a build class preference over other builds of the same priority level. Higher boost values correspond to greater preference. SQL query name for |
resourceRequest |
A request to the cloud provider for a particular type of agent. |
tagDefinition |
A format string that defines the resulting build name. SQL query name for |
getBuildClassComments
Retrieves a list of related build class comments.
Required arguments
buildClassId
|A unique number assigned by the Cluster Manager for each build class. You can use the getBuildClasses command to retrieve a list of build class IDs.
getBuildUserStats
Retrieves a list of user build statistics, grouped by user name, IP address, or host name.
Optional arguments
Field | Description | ||
---|---|---|---|
filter |
A SQL query used to limit the result set. See the possible values below.
|
||
order |
A SQL order by clause. Used to specify ordering for the query result set. |
Result tags and SQL query names
Field | Description |
---|---|
duration |
The total number of milli-seconds of all builds, filtered by the value specified in the ` groupBy ` argument. SQL query name for |
entryName |
The value specified in the |
umOfBuilds |
The number of builds. SQL query name for |
waitTime |
The number of seconds eMake was stalled because it had to wait for agents. SQL query name for |
workload |
The total number of seconds used by the agents for all of the filtered builds. SQL query name for |
Example
cmtool getBuildUserStats hostName --filter "duration >30000" --order "waitTime desc, entryName asc"
Retrieves build user statistics for builds longer than 30 seconds, grouped by host name and ordered by wait time in a descending order and by entry name (in this case host name) in an ascending order.
getMetrics
Returns metrics data for a particular metric. The response is in XML format.
modifyBuild
modifyBuildClass
Modifies a build class.
Required arguments
Field | Description |
---|---|
buildClassId |
Unique number assigned by the Cluster Manager for the build class. You can use the getBuildClasses command to retrieve a list of build class IDs. |
Optional arguments
Field | Description |
---|---|
buildClassName |
User-defined name of the build class. |
tagDefinition |
Format string that defines the resultant build name. The default is default_%GC%_%DATE%. This string generally consists of a generic build name appended with build-specific data that you construct from the following variables:
For information about constructing tag definitions, see Using Build Classes - Tag Definitions. |
annotationLevels |
Comma-separated list of values that indicates which levels of information to include in the annotation file. The possible values are basic, env, history, file, lookup, waiting, or registry (Windows only). An annotation file is not created until you specify at least one annotation level. Basic annotation includes annotation for the JobCache feature. For more information about JobCache, see Job Caching. |
maxAgents |
Maximum number of agents that can be assigned to this build. The default is 64. |
minAgents |
Minimum number of agents required for this build to run. The default is 2. |
platform |
OS being used or supported. The possible values are Windows or Linux. If an OS is specified for a build class, builds from other operating systems cannot affiliate themselves with this class. The default is that no platforms are specified. |
priority |
Priority for builds in this class. You can use one of three levels of priority: high, normal, and low. The default is 120 (middle of the normal priority range). The priority can be adjusted up or down by 1-10 to “boost” the priority to give certain classes preference over other builds of the same priority level. Higher boost values mean greater preference. The value must be a number in one of the following three ranges:
|
annoUpload |
Specifies whether to upload the annotation file to the Cluster Manager. The possible values are Y, 1, or true (upload) or N, 0, or false (do not upload). The default is N. |
jobcacheAllowed |
Specifies whether the JobCache feature is allowed for this build class. The possible values are Y, 1, or true (allow) or N, 0, or false (do not allow). The default is N, except for the default build class and for build classes that exist when you upgrade to CloudBees Build Acceleration 8.0. For more information about JobCache, see Job Caching. |
resourceRequest |
Name of an existing resource. This requests a particular type of agent from the cloud provider. |
modifyBuildClassComment
modifyBuildComment
Modifies a build comment.
Required arguments
Field | Description |
---|---|
buildId |
A unique number assigned by the Cluster Manager for each build. |
commentId |
The unique key that identifies a comment. Use the getBuildComments command to retrieve a list of comment IDs. |
text |
The text of the item. |
setDatabaseConfiguration
Modifies database configuration settings.
Required arguments
Field | Description |
---|---|
databaseName |
The database instance name. |
databaseType |
The database type. Can be mariadb, mysql, oracle, or sqlserver. |
hostName |
Machine name where the database is installed. |
port |
Database port number. |
userName |
Unique name of the user that is used to access the database. |
password |
Secret value used to identify an account for a particular user. |
stopBuild
Stops a running build. (This command has no effect on completed builds.)
Required arguments
Use getBuilds --filter "result <0" to retrieve a list of running builds.
|
Field | Description |
---|---|
buildId |
A unique number assigned by the Cluster Manager for each build. Use the getBuilds command to retrieve a list of build IDs. |