Device Manager API is an API that supports device lifecycle management.
With this API it is possible to perform:
- Create a new device.
- Fully and/or partially update an existing device.
- Fetch a single device.
- Fetch all devices.
- Fetch devices by brand.
- Fetch devices by state.
- Delete a single device.
The folder where this document is located, has all necessary files and folders to build and run the device-manager application.
The following table describes those files and folders:
| File/Folder | Description |
|---|---|
| sql folder | Folder containg the sql script to create the device-manager database schema |
| service folder | Contains rest api backend code. |
| Dockerfile | File required to build device-manager image. |
| docker-compose.yml | File used to run the application |
| Device_Mananger_api_calls.postman_collection | Sample file with requests that can be imported on Postman tool |
In order to build the application the environment must have:
- Maven 3.9+
- Java 21+
- Podman,Rancher,Docker or similar tool
In order to run the application the environment must have:
- Java 21+ (only if you run the jar locally)
- Podman,Rancher,Docker or similar tool
Device Manager supports MySQL Version 8.0.43 + docker-composer file has all the necessary configuration to start a MySQL data base together with Device Manager service.
The API documentation can be accessed in runtime by placing the following link http://host:port/swagger-ui/index.html.
The docker file has the necessary requirements to build the jar artifact and generate the final image.
But you can also perform local compilation by executing the following commands:
cd service
mvn clean package
Run the following command to generate the report
cd service
mvn clean verify
The test coverage report will be available on service\target\site\jacoco folder.
Easiest and fastest way to build the application and produce a container image. It pre-builds the jar artifact in a image that match the build enviroment requirements and produces the final image. No tests are run in this build mode. On the project root folder where the Dockerfile is located, run the following command:
[podman|nerdctl|docker] build -t device-manager:latest .
On the project root folder where the docker-compose.yml is located, run the following command:
[podman|nerdctl|docker] compose up -d
On the project root folder where the docker-compose.yml is located, run the following command:
[podman|nerdctl|docker] compose down
Currently isn't Device Manage doesn't integrate directly with any authentication service. In order to have security is necessary to configure an authentication proxy in between.