Submodel Repository#
The Submodel Repository is a component that provides a REST API to interact with Submodels. It allows the creation, retrieval, update, and deletion of Submodels.
Features#
Configuration#
Server Configuration
#
This section configures the server port, application name and Submodel Repository Name for the Submodel Repository.
server.port=8081
spring.application.name=Submodel Repository
basyx.smrepo.name = sm-repo
Backend Configuration
#
Configure the backend storage. By default, it uses InMemory. Optionally, you can configure MongoDB.
InMemory
#
basyx.backend = InMemory
MongoDB
#
basyx.backend = MongoDB
spring.data.mongodb.host=mongo
spring.data.mongodb.host=127.0.0.1
spring.data.mongodb.port=27017
spring.data.mongodb.database=submodels
spring.data.mongodb.authentication-database=admin
spring.data.mongodb.username=mongoAdmin
spring.data.mongodb.password=mongoPassword
CORS Configuration
#
Configure CORS settings to specify allowed origins and methods.
Warning
To use the component with the BaSyx Web GUI this configuration is required.
To do this, you need to add the URL of the Web GUI to the allowed origins.
This is what an example configuration looks like:
basyx.cors.allowed-origins=http://localhost:3000, https://my-url/*
basyx.cors.allowed-methods=GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD
Registry Integration
#
These settings allow the configuration of registry integration and the external URL of the repository.
basyx.submodelrepository.feature.registryintegration = http://localhost:8060
basyx.externalurl = http://localhost:8081
MQTT configuration#
This section provides the configuration for enabling MQTT.
basyx.submodelrepository.feature.mqtt.enabled = true
mqtt.clientId=TestClient
mqtt.hostname = localhost
mqtt.port = 1883
Operation Delegation
#
This feature is enabled by default and to disable this the following property should be defined:
basyx.submodelrepository.feature.operation.delegation.enabled = false
Docker#
Eclipse BaSyx provides the Submodel Repository as off-the-shelf component via DockerHub. The following command pulls the image and creates a container for the Submodel Repository:
docker run --name=sm-repo -p:8081:8081 -v C:/path/to/application.properties:/application/application.properties eclipsebasyx/submodel-repository:2.0.0-SNAPSHOT
Warning
When running this component inside Docker, do not modify the internal port configuration.
Changing the port setting may prevent the service from being accessible from outside the container.
Virtual Machine#
Eclipse BaSyx provides the Submodel Repository as a virtual machine image for Oracle VirtualBox and VMware Workstation Player.
The image can be found here. How to use it is described here.
Swagger UI#
In the Swagger UI, you can find the API documentation for the Submodel Repository.
You can also execute all the API calls directly from the Swagger UI.
The Aggregated API endpoint documentation is available at:
http://{host}:{port}/v3/api-docs
The Aggregated Swagger UI for the endpoints is available at:
http://{host}:{port}/swagger-ui/index.html