Skip to content

Add trigger policy #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Add support for trigger delivery policy.

## [1.0.3] - 2022-07-04

Expand Down
9 changes: 9 additions & 0 deletions lib/astarte_rpc/protocol/proto/realm_management/call.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ import "get_trigger.proto";
import "get_triggers_list.proto";
import "delete_trigger.proto";
import "get_health.proto";
import "install_trigger_policy.proto";
import "delete_trigger_policy.proto";
import "get_trigger_policies_list.proto";
import "get_trigger_policy_source.proto";


message Call {
int32 version = 1;
Expand All @@ -49,5 +54,9 @@ message Call {
GetTriggersList get_triggers_list = 12;
DeleteTrigger delete_trigger = 13;
GetHealth get_health = 14;
InstallTriggerPolicy install_trigger_policy = 15;
DeleteTriggerPolicy delete_trigger_policy = 16;
GetTriggerPoliciesList get_trigger_policies_list = 17;
GetTriggerPolicySource get_trigger_policy_source = 18;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// This file is part of Astarte.
//
// Copyright 2022 SECO Mind Srl
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

message DeleteTriggerPolicy {
string realm_name = 1;
string trigger_policy_name = 2;
bool async_operation = 3;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// This file is part of Astarte.
//
// Copyright 2022 SECO Mind Srl
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

message GetTriggerPoliciesList {
string realm_name = 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// This file is part of Astarte.
//
// Copyright 2022 SECO Mind Srl
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

message GetTriggerPoliciesListReply {
repeated string trigger_policies_names = 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// This file is part of Astarte.
//
// Copyright 2022 SECO Mind Srl
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

message GetTriggerPolicySource {
string realm_name = 1;
string trigger_policy_name = 2;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// This file is part of Astarte.
//
// Copyright 2022 SECO Mind Srl
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

message GetTriggerPolicySourceReply {
string source = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ message InstallTrigger {
string realm_name = 1;
string trigger_name = 2;
bytes action = 3;

repeated bytes serialized_tagged_simple_triggers = 4;
string trigger_policy = 5;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// This file is part of Astarte.
//
// Copyright 2022 SECO Mind Srl
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

message InstallTriggerPolicy {
string realm_name = 1;
string trigger_policy_json = 2;
bool async_operation = 3;
}
4 changes: 4 additions & 0 deletions lib/astarte_rpc/protocol/proto/realm_management/reply.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import "get_jwt_public_key_pem_reply.proto";
import "get_trigger_reply.proto";
import "get_triggers_list_reply.proto";
import "get_health_reply.proto";
import "get_trigger_policies_list_reply.proto";
import "get_trigger_policy_source_reply.proto";


message Reply {
Expand All @@ -43,5 +45,7 @@ message Reply {
GetTriggerReply get_trigger_reply = 9;
GetTriggersListReply get_triggers_list_reply = 10;
GetHealthReply get_health_reply = 11;
GetTriggerPoliciesListReply get_trigger_policies_list_reply = 12;
GetTriggerPolicySourceReply get_trigger_policy_source_reply = 13;
}
}