diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2DistributedStore.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2DistributedStore.java
index 4bee790..02ea103 100644
--- a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2DistributedStore.java
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2DistributedStore.java
@@ -43,6 +43,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.stream.Collectors;
 
+
 /**
  * SDX-L2 Store implementation backed by different distributed primitives.
  */
@@ -75,12 +76,15 @@
     private static String errorAddSdxL2CPSdx = "It is not possible to add %s " +
             "because the relative sdxl2 does not exist";
 
-    private static String errorGetSdxL2CPs = "It is not possible to list the sdxl2cps" +
+    private static String errorGetSdxL2CPs = "It is not possible to list the sdxl2cps " +
             "because sdxl2 %s does not exist";
 
     private static String errorRemoveSdxL2CP = "It is not possible to remove %s " +
             "because it does not exist";
 
+    private static String errorGetSdxL2CP = "It is not possible to retrieve %s " +
+            "because it does not exist";
+
     public void initForTest() {
 
         this.sdxL2s = Sets.newHashSet();
@@ -291,4 +295,23 @@
 
     }
 
+    /**
+     * Returns an SDX-L2 connection point in a SDX-L2.
+     *
+     * @param sdxl2cp the connection point name
+     * @return the relative SDXL2ConnectionPoint object
+     * @throws SdxL2Exception if SDX-L2 connection point does not exist
+     */
+    @Override
+    public SdxL2ConnectionPoint getSdxL2ConnectionPoint(String sdxl2cp) throws SdxL2Exception {
+        SdxL2ConnectionPoint sdxl2cpTemp = ImmutableSet.copyOf(sdxL2CPs.keySet()).parallelStream()
+                .filter(sdxl2cp_temp -> sdxl2cp_temp.name().equals(sdxl2cp)).findFirst().orElse(null);
+
+        if (sdxl2cpTemp == null) {
+            throw new SdxL2Exception(String.format(errorGetSdxL2CP, sdxl2cp));
+        }
+
+        return sdxl2cpTemp;
+    }
+
 }
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Manager.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Manager.java
index f73fb24..d59b909 100644
--- a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Manager.java
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Manager.java
@@ -25,6 +25,10 @@
 import org.apache.felix.scr.annotations.Deactivate;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.edge.EdgePortService;
+import org.onosproject.net.intent.IntentService;
+import org.onosproject.net.intent.Key;
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -52,16 +56,26 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
     protected CoreService coreService;
 
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected IntentService intentService;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected EdgePortService edgePortService;
+
     protected ApplicationId appId;
 
+    protected SdxL2MonitoringService monitoringManager;
+
     @Activate
     protected void activate(ComponentContext context) {
         appId = coreService.registerApplication(SDXL2_APP);
+        monitoringManager = new SdxL2MonitoringManager(appId, intentService, edgePortService);
         log.info("Started");
     }
 
     @Deactivate
     protected void deactivate() {
+        this.cleanSdxL2();
         log.info("Stopped");
     }
 
@@ -172,4 +186,54 @@
 
     }
 
+    /**
+     * Returns an SDX-L2 connection point in a SDX-L2.
+     *
+     * @param sdxl2cp SDX-L2 connection point name
+     * @return the relative SdxL2ConnectionPoint object
+     */
+    @Override
+    public SdxL2ConnectionPoint getSdxL2ConnectionPoint(String sdxl2cp) {
+        checkNotNull(sdxl2cp, "SdxL2ConnectionPoint name cannot be null");
+        try {
+            return this.sdxL2Store.getSdxL2ConnectionPoint(sdxl2cp);
+        } catch (SdxL2Exception e) {
+            log.info(e.getMessage());
+        }
+
+        return null;
+    }
+
+    /**
+     * Returns the state of the Intent that has been provided as input.
+     *
+     * @param intentKey key of the intent;
+     * @return the last state of the intent;
+     */
+    @Override
+    public SdxL2State getIntentState(Key intentKey) {
+        checkNotNull(intentKey, "Intent key cannot be null");
+        return this.monitoringManager.getIntentState(intentKey);
+    }
+
+    /**
+     * Returns the state of the EdgePort that has been provided as input.
+     *
+     * @param edgeport the connect point representing the edge port
+     * @return the last state of the edgeport;
+     */
+    @Override
+    public SdxL2State getEdgePortState(ConnectPoint edgeport) {
+        checkNotNull(edgeport, "Edge port cannot be null");
+        return this.monitoringManager.getEdgePortState(edgeport);
+    }
+
+    /**
+     * Cleans the state of the Application.
+     */
+    @Override
+    public void cleanSdxL2() {
+        this.monitoringManager.cleanup();
+    }
+
 }
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2MonitoringManager.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2MonitoringManager.java
new file mode 100644
index 0000000..734cbdc
--- /dev/null
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2MonitoringManager.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.sdxl2;
+
+
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.edge.EdgePortEvent;
+import org.onosproject.net.edge.EdgePortListener;
+import org.onosproject.net.edge.EdgePortService;
+import org.onosproject.net.intent.IntentEvent;
+import org.onosproject.net.intent.IntentListener;
+import org.onosproject.net.intent.IntentService;
+import org.onosproject.net.intent.IntentState;
+import org.onosproject.net.intent.Intent;
+import org.onosproject.net.intent.Key;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Iterator;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+/**
+ * Implementation of the SdxL2MonitoringService.
+ */
+public class SdxL2MonitoringManager implements SdxL2MonitoringService {
+
+    private static Logger log = LoggerFactory.getLogger(SdxL2MonitoringManager.class);
+    protected ApplicationId appId;
+    private final IntentService intentService;
+    private final EdgePortService edgePortService;
+
+    /**
+     * It is a local cache for the Intents' events.
+     */
+    private ConcurrentMap<Key, IntentEvent> intentsState;
+    /**
+     * Last time intentsState has been updated.
+     */
+    private long lastIntentUpdate;
+
+    /**
+     * It is a local cache for the edge ports related events.
+     */
+    private ConcurrentMap<ConnectPoint, EdgePortEvent> edgeportsState;
+    /**
+     * Last time edgeportsState has been updated.
+     */
+    private long lastEdgePortUpdate;
+
+    // A kind of timeout which causes a manual update.
+    private static int deltaUpdate = 60000;
+
+    private InternalIntentListener intentListener;
+    private InternalEdgePortListener edgePortListener;
+
+    /**
+     * Creates an SdxL2MonitoringManager.
+     *
+     * @param sdxl2id application id.
+     * @param intentService reference to the Intent service.
+     * @param edgePortService reference to the EdgePort service.
+     */
+    public SdxL2MonitoringManager(ApplicationId sdxl2id, IntentService intentService, EdgePortService edgePortService) {
+
+        this.appId = sdxl2id;
+        this.intentListener = new InternalIntentListener();
+        this.edgePortListener = new InternalEdgePortListener();
+        this.intentService = intentService;
+        this.edgePortService = edgePortService;
+
+        this.intentService.addListener(this.intentListener);
+        this.edgePortService.addListener(this.edgePortListener);
+
+        this.intentsState = new ConcurrentHashMap<>();
+        this.edgeportsState = new ConcurrentHashMap<>();
+
+        this.lastEdgePortUpdate = 0;
+        this.lastIntentUpdate = 0;
+
+        log.info("Started");
+
+    }
+
+    /**
+     * Remove listeners.
+     */
+    public void cleanup() {
+        this.intentService.removeListener(intentListener);
+        this.edgePortService.removeListener(edgePortListener);
+    }
+
+    /**
+     * Returns the state of the Intent that has been provided as input.
+     *
+     * @param intentKey key of the intent;
+     * @return the last state of the intent;
+     */
+    @Override
+    public SdxL2State getIntentState(Key intentKey) {
+        synchronized (intentsState) {
+            IntentEvent event = this.intentsState.get(intentKey);
+            long ts = System.currentTimeMillis();
+            if (event == null || (ts > lastIntentUpdate && ts - lastIntentUpdate > deltaUpdate)) {
+                Intent intent = this.intentService.getIntent(intentKey);
+                IntentState intentState = this.intentService.getIntentState(intentKey);
+                event = IntentEvent.getEvent(intentState, intent).get();
+                intentsState.put(intentKey, event);
+                this.lastIntentUpdate = ts;
+            }
+            return this.getSdxL2State(event.type());
+        }
+    }
+
+    /**
+     * Updates intentsState after an Intent event.
+     *
+     * @param event the event just happened
+     */
+    private void processIntentEvent(IntentEvent event) {
+        synchronized (intentsState) {
+            intentsState.put(event.subject().key(), event);
+            this.lastIntentUpdate = System.currentTimeMillis();
+        }
+    }
+
+    /**
+     * Translates the type of the IntentEvent in SdxL2State.
+     *
+     * @param type the type of event
+     * @return the SdxL2State
+     */
+    private SdxL2State getSdxL2State(IntentEvent.Type type) {
+        SdxL2State state;
+        switch (type) {
+            case INSTALLED:
+                state = SdxL2State.ONLINE;
+                break;
+            case FAILED:
+                state = SdxL2State.OFFLINE;
+                break;
+            case INSTALL_REQ:
+            case WITHDRAW_REQ:
+            case WITHDRAWN:
+            case CORRUPT:
+            case PURGED:
+            default:
+                state = SdxL2State.CHECK;
+        }
+        return state;
+    }
+
+    private class InternalIntentListener implements IntentListener {
+
+        /**
+         * Reacts to the specified event.
+         *
+         * @param event event to be processed
+         */
+        @Override
+        public void event(IntentEvent event) {
+            Intent intent = event.subject();
+            if (intent.appId().equals(appId)) {
+                if (event.type() == IntentEvent.Type.INSTALLED ||
+                        event.type() == IntentEvent.Type.FAILED ||
+                        event.type() == IntentEvent.Type.WITHDRAWN) {
+                    log.info("Intent {} {}", event.subject().key(), event.type());
+                }
+                processIntentEvent(event);
+            }
+        }
+
+    }
+
+    /**
+     * Returns the state of the EdgePort that has been provided as input.
+     *
+     * @param edgeport the connect point representing the edge port
+     * @return the last state of the edge port;
+     */
+    @Override
+    public SdxL2State getEdgePortState(ConnectPoint edgeport) {
+        synchronized (edgeportsState) {
+            EdgePortEvent event = this.edgeportsState.get(edgeport);
+            long ts = System.currentTimeMillis();
+            if (event == null ||
+                    (ts > lastEdgePortUpdate && ts - lastEdgePortUpdate > deltaUpdate)) {
+                event = new EdgePortEvent(EdgePortEvent.Type.EDGE_PORT_REMOVED, edgeport);
+                Iterator<ConnectPoint> cps = this.edgePortService.getEdgePoints(edgeport.deviceId()).iterator();
+                while (cps.hasNext()) {
+                    if (edgeport.equals(cps.next())) {
+                        event = new EdgePortEvent(EdgePortEvent.Type.EDGE_PORT_ADDED, edgeport);
+                        break;
+                    }
+                }
+                edgeportsState.put(edgeport, event);
+                this.lastEdgePortUpdate = ts;
+            }
+            return this.getSdxL2State(event.type());
+        }
+    }
+
+    /**
+     * Updates edgeportsState after an EdgePort event.
+     *
+     * @param event the event just happened
+     */
+    private void processEdgePortEvent(EdgePortEvent event) {
+        synchronized (edgeportsState) {
+            edgeportsState.put(event.subject(), event);
+            this.lastEdgePortUpdate = System.currentTimeMillis();
+        }
+    }
+
+    /**
+     * Translates the type of EdgePortEvent in SdxL2State.
+     *
+     * @param type the type of event
+     * @return the SdxL2State
+     */
+    private SdxL2State getSdxL2State(EdgePortEvent.Type type) {
+        return type == EdgePortEvent.Type.EDGE_PORT_ADDED ? SdxL2State.ONLINE : SdxL2State.OFFLINE;
+    }
+
+    private class InternalEdgePortListener implements EdgePortListener {
+
+        /**
+         * Reacts to the specified event.
+         *
+         * @param event event to be processed
+         */
+        @Override
+        public void event(EdgePortEvent event) {
+            ConnectPoint cp = event.subject();
+            log.info("ConnectPoint {}/{} {}", cp.elementId().toString(), cp.port().toString(), event.type().toString());
+            processEdgePortEvent(event);
+
+        }
+
+    }
+
+}
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2MonitoringService.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2MonitoringService.java
new file mode 100644
index 0000000..4da17e0
--- /dev/null
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2MonitoringService.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.sdxl2;
+
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.intent.Key;
+
+/**
+ * Service that provides the current state of
+ * the SDX-L2 related intents and of the
+ * client interfaces.
+ */
+public interface SdxL2MonitoringService {
+
+    /**
+     * Returns the state of the Intent that has been provided as input.
+     *
+     * @param intentKey key of the intent;
+     * @return the last state of the intent;
+     */
+    SdxL2State getIntentState(Key intentKey);
+
+    /**
+     * Returns the state of the EdgePort that has been provided as input.
+     *
+     * @param edgeport the connect point representing the edge port
+     * @return the last state of the edge port;
+     */
+    SdxL2State getEdgePortState(ConnectPoint edgeport);
+
+    /**
+     * Remove listeners.
+     */
+    void cleanup();
+
+}
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Service.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Service.java
index 57c1be2..94629d7 100644
--- a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Service.java
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Service.java
@@ -16,6 +16,9 @@
 
 package org.onosproject.sdxl2;
 
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.intent.Key;
+
 import java.util.Optional;
 import java.util.Set;
 
@@ -70,4 +73,33 @@
      */
     void removeSdxL2ConnectionPoint(String sdxl2cp);
 
+    /**
+     * Returns an SDX-L2 connection point in a SDX-L2.
+     *
+     * @param sdxl2cp SDX-L2 connection point name
+     * @return the relative SdxL2ConnectionPoint object
+     */
+    SdxL2ConnectionPoint getSdxL2ConnectionPoint(String sdxl2cp);
+
+    /**
+     * Returns the state of the Intent that has been provided as input.
+     *
+     * @param intentKey key of the intent;
+     * @return the last state of the intent;
+     */
+    SdxL2State getIntentState(Key intentKey);
+
+    /**
+     * Returns the state of the EdgePort that has been provided as input.
+     *
+     * @param edgeport the connect point representing the edge port
+     * @return the last state of the edgeport;
+     */
+    SdxL2State getEdgePortState(ConnectPoint edgeport);
+
+    /**
+     * Cleans the state of the Application.
+     */
+    void cleanSdxL2();
+
 }
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2State.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2State.java
new file mode 100644
index 0000000..ae00561
--- /dev/null
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2State.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.sdxl2;
+
+/**
+ * Representation of the states the SDX-L2 resources may attain during the time.
+ */
+public enum SdxL2State {
+
+    /**
+     * Signifies that the resource is available.
+     */
+    ONLINE,
+
+    /**
+     * Signifies that the resource is not available (currently).
+     */
+    OFFLINE,
+
+    /**
+     * Signifies that the resource has some problems. Further
+     * investigation is needed.
+     *
+     */
+    CHECK
+
+}
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Store.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Store.java
index 217a52a..c19ee42 100644
--- a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Store.java
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2Store.java
@@ -75,4 +75,13 @@
      */
     void removeSdxL2ConnectionPoint(String sdxl2cp) throws SdxL2Exception;
 
+    /**
+     * Returns an SDX-L2 connection point in a SDX-L2.
+     *
+     * @param sdxl2cp the connection point name
+     * @return the relative SDXL2ConnectionPoint object
+     * @throws SdxL2Exception if SDX-L2 connection point does not exist
+     */
+    SdxL2ConnectionPoint getSdxL2ConnectionPoint(String sdxl2cp) throws SdxL2Exception;
+
 }
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2GetCPCommand.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2GetCPCommand.java
new file mode 100644
index 0000000..8f5b3ea
--- /dev/null
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2GetCPCommand.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.sdxl2.cli;
+
+import org.apache.karaf.shell.commands.Argument;
+import org.apache.karaf.shell.commands.Command;
+import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.sdxl2.SdxL2ConnectionPoint;
+import org.onosproject.sdxl2.SdxL2Service;
+import org.onosproject.sdxl2.SdxL2State;
+
+/**
+ * Cli to print the details of an SdxL2ConnectionPoint.
+ */
+@Command(scope = "sdxl2", name = "sdxl2cp", description = "Prints the details of an SDXL2ConnectionPoint")
+public class SdxL2GetCPCommand extends AbstractShellCommand {
+
+    @Argument(index = 0, name = "sdxl2cpname", description = "Sdxl2cp name", required = true, multiValued = false)
+    String sdxl2cpname = null;
+
+    private static final String HEADER       = "\n\u001B[1;37mStatus\t\t" +
+            "Connection Point\t\tName\t\tVlan IDs\t\tCE Mac Address\u001B[0m";
+    private static final String SEPARATOR    = "\u001B[1;37m------------" +
+            "-----------------------------------------------------------" +
+            "--------------------------------------\u001B[0m";
+    private static final String FORMAT_SDXL2CP_ONLINE   = "\u001B[1;32m%" +
+            "s\u001B[0m\t\t\u001B[1;37m%s/%s\t\t%s\t\t%s\t\t%s\u001B[0m\n";
+    private static final String FORMAT_SDXL2CP_OFFLINE  = "\u001B[1;31m%" +
+            "s\u001B[0m\t\t\u001B[1;37m%s/%s\t\t%s\t\t%s\t\t%s\u001B[0m\n";
+
+    @Override
+    protected void execute() {
+        SdxL2Service sdxl2Service = get(SdxL2Service.class);
+        SdxL2ConnectionPoint sdxl2ConnectionPoint = sdxl2Service.getSdxL2ConnectionPoint(sdxl2cpname);
+        if (sdxl2ConnectionPoint == null) {
+            return;
+        }
+        SdxL2State sdxl2cpState = sdxl2Service.getEdgePortState(sdxl2ConnectionPoint.connectPoint());
+        print(HEADER);
+        print(SEPARATOR);
+        if (sdxl2cpState == SdxL2State.ONLINE) {
+            print(FORMAT_SDXL2CP_ONLINE,
+                    "ONLINE",
+                    sdxl2ConnectionPoint.connectPoint().elementId(),
+                    sdxl2ConnectionPoint.connectPoint().port(),
+                    sdxl2ConnectionPoint.name(),
+                    sdxl2ConnectionPoint.vlanIds(),
+                    sdxl2ConnectionPoint.macAddress());
+        } else if (sdxl2cpState == SdxL2State.OFFLINE) {
+            print(FORMAT_SDXL2CP_OFFLINE,
+                    "OFFLINE",
+                    sdxl2ConnectionPoint.connectPoint().elementId(),
+                    sdxl2ConnectionPoint.connectPoint().port(),
+                    sdxl2ConnectionPoint.name(),
+                    sdxl2ConnectionPoint.vlanIds(),
+                    sdxl2ConnectionPoint.macAddress());
+        }
+    }
+}
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2ListCPCommand.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2ListCPCommand.java
new file mode 100644
index 0000000..b25f349
--- /dev/null
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2ListCPCommand.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.sdxl2.cli;
+
+import org.apache.karaf.shell.commands.Argument;
+import org.apache.karaf.shell.commands.Command;
+import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.sdxl2.SdxL2ConnectionPoint;
+import org.onosproject.sdxl2.SdxL2Service;
+import org.onosproject.sdxl2.SdxL2State;
+
+import java.util.Optional;
+import java.util.Set;
+
+/**
+ * CLI to list the SDX-L2 connection points.
+ */
+@Command(scope = "sdxl2", name = "sdxl2cps-list", description = "Lists " +
+        "all the sdxl2 connection points. Argument not required the name of sdxl2")
+public class SdxL2ListCPCommand extends AbstractShellCommand {
+
+    @Argument(index = 0, name = "sdxl2name", description = "sdxl2name", required = false, multiValued = false)
+    String sdxl2 = null;
+
+    private static final String HEADER = "\n\u001B[1;37mStatus\t\tSDXL2 Connection Point\u001B[0m";
+    private static final String SEPARATOR = "\u001B[1;37m-----------------------------------------------\u001B[0m";
+    private static final String FORMAT_SDXL2CP_ONLINE = "\u001B[1;32m%s\u001B[0m\t\t\u001B[1;37m%s\u001B[0m";
+    private static final String FORMAT_SDXL2CP_OFFLINE = "\u001B[1;31m%s\u001B[0m\t\t\u001B[1;37m%s\u001B[0m";
+
+    @Override
+    protected void execute() {
+        SdxL2Service sdxl2Service = get(SdxL2Service.class);
+        Optional<String> sdxl2name = Optional.ofNullable(sdxl2);
+        Set<String> result = sdxl2Service.getSdxL2ConnectionPoints(sdxl2name);
+        SdxL2ConnectionPoint sdxl2ConnectionPoint;
+        SdxL2State sdxl2cpState;
+        if (result.size() > 0) {
+            print(HEADER);
+            print(SEPARATOR);
+            for (String sdxl2cp : result) {
+                sdxl2ConnectionPoint = sdxl2Service.getSdxL2ConnectionPoint(sdxl2cp);
+                if (sdxl2ConnectionPoint == null) {
+                    return;
+                }
+                sdxl2cpState = sdxl2Service.getEdgePortState(sdxl2ConnectionPoint.connectPoint());
+                if (sdxl2cpState == SdxL2State.ONLINE) {
+                    print(FORMAT_SDXL2CP_ONLINE, "ONLINE", sdxl2cp);
+                } else if (sdxl2cpState == SdxL2State.OFFLINE) {
+                    print(FORMAT_SDXL2CP_OFFLINE, "OFFLINE", sdxl2cp);
+                }
+            }
+            print("");
+        }
+    }
+}
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2ListCommand.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2ListCommand.java
index 56fc850..42f91d1 100644
--- a/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2ListCommand.java
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2ListCommand.java
@@ -28,9 +28,9 @@
 @Command(scope = "sdxl2", name = "sdxl2-list", description = "Lists the sdx-l2s")
 public class SdxL2ListCommand extends AbstractShellCommand {
 
-    private static final String HEADER           = "\n\u001B[1;37mSDXL2\u001B[0m";
-    private static final String SEPARATOR        = "\u001B[1;37m--------------\u001B[0m";
-    private static final String FORMAT_SDXL2     = "\u001B[1;37m%s\u001B[0m";
+    private static final String HEADER = "\n\u001B[1;37mSDXL2\u001B[0m";
+    private static final String SEPARATOR = "\u001B[1;37m--------------\u001B[0m";
+    private static final String FORMAT_SDXL2 = "\u001B[1;37m%s\u001B[0m";
 
     @Override
     protected void execute() {
diff --git a/sdx-l2/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/sdx-l2/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index 06a2060..5d576d5 100644
--- a/sdx-l2/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/sdx-l2/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -41,6 +41,18 @@
                 <ref component-id="sdxl2cpnameCompleter"/>
             </completers>
         </command>
+        <command>
+            <action class="org.onosproject.sdxl2.cli.SdxL2ListCPCommand"/>
+            <completers>
+                <ref component-id="sdxl2Completer"/>
+            </completers>
+        </command>
+        <command>
+            <action class="org.onosproject.sdxl2.cli.SdxL2GetCPCommand"/>
+            <completers>
+                <ref component-id="sdxl2cpnameCompleter"/>
+            </completers>
+        </command>
     </command-bundle>
 
     <bean id="sdxl2Completer" class="org.onosproject.sdxl2.cli.completer.SdxL2NameCompleter"/>
diff --git a/sdx-l2/src/test/java/org/onosproject/sdxl2/SdxL2ManagerTest.java b/sdx-l2/src/test/java/org/onosproject/sdxl2/SdxL2ManagerTest.java
index f1d1321..1b502b1 100644
--- a/sdx-l2/src/test/java/org/onosproject/sdxl2/SdxL2ManagerTest.java
+++ b/sdx-l2/src/test/java/org/onosproject/sdxl2/SdxL2ManagerTest.java
@@ -240,4 +240,48 @@
 
     }
 
+    @Test
+    public void testgetSdxL2ConnectionPoint() {
+
+        manager.createSdxL2(SDXL2);
+        manager.createSdxL2(SDXL2_2);
+
+        SdxL2ConnectionPoint one = SdxL2ConnectionPoint.sdxl2ConnectionPoint("ROM1", CP1, VLANS1, CEMAC1);
+        SdxL2ConnectionPoint two = SdxL2ConnectionPoint.sdxl2ConnectionPoint("ROM1", CP2, VLANS1, CEMAC1);
+        SdxL2ConnectionPoint three = SdxL2ConnectionPoint.sdxl2ConnectionPoint("ROM2", CP2, VLANS2, CEMAC1);
+        SdxL2ConnectionPoint four = SdxL2ConnectionPoint.sdxl2ConnectionPoint("ROM2", CP2, VLANS1, CEMAC1);
+        SdxL2ConnectionPoint five = SdxL2ConnectionPoint.sdxl2ConnectionPoint("ROM3", CP1, VLANS2, CEMAC1);
+        SdxL2ConnectionPoint six = SdxL2ConnectionPoint.sdxl2ConnectionPoint("ROM3", CP1, VLANS7, CEMAC1);
+        SdxL2ConnectionPoint seven = SdxL2ConnectionPoint.sdxl2ConnectionPoint("MI3", CP3, VLANS3, CEMAC1);
+        SdxL2ConnectionPoint eight = SdxL2ConnectionPoint.sdxl2ConnectionPoint("ROM4", CP3, VLANS4, CEMAC1);
+        SdxL2ConnectionPoint nine = SdxL2ConnectionPoint.sdxl2ConnectionPoint("FI1", CP4, VLANS8, CEMAC1);
+        SdxL2ConnectionPoint ten = SdxL2ConnectionPoint.sdxl2ConnectionPoint("FI2", CP5, VLANS2, CEMAC1);
+        SdxL2ConnectionPoint eleven = SdxL2ConnectionPoint.sdxl2ConnectionPoint("FI3", CP5, VLANS1, CEMAC1);
+        SdxL2ConnectionPoint twelve = SdxL2ConnectionPoint.sdxl2ConnectionPoint("FI31", CP5, VLANS1, CEMAC1);
+        SdxL2ConnectionPoint thirteen = SdxL2ConnectionPoint.sdxl2ConnectionPoint("FI31", CP5, VLANS8, CEMAC1);
+
+        manager.addSdxL2ConnectionPoint(SDXL2, one);
+        manager.addSdxL2ConnectionPoint(SDXL2, three);
+        manager.addSdxL2ConnectionPoint(SDXL2_2, six);
+        manager.addSdxL2ConnectionPoint(SDXL2, seven);
+        manager.addSdxL2ConnectionPoint(SDXL2_2, nine);
+        manager.addSdxL2ConnectionPoint(SDXL2, ten);
+
+        assertEquals(one, manager.getSdxL2ConnectionPoint(one.name()));
+        assertNotEquals(two, manager.getSdxL2ConnectionPoint(two.name()));
+        assertEquals(three, manager.getSdxL2ConnectionPoint(three.name()));
+        assertNotEquals(four, manager.getSdxL2ConnectionPoint(four.name()));
+        assertNotEquals(five, manager.getSdxL2ConnectionPoint(five.name()));
+        assertEquals(six, manager.getSdxL2ConnectionPoint(six.name()));
+        assertEquals(seven, manager.getSdxL2ConnectionPoint(seven.name()));
+        assertEquals(nine, manager.getSdxL2ConnectionPoint(nine.name()));
+        assertEquals(ten, manager.getSdxL2ConnectionPoint(ten.name()));
+
+        assertNotEquals(eight, manager.getSdxL2ConnectionPoint(eight.name()));
+        assertNotEquals(eleven, manager.getSdxL2ConnectionPoint(eleven.name()));
+        assertNotEquals(twelve, manager.getSdxL2ConnectionPoint(twelve.name()));
+        assertNotEquals(thirteen, manager.getSdxL2ConnectionPoint(thirteen.name()));
+
+    }
+
 }
