summaryrefslogtreecommitdiffstats
path: root/adapters/mso-requests-db-adapter/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-requests-db-adapter/src/main')
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java5
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java4
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java2
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml5
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/application.yaml30
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.13__Add_Rollback_Status_Message_To_Infra_Active_Reqests.sql4
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.14__Add_Flow_Status_To_Infra_Active_Requests.sql7
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.1__Add_Column_Request_url_varchar500.sql9
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.2__Add_Instance_Group_Data.sql7
9 files changed, 59 insertions, 14 deletions
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java
index 28c56b32cd..2a661a7a6a 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java
@@ -113,6 +113,7 @@ public class ArchiveInfraRequestsScheduler {
archivedInfra.setNetworkType(iar.getNetworkType());
archivedInfra.setOperationalEnvId(iar.getOperationalEnvId());
archivedInfra.setOperationalEnvName(iar.getOperationalEnvName());
+ archivedInfra.setRequestUrl(iar.getRequestUrl());
archivedInfra.setProgress(iar.getProgress());
archivedInfra.setProvStatus(iar.getProvStatus());
archivedInfra.setRequestAction(iar.getRequestAction());
@@ -150,9 +151,9 @@ public class ArchiveInfraRequestsScheduler {
}
logger.info("Creating archivedInfraRequest records: " + newArchivedReqs.size());
- archivedInfraRepo.save(newArchivedReqs);
+ archivedInfraRepo.saveAll(newArchivedReqs);
logger.info("Deleting InfraActiveRequest records: "+ oldInfraReqs.size());
- infraActiveRepo.delete(oldInfraReqs);
+ infraActiveRepo.deleteAll(oldInfraReqs);
}
}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
index a849478907..626e3568bc 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
@@ -301,7 +301,9 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
String resourceTemplateUUID) throws MsoRequestsDbException {
return resourceOperationStatusRepository
- .findOne(new ResourceOperationStatusId(serviceId, operationId, resourceTemplateUUID));
+ .findById(new ResourceOperationStatusId(serviceId, operationId, resourceTemplateUUID)).
+ orElseThrow( () -> new MsoRequestsDbException("Operation not found:" + operationId));
+
}
/**
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java
index bc1e17b067..99fa770974 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java
@@ -25,7 +25,7 @@ import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean;
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml b/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml
index 41b72ba08f..b2b16274aa 100644
--- a/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml
+++ b/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml
@@ -17,7 +17,7 @@ mso:
period: 180
spring:
datasource:
- url: jdbc:mariadb://localhost:3306/requestdb
+ jdbc-url: jdbc:mariadb://localhost:3306/requestdb
username: catalog
password: catalog123
driver-class-name: org.mariadb.jdbc.Driver
@@ -42,9 +42,6 @@ spring:
password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
role: ACTUATOR
-#Actuator
-management:
- context-path: /manage
flyway:
baseline-on-migrate: false
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/application.yaml b/adapters/mso-requests-db-adapter/src/main/resources/application.yaml
index 4f423ca870..0da782bf00 100644
--- a/adapters/mso-requests-db-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-requests-db-adapter/src/main/resources/application.yaml
@@ -4,17 +4,21 @@ server:
port: 8080
tomcat:
max-threads: 50
-
+ssl-enable: false
mso:
- site-name: unknown
- logPath: ./logs/reqdb/
+ adapters:
+ requestDb:
+ auth: Basic YnBlbDptc28tZGItMTUwNyE=
+ endpoint: http://localhost:8081
+ logPath: .logs/reqdb
+ site-name: unkwon
infra-requests:
archived:
period: 180
# H2
spring:
datasource:
- url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb
+ jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: org.mariadb.jdbc.Driver
@@ -30,6 +34,16 @@ spring:
ddl-auto: validate
naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
enable-lazy-load-no-trans: true
+ security:
+ usercredentials:
+ -
+ username: bpel
+ password: '$2a$12$1xyutEZNfjGewIZRfKaE8eZE99f5sYFUmmM80BobI65KNjmcK0JuO'
+ role: BPEL-Client
+ -
+ username: mso_admin
+ password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
+ role: ACTUATOR
flyway:
baseline-on-migrate: false
url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb
@@ -37,8 +51,12 @@ flyway:
password: ${DB_ADMIN_PASSWORD}
#Actuator
-management:
- context-path: /manage
+management:
+ endpoints:
+ web:
+ base-path: /manage
+ exposure:
+ include: "*"
metrics:
se-global-registry: false
export:
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.13__Add_Rollback_Status_Message_To_Infra_Active_Reqests.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.13__Add_Rollback_Status_Message_To_Infra_Active_Reqests.sql
new file mode 100644
index 0000000000..41c10a2f07
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.13__Add_Rollback_Status_Message_To_Infra_Active_Reqests.sql
@@ -0,0 +1,4 @@
+use requestdb;
+
+ALTER TABLE infra_active_requests ADD ROLLBACK_STATUS_MESSAGE LONGTEXT;
+ALTER TABLE archived_infra_requests ADD ROLLBACK_STATUS_MESSAGE LONGTEXT; \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.14__Add_Flow_Status_To_Infra_Active_Requests.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.14__Add_Flow_Status_To_Infra_Active_Requests.sql
new file mode 100644
index 0000000000..db34ab98e0
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.14__Add_Flow_Status_To_Infra_Active_Requests.sql
@@ -0,0 +1,7 @@
+use requestdb;
+
+ALTER TABLE infra_active_requests ADD FLOW_STATUS LONGTEXT;
+ALTER TABLE archived_infra_requests ADD FLOW_STATUS LONGTEXT;
+
+ALTER TABLE infra_active_requests ADD RETRY_STATUS_MESSAGE LONGTEXT;
+ALTER TABLE archived_infra_requests ADD RETRY_STATUS_MESSAGE LONGTEXT; \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.1__Add_Column_Request_url_varchar500.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.1__Add_Column_Request_url_varchar500.sql
new file mode 100644
index 0000000000..161ba61b60
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.1__Add_Column_Request_url_varchar500.sql
@@ -0,0 +1,9 @@
+use requestdb;
+
+ALTER TABLE infra_active_requests
+ADD COLUMN REQUEST_URL varchar(500)
+AFTER OPERATIONAL_ENV_NAME;
+
+ALTER TABLE archived_infra_requests
+ADD COLUMN REQUEST_URL varchar(500)
+AFTER OPERATIONAL_ENV_NAME; \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.2__Add_Instance_Group_Data.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.2__Add_Instance_Group_Data.sql
new file mode 100644
index 0000000000..0e48b20528
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.2__Add_Instance_Group_Data.sql
@@ -0,0 +1,7 @@
+use requestdb;
+
+ALTER TABLE infra_active_requests ADD INSTANCE_GROUP_ID varchar(45);
+ALTER TABLE infra_active_requests ADD INSTANCE_GROUP_NAME varchar(200);
+
+ALTER TABLE archived_infra_requests ADD INSTANCE_GROUP_ID varchar(45);
+ALTER TABLE archived_infra_requests ADD INSTANCE_GROUP_NAME varchar(200); \ No newline at end of file