Search in sources :

Example 1 with XconnectService

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);
}
Also used : XconnectService(org.onosproject.segmentrouting.xconnect.api.XconnectService) DeviceId(org.onosproject.net.DeviceId) XconnectEndpoint(org.onosproject.segmentrouting.xconnect.api.XconnectEndpoint) VlanId(org.onlab.packet.VlanId)

Example 2 with XconnectService

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);
}
Also used : XconnectService(org.onosproject.segmentrouting.xconnect.api.XconnectService) DeviceId(org.onosproject.net.DeviceId) VlanId(org.onlab.packet.VlanId)

Example 3 with XconnectService

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();
}
Also used : XconnectService(org.onosproject.segmentrouting.xconnect.api.XconnectService) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) XconnectDesc(org.onosproject.segmentrouting.xconnect.api.XconnectDesc) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) DELETE(javax.ws.rs.DELETE) Consumes(javax.ws.rs.Consumes)

Example 4 with XconnectService

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));
}
Also used : XconnectService(org.onosproject.segmentrouting.xconnect.api.XconnectService)

Example 5 with XconnectService

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());
}
Also used : XconnectService(org.onosproject.segmentrouting.xconnect.api.XconnectService)

Aggregations

XconnectService (org.onosproject.segmentrouting.xconnect.api.XconnectService)7 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)3 XconnectDesc (org.onosproject.segmentrouting.xconnect.api.XconnectDesc)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 Consumes (javax.ws.rs.Consumes)2 VlanId (org.onlab.packet.VlanId)2 DeviceId (org.onosproject.net.DeviceId)2 DELETE (javax.ws.rs.DELETE)1 GET (javax.ws.rs.GET)1 POST (javax.ws.rs.POST)1 Produces (javax.ws.rs.Produces)1 XconnectEndpoint (org.onosproject.segmentrouting.xconnect.api.XconnectEndpoint)1