automation.proto 1.7 KB
Newer Older
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
//
// 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.

Ricard Vilalta's avatar
Ricard Vilalta committed
syntax = "proto3";
package automation;

import "context.proto";

service AutomationService {
  rpc ZtpGetDeviceRole(DeviceRoleId) returns (DeviceRole) {}
  rpc ZtpGetDeviceRolesByDeviceId(context.DeviceId) returns (DeviceRoleList) {}
  rpc ZtpAdd(DeviceRole) returns (DeviceRoleState) {}
  rpc ZtpUpdate(DeviceRole) returns (DeviceRoleState) {}
  rpc ZtpDelete(DeviceRole) returns (DeviceRoleState) {}
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
  rpc ZtpDeleteAll(Empty) returns (DeviceDeletionResult) {}
Ricard Vilalta's avatar
Ricard Vilalta committed
}

enum DeviceRoleType {
  NONE = 0;
  DEV_OPS = 1;
  DEV_CONF = 2;
  PIPELINE_CONF = 3;
}

message DeviceRoleId {
  context.Uuid devRoleId = 1;
  context.DeviceId devId = 2;
}

message DeviceRole {
  DeviceRoleId devRoleId = 1;
  DeviceRoleType devRoleType = 2;
}

message DeviceRoleList {
  repeated DeviceRole devRole = 1;
}

message DeviceRoleState {
  DeviceRoleId devRoleId = 1;
  ZtpDeviceState devRoleState = 2;
}

Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
message DeviceDeletionResult {
  repeated string deleted = 1;
Ricard Vilalta's avatar
Ricard Vilalta committed
}

Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
message Empty {}
Ricard Vilalta's avatar
Ricard Vilalta committed

Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
enum ZtpDeviceState {
  ZTP_DEV_STATE_UNDEFINED = 0;
  ZTP_DEV_STATE_CREATED  = 1;
  ZTP_DEV_STATE_UPDATED  = 2;
  ZTP_DEV_STATE_DELETED  = 3;
}