CCSDK-3531 improve cmd-exec returned err msg
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / commons / processor-core / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / core / api / data / BlueprintRemoteProcessorData.kt
1 /*
2  *  Copyright © 2019 IBM.
3  *  Modifications Copyright © 2020 Bell Canada.
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  */
17
18 package org.onap.ccsdk.cds.blueprintsprocessor.core.api.data
19
20 import com.fasterxml.jackson.databind.JsonNode
21 import com.google.protobuf.ByteString
22 import java.util.Date
23
24 enum class StatusType {
25     SUCCESS, FAILURE
26 }
27
28 /* TODO: Group fields into another struct containing originatorId, requestId, subRequestId, correlationId generally go together */
29 // timeOuts are in seconds
30
31 data class RemoteIdentifier(
32     var blueprintName: String,
33     var blueprintVersion: String,
34     var blueprintUUID: String
35 )
36
37 data class RemoteScriptUploadBlueprintInput(
38     val remoteIdentifier: RemoteIdentifier? = null,
39     val requestId: String,
40     val subRequestId: String,
41     val originatorId: String,
42     val correlationId: String? = null,
43     val timeOut: Long = 30,
44     val archiveType: String = "CBA_ZIP",
45     val binData: ByteString
46 )
47
48 data class RemoteScriptUploadBlueprintOutput(
49     val requestId: String,
50     val subRequestId: String,
51     val status: StatusType = StatusType.SUCCESS,
52     val timestamp: Date = Date(),
53     val payload: JsonNode
54 )
55
56 data class RemoteScriptExecutionInput(
57     var originatorId: String,
58     var requestId: String,
59     var subRequestId: String,
60     var correlationId: String? = null,
61     var remoteIdentifier: RemoteIdentifier? = null,
62     var command: String,
63     var timeOut: Long = 30,
64     var properties: MutableMap<String, JsonNode> = hashMapOf()
65 )
66
67 data class RemoteScriptExecutionOutput(
68     var requestId: String,
69     var response: List<String>,
70     var status: StatusType = StatusType.SUCCESS,
71     var timestamp: Date = Date(),
72     var payload: JsonNode,
73     var errMsg: String?
74 )
75
76 data class PrepareRemoteEnvInput(
77     var originatorId: String,
78     var requestId: String,
79     var subRequestId: String,
80     var correlationId: String? = null,
81     var remoteIdentifier: RemoteIdentifier? = null,
82     var packages: JsonNode,
83     var timeOut: Long = 120,
84     var properties: MutableMap<String, JsonNode> = hashMapOf()
85 )