Author: Eduardo Espinoza Pérez (eduardo.espinoza@tenpo.cl)
Requirements:
- packer
- terraform
Instructions:
- Create Azure empty resource group
eespinoza-devopstest-images
(required by Packer) - Give execution permissions to
start.sh
(chmod +x start.sh
) - Set Azure account variables and VMs SSH public key in
start.sh
- Run
start.sh
(./start.sh
)
Default VMs user: testuser
API default port: HTTP 8069
API definition:
- PUT /devops-test/users Add new user.
{
"identifier": "eespinoza",
"password": "12345"
}
Returns: HTTP 201 (Created)
- POST /devops-test/login Request login.
{
"identifier": "eespinoza",
"password": "12345"
}
Returns:
{
"token": "<JWT Token>"
}
- DELETE /devops-test/logout Perform user logout (token revocation).
Required headers:
Authorization: Bearer <JWT Token>
Returns:
{
"token": "<JWT Token>"
}
- GET /devops-test/sum/{primaryOperand}/{secondaryOperand} Perform addition operation.
GET /devops-test/sum/2/2
Required headers:
Authorization: Bearer <JWT Token>
Returns:
{
"result": 4
}
- GET /devops-test/history Retrieve user's operation history.
Required headers:
Authorization: Bearer <JWT Token>
Returns:
[
{
"id": "e004a0fb-53d9-4787-a3c8-fa16ce02d05e",
"primary_operand": 36,
"secondary_operand": 88,
"result": 124,
"created_at": "2019-12-08T22:50:41.665104Z"
}
]