Skip to content

Commit 3afd4f6

Browse files
authored
Merge pull request astarte-platform#45 from Annopaolo/trigger_policy_protobuf
Add trigger policy
2 parents 4a321a2 + 6ba13cd commit 3afd4f6

10 files changed

+159
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- Add support for trigger delivery policy.
810

911
## [1.0.3] - 2022-07-04
1012

lib/astarte_rpc/protocol/proto/realm_management/call.proto

+9
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ import "get_trigger.proto";
3131
import "get_triggers_list.proto";
3232
import "delete_trigger.proto";
3333
import "get_health.proto";
34+
import "install_trigger_policy.proto";
35+
import "delete_trigger_policy.proto";
36+
import "get_trigger_policies_list.proto";
37+
import "get_trigger_policy_source.proto";
38+
3439

3540
message Call {
3641
int32 version = 1;
@@ -49,5 +54,9 @@ message Call {
4954
GetTriggersList get_triggers_list = 12;
5055
DeleteTrigger delete_trigger = 13;
5156
GetHealth get_health = 14;
57+
InstallTriggerPolicy install_trigger_policy = 15;
58+
DeleteTriggerPolicy delete_trigger_policy = 16;
59+
GetTriggerPoliciesList get_trigger_policies_list = 17;
60+
GetTriggerPolicySource get_trigger_policy_source = 18;
5261
}
5362
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// This file is part of Astarte.
3+
//
4+
// Copyright 2022 SECO Mind Srl
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
19+
syntax = "proto3";
20+
21+
message DeleteTriggerPolicy {
22+
string realm_name = 1;
23+
string trigger_policy_name = 2;
24+
bool async_operation = 3;
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// This file is part of Astarte.
3+
//
4+
// Copyright 2022 SECO Mind Srl
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
19+
syntax = "proto3";
20+
21+
message GetTriggerPoliciesList {
22+
string realm_name = 1;
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// This file is part of Astarte.
3+
//
4+
// Copyright 2022 SECO Mind Srl
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
19+
syntax = "proto3";
20+
21+
message GetTriggerPoliciesListReply {
22+
repeated string trigger_policies_names = 1;
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// This file is part of Astarte.
3+
//
4+
// Copyright 2022 SECO Mind Srl
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
19+
syntax = "proto3";
20+
21+
message GetTriggerPolicySource {
22+
string realm_name = 1;
23+
string trigger_policy_name = 2;
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// This file is part of Astarte.
3+
//
4+
// Copyright 2022 SECO Mind Srl
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
19+
syntax = "proto3";
20+
21+
message GetTriggerPolicySourceReply {
22+
string source = 1;
23+
}

lib/astarte_rpc/protocol/proto/realm_management/install_trigger.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ message InstallTrigger {
2222
string realm_name = 1;
2323
string trigger_name = 2;
2424
bytes action = 3;
25-
2625
repeated bytes serialized_tagged_simple_triggers = 4;
26+
string trigger_policy = 5;
2727
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// This file is part of Astarte.
3+
//
4+
// Copyright 2022 SECO Mind Srl
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
19+
syntax = "proto3";
20+
21+
message InstallTriggerPolicy {
22+
string realm_name = 1;
23+
string trigger_policy_json = 2;
24+
bool async_operation = 3;
25+
}

lib/astarte_rpc/protocol/proto/realm_management/reply.proto

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import "get_jwt_public_key_pem_reply.proto";
2727
import "get_trigger_reply.proto";
2828
import "get_triggers_list_reply.proto";
2929
import "get_health_reply.proto";
30+
import "get_trigger_policies_list_reply.proto";
31+
import "get_trigger_policy_source_reply.proto";
3032

3133

3234
message Reply {
@@ -43,5 +45,7 @@ message Reply {
4345
GetTriggerReply get_trigger_reply = 9;
4446
GetTriggersListReply get_triggers_list_reply = 10;
4547
GetHealthReply get_health_reply = 11;
48+
GetTriggerPoliciesListReply get_trigger_policies_list_reply = 12;
49+
GetTriggerPolicySourceReply get_trigger_policy_source_reply = 13;
4650
}
4751
}

0 commit comments

Comments
 (0)