acquireNamedLock
Retrieves the named lock.
Arguments | Descriptions |
---|---|
lockName |
Name of the lock. Argument type: String |
create |
< Boolean flag — When this argument is set to Argument type: Boolean |
changeOwner
Changes the owner of an object.
You must specify an object name. You must also specify the new owner name if it is not the current user.
The modify privilege on the "admin" system ACL is required to change the owner of an object. For email notifiers, the owner can be changed if the current user has sufficient privileges to delete and recreate the object. |
Arguments | Descriptions |
---|---|
applicationName |
(Optional) The name of the application. Argument type: String |
applicationTierName |
(Optional) The name of the application tier. Argument type: String |
componentName |
(Optional) The name of the component. Argument type: String |
configName |
(Optional) The name of the email configuration. Argument type: String |
credentialName |
(Optional)
Argument type: String |
dashboardName |
(Optional) The name of a dashboard. Argument type: String |
environmentName |
(Optional) The name of an environment. Argument type: String |
environmentTemplateName |
(Optional) The name of an environment template. Argument type: String |
environmentTierName |
(Optional) The name of an environment tier. Argument type: String |
groupName |
(Optional) The full name of a group. For Active Directory and LDAP, this is a full domain name. Argument type: String |
newOwnerName |
(Optional) The name of the new owner for this object. This defaults to the current user. Argument type: String |
notifierName |
(Optional) The name of the email notifier. Argument type: String |
pluginName |
(Optional) The name of the plugin. This is the plugin key for a promoted plugin or a plugin key and version for an unpromoted plugin. Argument type: String |
procedureName |
(Optional) The name of the procedure. It can be a path to the procedure. When using this argument, you must also enter the Argument type: String |
processName |
(Optional) The name of a process. It can be a path to the process. Argument type: String |
processStepName |
(Optional) The name of a process step. It can be a path to the process step. Argument type: String |
projectName |
(Optional) The name of the project. It can be a path to the project. The project name is ignored for credentials, procedure, steps, and schedules when it is specified as a path. Argument type: String |
propertySheetId |
(Optional) The unique identifier for a property sheet that is assigned automatically when the property sheet is created. Argument type: UUID |
reportName |
(Optional) The name of a report. Argument type: String |
reportObjectTypeName |
(Optional) The name of a report object type. Argument type: String |
resourceName |
(Optional) The name of the resource. Argument type: String |
scheduleName |
(Optional) The name of the schedule. It can be a path to the schedule. When using this argument, you must also use Argument type: String |
serviceName |
(Optional) The name of the service. Argument type: String |
stateDefinitionName |
(Optional) The name of the state definition. Argument type: String |
stepName |
(Optional) The name of the step. It can be a path to the step. When using this argument, you must also enter Argument type: String |
transitionDefinitionName |
(Optional) The name of the transition definition. Argument type: String |
userName |
(Optional) The full name of the user. For Active Directory and LDAP, the name can be Argument type: String |
widgetName |
(Optional) The name of a widget. Argument type: String |
workflowDefinitionName |
(Optional) The name of the workflow definition. Argument type: String |
workspaceName |
(Optional) The name of the workspace. Argument type: String |
ec-perl
syntax: $cmdr->changeOwner({<optionals>});
Examples
The following example changes the owner of the default project to the current user:
$cmdr->changeOwner ({"projectName" => "Default"});
The following example changes the owner of a project named Q2Release to a new owner named hjindal:
$cmdr->changeOwner ({"newOwnerName" => "hjindal", "projectName" => "Q2Release"});
ectool
syntax: ectool changeOwner [optionals]
Examples
The following example changes the owner of the default project to the current user:
ectool changeOwner –-projectName "Default"
The following example changes the owner of a project named Q2Release to a new owner named hjindal:
ectool changeOwner --newOwnerName "hjindal" –-projectName "Q2Release"
clone
Makes a copy of an existing CloudBees CD object.
You cannot clone parameters, artifacts, or artifact versions. |
To find the entity you want to clone, you must specify the following arguments: —A new name for the cloned object ( cloneName ) —Locator arguments for the objects that can be cloned For example, if you want to clone a project, you must specify the name of the project that you want to clone.
|
Arguments | Descriptions | ||
---|---|---|---|
Naming |
|||
cloneName |
(Optional) New name of the cloned copy of an object. The Argument type: String |
||
Optionals |
|||
disableProjectTracking |
(Optional) < Boolean flag — If set to If you do not need to track changes for the new copy, this avoids the Change Tracking overhead that would otherwise slow down the copying operation, and also saves having to subsequently disable Change Tracking for the new copy of the project. Argument type: Boolean |
||
reducedDetailChangeHistory |
(Optional) < Boolean flag — Use this argument for large projects containing over 20,000 audited objects with Change Tracking enabled. When this argument is set to Set this argument to Argument type: Boolean |
||
Locators |
|||
applicationName |
(Optional) The name of the application that is unique among all projects. Argument type: String |
||
applicationTierName |
(Optional) The name of the application tier. Argument type: String |
||
artifactName |
(Optional) The name of the artifact. Argument type: String |
||
artifactVersionName |
(Optional) The name of the artifact version. Argument type: String |
||
componentName |
(Optional) The name of the component. Argument type: String |
||
configName |
(Optional) The name of the email configuration ( Argument type: String |
||
credentialName |
(Optional) The name of the credential that can be specified in one of these formats: relative (for example, absolute (for example, Argument type: String |
||
environmentName |
(Optional) The name of the environment that must be unique among all projects. Argument type: String |
||
environmentTemplateName |
(Optional) The name of the environment template. Argument type: String |
||
environmentTemplateTierName |
(Optional) The name of the environment template tier. Argument type: String |
||
environmentTierName |
(Optional) The name of the environment tier. Argument type: String |
||
flowName |
(Optional) Name of the flow that must be unique within the project. Argument Type: String |
||
flowRuntimeName |
(Optional) Name of the flow runtime. Argument Type: String |
||
flowRuntimeStateName |
(Optional) Name of the flow state. Argument Type: String |
||
flowStateName |
(Optional) Name of the flow state that must be unique within the flow. Argument Type: String |
||
flowTransitionName |
Name of the flow transition that must be unique within the flow state. Argument Type: String |
||
gatewayName |
(Optional) The name of the gateway. Argument type: String |
||
groupName |
(Optional) The name of the group. Argument type: String |
||
jobId |
(Optional) include::partial$job-id.adoc[] Argument type: UUID |
||
jobStepId |
(Optional) The unique identifier for a job step that is assigned automatically when the job step is created. Argument type: UUID |
||
notifierName |
(Optional) The name of the email notifier ( Argument type: String |
||
objectId |
(Optional) The object id as returned by Argument type: String |
||
path |
(Optional) The property path for the object. Argument type: String |
||
pipelineName |
(Optional) The name of the pipeline. Argument type: String |
||
pluginName |
(Optional) The name of the plugin. Argument type: String |
||
procedureName |
(Optional) The name of the procedure that you want to clone. When using this argument, you must also enter the Argument type: String |
||
processName |
(Optional) The name of the process. Argument type: String |
||
processStepName |
(Optional) The name of the process step. Argument type: String |
||
projectName |
(Optional) The name of the project that you want to clone.
Argument type: String |
||
propertySheetId |
(Optional) The unique identifier for a property sheet that is assigned automatically when the property sheet is created. |
||
providerName |
(Optional) The unique name of the directory provider, such as the LDAP or Active Directory provider name. Argument type: String |
||
releaseName |
(Optional) The name of the Release which owns the property. Argument type: String |
||
repositoryName |
(Optional) The name of the repository used for artifact management. Argument type: String |
||
resourceName |
(Optional) The name of the resource that you want to clone. Argument type: String |
||
resourcePoolName |
(Optional) The name of a resource pool. Argument type: String |
||
resourceTemplateName |
(Optional) The name of the resource template. Argument type: String |
||
scheduleName |
(Optional) The name of the schedule that you want to clone. When using this argument, you must also enter Argument type: String |
||
snapshotName |
(Optional) The name of the snapshot that you want to clone. Argument type: String |
||
stageName |
(Optional) The name of the stage definition. Argument type: String |
||
stateDefinitionName |
(Optional) The name of the state definition. Argument type: String |
||
stateName |
(Optional) The name of the state. Argument type: String |
||
stepName |
(Optional) The name of the procedure step that you want to clone. When using this argument, you must also enter Argument type: String |
||
systemObjectName |
(Optional) System object names include:
Argument type: SystemObjectName |
||
taskName |
(Optional) The name of the task. Argument type: String |
||
transitionDefinitionName |
(Optional) The name of the transition definition. Argument type: String |
||
transitionName |
(Optional) The name of the transition. Argument type: String |
||
userName |
(Optional) The name of the user where you may need to expand the string. Argument type: String |
||
workflowDefinitionName |
(Optional) The name of the workflow definition. Argument type: String |
||
workflowName |
(Optional) The name of the workflow. Argument type: String |
||
workspaceName |
(Optional) The name of the workspace that you want to clone. Argument type: String |
||
zoneName |
(Optional) The name of the zone. Argument type: String |
Positional arguments
None.
To clone an existing entity, you must specify the following arguments:
-
A new name for the cloned object (
cloneName
) -
Locator arguments for the objects that can be cloned
Response
Returns the name of the new cloned object.
Using the clone
command successfully depends on the context of the locator arguments in your system. The command works when the arguments are specified correctly.
ec-perl
syntax: $cmdr->clone ({<optionals>});
Examples
# Create a copy of a procedure, as though you clicked the "Copy" # button in the UI. $xPath = $cmdr\->clone( { projectName => "EC-Examples", procedureName => "set Property" } );
# Create a copy of a procedure providing a name for the copy. $xPath = $cmdr\->clone( { projectName => "EC-Examples", procedureName => "set Property", cloneName => "set Property 2" } );
# Create a copy of a procedure step. $xPath = $cmdr\->clone( { projectName => "EC-Examples", procedureName => "set Property", cloneName => "set Property 2", stepName => 'setProperty' } );
# Copy a step using the path. $xPath = $cmdr\->clone( { path => '/projects/EC-Examples/procedures/set Property/steps/setProperty' } );
ectool
syntax: ectool clone [optionals]
Examples
# Create a copy of a procedure, as though you clicked the "Copy"# button in the UI.$ ectool clone --projectName 'EC-Examples' --procedureName 'set Property' <response requestId="1" nodeId="192.168.16.238"> <cloneName>Set Property copy</cloneName></response>
# Create a copy of a procedure providing a name for the copy.$ ectool clone --projectName 'EC-Examples' --procedureName 'set Property' --cloneName 'set Property 2' <response requestId="1" nodeId="192.168.16.238"> <cloneName>set Property 2</cloneName></response>
# Create a copy of a procedure step.$ ectool clone --projectName 'EC-Examples' --procedureName 'set Property' --stepName 'setProperty <response requestId="1" nodeId="192.168.16.238"> <cloneName>setProperty copy</cloneName></response>
# Create a copy of a procedure step using the full path.$ ectool clone --path '/projects/EC-Examples/procedures/set Property/steps/setProperty' <response requestId="1" nodeId="192.168.16.238"> <cloneName>setProperty copy</cloneName></response>
countObjects
Returns the count of objects specified by the provided filter.
You must enter objectType
.
Arguments | Descriptions | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
objectType |
The type of object to count.
Argument type: String |
||||||||||||||||||||||||||||||||||||||||||||||
filter |
(Optional) A list of zero or more filter criteria definitions used to define objects to find. Each element of the filter list is a hash reference containing one filter criterion. You can specify several filter criteria, in which case an object must meet all filter criteria to be included in the result. See the code example below for instructions on forming the list and passing it to the CloudBees CD Perl API. Two types of filters:
Each "property filter" consists of a property name to test and an operator to use for comparison. The property can be either an intrinsic property defined by CloudBees CD or a custom property added by the user. Each operator takes zero, one, or two operands to compare against the desired property. Property filter operators are:
A Boolean filter is a Boolean operator and an array of one or more filters that are operands. Each operand can be either a property filter or a Boolean filter. Boolean operators are:
Argument type: Collection |
ec-perl
syntax: $cmdr->countObjects(<objectType>, {<optionals>});
Example
use ElectricCommander(); my @artifactNameFilters; # Create the filter list for filtering on artifact name push (@artifactNameFilters, {"propertyName"=>"artifactName", "operator"=>"contains", "operand1"=>"groupId:installer-windows", ); my $cmdr = new ElectricCommander(); # Perform the countObjects query my $reference=$cmdr\->countObjects("artifactVersion", { filter=> {operator=>"and", filter=>[ { propertyName=>"modifyTime" , operator=>"greaterOrEqual",# Give me all dates after or equal arbinary date "operand1"=>"2014-03-25T14:48:55.286Z", } , { operator => 'or', # apply 'or' for the filters in the list filter => \@artifactNameFilter } ] } }); my $jobs=$reference->find('\/response\/count'); print $jobs;
deleteObjects
Deletes objects specified by the provided filters. Because of the complexity of specifying filter criteria, this API is not supported by ectool. However, all of its capabilities are supported through the Perl API.
You must specify an objectType
and at least one filter.
This API supports deleting artifact , artifactVersion , job , logEntry , project , repository , and workflow .
|
Arguments | Descriptions |
---|---|
objectType |
This argument specifies the type of object to find. Values include: Argument type: String |
filters |
(Optional) Specify filters in a space-separated list:
A list of zero or more filter criteria definitions used to define objects to find. Each element of the filter list is a hash reference containing one filter criterion. You may specify several filter criteria, in which case an object must meet all filter criteria to be included in the result. See the code example below for instructions on forming the list and passing it to the CloudBees CD Perl API. Two types of filters: "property filters"—used to select objects based on the value of the object’s intrinsic or custom property "Boolean filters" ("and", "or", "not")—used to combine one or more filters using Boolean logic. Each "property filter" consists of a property name to test and an operator to use for comparison. The property can be either an intrinsic property defined by CloudBees CD or a custom property added by the user. Each operator takes zero, one, or two operands to compare against the desired property. Property filter operators are:
A Boolean filter is a Boolean operator and an array of one or more filters that are operands. Each operand can be either a property filter or a Boolean filter. Boolean operators are:
Argument type: Collection |
maxIds |
(Optional) Argument type: Integer |
sorts |
(Optional) Specify "sorts" in a space-separated list: If you specify more than one sort criterion, the sorts are applied according to the order they appear in the list. The first item in the list is the primary sort key. Each item in the list is a hash reference. See the code example below for instructions about forming the list and passing it to the CloudBees CD Perl API. The sort order affects which objects are deleted if a Argument type: Collection |
ec-perl
syntax: $cmdr->deleteObjects(<objectType>, {<optionals>});
Example
This code example illustrates using a Boolean filter for the deleteObjects
command to find jobs matching either of two patterns for the job name.
my @filterList; push (@filterList, {"propertyName" => "jobName", "operator" => "like", "operand1" => "%-branch-%"}); push (@filterList, {"propertyName" => "jobName", "operator" => "like", "operand1" => "branch-%"}); my $result = $cmdr\->deleteObjects('job', {filter => [ { operator => 'or', filter => \@filterList, } ]} ); print "result = " . $result-> findnodes_as_string("n"). "\n";
describeObject
describeObjectTypeStructure
Returns the CloudBees CD object structure of top-level objects including all nested objects, parameters, and custom properties, subject to arguments passed in with the command. If not specified, the entire object structure is returned.
Use information returned from this command to aide in constructing arguments for generateDsl . See Using the CloudBees CD DSL for more information.
Arguments | Descriptions |
---|---|
includeChildrenWithFileRef |
(Optional) < Boolean flag — If this argument is set to Argument type: Boolean |
objectType |
(Optional) Return the object structure for |
topLevelOnly |
(Optional) < Boolean flag — If this argument is set to Argument type: Boolean |
Response
Returns the specified CloudBees CD object structure as a structed set of <objectType>
elements.
dumpHeap
dumpStatistics
Prints (emits) internal timing statistics.
Arguments | Descriptions |
---|---|
clearStatistics |
(Optional) < Boolean flag — If this argument is set to Argument type: Boolean |
dumpLapTimes |
(Optional) < Boolean flag — If this argument is set to Argument type: Boolean |
fileName |
(Optional) If you specify a file name with a path, the output is redirected to this file. When the path is relative, the file is written relative to the working directory of the server. Argument type: String |
format |
(Optional) Format of the output. Valid values are The default is . Argument type: String |
evalDsl
Evaluates and runs a CloudBees CD domain-specific language (DSL) script.
You must enter either the dsl
or the dslFile
argument.
Arguments | Descriptions |
---|---|
dsl |
The DSL text. Either Argument type: String |
dslFile |
Path to the file on the client containing the DSL script. Either Argument type: String |
applicationName |
(Optional) Name of the application. Argument type: String |
applicationTierName |
(Optional) Name of the application tier. Argument type: String |
artifactName |
(Optional) Name of the artifact. Argument type: String |
artifactVersionName |
(Optional) Name of the artifact version. Argument type: String |
componentName |
(Optional) Name of the component. Argument type: String |
configName |
(Optional) Name of the email configuration. Argument type: String |
credentialName |
(Optional) Name of the credential. Argument type: String |
debug |
(Optional) < Boolean flag — |