Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BlobApi
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
apis
BlobApi
Commits
84bd26f8
Commit
84bd26f8
authored
4 years ago
by
Marcel Nellesen
Browse files
Options
Downloads
Patches
Plain Diff
Small changes to the Documentation (coscine/issues#1108)
parent
081ac501
No related branches found
No related tags found
1 merge request
!7
Topic/1108 docu blob api
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Blob/Controllers/BlobController.cs
+5
-14
5 additions, 14 deletions
src/Blob/Controllers/BlobController.cs
with
5 additions
and
14 deletions
src/Blob/Controllers/BlobController.cs
+
5
−
14
View file @
84bd26f8
...
...
@@ -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
0
r 500 </returns>
/// <returns>Data, file count and bytesize used or Status Code 400
,
404
,
401
o
r 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
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment