blob: 277d0c318eee366545953c42befbad1171f9f7c0 [file] [log] [blame]
oleksandr.yashchuk@plvision.eu3dbcaaf2019-03-13 14:44:46 +02001/*
2 * Copyright 2019-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.gnoi.api;
18
19import gnoi.system.SystemOuterClass.TimeResponse;
20import gnoi.system.SystemOuterClass.RebootRequest;
21import gnoi.system.SystemOuterClass.RebootResponse;
Serhii Boiko992bf522019-03-28 18:38:04 +020022import gnoi.system.SystemOuterClass.SetPackageRequest;
23import gnoi.system.SystemOuterClass.SetPackageResponse;
24import gnoi.system.SystemOuterClass.SwitchControlProcessorRequest;
25import gnoi.system.SystemOuterClass.SwitchControlProcessorResponse;
oleksandr.yashchuk@plvision.eu3dbcaaf2019-03-13 14:44:46 +020026import com.google.common.annotations.Beta;
27import org.onosproject.grpc.api.GrpcClient;
28import java.util.concurrent.CompletableFuture;
Serhii Boiko992bf522019-03-28 18:38:04 +020029import java.util.concurrent.SynchronousQueue;
oleksandr.yashchuk@plvision.eu3dbcaaf2019-03-13 14:44:46 +020030
31/**
32 * Client to control a gNOI server.
33 */
34@Beta
35public interface GnoiClient extends GrpcClient {
36
37 /**
38 * Returns the current time on the target.
39 *
40 * @return the TimeResponse result
41 */
42 CompletableFuture<TimeResponse> time();
43
44 /**
45 * Causes the target to reboot immediately.
46 *
47 * @param request RebootRequest
48 * @return the RebootResponse result
49 */
50 CompletableFuture<RebootResponse> reboot(RebootRequest request);
Serhii Boiko992bf522019-03-28 18:38:04 +020051
52 /**
53 * Executes a SetPackage RPC for the given list
54 * of SetPackageRequest messages.
55 *
56 * @param stream list of SetPackageRequests.
57 * @return SetPackageResponse from device.
58 */
59 CompletableFuture<SetPackageResponse> setPackage(SynchronousQueue<SetPackageRequest> stream);
60
61 /**
62 * Executes a SwitchControlProcessor RPC given the path
63 * to the new software agent.
64 *
65 * @param request SwitchControlProcessorRequest
66 * @return SwitchControlProcessorResponse from device.
67 */
68 CompletableFuture<SwitchControlProcessorResponse> switchControlProcessor(SwitchControlProcessorRequest request);
69
oleksandr.yashchuk@plvision.eu3dbcaaf2019-03-13 14:44:46 +020070}