Improve Remote Python Executor error handling and allow for structured response
[ccsdk/cds.git] / components / model-catalog / proto-definition / proto / CommandExecutor.proto
1 syntax = "proto3";
2 import "google/protobuf/struct.proto";
3 import "google/protobuf/timestamp.proto";
4 option java_multiple_files = true;
5 package org.onap.ccsdk.cds.controllerblueprints.command.api;
6
7 message ExecutionInput {
8     string requestId = 1;
9     // Optional Id used to correlate multiple requests so that it can identify previous request information.
10     string correlationId = 2;
11     // Optional Blueprint Information used to identify CBA content information in shared file structure environment.
12     Identifiers identifiers = 3;
13     // Actual Command to Execute in Scripting Environment
14     string command = 4;
15     int32 timeOut = 5;
16     // Extra Dynamic Properties for Command processing in JSON format
17     google.protobuf.Struct properties = 6;
18     // Request Time Stamp
19     google.protobuf.Timestamp timestamp = 7;
20 }
21
22 message PrepareEnvInput {
23     Identifiers identifiers = 1;
24     string requestId = 2;
25     // Optional Id used to correlate multiple requests so that it can identify previous request information.
26     string correlationId = 3;
27     repeated Packages packages = 4;
28     int32 timeOut = 5;
29     google.protobuf.Struct properties = 6;
30     google.protobuf.Timestamp timestamp = 7;
31 }
32
33 message Identifiers {
34     string blueprintName = 1;
35     string blueprintVersion = 2;
36 }
37
38 message ExecutionOutput {
39     string requestId = 1;
40     repeated string response = 2;
41     ResponseStatus status = 3;
42     google.protobuf.Timestamp timestamp = 4;
43     string payload = 5;
44 }
45
46 enum ResponseStatus {
47     SUCCESS = 0;
48     FAILURE = 1;
49 }
50
51 message Packages {
52     PackageType type = 1;
53     repeated string package = 2;
54 }
55
56 enum PackageType {
57     pip = 0;
58     ansible_galaxy = 1;
59     utilities = 2;
60 }
61
62 service CommandExecutorService {
63     rpc prepareEnv (PrepareEnvInput) returns (ExecutionOutput);
64     rpc executeCommand (ExecutionInput) returns (ExecutionOutput);
65 }