| /* |
| * Copyright 2017-present Open Networking Foundation |
| * |
| * 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"; |
| option java_package = "org.onosproject.grpc.nb.mastership"; |
| |
| package nb.mastership; |
| |
| import "net/MastershipRoleProto.proto"; |
| import "cluster/RoleInfoProto.proto"; |
| import "cluster/NodeIdProto.proto"; |
| |
| message getLocalRoleRequest { |
| string device_id = 1; |
| } |
| |
| message getLocalRoleReply { |
| .net.MastershipRoleProto mastership_role = 1; |
| } |
| |
| message isLocalMasterRequest { |
| string device_id = 1; |
| } |
| |
| message isLocalMasterReply { |
| bool is_local_master = 1; |
| } |
| |
| message requestRoleForSyncRequest { |
| string device_id = 1; |
| } |
| |
| message requestRoleForSyncReply { |
| .net.MastershipRoleProto mastership_role = 1; |
| } |
| |
| message relinquishMastershipSyncRequest { |
| string device_id = 1; |
| } |
| |
| message relinquishMastershipSyncReply { |
| } |
| |
| message getMasterForRequest { |
| string device_id = 1; |
| } |
| |
| message getMasterForReply { |
| .cluster.NodeIdProto node_id = 1; |
| } |
| |
| message getNodesForRequest { |
| string device_id = 1; |
| } |
| |
| message getNodesForReply { |
| .cluster.RoleInfoProto role_info = 1; |
| } |
| |
| service MastershipService { |
| rpc getLocalRole(getLocalRoleRequest) returns (getLocalRoleReply) {} |
| rpc isLocalMaster(isLocalMasterRequest) returns (isLocalMasterReply) {} |
| rpc requestRoleForSync(requestRoleForSyncRequest) returns (requestRoleForSyncReply) {} |
| rpc relinquishMastershipSync(relinquishMastershipSyncRequest) returns (relinquishMastershipSyncReply) {} |
| rpc getMasterFor(getMasterForRequest) returns (getMasterForReply) {} |
| rpc getNodesFor(getNodesForRequest) returns (getNodesForReply) {} |
| } |