blob: 77873aa8a6317bb6263a3cba6f1a513c52e29789 [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 Katsikas13ccba62020-03-18 12:05:03 +010019import org.onosproject.drivers.server.devices.cpu.CpuCacheHierarchyDevice;
20import org.onosproject.drivers.server.devices.cpu.CpuDevice;
21import org.onosproject.drivers.server.devices.memory.MemoryHierarchyDevice;
Georgios Katsikas2ebd8a02018-06-27 18:32:50 +020022import org.onosproject.drivers.server.devices.nic.NicDevice;
Georgios Katsikas83600982017-05-28 20:41:45 +020023import org.onosproject.protocol.rest.RestSBDevice;
24
25import java.util.Collection;
26
27/**
Georgios Katsikas13ccba62020-03-18 12:05:03 +010028 * Represents an abstraction of a REST server device.
Georgios Katsikas83600982017-05-28 20:41:45 +020029 */
30public interface RestServerSBDevice extends RestSBDevice {
Georgios Katsikas13ccba62020-03-18 12:05:03 +010031
Georgios Katsikas83600982017-05-28 20:41:45 +020032 /**
33 * Returns the set of CPUs of the server.
34 *
35 * @return set of CPUs
36 */
37 Collection<CpuDevice> cpus();
38
39 /**
40 * Returns the number of CPUs of the server.
41 *
42 * @return number of CPUs
43 */
44 int numberOfCpus();
45
46 /**
Georgios Katsikas13ccba62020-03-18 12:05:03 +010047 * Returns the CPU cache hierarchy of the server.
48 *
49 * @return CPU cache hierarchy
50 */
51 CpuCacheHierarchyDevice caches();
52
53 /**
54 * Returns the number of CPU caches of the server.
55 *
56 * @return number of CPU caches
57 */
58 int numberOfCaches();
59
60 /**
61 * Returns the capacity of the CPU caches of the server.
62 *
63 * @return total CPU cache capacity
64 */
65 long cacheCapacity();
66
67 /**
68 * Returns the main memory hierarchy of the server.
69 *
70 * @return main memory hierarchy
71 */
72 MemoryHierarchyDevice memory();
73
74 /**
75 * Returns the capacity of the server's main memory.
76 *
77 * @return total main memory capacity
78 */
79 long memoryCapacity();
80
81 /**
Georgios Katsikas83600982017-05-28 20:41:45 +020082 * Returns the set of NICs of the server.
83 *
84 * @return set of NICs
85 */
86 Collection<NicDevice> nics();
87
88 /**
89 * Returns the number of NICs of the server.
90 *
91 * @return number of NICs
92 */
93 int numberOfNics();
94
Georgios Katsikas80e0b9f2018-07-21 20:29:18 +020095 /**
96 * Returns the port number of a specific NIC.
97 *
98 * @param portName name of the NIC
99 * @return NIC port number
100 */
101 long portNumberFromName(String portName);
102
103 /**
104 * Returns the port name of a specific NIC.
105 *
106 * @param portNumber NIC port number
107 * @return NIC name
108 */
109 String portNameFromNumber(long portNumber);
110
Georgios Katsikas83600982017-05-28 20:41:45 +0200111}