use of org.onosproject.vpls.api.Vpls in project onos by opennetworkinglab.
the class VplsWebResource method deleteInterface.
/**
* Removes a specified interface.
*
* @param vplsName Vpls name
* @param interfaceName interface name
* @return 204 NO CONTENT
*/
@DELETE
@Path("interface/{vplsName}/{interfaceName}")
public Response deleteInterface(@PathParam("vplsName") String vplsName, @PathParam("interfaceName") String interfaceName) {
Vpls service = get(Vpls.class);
InterfaceAdminService interfaceService = get(InterfaceAdminService.class);
final VplsData vplsData = nullIsNotFound(service.getVpls(vplsName), VPLS_NOT_FOUND + vplsName);
vplsData.interfaces().forEach(anInterface -> {
if (anInterface.name().equals(interfaceName)) {
interfaceService.remove(anInterface.connectPoint(), anInterface.name());
service.removeInterface(vplsData, anInterface);
}
});
return Response.noContent().build();
}
use of org.onosproject.vpls.api.Vpls in project onos by opennetworkinglab.
the class VplsWebResource method getVpls.
/**
* Gets Vpls. Returns a Vpls by vplsName.
* @param vplsName vpls name
* @return 200 OK with a vpls, return 404 if no entry has been found
* @onos.rsModel Vpls
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("{vplsName}")
public Response getVpls(@PathParam("vplsName") String vplsName) {
ArrayNode vplsNode = root.putArray(VPLS);
Vpls service = get(Vpls.class);
final VplsData vplsData = nullIsNotFound(service.getVpls(vplsName), VPLS_NOT_FOUND + vplsName);
vplsNode.add(codec(VplsData.class).encode(vplsData, this));
return ok(root).build();
}
use of org.onosproject.vpls.api.Vpls in project onos by opennetworkinglab.
the class VplsWebResource method deleteVpls.
/**
* Removes the specified vpls.
*
* @param vplsName Vpls name
* @return 204 NO CONTENT
*/
@DELETE
@Path("{vplsName}")
public Response deleteVpls(@PathParam("vplsName") String vplsName) {
Vpls service = get(Vpls.class);
final VplsData vplsData = nullIsNotFound(service.getVpls(vplsName), VPLS_NOT_FOUND + vplsName);
service.removeVpls(vplsData);
return Response.noContent().build();
}
Aggregations