Search in sources :

Example 1 with BasicRegionConfig

use of org.onosproject.net.config.basics.BasicRegionConfig 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();
}
Also used : NetworkConfigService(org.onosproject.net.config.NetworkConfigService) RegionId(org.onosproject.net.region.RegionId) BasicRegionConfig(org.onosproject.net.config.basics.BasicRegionConfig)

Example 2 with BasicRegionConfig

use of org.onosproject.net.config.basics.BasicRegionConfig in project onos by opennetworkinglab.

the class RegionAddCommand method doExecute.

@Override
protected void doExecute() {
    RegionAdminService service = get(RegionAdminService.class);
    RegionId regionId = RegionId.regionId(id);
    NetworkConfigService cfgService = get(NetworkConfigService.class);
    BasicRegionConfig cfg = cfgService.addConfig(regionId, BasicRegionConfig.class);
    setConfigurationData(cfg);
    List<Set<NodeId>> masters = parseMasterArgs();
    service.createRegion(regionId, name, REGION_TYPE_MAP.get(type), masters);
    print("Region successfully added.");
}
Also used : RegionAdminService(org.onosproject.net.region.RegionAdminService) Set(java.util.Set) NetworkConfigService(org.onosproject.net.config.NetworkConfigService) RegionId(org.onosproject.net.region.RegionId) BasicRegionConfig(org.onosproject.net.config.basics.BasicRegionConfig)

Aggregations

NetworkConfigService (org.onosproject.net.config.NetworkConfigService)2 BasicRegionConfig (org.onosproject.net.config.basics.BasicRegionConfig)2 RegionId (org.onosproject.net.region.RegionId)2 Set (java.util.Set)1 RegionAdminService (org.onosproject.net.region.RegionAdminService)1