---
title: Mirror
slug: aidc/mirror
createdAt: 2025-12-29T10:35:14.875Z
---

## <font color="#1d50a2">URLs Summary</font>

| <font color="#2166ae">**URL**</font>        | <font color="#2166ae">**GET**</font> | <font color="#2166ae">**POST**</font> | <font color="#2166ae">**PATCH**</font> | <font color="#2166AE">**PUT**</font> | <font color="#2166AE">**DELETE**</font> |
| ------------------------------------------- | ------------------------------------ | ------------------------------------- | -------------------------------------- | ------------------------------------ | --------------------------------------- |
| /rest/v1/running/mirror                     | Y                                    | N                                     | Y                                      | N                                    | N                                       |
| /rest/v1/running/mirror/session/&#x7B;name} | Y                                    | Y                                     | Y                                      | N                                    | Y                                       |
| /rest/v1/rpc/show-mirror                    | N                                    | Y                                     | N                                      | N                                    | N                                       |

## <font color="#1d50a2">Examples</font>

### <font color="#1d50a2">Show mirror</font>

```json
POST HTTPS://{switch IP}/rest/v1/rpc/show-mirror
```

### <font color="#1d50a2">Get all mirror sessions</font>

```json
GET HTTPS://{switch IP}/rest/v1/running/mirror
```

### <font color="#1d50a2">Create a mirror session</font>

```json
POST HTTPS://{switch IP}/rest/v1/running/mirror/session
{
    "name": 3,
    "type": "SPAN",
    "direction": "TX",
    "dst-port": "Ethernet11",
    "egress-queue": 3
}
```

## <font color="#1d50a2">Properties Descriptions</font>

### <font color="#1d50a2">Mirror Session</font>

**Tree Diagrams**

```plaintext
  +--rw mirror
     +--rw session* [name]
        +--rw name
        +--rw type
        +--rw commit?
        +--rw direction?
        +--rw dst-port
        +--rw src-port*
        +--rw dst-ip
        +--rw gre-type?
        +--rw ip-dscp
        +--rw ip-ttl
        +--rw src-ip
        +--rw egress-queue?
```

**Table of Properties**

| **Name**     | **Required** | **Type/Range**                                         | **Description**                                                                                                                       |
| ------------ | ------------ | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| mirror       | M            |                                                        | Path-only node, has no configurable value.<br />Top-level configuration for the mirror.                                               |
| session      | M            |                                                        | (sub-property of mirror)<br />Path-only node, has no configurable value.                                                              |
| name         | M            | 1..63                                                  | (sub-property of session)<br />Identify different mirror sessions.                                                                    |
| type         | M            | "SPAN"<br />"ERSPAN"                                   | (sub-property of session)<br />Mirror type.                                                                                           |
| direction    | CO           | "RX"<br />"TX"<br />"BOTH"                             | (sub-property of session)<br />Only applicable when type = "SPAN".<br />Direction of mirror(default both).<br />Default value: "BOTH" |
| dst-port     | CM           | Ethernet name<br />"CPU"                               | (sub-property of session)<br />Only applicable when type = "SPAN".<br />Set span mirror destination.                                  |
| src-port     | CO           | Ethernet name                                          | (sub-property of session)<br />Only applicable when type = "SPAN".<br />Set span mirror session source.                               |
| dst-ip       | CM           | A.B.C.D                                                | (sub-property of session)<br />Only applicable when type = "ERSPAN".<br />Set erspan mirror destination IP.                           |
| gre-type     | CO           | a 4-digit hex number prefixed with '0x' (e.g., 0x1A3F) | (sub-property of session)<br />Only applicable when type = "ERSPAN".<br />Set erspan gre type.                                        |
| ip-dscp      | CM           | 0..63                                                  | (sub-property of session)<br />Only applicable when type = "ERSPAN".<br />Set erspan ip differentiated services code point.           |
| ip-ttl       | CM           | 1..255                                                 | (sub-property of session)<br />Only applicable when type = "ERSPAN".<br />Set erspan ip ttl.                                          |
| src-ip       | CM           | A.B.C.D                                                | (sub-property of session)<br />Only applicable when type = "ERSPAN".<br />Set erspan mirror source IP.                                |
| egress-queue | O            | 0..7                                                   | (sub-property of session)<br />Set erspan port egress queue.                                                                          |

### <font color="#1d50a2">show-mirror</font>

**Tree Diagrams**

```plaintext
    +---x show-mirror
       +---w input
       |  +---w session-name?
       +--ro output
          +--ro session* [name]
             +--ro name
             +--ro type?
             +--ro status?
             +--ro dst-port?
             +--ro src-port*
             +--ro direction?
             +--ro egress-queue?
             +--ro src-ip?
             +--ro dst-ip?
             +--ro gre-type?
             +--ro dscp?
             +--ro ttl?
```

**Table of Properties**

| **Name**     | **Required** | **Type/Range**                                         | **Description**                                                                   |
| ------------ | ------------ | ------------------------------------------------------ | --------------------------------------------------------------------------------- |
| show-mirror  | M            |                                                        | Path-only node, has no configurable value.<br />Show mirror sessions information. |
| session-name | O            | 1..63                                                  | (sub-property of input)<br />Identify different mirror sessions.                  |
| session      | RO           |                                                        | (sub-property of output)<br />Path-only node, has no configurable value.          |
| name         | RO           | 1..63                                                  | (sub-property of session)<br />Identify different mirror sessions.                |
| type         | RO           | "SPAN"<br />"ERSPAN"                                   | (sub-property of session)<br />Mirror type.                                       |
| status       | RO           | string                                                 | (sub-property of session)<br />Mirror session active status.                      |
| dst-port     | RO           | string                                                 | (sub-property of session)<br />Span mirror destination.                           |
| src-port     | RO           | string                                                 | (sub-property of session)<br />Span mirror source.                                |
| direction    | RO           | string                                                 | (sub-property of session)<br />Direction of mirror.                               |
| egress-queue | RO           | 0..7                                                   | (sub-property of session)<br />Egress queue.                                      |
| src-ip       | RO           | A.B.C.D                                                | (sub-property of session)<br />Erspan mirror source IP.                           |
| dst-ip       | RO           | A.B.C.D                                                | (sub-property of session)<br />Erspan mirror destination IP.                      |
| gre-type     | RO           | a 4-digit hex number prefixed with '0x' (e.g., 0x1A3F) | (sub-property of session)<br />Erspan gre type.                                   |
| dscp         | RO           | 0..63                                                  | (sub-property of session)<br />Erspan ip differentiated services code point.      |
| ttl          | RO           | 1..255                                                 | (sub-property of session)<br />Erspan ip ttl.                                     |

