You are here: ectool and the Commander API > API Commands - listed by group and in alphabetical order > Credential Management

API Commands - Credential Management


attachCredential
createCredential
deleteCredential
detachCredential
getCredential
getCredentials
getFullCredential
modifyCredential

attachCredential

Attaches a credential to a step or a schedule.

Attaching a credential allows the credential to be passed as an actual argument by a schedule or subprocedure
step, or to be used in a getFullCredential call by a command step.

You must specify projectName, credentialName, and locator arguments to identify a step or a schedule.


Arguments Descriptions
credentialName credentialName can be one of two forms:
relative
(for example, "cred1") - the credential is assumed to be in the project that contains the request target object.
absolute
(for example, "/projects/BuildProject/credentials/cred1") - the credential can be from any specified project, regardless of the target object’s project.
procedureName The name of a procedure within the "named" project where this credential will be attached.
projectName The name of the project that contains the object where this credential will be attached.
scheduleName The schedule name for running one of the procedures within the "named" project.
stepName   A step name within one of the procedures contained in the "named" project.
Positional arguments

projectName, credentialName

Response

None or status OK message.

ec-perl

syntax: $cmdr->attachCredential(<projectName>, <credentialName>, {...});

Example
$cmdr->attachCredential("Test Proj", "Preflight User", {procedureName => 
   "Run Build", stepName=>"Get Sources"}); 
ectool

syntax: ectool attachCredential <projectName> <credentialName> ...

Example
ectool attachCredential "Test Proj" "Preflight User"
   --procedureName "Run Build" --stepName "Get Sources" 

Back to Top

createCredential

Creates a new credential for a project.

You must specify a projectName and credentialName.


Arguments Descriptions
description A plain text or HTML description for this object.
If using HTML, you must surround your text with  <html> ... </html> tags. The only HTML tags allowed in the text are: <a> <b> <br> <div> <dl> <font> <i> <li> <ol> <p> <pre> <span> <style> <table> <tc> <td> <th> <tr> <ul>
credentialName The name of the credential to create (any name you choose).
password The password matching the specified user name.
projectName The name of the project where the credential will be stored.
userName The name of the user.
Positional arguments

projectName, credentialName

Response

None or status OK message.

ec-perl

syntax: $cmdr->createCredential(<projectName>, <credentialName>, {<optionals>});

Example
$cmdr->createCredential("Sample Project", "Build User", {userName => "build",
   password => "abc123"}); 
ectool

syntax: ectool createCredential <projectName> <credentialName> --userName <userName>
   --password <password> ...

Example
ectool createCredential "Sample Project" "Build User" --userName build --password abc123 

Back to Top

deleteCredential

Deletes a credential.

You must specify a projectName and a credentialName.


Arguments Descriptions
projectName The name of the project that contains this credential.
credentialName credentialName can be one of two forms:
relative
(for example, "cred1") - the credential is assumed to be in the project that contains the request target object.
absolute
(for example, "/projects/BuildProject/credentials/cred1") - the credential can be from any specified project, regardless of the target object's project.
Positional arguments

projectName, credentialName

Response

None or a status OK message.

ec-perl

syntax: $cmdr->deleteCredential(<projectName>, <credentialName>);

Example
$cmdr->deleteCredential('Sample Project', 'Build User'); 
ectool

syntax: ectool deleteCredential <projectName> <credentialName>

Example
ectool deleteCredential "Sample Project" "Build User" 

Back to Top

detachCredential

Detaches a credential from an object.

You must specify projectName and credentialName. Also, depending on where the credential is
attached, you must specify a step (using procedureName and stepName), or define a schedule
(using scheduleName).


Arguments Descriptions
credentialName credentialName can be one of two forms:
relative
(for example, "cred1") - the credential is assumed to be in the project that contains the request target object.
absolute
(for example, "/projects/BuildProject/credentials/cred1") - the credential can be from any specified project, regardless of the target object's project.
procedureName The name of the procedure that contains the step with the credential to detach.
projectName The name of the project that contains this credential, schedule, or procedure step.
scheduleName The name of the schedule where this credential may be attached.
stepName The name of the step where this credential may be attached.
Also requires procedureName.
Positional arguments

projectName, credentialName

Response

None, or a status OK message on success, or:

NoSuchCredential if the specified credential does not exist.

NoSuchSchedule if the specified schedule does not exist.

ec-perl

syntax: $cmdr->detachCredential(<projectName>, <credentialName>, {<optionals>});

Examples
$cmdr->detachCredential("Test Proj", "Preflight User",
                         {procedureName => "Run Build",
                               stepName => "Get Sources"});

$cmdr->detachCredential("Test Proj", "Preflight User",
                          {scheduleName => "Build Schedule"});
ectool

syntax: ectool detachCredential <projectName> <credentialName> ...

Examples
ectool detachCredential "Test Proj" "Preflight User"
  --procedureName "Run Build" --stepName "Get Sources"

ectool detachCredential "Test Proj" "Preflight User"
  --scheduleName "Build Schedule"

Back to Top

getCredential

Finds a credential by name.

You must specify projectName and credentialName.


Arguments Descriptions
credentialName credentialName can be one of two forms:
relative
(for example, "cred1") - the credential is assumed to be in the project that contains the request target object.
absolute
(for example, "/projects/BuildProject/credentials/cred1") - the credential can be from any specified project, regardless of the target object's project.
projectName The name of the project containing this credential.
Positional arguments

projectName, credentialName

Response

One credential element.

ec-perl

syntax: $cmdr->getCredential(<projectName>, <credentialName> );

Example
$cmdr->getCredential("SampleProject", "Build User");
ectool

syntax: ectool getCredential <projectName> <credentialName>

Example
ectool getCredential "Sample Project" "Build User"

Back to Top

getCredentials

Retrieves all credentials in a project.

You must specify a projectName.


Arguments Descriptions
projectName The name of the project containing these credentials.
usableOnly <Boolean flag - 0|1|true|false>   If set to 1, only those credentials that the currently logged-in user has execute privileges for will be returned.
Positional arguments

projectName

Response

Zero or more credential elements.

ec-perl

syntax: $cmdr->getCredentials(<projectName>, {...});

Example
$cmdr->getCredentials("Sample Project", {"usableOnly" => 1});
ectool

syntax: ectool getCredentials <projectName> ...

Example
ectool getCredentials "Sample Project" --usableOnly 1

Back to Top

getFullCredential

Finds a credential by name, including password, from within a running step.

You must specify the credentialName.


Arguments Descriptions
credentialName credentialName can be one of two forms:
relative
(for example, "cred1") - the credential is assumed to be in the project that contains the request target object.
absolute
(for example, "/projects/BuildProject/credentials/cred1") - the credential can be from any specified project, regardless of the target object’s project.
value <password|userName>  If specified, returns only the password or user name.
Positional arguments

credentialName

Response

If value is supplied, only the name is returned when called by ectool. If no value is supplied,
an xPath object is returned.

ec-perl

syntax: $cmdr->getFullCredential(<credentialName>, {<optionals>});

Example
# Returns an xPath object containing the password.
my $xpath = $cmdr->getFullCredential("myCred", {value => "password"});

# Parse password from response.
my $password = $xpath->find("//password");
ectool

syntax: ectool getFullCredential <credentialName> ...

Example
ectool getFullCredential myCred --value password

Back to Top

modifyCredential

Modifies an existing credential.

You must specify projectName and credentialName.


Arguments Descriptions
credentialName credentialName can be one of two forms:
relative
(for example, "cred1") - the credential is assumed to be in the project that contains the request target object.
absolute
(for example, /projects/BuildProject/credentials/cred1") - the credential can be from any specified project, regardless of the target object's project.
description A plain text or HTML description for this object.
If using HTML, you must surround your text with
<html> ... </html> tags. The only HTML tags allowed in the text are: <a> <b> <br> <div> <dl> <font> <i> <li> <ol> <p> <pre> <span> <style> <table> <tc> <td> <th> <tr> <ul>
newName Supply any name of your choice to rename the credential.
password The password for the specified user name.
projectName The name of the project containing this credential.
userName The name of the user containing this credential.
Positional arguments

projectName, credentialName

Response

None or a status OK message.

ec-perl

syntax: $cmdr->modifyCredential(<projectName>, <credentialName>, {<optionals>});

Example
$cmdr->modifyCredential("Sample Project", "Build User", {userName => "build"});
ectool

syntax: ectool modifyCredential <projectName> <credentialName> ...

Example
ectool modifyCredential "Sample Project" "Build User" --userName build

Back to Top

Previous TopicNext Topic