Set credentials in the AWS credentials profile file on your local system, located at:
~/.aws/credentials on Linux, macOS, or Unix
C:\Users\USERNAME \.aws\credentials on Windows
This file should contain lines in the following format:
[default]
aws_access_key_id = your_access_key_id
aws_secret_access_key = your_secret_access_key
Substitute your own AWS credentials values for the values your_access_key_id and your_secret_access_key.`
Edit the bucket and region values in TechExamModule.java
private final String bucket = "your bucket";
private final String region = "your region";
Substitute your own AWS values for bucket and region.
- Run
mvn clean install
to build your application - Start application with
java -jar target/tech-exam-1.0-SNAPSHOT.jar server config.yml
- To check that your application is running enter url
http://localhost:8080
To see your applications health enter url http://localhost:8081/healthcheck
To see your applications admin console enter url http://localhost:8081
The TechExam server provides an S3 asset uploader API as described below:
POST /asset
Body: empty
Sample response
{
“upload_url”: <s3-signed-url-for-upload>,
“id”: <asset-id>
}
PUT /asset/<asset-id>
Body:
{
“Status”: “uploaded”
}
4. When a Get request is made on the asset, the service returns an s3 signed url for download with the timeout in seconds as a url parameter. If the timeout is not specified assume 60 seconds.
GET /asset/<asset-id>?timeout=100
Sample response
{
“Download_url”: <s3-signed-url-for-upload>
}
A get call made on an asset which has not been set to “status: uploaded” returns an error.