blob: 0d64248516646b2ce7c59198f2cd70a620888b43 [file] [log] [blame]
Georgios Katsikas83600982017-05-28 20:41:45 +02001/*
2 * Copyright 2017-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.drivers.server.devices;
18
Georgios Katsikas2ebd8a02018-06-27 18:32:50 +020019import org.onosproject.drivers.server.devices.nic.NicDevice;
Georgios Katsikas83600982017-05-28 20:41:45 +020020import org.onosproject.protocol.rest.RestSBDevice;
21
22import java.util.Collection;
23
24/**
25 * Represents an abstraction of a REST server device in ONOS.
26 */
27public interface RestServerSBDevice extends RestSBDevice {
28 /**
29 * Returns the set of CPUs of the server.
30 *
31 * @return set of CPUs
32 */
33 Collection<CpuDevice> cpus();
34
35 /**
36 * Returns the number of CPUs of the server.
37 *
38 * @return number of CPUs
39 */
40 int numberOfCpus();
41
42 /**
43 * Returns the set of NICs of the server.
44 *
45 * @return set of NICs
46 */
47 Collection<NicDevice> nics();
48
49 /**
50 * Returns the number of NICs of the server.
51 *
52 * @return number of NICs
53 */
54 int numberOfNics();
55
Georgios Katsikas80e0b9f2018-07-21 20:29:18 +020056 /**
57 * Returns the port number of a specific NIC.
58 *
59 * @param portName name of the NIC
60 * @return NIC port number
61 */
62 long portNumberFromName(String portName);
63
64 /**
65 * Returns the port name of a specific NIC.
66 *
67 * @param portNumber NIC port number
68 * @return NIC name
69 */
70 String portNameFromNumber(long portNumber);
71
Georgios Katsikas83600982017-05-28 20:41:45 +020072}