Interface SegmentRoutingService

  • All Known Implementing Classes:
    SegmentRoutingManager

    public interface SegmentRoutingService
    Segment Routing Service for REST API.
    • Method Detail

      • getTunnels

        List<Tunnel> getTunnels()
        Returns all tunnels.
        Returns:
        list of tunnels
      • createTunnel

        TunnelHandler.Result createTunnel​(Tunnel tunnel)
        Creates a tunnel.
        Parameters:
        tunnel - tunnel reference to create
        Returns:
        WRONG_PATH if the tunnel path is wrong, ID_EXISTS if the tunnel ID exists already, TUNNEL_EXISTS if the same tunnel exists, INTERNAL_ERROR if the tunnel creation failed internally, SUCCESS if the tunnel is created successfully
      • getPolicies

        List<Policy> getPolicies()
        Returns all policies.
        Returns:
        list of policy
      • getL2TunnelDescriptions

        Set<L2TunnelDescription> getL2TunnelDescriptions​(boolean pending)
        Returns the l2 tunnel descriptions.
        Parameters:
        pending - if true fetch pending pseudowires, else fetch installed
        Returns:
        set of l2 tunnel descriptions.
      • getL2Tunnels

        List<L2Tunnel> getL2Tunnels()
        Returns all l2 tunnels of pseudowires.
        Returns:
        list of l2 tunnels
      • getL2Policies

        List<L2TunnelPolicy> getL2Policies()
        Returns all l2 policie of pseudowires.
        Returns:
        list of l2 policies.
      • removePseudowire

        L2TunnelHandler.Result removePseudowire​(Integer pwId)
        Removes pseudowire.
        Parameters:
        pwId - The id of the pseudowire.
        Returns:
        SUCCESS if operation successful or a descriptive error otherwise.
      • addPseudowire

        L2TunnelHandler.Result addPseudowire​(L2TunnelDescription tunnel)
        Adds a Pseudowire to the system.
        Parameters:
        tunnel - The pseudowire tunnel.
        Returns:
        SUCCESS if operation is successful or a descriptive error otherwise.
      • addPseudowiresBulk

        @Deprecated
        L2TunnelHandler.Result addPseudowiresBulk​(List<DefaultL2TunnelDescription> l2TunnelDescriptions)
        Deprecated.
        onos-1.12 use addPseudowire instead
        Adds a set of pseudowires.
        Parameters:
        l2TunnelDescriptions - The pseudowires to add.
        Returns:
        SUCCESS if ALL pseudowires can be instantiated and are deployed, or a a descriptive error otherwise, without deploying any pseudowire.
      • createPolicy

        PolicyHandler.Result createPolicy​(Policy policy)
        Creates a policy.
        Parameters:
        policy - policy reference to create
        Returns:
        ID_EXISTS if the same policy ID exists, POLICY_EXISTS if the same policy exists, TUNNEL_NOT_FOUND if the tunnel does not exists, UNSUPPORTED_TYPE if the policy type is not supported, SUCCESS if the policy is created successfully.
      • removeTunnel

        TunnelHandler.Result removeTunnel​(Tunnel tunnel)
        Removes a tunnel.
        Parameters:
        tunnel - tunnel reference to remove
        Returns:
        TUNNEL_NOT_FOUND if the tunnel to remove does not exists, INTERNAL_ERROR if the tunnel creation failed internally, SUCCESS if the tunnel is created successfully.
      • removePolicy

        PolicyHandler.Result removePolicy​(Policy policy)
        Removes a policy.
        Parameters:
        policy - policy reference to remove
        Returns:
        POLICY_NOT_FOUND if the policy to remove does not exists, SUCCESS if it is removed successfully
      • rerouteNetwork

        void rerouteNetwork()
        Use current state of the network to repopulate forwarding rules.
      • getDeviceSubnetMap

        Map<org.onosproject.net.DeviceId,​Set<org.onlab.packet.IpPrefix>> getDeviceSubnetMap()
        Returns device-subnet mapping.
        Returns:
        device-subnet mapping
      • getCurrentEcmpSpg

        com.google.common.collect.ImmutableMap<org.onosproject.net.DeviceId,​EcmpShortestPathGraph> getCurrentEcmpSpg()
        Returns the current ECMP shortest path graph in this controller instance.
        Returns:
        ECMP shortest path graph
      • getDstNextObjStore

        com.google.common.collect.ImmutableMap<DestinationSetNextObjectiveStoreKey,​NextNeighbors> getDstNextObjStore()
        Returns the destinatiomSet-NextObjective store contents.
        Returns:
        current contents of the dstNextObjStore
      • getVlanNextObjStore

        com.google.common.collect.ImmutableMap<VlanNextObjectiveStoreKey,​Integer> getVlanNextObjStore()
        Returns the VLAN next objective store.
        Returns:
        current contents of the vlanNextObjStore
      • getMacVlanNextObjStore

        com.google.common.collect.ImmutableMap<MacVlanNextObjectiveStoreKey,​Integer> getMacVlanNextObjStore()
        Returns the Mac Vlan next objective store.
        Returns:
        current contents of the macVlanNextObjStore
      • getPortNextObjStore

        com.google.common.collect.ImmutableMap<PortNextObjectiveStoreKey,​Integer> getPortNextObjStore()
        Returns the port next objective store.
        Returns:
        current contents of the portNextObjStore
      • getMcastNextIds

        Map<McastStoreKey,​Integer> getMcastNextIds​(org.onlab.packet.IpAddress mcastIp)
        Returns the associated next ids to the mcast groups or to the single group if mcastIp is present.
        Parameters:
        mcastIp - the group ip
        Returns:
        the mapping mcastIp-device to next id
      • getPwInitNext

        com.google.common.collect.ImmutableMap<String,​org.onosproject.net.flowobjective.NextObjective> getPwInitNext()
        Returns the PW init next objective store.
        Returns:
        current contents of the l2InitiationNextObjStore
      • getPwTermNext

        com.google.common.collect.ImmutableMap<String,​org.onosproject.net.flowobjective.NextObjective> getPwTermNext()
        Returns the PW termination next objective store.
        Returns:
        current contents of the l2TerminationNextObjStore
      • invalidateNextObj

        void invalidateNextObj​(int nextId)
        Removes all entries in dst/vlan/port/mcast NextObjectiveStore that are associated with the given nextId.
        Parameters:
        nextId - nextId
      • verifyGroups

        void verifyGroups​(org.onosproject.net.DeviceId id)
        Triggers the verification of all ECMP groups in the specified device. Adjusts the group buckets if verification finds that there are more or less buckets than what should be there.
        Parameters:
        id - the device identifier
      • getSeenLinks

        com.google.common.collect.ImmutableMap<org.onosproject.net.Link,​Boolean> getSeenLinks()
        Returns the internal link state as seen by this instance of the controller.
        Returns:
        the internal link state
      • getDownedPortState

        com.google.common.collect.ImmutableMap<org.onosproject.net.DeviceId,​Set<org.onosproject.net.PortNumber>> getDownedPortState()
        Returns the ports administratively disabled by the controller.
        Returns:
        a map of devices and port numbers for administratively disabled ports. Does not include ports manually disabled by the operator.
      • getMcastRoles

        Map<McastRoleStoreKey,​McastRole> getMcastRoles​(org.onlab.packet.IpAddress mcastIp,
                                                             org.onosproject.net.ConnectPoint sourcecp)
        Returns the associated roles to the mcast groups.
        Parameters:
        mcastIp - the group ip
        sourcecp - the source connect point
        Returns:
        the mapping mcastIp-device to mcast role
      • getMcastTrees

        com.google.common.collect.Multimap<org.onosproject.net.ConnectPoint,​List<org.onosproject.net.ConnectPoint>> getMcastTrees​(org.onlab.packet.IpAddress mcastIp,
                                                                                                                                        org.onosproject.net.ConnectPoint sourcecp)
        Returns the associated trees to the mcast group.
        Parameters:
        mcastIp - the group ip
        sourcecp - the source connect point
        Returns:
        the mapping egress point to mcast path
      • getMcastLeaders

        Map<org.onlab.packet.IpAddress,​org.onosproject.cluster.NodeId> getMcastLeaders​(org.onlab.packet.IpAddress mcastIp)
        Return the leaders of the mcast groups.
        Parameters:
        mcastIp - the group ip
        Returns:
        the mapping group-node
      • getShouldProgram

        @Deprecated
        Map<Set<org.onosproject.net.DeviceId>,​org.onosproject.cluster.NodeId> getShouldProgram()
        Deprecated.
        in trellis-control-3.0.1
        Returns shouldProgram map.
        Returns:
        shouldProgram map
      • getShouldProgramCache

        @Deprecated
        Map<org.onosproject.net.DeviceId,​Boolean> getShouldProgramCache()
        Deprecated.
        in trellis-control-3.0.1
        Returns shouldProgram local cache.
        Returns:
        shouldProgram local cache
      • getShouldProgramLeaders

        Map<org.onosproject.net.DeviceId,​org.onosproject.cluster.NodeId> getShouldProgramLeaders()
        Returns shouldProgram leaders.
        Returns:
        shouldProgram mapping device to node
      • shouldProgram

        boolean shouldProgram​(org.onosproject.net.DeviceId deviceId)
        Determines whether this controller instance should program the given deviceId, based on work partition service and pairDeviceId if one exists.

        Once an instance is elected, it will be the only instance responsible for programming both devices in the pair until it goes down.

        Parameters:
        deviceId - device identifier to consider for routing
        Returns:
        true if current instance should handle the routing for given device
      • getMcastFilters

        Map<org.onosproject.net.DeviceId,​List<McastFilteringObjStoreKey>> getMcastFilters()
        Returns the mcast filtering obj.
        Returns:
        the mapping group-node
      • isRoutingStable

        boolean isRoutingStable()
        Determines if routing in the network has been stable in the last STABILITY_THRESHOLD seconds, by comparing the current time to the last routing change timestamp.
        Returns:
        true if stable
      • initHost

        void initHost​(org.onosproject.net.DeviceId deviceId)
        Invoke hostHandler.init() for given device.
        Parameters:
        deviceId - device ID
      • initRoute

        void initRoute​(org.onosproject.net.DeviceId deviceId)
        Invoke routeHandler.init() for given device.
        Parameters:
        deviceId - device ID
      • appId

        default org.onosproject.core.ApplicationId appId()
        Gets application id.
        Returns:
        application id
      • getInternalVlanId

        default org.onlab.packet.VlanId getInternalVlanId​(org.onosproject.net.ConnectPoint connectPoint)
        Returns internal VLAN for untagged hosts on given connect point.

        The internal VLAN is either vlan-untagged for an access port, or vlan-native for a trunk port.

        Parameters:
        connectPoint - connect point
        Returns:
        internal VLAN or null if both vlan-untagged and vlan-native are undefined
      • getPairDeviceId

        default Optional<org.onosproject.net.DeviceId> getPairDeviceId​(org.onosproject.net.DeviceId deviceId)
        Returns optional pair device ID of given device.
        Parameters:
        deviceId - device ID
        Returns:
        optional pair device ID. Might be empty if pair device is not configured
      • getPairLocalPort

        default Optional<org.onosproject.net.PortNumber> getPairLocalPort​(org.onosproject.net.DeviceId deviceId)
        Returns optional pair device local port of given device.
        Parameters:
        deviceId - device ID
        Returns:
        optional pair device ID. Might be empty if pair device is not configured
      • getInfraPorts

        default Set<org.onosproject.net.PortNumber> getInfraPorts​(org.onosproject.net.DeviceId deviceId)
        Returns a set of infrastructure ports on the given device.
        Parameters:
        deviceId - device ID
        Returns:
        a set of ports that does not have interface configuration
      • getEdgePorts

        default Set<org.onosproject.net.PortNumber> getEdgePorts​(org.onosproject.net.DeviceId deviceId)
        Returns a set of edge ports on the given device.
        Parameters:
        deviceId - device ID
        Returns:
        a set of ports that has interface configuration
      • getEdgeDeviceIds

        List<org.onosproject.net.DeviceId> getEdgeDeviceIds()
        Returns a list of edge devices.
        Returns:
        list of the edge device ids
      • getInfraDeviceIds

        List<org.onosproject.net.DeviceId> getInfraDeviceIds()
        Returns a list of infra devices.
        Returns:
        list of the infra device ids
      • getDeviceMacAddress

        org.onlab.packet.MacAddress getDeviceMacAddress​(org.onosproject.net.DeviceId deviceId)
                                                 throws org.onosproject.segmentrouting.config.DeviceConfigNotFoundException
        Returns the configured mac address of the device.
        Parameters:
        deviceId - the device id
        Returns:
        the configured mac address
        Throws:
        org.onosproject.segmentrouting.config.DeviceConfigNotFoundException - if config is not present
      • getDefaultInternalVlan

        org.onlab.packet.VlanId getDefaultInternalVlan()
        Returns the VlanId assigned internally by default to unconfigured ports.
        Returns:
        the default internal vlan id