Search in sources :

Example 31 with NetworkEndpoint

use of org.openkilda.messaging.model.NetworkEndpoint in project open-kilda by telstra.

the class LinkPropsMapper method toLinkMaxBandwidth.

/**
 * Converts {@link LinkPropsDto} to {@link LinkMaxBandwidthDto}.
 */
default LinkMaxBandwidthDto toLinkMaxBandwidth(LinkPropsDto input) {
    NetworkEndpoint source = input.getSource();
    NetworkEndpoint dest = input.getDest();
    Long maxBandwidth = Long.valueOf(input.getProps().get(LinkProps.MAX_BANDWIDTH_PROP_NAME));
    return new LinkMaxBandwidthDto(source.getDatapath().toString(), source.getPortNumber(), dest.getDatapath().toString(), dest.getPortNumber(), maxBandwidth);
}
Also used : NetworkEndpoint(org.openkilda.messaging.model.NetworkEndpoint) LinkMaxBandwidthDto(org.openkilda.northbound.dto.v1.links.LinkMaxBandwidthDto)

Example 32 with NetworkEndpoint

use of org.openkilda.messaging.model.NetworkEndpoint in project open-kilda by telstra.

the class BfdPropertyApplyException method formatErrorMessage.

private static String formatErrorMessage(BfdPropertiesResponse properties) {
    NetworkEndpoint source = properties.getSource();
    NetworkEndpoint destination = properties.getDestination();
    return String.format("Unable to apply BFD properties %s on %s_%s <===> %s_%s " + "(effective source: %s, effective destination: %s", properties.getGoal(), source.getDatapath(), source.getPortNumber(), destination.getDatapath(), destination.getPortNumber(), properties.getEffectiveSource(), properties.getEffectiveDestination());
}
Also used : NetworkEndpoint(org.openkilda.messaging.model.NetworkEndpoint)

Aggregations

NetworkEndpoint (org.openkilda.messaging.model.NetworkEndpoint)32 SwitchId (org.openkilda.model.SwitchId)16 Test (org.junit.Test)14 Ping (org.openkilda.messaging.model.Ping)7 CommandMessage (org.openkilda.messaging.command.CommandMessage)5 InfoMessage (org.openkilda.messaging.info.InfoMessage)5 LinkPropsDto (org.openkilda.messaging.model.LinkPropsDto)5 LinkPropsResponse (org.openkilda.messaging.nbtopology.response.LinkPropsResponse)5 FlowTransitEncapsulation (org.openkilda.model.FlowTransitEncapsulation)5 ApiOperation (io.swagger.annotations.ApiOperation)4 HashMap (java.util.HashMap)4 MessageException (org.openkilda.messaging.error.MessageException)4 LinkPropsPut (org.openkilda.messaging.nbtopology.request.LinkPropsPut)4 LinkPropsDto (org.openkilda.northbound.dto.v1.links.LinkPropsDto)4 Ethernet (net.floodlightcontroller.packet.Ethernet)3 IPacket (net.floodlightcontroller.packet.IPacket)3 InputService (org.openkilda.floodlight.service.of.InputService)3 DatapathId (org.projectfloodlight.openflow.types.DatapathId)3 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)3 Date (java.util.Date)2