diff options
author | Plummer, Brittany <brittany.plummer@att.com> | 2019-10-24 14:42:15 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2019-10-24 14:42:16 -0400 |
commit | fd9cba6af0486e479ae5e953e880ae99aa3f2432 (patch) | |
tree | ec678706f78886324827f844c7dcb28aa0b6e8fa /mso-api-handlers/mso-requests-db-repositories | |
parent | 86f62530f1813152efbcc3d61f85e1fa6c943e36 (diff) |
add new query for requestdb
Updated RequestDbClient to call new request mapping to query for
IN_PROGRESS volumeGroup and vfModule requests older than two minutes.
Issue-ID: SO-2490
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: Idd4c077a13c15dd6c22ef168d164f2df2aed4cff
Diffstat (limited to 'mso-api-handlers/mso-requests-db-repositories')
-rw-r--r-- | mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java index a14699827d..e2c7aef4f4 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java @@ -25,6 +25,7 @@ import java.util.List; import org.onap.so.db.request.beans.InfraActiveRequests; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @@ -47,4 +48,8 @@ public interface InfraActiveRequestsRepository List<InfraActiveRequests> findByEndTimeLessThan(Date endTime, Pageable request); List<InfraActiveRequests> findByStartTimeLessThanAndEndTime(Date startTime, Date endTime, Pageable request); + + @Query(value = "SELECT * FROM infra_active_requests WHERE request_status = 'IN_PROGRESS' AND (request_scope = 'volumeGroup' OR request_scope = 'vfModule') AND start_time < (NOW() - INTERVAL 2 MINUTE)", + nativeQuery = true) + List<InfraActiveRequests> getInProgressVolumeGroupsAndVfModules(); } |