@Path(value="mastership")
public final class MastershipWebResource
extends org.onosproject.rest.AbstractWebResource
| Constructor and Description |
|---|
MastershipWebResource() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
balanceRoles()
Balances the mastership to be shared as evenly as possibly by all
online instances.
|
javax.ws.rs.core.Response |
getDeviceOf(String nodeId)
Returns the devices for which a controller is master.
|
javax.ws.rs.core.Response |
getLocalRole(String deviceId)
Returns the role of the local node for the specified device.
|
javax.ws.rs.core.Response |
getMasterFor(String deviceId)
Returns the current master for a given device.
|
javax.ws.rs.core.Response |
getNodesFor(String deviceId)
Returns controllers connected to a given device, in order of
preference.
|
javax.ws.rs.core.Response |
relinquishMastership(String deviceId)
Abandons mastership of the specified device on the local node thus
forcing selection of a new master.
|
javax.ws.rs.core.Response |
requestRoleFor(String deviceId)
Returns the mastership status of the local controller for a given
device forcing master selection if necessary.
|
javax.ws.rs.core.Response |
setRole(InputStream stream)
Applies the current mastership role for the specified device.
|
codec, encodeArray, getService, mapper, newArray, newObject@GET
@Produces(value="application/json")
@Path(value="{deviceId}/local")
public javax.ws.rs.core.Response getLocalRole(@PathParam(value="deviceId")
String deviceId)
deviceId - device identifier@GET
@Produces(value="application/json")
@Path(value="{deviceId}/master")
public javax.ws.rs.core.Response getMasterFor(@PathParam(value="deviceId")
String deviceId)
deviceId - device identifier@GET
@Produces(value="application/json")
@Path(value="{deviceId}/role")
public javax.ws.rs.core.Response getNodesFor(@PathParam(value="deviceId")
String deviceId)
deviceId - device identifier@GET
@Produces(value="application/json")
@Path(value="{nodeId}/device")
public javax.ws.rs.core.Response getDeviceOf(@PathParam(value="nodeId")
String nodeId)
nodeId - controller identifier@GET
@Produces(value="application/json")
@Path(value="{deviceId}/request")
public javax.ws.rs.core.Response requestRoleFor(@PathParam(value="deviceId")
String deviceId)
deviceId - device identifier@GET
@Produces(value="application/json")
@Path(value="{deviceId}/relinquish")
public javax.ws.rs.core.Response relinquishMastership(@PathParam(value="deviceId")
String deviceId)
deviceId - device identifier@PUT @Consumes(value="application/json") public javax.ws.rs.core.Response setRole(InputStream stream)
stream - JSON representation of device, node, mastership info@GET @Produces(value="application/json") public javax.ws.rs.core.Response balanceRoles()