use of org.onosproject.net.region.RegionId in project onos by opennetworkinglab.
the class RegionsWebResource method getRegionById.
/**
* Returns the region with the specified identifier.
*
* @param regionId region identifier
* @return 200 OK with a region, 404 not found
* @onos.rsModel Region
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("{regionId}")
public Response getRegionById(@PathParam("regionId") String regionId) {
final RegionId rid = RegionId.regionId(regionId);
final Region region = nullIsNotFound(regionService.getRegion(rid), REGION_NOT_FOUND + rid.toString());
return ok(codec(Region.class).encode(region, this)).build();
}
use of org.onosproject.net.region.RegionId in project onos by opennetworkinglab.
the class RegionRemoveCommand method doExecute.
@Override
protected void doExecute() {
RegionAdminService service = get(RegionAdminService.class);
RegionId regionId = RegionId.regionId(id);
service.removeRegion(regionId);
print("Region with id %s is successfully removed.", regionId);
}
use of org.onosproject.net.region.RegionId in project onos by opennetworkinglab.
the class RegionRemoveDevicesCommand method doExecute.
@Override
protected void doExecute() {
RegionAdminService service = get(RegionAdminService.class);
RegionId regionId = RegionId.regionId(id);
List<DeviceId> dids = devIds.stream().map(s -> DeviceId.deviceId(s)).collect(Collectors.toList());
service.removeDevices(regionId, dids);
}
use of org.onosproject.net.region.RegionId in project onos by opennetworkinglab.
the class RegionAddPeerLocCommand method doExecute.
@Override
protected void doExecute() {
RegionId regionId = RegionId.regionId(id);
NetworkConfigService cfgService = get(NetworkConfigService.class);
BasicRegionConfig cfg = cfgService.getConfig(regionId, BasicRegionConfig.class);
cfg.addPeerLocMapping(peerId, locType, latOrY, longOrX).apply();
}
use of org.onosproject.net.region.RegionId in project onos by opennetworkinglab.
the class ModelCache method addOrUpdateRegion.
// invoked from UiSharedTopologyModel region listener
void addOrUpdateRegion(Region region) {
RegionId id = region.id();
String memo = MEMO_UPDATED;
UiRegion uiRegion = uiTopology.findRegion(id);
if (uiRegion == null) {
uiRegion = addNewRegion(region);
memo = MEMO_ADDED;
}
updateRegion(uiRegion);
postEvent(REGION_ADDED_OR_UPDATED, uiRegion, memo);
}
Aggregations