blob: 2b39179874201e72d489327ed11a1fa71a8868a3 [file] [log] [blame]
Jian Li7b8c3682019-05-12 13:57:15 +09001/*
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 */
16package org.onosproject.openstacknetworking.api;
17
18import org.onlab.packet.IpAddress;
19
20/**
21 * Handles openstack mastership.
22 */
23public interface OpenstackHaService {
24
25 /**
26 * Indicates the active-standby status.
27 *
28 * @return true if the the node runs in active mode, false otherwise
29 */
30 boolean isActive();
31
32 /**
33 * Obtains the IP address of the active node.
34 *
35 * @return IP address of the active node
36 */
37 IpAddress getActiveIp();
38
39 /**
40 * Configures the IP address of the active node.
41 *
42 * @param ip IP address of the active node
43 */
44 void setActiveIp(IpAddress ip);
45
46 /**
47 * Configures the active status.
48 *
49 * @param flag true if the node runs in active mode, false otherwise
50 */
51 void setActive(boolean flag);
52}