use of org.onosproject.segmentrouting.xconnect.api.XconnectService in project trellis-control by opennetworkinglab.
the class XconnectAddCommand method doExecute.
@Override
protected void doExecute() {
DeviceId deviceId = DeviceId.deviceId(deviceIdStr);
VlanId vlanId = VlanId.vlanId(vlanIdStr);
XconnectEndpoint ep1 = XconnectEndpoint.fromString(ep1Str);
XconnectEndpoint ep2 = XconnectEndpoint.fromString(ep2Str);
Set<XconnectEndpoint> endpoints = Sets.newHashSet(ep1, ep2);
XconnectService xconnectService = get(XconnectService.class);
xconnectService.addOrUpdateXconnect(deviceId, vlanId, endpoints);
}
use of org.onosproject.segmentrouting.xconnect.api.XconnectService in project trellis-control by opennetworkinglab.
the class XconnectRemoveCommand method doExecute.
@Override
protected void doExecute() {
DeviceId deviceId = DeviceId.deviceId(deviceIdStr);
VlanId vlanId = VlanId.vlanId(vlanIdStr);
XconnectService xconnectService = get(XconnectService.class);
xconnectService.removeXonnect(deviceId, vlanId);
}
use of org.onosproject.segmentrouting.xconnect.api.XconnectService in project trellis-control by opennetworkinglab.
the class XconnectWebResource method removeXconnect.
/**
* Delete an existing Xconnect.
*
* @param input JSON stream for xconnect to remove
* @return 204 NO CONTENT
* @throws IOException Throws IO exception
* @onos.rsModel XconnectDelete
*/
@DELETE
@Consumes(MediaType.APPLICATION_JSON)
public Response removeXconnect(InputStream input) throws IOException {
ObjectMapper mapper = new ObjectMapper();
ObjectNode json = readTreeFromStream(mapper, input);
XconnectDesc desc = codec(XconnectDesc.class).decode(json, this);
XconnectService xconnectService = get(XconnectService.class);
xconnectService.removeXonnect(desc.key().deviceId(), desc.key().vlanId());
return Response.noContent().build();
}
use of org.onosproject.segmentrouting.xconnect.api.XconnectService in project trellis-control by opennetworkinglab.
the class XconnectListCommand method doExecute.
@Override
protected void doExecute() {
XconnectService xconnectService = get(XconnectService.class);
xconnectService.getXconnects().forEach(desc -> print("%s", desc));
}
use of org.onosproject.segmentrouting.xconnect.api.XconnectService in project trellis-control by opennetworkinglab.
the class XconnectNextListCommand method doExecute.
@Override
protected void doExecute() {
XconnectService xconnectService = AbstractShellCommand.get(XconnectService.class);
print(xconnectService.getNext());
}
Aggregations