Skip to content

Commit

Permalink
MINOR: Doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
thehoneymad committed May 1, 2016
1 parent def57a3 commit 5827f8b
Showing 1 changed file with 54 additions and 5 deletions.
59 changes: 54 additions & 5 deletions TaskCat/TaskCat/Controller/JobController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ public JobController(IJobRepository repository)
/// If you're accessing the non-authorized endpoint, you can only search
/// by hrid
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
/// <param name="id">
/// job id to get
/// </param>
/// <returns>Job </returns>
///
[AllowAnonymous]
[ResponseType(typeof(Job))]
[Authorize(Roles = "Administrator, BackOfficeAdmin, Asset")]
[HttpGet]
public async Task<IHttpActionResult> Get(string id)
Expand Down Expand Up @@ -78,7 +80,27 @@ public async Task<IHttpActionResult> Get(string id)
}
}


/// <summary>
/// List Jobs mostly with just type filter
/// </summary>
/// <param name="type">
/// Job type to be filtered by
/// </param>
/// <param name="pageSize">
/// Page Size to return results
/// </param>
/// <param name="page">
/// page number to return results
/// </param>
/// <param name="envelope">
/// envelope the job results in pagination header
/// </param>
/// <returns>
/// Return Jobs matching type filter
/// </returns>
///
[ResponseType(typeof(Job))]
[Authorize(Roles = "Administrator, BackOfficeAdmin, Asset")]
[HttpGet]
public async Task<IHttpActionResult> List(string type = "", int pageSize = AppConstants.DefaultPageSize, int page = 0, bool envelope = false)
{
Expand Down Expand Up @@ -226,7 +248,8 @@ public async Task<IHttpActionResult> GenerateInvoiceForAJob(string jobhrid)
/// <summary>
/// Post a generic job payload
/// </summary>
/// <returns></returns>
/// <returns>
/// </returns>
[HttpPost]
public async Task<IHttpActionResult> Post(JobModel model)
{
Expand All @@ -241,6 +264,19 @@ public async Task<IHttpActionResult> Post(JobModel model)
}
}

/// <summary>
/// Claim a job as a server
/// </summary>
/// <remarks>
/// This is used to claim a job
/// </remarks>
/// <param name="jobId">
/// Id for a job
/// </param>
/// <returns>
/// Returns a replace result that replaces the JobServedBy field
/// </returns>
///
[Authorize(Roles = "Administrator, BackOfficeAdmin")]
[Route("api/Job/claim/{jobId}")]
[HttpPost]
Expand All @@ -250,6 +286,19 @@ public async Task<IHttpActionResult> Claim(string jobId)
return Json(result);
}

/// <summary>
/// Partial update to a specific task under a job
/// </summary>
/// <remarks>
/// Patch update to a specific task to set a partial update
/// like changing assetRef or task state
/// </remarks>
/// <param name="jobId">
/// Job Id the task is associated with
/// </param>
/// <param name="taskId"></param>
/// <param name="taskPatch"></param>
/// <returns></returns>
[Authorize(Roles = "Asset, Administrator, Enterprise, BackOfficeAdmin")]
[Route("api/Job/{jobId}/{taskId}")]
[HttpPatch]
Expand Down

0 comments on commit 5827f8b

Please sign in to comment.