User Tools
This is an old revision of the document!
Table of Contents
IDMS PROXY Development Details
Updated by Anna Dowling 10/11/2020
- See also: IDMS Mobile (Mobile Navigator)
- See also: EMS Nova (EMS Nova)
Overview
The idms proxy application is utilised as a api gateway for the mobile navigator application(idms-mobile) and mes-nova. It provides data integration points for device, alarm, ticket and discovered data within Errigal's network access. Currently this is a service oriented application with little front end capabilities apart from its status check page.
Repo: https://bitbucket.org/errigal/idms-proxy/src/master/
Local Dev App Urls
- http://localhost:8099/idms-proxy/status (status health page)
Project Documents
For further information see mobile requirements documentationhere
For further information see nova requirements documentationhere
Apis / Data Accessed
API endpoints for core IDMS Areas including:
- Authentication: UserProfile
- Element data: SnmpManager
- MDC data - Orchestrator
- MDC data translation (ui / unification) - mdc translator
- Ticket data - Ticketer
- IDMS Database
- Nova Data: Elastic Search (populated using elastic replicator application)
- SSE events for nova front end.
Architecture
Development Configuration
Project can be pointed at local or server deployed version of all api endpoints listed above. See src/main/resources/application.properties for environment configuration for local dev.
API Testing
For api testing either [idms-mobile](https://bitbucket.org/errigal/idms-mobile/src) or [postman](https://www.postman.com/) can be utilised. All apis are documented using open-api with swagger, see details below on how to access:
OPEN API Documentation
To view the api docs using open-api run the app locally and hit the following link:
Docs can be generated in yaml or json using the following links:
A pdf generator can be used to output the pdf of the api docs if required: https://www.swdoc.org/ Reference:
- [Open-API SpringBoot tutorial](https://www.baeldung.com/spring-rest-openapi-documentation)
Proxy Status
As a party of the proxy application there is a status page which checks the reachability of all api endpoints and database connections utilised for data retrieval. if an issue is found the field for Is Reachable? will show false, with the coloured red to signify an issue. Any associated exceptions will be logged in the Exceptions column of the table.
This page is available via the following link(ensure to change url per environment):
- load balancer example: https://demo.errigal.com/idms-proxy/status
- direct handler example: http://novaapps1.err:8099/idms-proxy/status
Configuration
For application configuration for local development see README.MD
List of Tools & Technologies
- JAVA 17
- Spring Boot 2.6.6
- MySQL 5.7
- Okhttp3
- Lombok 1.18.2
- JWT 3.10.3
- Open API 1.6.4
Deployment
The idms-proxy is deployed to the server handlers in /var/spring-boot/ and is load balanced. Its environment specific variables are passed via the application.properties file to the app at runtime.
Current Config Fields Are:
# Build Info
jenkins.build.identifier=idms-proxy » idms-proxy-feature-branches » REL-4.3.0 REL-4.3.0.7
jenkins.build.branch=REL-4.3.0
jenkins.build.number=7
jenkins.build.time=2022-09-21 01:18:37
deployment.time=2022-09-23 12:20:15
# Port
server.port = 8099
server.servlet.context-path=/idms-proxy
# api docs
springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.path=/swagger-ui.html
# SnmpManager Database
snmp.manager.database.name=snmp_manager
# Ticketer Database
ticketer.database.name=ticketer
## Database Properties
spring.datasource.platform=mysql
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url = jdbc:mysql://10.91.130.211:3306/${snmp.manager.database.name}?autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password==T7g(?(HHL
## Hibernate Properties
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto = update
# RabbitMQ settings
camel.component.rabbitmq.hostname=qanovalb1
camel.component.rabbitmq.username=rabbit
camel.component.rabbitmq.password=#rabbit321!#
camel.component.rabbitmq.port-number=5672
camel.component.rabbitmq.vhost=admin
spring.data.rest.base-path=/api/v0
#Preferred JSON mapper to use for HTTP message conversion.
spring.mvc.converters.preferred-json-mapper=gson
spring.security.user.name=test
spring.security.user.password=test
# snmp manager api details
snmp.manager.api.endpoint=https://qanova.errigal.com/SnmpManager/api/v1
snmp.manager.api.userName=userapiadmin
snmp.manager.api.password=#api321!#
snmp.manager.api.requestTimeout=60000
# ticketer api details
ticketer.api.endpoint=https://qanova.errigal.com/Ticketer/api/v1
ticketer.api.userName=userapiadmin
ticketer.api.password=#api321!#
ticketer.api.requestTimeout=60000
# userprofile api details
userprofile.api.endpoint=https://qanova.errigal.com/userprofile/api/v1
userprofile.api.userName=userapiadmin
userprofile.api.password=#api321!#
userprofile.api.requestTimeout=60000
userprofile.caching.enabled=true
userprofile.caching.ttl-seconds=60
orchestrator.location = https://qanovardflb.errigal.com
orchestrator.accessToken = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJyZGYiLCJleHAiOjQ3NjUxODY4NTMsInVzZXJJZCI6ODIsInVzZXJuYW1lIjoicWFub3ZhX2FnZW50MSJ9.XFxZkmnrYbzYBfRSCKaPofOmCMfGVA8ioszBbENN5tw
orchestrator.accessUser = nova
orchestrator.requesterSite = novaqa
orchestrator.api.discovery.url = /mdc-translator/api/v0/discover
orchestrator.api.query.url = api/v1/query
orchestrator.api.changes.url = /api/v1/changes
elastic-replicator.status.location=https://qanova.errigal.com/elastic-replicator/status
# General logging settings
spring.application.name=idms-proxy
logging.file.max-history=5
logging.file.max-size=50MB
logging.file.name=/home/scotty/logs/spring-boot/idms-proxy.log
# file upload
spring.servlet.multipart.max-file-size=30MB
spring.servlet.multipart.max-request-size=100MB
auth.jwt.jwksUrlPath=https://qanova.errigal.com
spring.elasticsearch.uris=qanovalb1:9200
elastic.index.prefix=nova.
#Metrics related configurations
management.endpoint.metrics.enabled=true
management.metrics.tags.application=idms-proxy
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.metrics.export.prometheus.enabled=true
# platform events
platform.events.enabled=true
# sse heartbeats configs
# repeat 0 means repeat forever, 1 means fire only once
sse.heartbeats.repeat=0
sse.heartbeats.period=20000
# change this to trace to get more detailed SSE emitters logging
logging.level.com.errigal.idmsproxy.integration = info
Ansible Playbooks
ansible-playbook -i ../env-configuration/ENV/hosts.ini --diff idms-proxy.yml --ask-vault-pass --extra-vars "jenkins_build_name='idms-proxy-feature-branches/job/BRANCH' appFileExtension='.jar' jenkins_job_build_num=NUMBER actions='upload,stop,deploy,configure,start'" ansible-playbook -i ../env-configuration/ENV/hosts --diff --vault-id @prompt restart-idms-proxy.yml ansible-playbook -i ../env-configuration/ENV/hosts --diff --vault-id @prompt shutdown-idms-proxy.yml ansible-playbook -i ../env-configuration/ENV/hosts --diff --vault-id @prompt startup-idms-proxy.yml

