Skip to content

Commit

Permalink
Merge branch 'i333' into release-1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Jun 9, 2011
2 parents 020aecc + d9bfae7 commit aebf5e4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public class RundeckAPICentralDispatcher implements CentralDispatcher {
* Webservice link prefix for a stored job.
*/
public static final String RUNDECK_JOB_LINK_PREFIX = "/job/show/";
/**
* Webservice link prefix for an execution
*/
public static final String RUNDECK_EXEC_LINK_PREFIX = "/execution/show/";

/*******************
* API v1 endpoints
Expand Down Expand Up @@ -331,7 +335,7 @@ private QueuedItemResult submitRunRequest(final File tempxml, final HashMap<Stri
final Node node = resultDoc.selectSingleNode("/result/execution/@id");
final String succeededId = node.getStringValue();
final String name = "adhoc";
String url = createJobURL(succeededId);
String url = createExecutionURL(succeededId);
url = makeAbsoluteURL(url);
logger.info("\t[" + succeededId + "] <" + url + ">");
return QueuedItemResultImpl.successful("Succeeded queueing " + name, succeededId, url, name);
Expand Down Expand Up @@ -614,7 +618,16 @@ public String getMessage() {
*/
private String createJobURL(final String id) {
return makeContextAbsoluteURL(RUNDECK_JOB_LINK_PREFIX + id);

}
/**
* Return the URL for a job based on its ID
*
* @param id job ID
*
* @return absolute URL for the job's link
*/
private String createExecutionURL(final String id) {
return makeContextAbsoluteURL(RUNDECK_EXEC_LINK_PREFIX + id);
}

public Collection<IStoredJob> listStoredJobs(final IStoredJobsQuery iStoredJobsQuery, final OutputStream output,
Expand Down
2 changes: 1 addition & 1 deletion core/src/java/com/dtolabs/rundeck/core/cli/ExecTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ private void queueAction() {
if (null != result.getMessage()) {
out.println(result.getMessage());
}
out.println("Queued job ID: " + result.getItem().getId() + " <" + result.getItem().getUrl() + ">");
out.println("Queued Execution ID: " + result.getItem().getId() + " <" + result.getItem().getUrl() + ">");
} else {
throw new CoreException(
"Queued job request failed: " + (null != result ? result.getMessage() : "Result was null"));
Expand Down

0 comments on commit aebf5e4

Please sign in to comment.