FileStorageWebService
Web service for S3 file storage
Base URL: /domains/file/storage/v1
Version: v1
Summary
Path | Operation | Description |
---|---|---|
/file | POST | Create a new file |
/file/{fileUUID} | DELETE | Delete the specified file |
GET | Get a file from S3 | |
/heartbeat | GET | Web service heatbeat |
Paths
POST /file
Save a file to S3. Get back an UUID which is the S3 filename.
*/*
The content of the file to be saved
"one
two
three lines"
filename | The name of the file | query | string |
application/json
- 200 OK
-
File successfully saved to S3 bucket.
The UUID assigned to the file in the S3 bucket is returned in JSON in the Response Body.
{
"fileUUID": "4674cca9-b759-4e44-86da-830cec378d56"
} - 401 Unauthorized #/responses/Invalid Credentials
-
Invalid Credentials.
- 403 Forbidden #/responses/Client Does Not Have Privileges
-
Error: The Client does not have rights to access this file or it does not exist.
- 404 Not Found #/responses/S3 Error: Unable to save S3 file
-
S3 Error:
Unable to create or replace S3 file
Caught an AmazonServiceException, which means your request made it to Amazon S3, but was rejected with an error response for some reason. - 500 Internal Server Error #/responses/S3 Error: Unable to access AWS
-
S3 Error:
Caught an AmazonClientException, which means the client encountered an internal error while trying to communicate with S3, such as not being able to access the network.
DELETE /file/{fileUUID}
Remove the file identifed by the fileUUID
fileUUID | The UUID (filename on S3) of the file | path | string |
text/plain
- 200 OK
-
File was successfully deleted.
When the file is successfully removed from S3 then the call will return 'true' in the Response Body, otherwise it will return an error.
"true"
- 401 Unauthorized #/responses/Invalid Credentials
-
Invalid Credentials.
- 403 Forbidden #/responses/Client Does Not Have Privileges
-
Error: The Client does not have rights to access this file or it does not exist.
- 404 Not Found #/responses/S3 Error: Unable to delete S3 file
-
S3 Error:
Unable to delete S3 file
Caught an AmazonServiceException, which means your request made it to Amazon S3, but was rejected with an error response for some reason.
Error Message: Not Found (Service: Amazon S3; Status Code: 404; Error Code: 404 Not Found; Request ID: C19B0...B3)
HTTP Status Code: 404
AWS Error Code: 404 Not Found
Error Type: Client
Request ID: C19B0...B3/ncom.amazonaws.services.s3.model.AmazonS3Exception: Not Found (Service: Amazon S3; Status Code: 404; Error Code: 404 Not Found; Request ID: C19B0...B3), S3 Extended Request ID: D0v0Aqget310...KI= - 500 Internal Server Error #/responses/S3 Error: Unable to access AWS
-
S3 Error:
Caught an AmazonClientException, which means the client encountered an internal error while trying to communicate with S3, such as not being able to access the network.
GET /file/{fileUUID}
Get a file based on the fileUUID (file name in S3).
fileUUID | The UUID of the file (filename on S3). | path | string |
*/*
- 200 OK
-
File was successfully retrieved.
- file_name: string
-
The file name that was given in the file POST query parameter. It is returned in the response header.
{
"filename": "test_file_name.txt"
} - file: string (binary)
-
The file contents are in the body of the GET response.
"one
two
three lines"
- 401 Unauthorized #/responses/Invalid Credentials
-
Invalid Credentials.
- 403 Forbidden #/responses/Client Does Not Have Privileges
-
Error: The Client does not have rights to access this file or it does not exist.
- 404 Not Found #/responses/S3 Error: Unable to get S3 file
-
S3 Error:
Unable to get S3 file
Caught an AmazonServiceException, which means your request made it to Amazon S3, but was rejected with an error response for some reason. - 500 Internal Server Error #/responses/S3 Error: Unable to access AWS
-
S3 Error:
Caught an AmazonClientException, which means the client encountered an internal error while trying to communicate with S3, such as not being able to access the network.
GET /heartbeat
Simple heartbeat checks to make sure the service is available. Also checks to make sure the S3 bucket is accessible.
text/plain
- 200 OK
-
The web service is responding and the S3 bucket that it uses is accessible.
"Version: v1. S3 bucket is accessible: true"
- 401 Unauthorized #/responses/Invalid Credentials
-
Invalid Credentials.
- 403 Forbidden #/responses/Client Does Not Have Privileges
-
Error: The Client does not have rights to access this file or it does not exist.
- 500 Internal Server Error #/responses/S3 Error: Unable to access AWS
-
S3 Error:
Caught an AmazonClientException, which means the client encountered an internal error while trying to communicate with S3, such as not being able to access the network.
Response definitions
- Invalid Credentials
-
Invalid Credentials.
- Client Does Not Have Privileges
-
Error: The Client does not have rights to access this file or it does not exist.
- S3 Error: Unable to access AWS
-
S3 Error:
Caught an AmazonClientException, which means the client encountered an internal error while trying to communicate with S3, such as not being able to access the network. - S3 Error: Unable to save S3 file
-
S3 Error:
Unable to create or replace S3 file
Caught an AmazonServiceException, which means your request made it to Amazon S3, but was rejected with an error response for some reason. - S3 Error: Unable to get S3 file
-
S3 Error:
Unable to get S3 file
Caught an AmazonServiceException, which means your request made it to Amazon S3, but was rejected with an error response for some reason. - S3 Error: Unable to delete S3 file
-
S3 Error:
Unable to delete S3 file
Caught an AmazonServiceException, which means your request made it to Amazon S3, but was rejected with an error response for some reason.
Error Message: Not Found (Service: Amazon S3; Status Code: 404; Error Code: 404 Not Found; Request ID: C19B0...B3)
HTTP Status Code: 404
AWS Error Code: 404 Not Found
Error Type: Client
Request ID: C19B0...B3/ncom.amazonaws.services.s3.model.AmazonS3Exception: Not Found (Service: Amazon S3; Status Code: 404; Error Code: 404 Not Found; Request ID: C19B0...B3), S3 Extended Request ID: D0v0Aqget310...KI=