Skip to content
Snippets Groups Projects
Commit 84bd26f8 authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Small changes to the Documentation (coscine/issues#1108)

parent 081ac501
No related branches found
No related tags found
1 merge request!7Topic/1108 docu blob api
......@@ -43,8 +43,6 @@ namespace Coscine.Api.Blob.Controllers
private readonly string _rdsResourceHost;
private readonly WaterbutlerInterface _waterbutlerInterface;
/// <summary>
/// Blob controller constructor
/// </summary>
......@@ -76,7 +74,7 @@ namespace Coscine.Api.Blob.Controllers
/// This method returns the amount of allocated space for the given resource
/// </summary>
/// <param name="resourceId">Id of a resource</param>
/// <returns>Data, file count and bytesize used or Status Code 400 or 404 or 401 0r 500 </returns>
/// <returns>Data, file count and bytesize used or Status Code 400, 404, 401 or 500 </returns>
[HttpGet("[controller]/{resourceId}/quota")]
public IActionResult GetQuota (string resourceId)
{
......@@ -161,7 +159,7 @@ namespace Coscine.Api.Blob.Controllers
/// </summary>
/// <param name="resourceId">Id of the resource</param>
/// <param name="path"> Path to the file </param>
/// <returns>Ok if file exists otherwise Statuscode 400 or 401 or 404 or 204 </returns>
/// <returns>File if file exists otherwise Statuscode 204, 400, 401 or 404 </returns>
[HttpGet("[controller]/{resourceId}/{*path}")]
[DisableRequestSizeLimit]
public async Task<IActionResult> GetFile(string resourceId, string path)
......@@ -233,7 +231,7 @@ namespace Coscine.Api.Blob.Controllers
/// </summary>
/// <param name="resourceId">Id of the resource </param>
/// <param name="path">Path to the file</param>
/// <returns>Ok if file is uploaded otherwise Statuscode 400 or 401 or 404 or 204</returns>
/// <returns>Statuscode 204 if file is uploaded otherwise Statuscode 400, 401 or 404</returns>
[HttpPut("[controller]/{resourceId}/{*path}")]
[DisableRequestSizeLimit]
public async Task<IActionResult> UploadFile(string resourceId, string path)
......@@ -318,7 +316,7 @@ namespace Coscine.Api.Blob.Controllers
/// </summary>
/// <param name="resourceId">Id of the resource </param>
/// <param name="path">Path to the file</param>
/// <returns>Ok if deletion successful otherwise Statuscode 400 or 401 or 404 or 204 </returns>
/// <returns>Statuscode 204 if deletion successful otherwise Statuscode 400, 401 or 404 </returns>
[HttpDelete("[controller]/{resourceId}/{*path}")]
public async Task<IActionResult> DeleteFile(string resourceId, string path)
{
......@@ -382,7 +380,7 @@ namespace Coscine.Api.Blob.Controllers
/// <summary>
/// This method checks if the resource is valid
/// </summary>
/// <returns>Ok if resource is valid otherwise Statuscode 400 or 404 or 204</returns>
/// <returns>Statuscode 204 if resource is valid otherwise Statuscode 400 or 404</returns>
[HttpPost("[controller]/validate")]
public async Task<IActionResult> IsResourceValid([FromBody] JToken resource)
{
......@@ -432,7 +430,6 @@ namespace Coscine.Api.Blob.Controllers
/// <summary>
/// Returns the name of the resource
/// </summary>
private string GetResourceTypeName(Resource resource)
{
if (resource.Type.DisplayName.ToLower().Equals("s3"))
......@@ -447,7 +444,6 @@ namespace Coscine.Api.Blob.Controllers
/// <summary>
/// Returns the name of the resource
/// </summary>
private string GetResourceTypeName(JToken resource)
{
if (resource["type"]["displayName"].ToString().ToLower().Equals("s3"))
......@@ -462,7 +458,6 @@ namespace Coscine.Api.Blob.Controllers
/// <summary>
/// Creates an Action Result that can be returned on error
/// </summary>
private IActionResult FailedRequest(HttpResponseMessage response, string path)
{
if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
......@@ -523,13 +518,9 @@ namespace Coscine.Api.Blob.Controllers
// All good
return null;
}
// XXX extract in the future to an analytics Controller
/// <summary>
/// Writes an analytics log entry
/// </summary>
private void LogAnalytics(string operation, string resourceId, string path, User user)
{
if (CoscineLoggerConfiguration.IsLogLevelActivated(LogType.Analytics))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment