summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons')
-rw-r--r--ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/domain/BlueprintModelSearch.kt2
-rw-r--r--ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelRepository.kt12
-rw-r--r--ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintRemoteProcessorData.kt26
3 files changed, 38 insertions, 2 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/domain/BlueprintModelSearch.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/domain/BlueprintModelSearch.kt
index 734bf3689..ba9051898 100644
--- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/domain/BlueprintModelSearch.kt
+++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/domain/BlueprintModelSearch.kt
@@ -104,6 +104,6 @@ class BlueprintModelSearch : Serializable {
companion object {
- const val serialversionuid = 1L
+ const val serialVersionUID = 1L
}
}
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelRepository.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelRepository.kt
index a7891f6a7..a6f0da1cc 100644
--- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelRepository.kt
+++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelRepository.kt
@@ -20,6 +20,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository
import org.jetbrains.annotations.NotNull
import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModel
import org.springframework.data.jpa.repository.JpaRepository
+import org.springframework.data.jpa.repository.Query
+import org.springframework.data.repository.query.Param
import org.springframework.stereotype.Repository
import java.util.Optional
import javax.transaction.Transactional
@@ -48,6 +50,16 @@ interface BlueprintModelRepository : JpaRepository<BlueprintModel, String> {
fun findByArtifactNameAndArtifactVersion(artifactName: String, artifactVersion: String): BlueprintModel?
/**
+ * Find the Blueprint UUID (blueprint_model_id) for a given artifactName/Version
+ *
+ * @param artifactName artifactName
+ * @param artifactVersion artifactVersion
+ * @return String?
+ */
+ @Query("SELECT m.id FROM BlueprintModel m WHERE m.artifactName = :artifactName AND m.artifactVersion = :artifactVersion")
+ fun findIdByArtifactNameAndArtifactVersion(@Param("artifactName") artifactName: String, @Param("artifactVersion") artifactVersion: String): String?
+
+ /**
* This is a findTopByArtifactNameOrderByArtifactIdDesc method
*
* @param artifactName artifactName
diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintRemoteProcessorData.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintRemoteProcessorData.kt
index 6baf261fb..d8baa8eaf 100644
--- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintRemoteProcessorData.kt
+++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintRemoteProcessorData.kt
@@ -18,15 +18,39 @@
package org.onap.ccsdk.cds.blueprintsprocessor.core.api.data
import com.fasterxml.jackson.databind.JsonNode
+import com.google.protobuf.ByteString
import java.util.Date
enum class StatusType {
SUCCESS, FAILURE
}
+/* TODO: Group fields into another struct containing originatorId, requestId, subRequestId, correlationId generally go together */
+// timeOuts are in seconds
+
data class RemoteIdentifier(
var blueprintName: String,
- var blueprintVersion: String
+ var blueprintVersion: String,
+ var blueprintUUID: String
+)
+
+data class RemoteScriptUploadBlueprintInput(
+ val remoteIdentifier: RemoteIdentifier? = null,
+ val requestId: String,
+ val subRequestId: String,
+ val originatorId: String,
+ val correlationId: String? = null,
+ val timeOut: Long = 30,
+ val archiveType: String = "CBA_ZIP",
+ val binData: ByteString
+)
+
+data class RemoteScriptUploadBlueprintOutput(
+ val requestId: String,
+ val subRequestId: String,
+ val status: StatusType = StatusType.SUCCESS,
+ val timestamp: Date = Date(),
+ val payload: JsonNode
)
data class RemoteScriptExecutionInput(