fd2d4f30597c1646a921dc226ee81041610bf167
[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 }
44
45 enum ResponseStatus {
46     SUCCESS = 0;
47     FAILURE = 1;
48 }
49
50 message Packages {
51     PackageType type = 1;
52     repeated string package = 2;
53 }
54
55 enum PackageType {
56     pip = 0;
57     ansible_galaxy = 1;
58 }
59
60 service CommandExecutorService {
61     rpc prepareEnv (PrepareEnvInput) returns (ExecutionOutput);
62     rpc executeCommand (ExecutionInput) returns (ExecutionOutput);
63 }