---
# System prepended metadata

title: Guia do Usuário - Wave 3

---

# Guia do Usuário - Wave 3

Este Guia do Usuário apresenta as entregas da Wave 3 e documenta o uso dos recursos disponibilizados pela aplicação `superviser` - que torna um TM1200G NETCONF-enabled.

- Features: Aplicação erlang e modelos yang
    - aplicação `superviser` e `confd` integram a solução que permite gerenciar o TM1200G via NETCONF, RESTCONF e CLI
    - suporte aos modelos YANG openconfig-platform (gestão de inventário) e openconfig-terminal-device (gestão de protocolos e recursos de transporte)

- DevOps: Jenkins e ambiente sistema de build
    - Geração de imagem do TM1200G-netconf.
    - Mudança no sistema de build e distribuição dos modelos Yang/FXS.

- Documentação: Guia e confluence
    - Confluence:  http://confluence.padtec.com.br:8090/pages/viewpage.action?pageId=181961191

## Introdução
A wave 3 consistiu em adicionar à aplicação `superviser-0.1.0` o suporte ao TM1200G a partir da versão de firmware 1.2.2. Ao fim da wave 3, a aplicação `superviser-0.1.0` é capaz de gerenciar os seguintes equipamentos:

- Chassis:
    - 2U
- Supervisoras:
    - SPVL-HB FwVersion 4.0.0RC3
    - Aplicação de controle de fantray (FT-HC)
    - Aplicação de controle das fontes de alimentação (PSU-HA e SSC-HC)
- Placas de linha:
    - TD100G FwVersion 2.6.9
    - TM200G FwVersion 3.0.0
- Chassis standalone:
    - TM1200G FwVersion 1.3.0-1
    - Aplicação de controle da fantray FT-10.

## Informações Importantes

### TM1200G-Netconf FwVersion 1.3.0
A modelagem e instrumentação do TM1200G para torná-lo NETCONF-enabled foram feitas a partir do firmware 1.2.2, sendo este o set de comandos suportado. Como entregável da Wave, foi gerada a versão de firmware 1.3.0-1 do TM1200G, que adiciona as seguintes features à imagem 1.2.2 do TM1200G:
- Aplicações `superviser` e `confd` e suas dependências
- Troca de modo de operação entre SDN e DEFAULT. 
- Controle em runtime para iniciar e pausar as aplicações referentes ao modo de operação.

#### Artefatos da imagem `TM1200G-Netconf` e aplicação `superviser`
- As imagens TM1200G-Netconf estão disponíveis no link abaixo:
http://esbuild01/artifactory/list/test/tm1200g-netconf/
- Os pacotes somente da aplicação `superviser` estão disponíveis no link abaixo:
http://esbuild01/artifactory/build/sandbox.erlang.superviser/


#### Troca de modo de operação
O TM1200G 1.3.0-1 implementa um tipo de *feature toggle* que permite a troca de modo de operação *hitless*.

Existem 2 modos de operação para a o TM1200G:
- Modo DEFAULT: modo de operação para comunicação via ppm3 com a gerência.
- Modo SDN: modo de operação para comunicação via netconf.

No modo SDN, as aplicações ativas são:
- confd-7.4
- superviser-0.1.0
- padtec.es.proj.t1200g.app.ctl: aplicação de controle do TM1200G.
- padtec.es.proj.t1200g.app.fan: aplicação de gerenciamento da fantray

Para a troca de modo de operação, utiliza-se o script *tm1200g-ctl*. Através dele também é possível checar o modo de operação atual da placa.

**Nota**: Quando há uma mudança no modo de operação, todas as aplicações relacionadas ao modo atual serão paradas, e as as aplicações relacionadas ao modo escolhido serão inicializadas.

O script deve ser usado da seguinte forma para executar as ações descritas acima:

`tm1200g-ctl set-mode DEFAULT|SDN`: Troca o modo de operação para DEFAULT ou SDN.
`tm1200g-ctl get-mode`: Retorna o modo de operação atual.

### Chassis TM1200G standalone
O TM1200G é uma placa modelo standalone, ou seja, ela não é um chassis com slots físicos tradicionais. Porém, ela tem dois slots lógicos, que são:

- Slot 1 - Aplicação de controle do TM1200G.
- Slot 2 - Aplicação de controle da fan.

Para a aplicação superviser, é como se o TM1200G fosse um transponder qualquer conectado ao slot 1 de um chassis comum.

## Modelos YANG

### Openconfig
Repositório: sandbox/openconfig2
Revisão (sha1): df7d15f708ea3a463d0dd83d168762712a334dcc

| Modelo  | Revisão |
|------------- | -------------|
| openconfig-alarm-types               | 2018-11-21 |
| openconfig-alarms                    | 2019-07-09 |
| openconfig-extensions                | 2018-10-17 |
| openconfig-if-ethernet               | 2020-05-06 |
| openconfig-interfaces                | 2019-11-19 |
| openconfig-lldp                      | 2018-11-21 |
| openconfig-lldp-types                | 2018-11-21 |
| openconfig-platform                  | 2019-04-16 |
| openconfig-platform-augments         | 2020-08-27 |
| openconfig-platform-linecard         | 2020-05-10 |
| openconfig-platform-port             | 2020-05-06 |
| openconfig-platform-transceiver      | 2020-05-06 |
| openconfig-platform-types            | 2019-06-03 |
| openconfig-terminal-device           | 2020-05-09 |
| openconfig-terminal-device-augments  | 2020-08-04 |
| openconfig-transport-line-common     | 2019-06-03 |
| openconfig-transport-line-protection | 2018-11-21 |
| openconfig-transport-types           | 2020-04-24 |
| openconfig-types                     | 2019-04-16 |
| openconfig-yang-types                | 2018-11-21 |

### Padtec
Repositório: sandbox/yang
Revisão (sha1): 9c1b2347c6f89b69ddcdf906e650d6f6a638c2b3

| Modelo  | Revisão |
|------------- | -------------|
| padtec-device                        | 2020-02-19 |
| padtec-device-types                  | 2020-03-12 |
| padtec-netconf-notifications         | 2020-08-28 |
| padtec-platform-transceiver          | 2020-08-05 |
| padtec-platform-types                | 2020-08-12 |
| padtec-rpc                           | 2020-06-04 |
| padtec-terminal-device               | 2020-05-11 |
| padtec-transport-types               | 2020-06-26 |

## Configuração do TM1200G (config)
Abaixo são listados os paths subscritos, ou seja, os paths onde há a possibilidade de se executar configurações.

### Subscrições em `/interfaces/interface/`
- Habilitar interface
- Ip
- Prefix-length

| PRIORITY  | PATH |
|------------- | -------------|
| 101 | /interfaces/interface{IfName}/subinterfaces/subinterface{IfIndex}/config/enabled |
| 103 | /interfaces/interface{IfName}/subinterfaces/subinterface{IfIndex}/oc-ip:ipv4/addresses/address{Ip}/config/ip |
| 104 | /interfaces/interface{IfName}/subinterfaces/subinterface{IfIndex}/oc-ip:ipv4/addresses/address{Ip}/config/prefix-length |

##### Exemplo
```bash
> show configuration interfaces interface dcn0_1_1 | display xpath
```

OUTPUT:
```bash
/interfaces/interface[name='dcn0_1_1']/config/name dcn0_1_1
/interfaces/interface[name='dcn0_1_1']/config/type dcn
/interfaces/interface[name='dcn0_1_1']/config enabled
/interfaces/interface[name='dcn0_1_1']/subinterfaces/subinterface[index='0']/config/index 0
/interfaces/interface[name='dcn0_1_1']/subinterfaces/subinterface[index='0']/oc-ip:ipv4/addresses/address[ip='172.30.0.128']/config/ip 172.30.0.128
/interfaces/interface[name='dcn0_1_1']/subinterfaces/subinterface[index='0']/oc-ip:ipv4/addresses/address[ip='172.30.0.128']/config/prefix-length 16
```

Note que outras "configs" além das subscrições foram exibidas. Esses elementos estão armazenados no CDB, mas não possuem função de configuração ou não devem ser editados pelo usuário. É o caso dos seguintes paths:

**Index**: é uma config de uso interno e não deve ser modificado.
```bash
/interfaces/interface[name='dcn0_1_1']/subinterfaces/subinterface[index='0']/config/index 0
```

### Subscrições em `/local-routes`
- Configura o default-gateway da placa

| PRIORITY  | PATH |
|------------- | -------------|
| 105 | /local-routes/static-routes/static{Prefix}/config/prefix |

#### Exemplo
```bash
> show configuration local-routes | display xpath
```

OUTPUT:
```bash
/local-routes/static-routes/static[prefix='172.30.0.254/16']/config/prefix 172.30.0.254/16
```

### Subscrições em `/system`
- Configuração de data e hora do sistema

| PRIORITY  | PATH |
|------------- | -------------|
| 110 | /system/config/current-datetime |

#### Exemplo
```bash
> show configuration system config
```

OUTPUT:
```bash
current-datetime 2021-01-26T21:00:08.904Z+00:00;
```

### Subscrições em `/components/component`

#### Configurações dos optical-channels
- Modo de Operação: configura taxa e modulação
- Chromatic Dispersion: configura janela de dispersão cromática
- Target output power: configura a potência de saída alvo para o canal óptico
- Phase encoding: configura o modo do phase enconding, que pode ter os valores **DIFF** ou **NON-DIFF**

**Nota:** Os modos de operação válidos são:

| Valor numérico de entrada para o confd | Modo de operação equivalente |
| -------------- | ---------------- |
| 0 | none |
| 1 | 100g_dp_bpsk |
| 2 | 100g_dp_p_qpsk |
| 3 | 100g_dp_qpsk |
| 4 | 200g_dp_qpsk |
| 5 | 200g_dp_p_8qam |
| 6 | 300gb_dp_8qam |
| 7 | 300gb_dp_16qam |
| 8 | 400gb_dp_16qam |
| 9 | 400gb_dp_32qam |
| 10 | 500gb_dp_32qam |
| 11 | 500gb_dp_64qam |
| 12 | 600gb_dp_64qam |
| 13 | 200gb_dp_16qam |
| 14 | 200gb_dp_32qam |
| 15 | 300gb_dp_24qam |
| 16 | 400gb_dp_64qam |

| PRIORITY | PATH |
| -------- | ---- |
| 100 | /components/component{OpticalChannel}/optical-channel/config/chromatic-dispersion-control/mode |
| 100 | /components/component{OpticalChannel}/optical-channel/config/chromatic-dispersion-control/low-search |
| 100 | /components/component{OpticalChannel}/optical-channel/config/chromatic-dispersion-control/fixed-or-high-search |
| 100 | /components/component{OpticalChannel}/optical-channel/config/target-output-power |
| 100 | /components/component{OpticalChannel}/optical-channel/config/phase-encoding |
| 100 | /components/component{OpticalChannel}/optical-channel/config/operational-mode |

##### Exemplo
```bash
> show configuration components component opticalchannel0_1_9 | display xpath
```

OUTPUT:
```bash
/components/component[name='opticalchannel0_1_9']/config/name opticalchannel0_1_9
/components/component[name='opticalchannel0_1_9']/oc-opt-term:optical-channel/config/target-output-power 0.0
/components/component[name='opticalchannel0_1_9']/oc-opt-term:optical-channel/config/operational-mode 12
/components/component[name='opticalchannel0_1_9']/oc-opt-term:optical-channel/config/openconfig-platform-augments:phase-encoding NON_DIFF
/components/component[name='opticalchannel0_1_9']/oc-opt-term:optical-channel/config/openconfig-platform-augments:chromatic-dispersion-control/mode AUTO
/components/component[name='opticalchannel0_1_9']/oc-opt-term:optical-channel/config/openconfig-platform-augments:chromatic-dispersion-control/fixed-or-high-search 3000
/components/component[name='opticalchannel0_1_9']/oc-opt-term:optical-channel/config/openconfig-platform-augments:chromatic-dispersion-control/low-search -3000
```

#### Configuração de parâmetros de transceiver - Porta CLIENT 1
**Nota**: Como forma de simplificar os exemplos, as configurações mostradas aqui foram obtidas de um transceiver cliente 1, porém são válidas para os outros transceivers cliente.
- Limiares de potênica de transmissão e recepção (TX e RX)
- Canal de operação DWDM
- Laser On/Off
- Auto Laser off

| PRIORITY | PATH                                                                                                                    |
| -------- | ----------------------------------------------------------------------------------------------------------------------- |
| 200      | /components/component{transceiver0_1_1_1}/transceiver/physical-channels/channel{0}/config/alo                           |
| 200      | /components/component{transceiver0_1_1_1}/transceiver/physical-channels/channel{0}/config/tx-channel                      |
| 200      | /components/component{transceiver0_1_1_1}/transceiver/physical-channels/channel{0}/config/tx-laser                        |
| 300      | /components/component{transceiver0_1_1_1}/transceiver/physical-channels/channel{0}/config/rx-power-threshold/alarm-enable |
| 300      | /components/component{transceiver0_1_1_1}/transceiver/physical-channels/channel{0}/config/tx-power-threshold/alarm-enable |
| 300      | /components/component{transceiver0_1_1_1}/transceiver/physical-channels/channel{0}/config/rx-power-threshold/max-power    |
| 300      | /components/component{transceiver0_1_1_1}/transceiver/physical-channels/channel{0}/config/tx-power-threshold/max-power    |
| 300      | /components/component{transceiver0_1_1_1}/transceiver/physical-channels/channel{0}/config/rx-power-threshold/min-power    |
| 300      | /components/component{transceiver0_1_1_1}/transceiver/physical-channels/channel{0}/config/tx-power-threshold/min-power    |

##### Exemplo
```bash
> show configuration components component transceiver0_1_1_1 transceiver physical-channels channel | display prefixes | display xpath
```

OUTPUT:
```bash
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/oc-transceiver:index 0
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/oc-transceiver:tx-laser true
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:alo OFF
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:rx-power-threshold/openconfig-platform-augments:min-power -30.0
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:rx-power-threshold/openconfig-platform-augments:max-power 5.0
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:rx-power-threshold/openconfig-platform-augments:alarm-enable false
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:tx-power-threshold/openconfig-platform-augments:min-power 0.0
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:tx-power-threshold/openconfig-platform-augments:max-power 5.0
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:tx-power-threshold/openconfig-platform-augments:alarm-enable false
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='1']/oc-transceiver:config/oc-transceiver:index 1
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='2']/oc-transceiver:config/oc-transceiver:index 2
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_1_1']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='3']/oc-transceiver:config/oc-transceiver:index 3
```
**Nota**: Outras "configs" além das subscrições foram exibidas. Esses elementos estão armezenados no CDB, mas não possuem função de configuração ou não devem ser editados pelo usuário.

#### Configuração de parâmetros de transceiver - Porta LINE 1
**Nota**: Como forma de simplificar os exemplos, as configurações mostradas aqui foram obtidas de um transceiver rede 1, porém são válidas para os outros transceivers rede.
- Limiares de potênica de transmissão e recepção (TX e RX)
- Canal de operação DWDM
- Laser On/Off

| PRIORITY | PATH                                                                                                                    |
| -------- | ----------------------------------------------------------------------------------------------------------------------- |
| 200      | /components/component{transceiver0_1_9}/transceiver/physical-channels/channel{0}/config/tx-channel                      |
| 200      | /components/component{transceiver0_1_9}/transceiver/physical-channels/channel{0}/config/tx-laser                        |
| 300      | /components/component{transceiver0_1_9}/transceiver/physical-channels/channel{0}/config/rx-power-threshold/alarm-enable |
| 300      | /components/component{transceiver0_1_9}/transceiver/physical-channels/channel{0}/config/tx-power-threshold/alarm-enable |
| 300      | /components/component{transceiver0_1_9}/transceiver/physical-channels/channel{0}/config/rx-power-threshold/max-power    |
| 300      | /components/component{transceiver0_1_9}/transceiver/physical-channels/channel{0}/config/tx-power-threshold/max-power    |
| 300      | /components/component{transceiver0_1_9}/transceiver/physical-channels/channel{0}/config/rx-power-threshold/min-power    |
| 300      | /components/component{transceiver0_1_9}/transceiver/physical-channels/channel{0}/config/tx-power-threshold/min-power    |

##### Exemplo
```bash
> show configuration components component transceiver0_1_9 transceiver physical-channels channel | display prefixes | display xpath
```

OUTPUT:
```bash
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_9']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/oc-transceiver:index 0
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_9']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/oc-transceiver:tx-laser false
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_9']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:rx-power-threshold/openconfig-platform-augments:min-power -30.0
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_9']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:rx-power-threshold/openconfig-platform-augments:max-power 5.0
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_9']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:rx-power-threshold/openconfig-platform-augments:alarm-enable false
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_9']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:tx-power-threshold/openconfig-platform-augments:min-power 0.0
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_9']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:tx-power-threshold/openconfig-platform-augments:max-power 5.0
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_9']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:tx-power-threshold/openconfig-platform-augments:alarm-enable false
/oc-platform:components/oc-platform:component[oc-platform:name='transceiver0_1_9']/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel[oc-transceiver:index='0']/oc-transceiver:config/openconfig-platform-augments:tx-channel 0
```
**Nota**: Outras "configs" além das subscrições foram exibidas. Esses elementos estão armezenados no CDB, mas não possuem função de configuração ou não devem ser editados pelo usuário.


### Subscrições em `/terminal-device`
Para entender melhor as configurações relacionadas com os logical-channels, é importante ter a tabela abaixo em mãos:
![](https://i.imgur.com/ZiEdJrR.png)

#### Configuração de Loopback
As subscrições de paths para configuração de loopback estão disponíveis somente para os logica-channels das camadas 100GE e OTUj:
- **100GE**: 1011103, 1021203, 1051503, 1051506, 1061603, 1061606, 1031303, 1041403, 1071703, 1071706, 1081803, 1081806.
- **OTUj**: 1090900, 1101000.

O path para configuração de loopback é mostrado na tabela abaixo:
| PRIORITY  | PATH |
|------------- | -------------|
| 100 | /terminal-device/logical-channels/channel{LogicalChannel}/config/loopback-mode |

##### Exemplo
```bash
> show configuration terminal-device logical-channels channel config loopback-mode | display xpath  
```
 OUTPUT:
```bash
/terminal-device/logical-channels/channel[index='1011103']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1021203']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1031303']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1041403']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1051503']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1051506']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1061603']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1061606']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1071703']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1071706']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1081803']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1081806']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1090900']/config/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1101000']/config/loopback-mode NONE
```

#### Configuração de OTN
As subscrições de paths para configuração OTN estão disponíveis somente para os logical-channels da camada OTU4:
- **OTU4**: 1091101, 1091201, 1091501, 1091504, 1091601, 1091604, 1101301, 1101401, 1101701, 1101704, 1101801, 1101804.

Os paths para configurações OTN são mostrados na tabela abaixo:
| PRIORITY  | PATH |
|------------- | -------------|
| 100 | /terminal-device/logical-channels/channel{LogicalChannel}/otn/config/timactenable     |
| 100 | /terminal-device/logical-channels/channel{LogicalChannel}/otn/config/timdetmo         |
| 100 | /terminal-device/logical-channels/channel{LogicalChannel}/otn/config/tti-msg-transmit |
| 100 | /terminal-device/logical-channels/channel{LogicalChannel}/otn/config/tti-msg-expected |

##### Exemplo
```bash
> show configuration terminal-device logical-channels channel 1091101 otn config | display xpath
```

 OUTPUT:
```bash
/terminal-device/logical-channels/channel[index='1091101']/otn/config/tti-msg-transmit "0PADTEC-SAPI-SM 0PADTEC-DAPI-SM PADTEC Operator Specific SM = 32"
/terminal-device/logical-channels/channel[index='1091101']/otn/config/tti-msg-expected "0PADTEC-SAPI-SM 0PADTEC-DAPI-SM "
/terminal-device/logical-channels/channel[index='1091101']/otn/config/oc-opt-term-augments:timdetmo OFF
/terminal-device/logical-channels/channel[index='1091101']/otn/config/oc-opt-term-augments:timactenable false
```

### Configuração Default
A configuração default encontra-se no Anexo I, no fim deste documento.

## Estado Operacional (state) e Inventário

### Inventário: FT-10
A fantray do TM1200G tem uma memória de inventário onde ficam salvas suas informações de part-number, serial-number, versão de firmware e de hardware, essas informações são adquiridas pelo get de discovery enviado ao slot 2, e são salvas no inventário. Outras informações como nome do componente e tipo, são obtidas pelo inventário JSON.

```bash
components component fan0_2
 state name         fan0_2
 state type         FAN
 state hardware-version A.1.3...........
 state firmware-version 1.0.0...........
 state serial-no    52
 state part-no      2632
 state empty        false
 state equipment-failure false
 state equipment-mismatch false
 linecard state power-admin-state POWER_ENABLED
 linecard state slot-admin-state SLOT_ENABLED
```

### Inventário: TM1200G
Nesta seção constam os elementos de `state` para o TM1200G (state comum).

Alguns paths inválidos são listados. Eles se tratam de paths que não fazem sentido para o componente ou ainda não foram instrumentados. A presença destes paths no `state` não afetam o funcionamento do sistema.

#### Estrutura de componentes `openconfig-platform`
O TM1200G é representado pela seguinte estrutura de componentes/subcomponentes:
![](https://i.imgur.com/836owEI.png)

#### Linecard
###### Discovery, Inventário e State
```bash
/components/component[name='linecard0_1']/state/name linecard0_1
/components/component[name='linecard0_1']/state/type LINECARD
/components/component[name='linecard0_1']/state/hardware-version A.1.5...........
/components/component[name='linecard0_1']/state/firmware-version 1.3.0-1.........
/components/component[name='linecard0_1']/state/serial-no 41
/components/component[name='linecard0_1']/state/part-no 2631
/components/component[name='linecard0_1']/state/empty false
/components/component[name='linecard0_1']/state/temperature/instant 22.6
/components/component[name='linecard0_1']/state/oc-alarms:equipment-failure false
/components/component[name='linecard0_1']/state/oc-alarms:equipment-mismatch false
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='fabric0_1_1']/state/name fabric0_1_1
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_10']/state/name port0_1_10
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_1_1']/state/name port0_1_1_1
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_2']/state/name port0_1_2
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_2_1']/state/name port0_1_2_1
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_32']/state/name port0_1_32
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_3_1']/state/name port0_1_3_1
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_4_1']/state/name port0_1_4_1
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_5_1']/state/name port0_1_5_1
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_5_2']/state/name port0_1_5_2
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_6_1']/state/name port0_1_6_1
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_6_2']/state/name port0_1_6_2
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_7_1']/state/name port0_1_7_1
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_7_2']/state/name port0_1_7_2
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_8_1']/state/name port0_1_8_1
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_8_2']/state/name port0_1_8_2
/components/component[name='linecard0_1']/subcomponents/subcomponent[name='port0_1_9']/state/name port0_1_9
/components/component[name='linecard0_1']/oc-linecard:linecard/state/power-admin-state POWER_ENABLED
/components/component[name='linecard0_1']/oc-linecard:linecard/state/openconfig-platform-augments:slot-admin-state SLOT_ENABLED
```
- equipment-mismatch:
    - false: o equipamento inserido no slot é suportato
    - true: o equipamento inserido no slot NÃO é suportato
- equipment-failure:
    - false: leitura dos dados operacionais está funcionando
    - true: erro na leitura dos dados operacionais
- slot-admin-state:
    - **Nota**: Não há como desabilitar o slot para o TM1200G, pois a nível lógico, o slot 1 representa o próprio TM1200G standalone.
    - SLOT_ENABLED: o slot pode ser gerenciado
    - SLOT_DISABLED: o slot está desativado

#### Porta Cliente
O exemplo mostrado refere-se à porta cliente 1, porém os paths e valores são válidos para todas as portas cliente.
###### Inventário e State
```bash
/components/component[name='port0_1_1_1']/state/name port0_1_1_1
/components/component[name='port0_1_1_1']/state/type PORT
/components/component[name='port0_1_1_1']/state/empty false
/components/component[name='port0_1_1_1']/state/oc-alarms:equipment-failure false
/components/component[name='port0_1_1_1']/state/oc-alarms:equipment-mismatch false
/components/component[name='port0_1_1_1']/subcomponents/subcomponent[name='transceiver0_1_1_1']/state/name transceiver0_1_1_1
/components/component[name='port0_1_1_1']/port/state/openconfig-platform-augments:led-rx RED
/components/component[name='port0_1_1_1']/port/state/openconfig-platform-augments:led-tx RED
/components/component[name='port0_1_1_1']/port/oc-line-com:optical-port/state/optical-port-type TERMINAL_CLIENT
/components/component[name='port0_1_1_1']/oc-linecard:linecard/state/power-admin-state POWER_ENABLED
/components/component[name='port0_1_1_1']/oc-linecard:linecard/state/openconfig-platform-augments:slot-admin-state SLOT_ENABLED
```

#### Porta Rede
O exemplo mostrado refere-se à porta rede 1, porém os paths e valores são válidos para todas as portas rede.
###### Inventário
```bash
/components/component[name='port0_1_9']/state/name port0_1_9
/components/component[name='port0_1_9']/state/type PORT
/components/component[name='port0_1_9']/state/empty false
/components/component[name='port0_1_9']/state/oc-alarms:equipment-failure false
/components/component[name='port0_1_9']/state/oc-alarms:equipment-mismatch false
/components/component[name='port0_1_9']/subcomponents/subcomponent[name='opticalchannel0_1_9']/state/name opticalchannel0_1_9
/components/component[name='port0_1_9']/subcomponents/subcomponent[name='transceiver0_1_9']/state/name transceiver0_1_9
```
###### Status dos Leds
```bash
/components/component[name='port0_1_9']/port/state/openconfig-platform-augments:led-rx RED
/components/component[name='port0_1_9']/port/state/openconfig-platform-augments:led-tx RED
```
###### Tipo da Porta
```bash
/components/component[name='port0_1_9']/port/oc-line-com:optical-port/state/optical-port-type TERMINAL_LINE
```
###### LOS
```bash
/components/component[name='port0_1_9']/port/oc-line-com:optical-port/state/openconfig-platform-augments:port-los true
```

#### Transceiver

##### QSFP28
O exemplo mostrado refere-se ao transceiver cliente 1.1, porém os paths e valores são válidos para todos QSFP28 usados em portas cliente.
###### Inventário
```bash
/components/component[name='transceiver0_1_1_1']/state/name transceiver0_1_1_1
/components/component[name='transceiver0_1_1_1']/state/type TRANSCEIVER
/components/component[name='transceiver0_1_1_1']/state/empty false
/components/component[name='transceiver0_1_1_1']/state/oc-alarms:equipment-failure false
/components/component[name='transceiver0_1_1_1']/state/oc-alarms:equipment-mismatch false
/components/component[name='transceiver0_1_1_1']/oc-linecard:linecard/state/power-admin-state POWER_ENABLED
/components/component[name='transceiver0_1_1_1']/oc-linecard:linecard/state/openconfig-platform-augments:slot-admin-state SLOT_ENABLED
```

###### Temperatura
```bash
/components/component[name='transceiver0_1_1_1']/state/temperature/instant 29.2
```

###### Transceiver Info
```bash
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/present PRESENT
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/form-factor QSFP28
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/vendor "FINISAR CORP.   "
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/vendor-part "FTLC1154SDPL    "
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/vendor-rev A0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/serial-no "U0FA76M         "
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/date-code "181019  "
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/nominal-wavelength 0.0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/temp-high-alarm 75
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/temp-low-alarm -5
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/temp-high-warning 70
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/temp-low-warning 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/rx-power-high-alarm 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/rx-power-low-alarm 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/rx-power-high-warning 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/rx-power-low-warning 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/tx-bias-high-alarm 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/tx-bias-low-alarm 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/tx-bias-high-warning 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/tx-bias-low-warning 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/tx-power-high-alarm 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/tx-power-low-alarm 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/tx-power-high-warning 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/tx-power-low-warning 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/extended-compliance 3
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/identifier 17
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/state/pad-transceiver:qsfp28-info/specification-compliance 0
```

###### Physical Channels - Lanes

O QSFP28 é representado por 4 lanes.

State global é acessado pela lane `index = 0`.

State por lane, acessado na respectiva lane.

```bash
## LANE 0 - GLOBAL
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/tx-laser false
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:alo OFF
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:rx-power-threshold/min-power -30.0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:rx-power-threshold/max-power 5.0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:rx-power-threshold/alarm-enable false
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:tx-power-threshold/min-power 0.0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:tx-power-threshold/max-power 5.0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:tx-power-threshold/alarm-enable false
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/pad-transceiver:tx-laser-off-reason [ ADMINISTRATIVE ]
## LANE 0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/output-power/instant -40.0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/input-power/instant -40.0
# LANE 1
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='1']/state/output-power/instant -40.0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='1']/state/input-power/instant -40.0
# LANE 2
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='2']/state/output-power/instant -40.0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='2']/state/input-power/instant -40.0
# LANE 3
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='3']/state/output-power/instant -40.0
/components/component[name='transceiver0_1_1_1']/oc-transceiver:transceiver/physical-channels/channel[index='3']/state/input-power/instant -40.0
```

##### QSFPDD
O exemplo mostrado refere-se ao transceiver cliente 7.2, porém os paths e valores são válidos para todos os transceivers QSFPDD usados em portas cliente que o suportam.
###### Inventário
```bash
/components/component[name='transceiver0_1_7_2']/state/name transceiver0_1_7_2
/components/component[name='transceiver0_1_7_2']/state/type TRANSCEIVER
/components/component[name='transceiver0_1_7_2']/state/empty false
/components/component[name='transceiver0_1_7_2']/state/oc-alarms:equipment-failure false
/components/component[name='transceiver0_1_7_2']/state/oc-alarms:equipment-mismatch false
/components/component[name='transceiver0_1_7_2']/oc-linecard:linecard/state/power-admin-state POWER_ENABLED
/components/component[name='transceiver0_1_7_2']/oc-linecard:linecard/state/openconfig-platform-augments:slot-admin-state SLOT_ENABLED
```

###### Temperatura
```bash
/components/component[name='transceiver0_1_7_2']/state/temperature/instant 27.4
```

###### Transceiver Info
```bash
components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/present PRESENT
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/form-factor QSFPDD
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/vendor "Gigalight       "
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/vendor-part GQD-MPO201-DSR4C
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/vendor-rev "A "
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/serial-no "M1907187813     "
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/date-code "190910  "
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/nominal-wavelength 0.0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/temp-high-alarm 85
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/temp-low-alarm -15
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/temp-high-warning 80
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/temp-low-warning -10
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/rx-power-high-alarm 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/rx-power-low-alarm 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/rx-power-high-warning 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/rx-power-low-warning 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/tx-bias-high-alarm 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/tx-bias-low-alarm 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/tx-bias-high-warning 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/tx-bias-low-warning 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/tx-power-high-alarm 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/tx-power-low-alarm 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/tx-power-high-warning 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/tx-power-low-warning 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/extended-compliance 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/identifier 24
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/specification-compliance 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/cmis-module-media-type-encodings 1
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/state/pad-transceiver:qsfpdd-info/cmis-module-media-interface-id 648518346341351424
```

###### Physical Channels - Lanes

O QSFPDD é representado por 4 lanes.

State global é acessado pela lane `index = 0`.

State por lane, acessado na respectiva lane.

```bash
## LANE 0 - GLOBAL
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/tx-laser false
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:alo OFF
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:rx-power-threshold/min-power -30.0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:rx-power-threshold/max-power 5.0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:rx-power-threshold/alarm-enable false
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:tx-power-threshold/min-power 0.0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:tx-power-threshold/max-power 5.0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/openconfig-platform-augments:tx-power-threshold/alarm-enable false
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/pad-transceiver:tx-laser-off-reason [ ADMINISTRATIVE ]
## LANE 0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/output-power/instant -40.0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='0']/state/input-power/instant -40.0
# LANE 1
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='1']/state/output-power/instant -40.0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='1']/state/input-power/instant -40.0
# LANE 2
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='2']/state/output-power/instant -40.0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='2']/state/input-power/instant -40.0
# LANE 3
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='3']/state/output-power/instant -40.0
/components/component[name='transceiver0_1_7_2']/oc-transceiver:transceiver/physical-channels/channel[index='3']/state/input-power/instant -40.0
```

#### Optical channels
###### Inventário
Exemplo: Porta Rede 1 do TM1200G
```bash
state name         opticalchannel0_1_9
state type         OPTICAL_CHANNEL
state empty        false
state equipment-failure false
state equipment-mismatch false
```

#### Logical channels

##### Inventário Lógico `openconfig-terminal-device`
O TM1200G tem sua estrutura de transporte representada logicamente pelos seguintes elementos:
![](https://i.imgur.com/1wBS389.png)

A tabela abaixo faz uma relação entre as portas e os logical channels:
![](https://i.imgur.com/ZiEdJrR.png)

##### Dados de State `openconfig-terminal-device`
Como existe um número elevado de logical channels, o exemplo abaixo mostrará somente um logical channel de cada camada da tabela mostrada acima.

###### 100GE - Channel 1031303
```bash
/terminal-device/logical-channels/channel[index='1031303']/state/index 1031303
/terminal-device/logical-channels/channel[index='1031303']/state/description "100GE C3"
/terminal-device/logical-channels/channel[index='1031303']/state/trib-protocol PROT_100GE
/terminal-device/logical-channels/channel[index='1031303']/state/logical-channel-type PROT_ETHERNET
/terminal-device/logical-channels/channel[index='1031303']/state/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1031303']/ingress/state/transceiver transceiver0_1_3_1
/terminal-device/logical-channels/channel[index='1031303']/logical-channel-assignments/assignment[index='1']/state/index 1
/terminal-device/logical-channels/channel[index='1031303']/logical-channel-assignments/assignment[index='1']/state/description "100GE -> ODU4"
/terminal-device/logical-channels/channel[index='1031303']/logical-channel-assignments/assignment[index='1']/state/assignment-type LOGICAL_CHANNEL
/terminal-device/logical-channels/channel[index='1031303']/logical-channel-assignments/assignment[index='1']/state/logical-channel 1101302
/terminal-device/logical-channels/channel[index='1031303']/logical-channel-assignments/assignment[index='1']/state/allocation 100.0
```
###### ODU4 - Channel 1101302
```bash
/terminal-device/logical-channels/channel[index='1101302']/state/index 1101302
/terminal-device/logical-channels/channel[index='1101302']/state/description "ODU4 L2-C3"
/terminal-device/logical-channels/channel[index='1101302']/state/logical-channel-type PROT_OTN
/terminal-device/logical-channels/channel[index='1101302']/logical-channel-assignments/assignment[index='1']/state/index 1
/terminal-device/logical-channels/channel[index='1101302']/logical-channel-assignments/assignment[index='1']/state/description "ODU4 -> OTU4"
/terminal-device/logical-channels/channel[index='1101302']/logical-channel-assignments/assignment[index='1']/state/assignment-type LOGICAL_CHANNEL
/terminal-device/logical-channels/channel[index='1101302']/logical-channel-assignments/assignment[index='1']/state/logical-channel 1101301
/terminal-device/logical-channels/channel[index='1101302']/logical-channel-assignments/assignment[index='1']/state/allocation 100.0
```
###### OTU4 - Channel 1101301
```bash
/terminal-device/logical-channels/channel[index='1101301']/state/index 1101301
/terminal-device/logical-channels/channel[index='1101301']/state/description "OTU4 L2-C3"
/terminal-device/logical-channels/channel[index='1101301']/state/logical-channel-type PROT_OTN
/terminal-device/logical-channels/channel[index='1101301']/otn/state/tti-msg-transmit "0PADTEC-SAPI-SM.0PADTEC-DAPI-SM.PADTEC Operator Specific SM = 32"
/terminal-device/logical-channels/channel[index='1101301']/otn/state/tti-msg-expected 0PADTEC-SAPI-SM.0PADTEC-DAPI-SM.
/terminal-device/logical-channels/channel[index='1101301']/otn/state/oc-opt-term-augments:timdetmo OFF
/terminal-device/logical-channels/channel[index='1101301']/otn/state/oc-opt-term-augments:timactenable false
/terminal-device/logical-channels/channel[index='1101301']/otn/state/oc-opt-term-augments:pn-ebc 0
/terminal-device/logical-channels/channel[index='1101301']/otn/state/oc-opt-term-augments:pn-ds 7478
/terminal-device/logical-channels/channel[index='1101301']/otn/state/oc-opt-term-augments:pf-ebc 0
/terminal-device/logical-channels/channel[index='1101301']/otn/state/oc-opt-term-augments:pf-ds 0
/terminal-device/logical-channels/channel[index='1101301']/logical-channel-assignments/assignment[index='1']/state/index 1
/terminal-device/logical-channels/channel[index='1101301']/logical-channel-assignments/assignment[index='1']/state/description "OTU4 -> ODUj"
/terminal-device/logical-channels/channel[index='1101301']/logical-channel-assignments/assignment[index='1']/state/assignment-type LOGICAL_CHANNEL
/terminal-device/logical-channels/channel[index='1101301']/logical-channel-assignments/assignment[index='1']/state/logical-channel 1101001
/terminal-device/logical-channels/channel[index='1101301']/logical-channel-assignments/assignment[index='1']/state/allocation 100.0
```
###### ODUj - Channel 1101001
```bash
/terminal-device/logical-channels/channel[index='1101001']/state/index 1101001
/terminal-device/logical-channels/channel[index='1101001']/state/description "ODUj L2"
/terminal-device/logical-channels/channel[index='1101001']/state/logical-channel-type PROT_OTN
/terminal-device/logical-channels/channel[index='1101001']/logical-channel-assignments/assignment[index='1']/state/index 1
/terminal-device/logical-channels/channel[index='1101001']/logical-channel-assignments/assignment[index='1']/state/description "ODUj -> OTUj"
/terminal-device/logical-channels/channel[index='1101001']/logical-channel-assignments/assignment[index='1']/state/assignment-type LOGICAL_CHANNEL
/terminal-device/logical-channels/channel[index='1101001']/logical-channel-assignments/assignment[index='1']/state/logical-channel 1101000
/terminal-device/logical-channels/channel[index='1101001']/logical-channel-assignments/assignment[index='1']/state/allocation 600.0
```
###### OTUj - Channel 1101000
```bash
/terminal-device/logical-channels/channel[index='1101000']/state/index 1101000
/terminal-device/logical-channels/channel[index='1101000']/state/description "OTUj L2"
/terminal-device/logical-channels/channel[index='1101000']/state/logical-channel-type PROT_OTN
/terminal-device/logical-channels/channel[index='1101000']/state/loopback-mode NONE
/terminal-device/logical-channels/channel[index='1101000']/otn/state/fec-uncorrectable-blocks 0
/terminal-device/logical-channels/channel[index='1101000']/otn/state/fec-corrected-bits 0
/terminal-device/logical-channels/channel[index='1101000']/otn/state/pre-fec-ber/avg 340282346638528873215639292979608587801.990395866994704384
/terminal-device/logical-channels/channel[index='1101000']/otn/state/pre-fec-ber/min 340282346638528873215639292979608587801.990395866994704384
/terminal-device/logical-channels/channel[index='1101000']/otn/state/pre-fec-ber/max 340282346638528873215639292979608587801.990395866994704384
/terminal-device/logical-channels/channel[index='1101000']/ingress/state/transceiver transceiver0_1_10
/terminal-device/logical-channels/channel[index='1101000']/logical-channel-assignments/assignment[index='1']/state/index 1
/terminal-device/logical-channels/channel[index='1101000']/logical-channel-assignments/assignment[index='1']/state/description "OTUj -> opticalchannel"
/terminal-device/logical-channels/channel[index='1101000']/logical-channel-assignments/assignment[index='1']/state/assignment-type OPTICAL_CHANNEL
/terminal-device/logical-channels/channel[index='1101000']/logical-channel-assignments/assignment[index='1']/state/optical-channel opticalchannel0_1_10
/terminal-device/logical-channels/channel[index='1101000']/logical-channel-assignments/assignment[index='1']/state/allocation 600.0
```

#### System
As informações de inventário em system são:
- A hora do sistema
- O site-id, group-id e site-name que são configurados com os respectivos valores *harcoded*: 1, 0 e "TM1200G"

###### Inventário
```bash
system state current-datetime 2021-01-26T21:43:35.342Z+00:00
system site state site-id 1
system site state group-id 0
system site state site-name TM1200G
```

#### Interfaces DCN e GL
As interfaces ETH das portas GL e DCN são descritas em inventário JSON e são gerenciáveis.

A interface GL está disponível somente para leitura.

Para a interface DCN, o usuário pode configurar IP e MÁSCARA de rede, e também habilitar/desabilitar.

Valores pré-definidos:

- VlanId DCN: 100
- Vlan GL: 301

###### Interface DCN
Exemplo de uma placa configurada com o IP 172.30.0.128. O IP varia conforme a rede usada:
```bash
/interfaces/interface[name='dcn0_1_1']/subinterfaces/subinterface[index='0']/state/index 0
/interfaces/interface[name='dcn0_1_1']/subinterfaces/subinterface[index='0']/state enabled
/interfaces/interface[name='dcn0_1_1']/subinterfaces/subinterface[index='0']/oc-ip:ipv4/addresses/address[ip='172.30.0.128']/state/ip 172.30.0.128
/interfaces/interface[name='dcn0_1_1']/subinterfaces/subinterface[index='0']/oc-ip:ipv4/addresses/address[ip='172.30.0.128']/state/prefix-length 16
/interfaces/interface[name='dcn0_1_1']/subinterfaces/subinterface[index='0']/oc-ip:ipv4/state enabled
/interfaces/interface[name='dcn0_1_1']/subinterfaces/subinterface[index='0']/oc-vlan:vlan/state/vlan-id 100
```

###### Interface GL
```bash
/interfaces/interface[name='gl0_1_1']/subinterfaces/subinterface[index='0']/state/index 0
/interfaces/interface[name='gl0_1_1']/subinterfaces/subinterface[index='0']/state enabled
/interfaces/interface[name='gl0_1_1']/subinterfaces/subinterface[index='0']/oc-ip:ipv4/addresses/address[ip='169.254.32.5']/state/ip 169.254.32.5
/interfaces/interface[name='gl0_1_1']/subinterfaces/subinterface[index='0']/oc-ip:ipv4/addresses/address[ip='169.254.32.5']/state/prefix-length 30
/interfaces/interface[name='gl0_1_1']/subinterfaces/subinterface[index='0']/oc-ip:ipv4/state enabled
/interfaces/interface[name='gl0_1_1']/subinterfaces/subinterface[index='0']/oc-vlan:vlan/state/vlan-id 301
```

#### Local-routes
O local-route representa o default gateway da placa e varia conforme a rede usada.

Exemplo de default-gw para uma placa configurada com IP 172.30.0.128:

```bash
/local-routes/static-routes/static[prefix='172.30.0.254/16']/state/prefix 172.30.0.254/16
```

## Actions
Actions são comandos *rpc* que executam uma ação.

#### Reboot da placa
Atualmente somente o reboot está disponível no set de comandos do TM1200G, não existindo uma opção de reset das configurações padrão, desta forma, as actions para realizar o reboot são as seguintes:

```bash
request reboot-request component linecard0_1 method SYSTEM
```

```bash
request reboot-request component linecard0_1 method FACTORY
```

#### Reset de Contadores OTN
Para o TM1200G, o reset de contadores é implementado somente para os logical channels relacionados às portas rede, ou seja, **1090900** e **1101000**.

O reset de contadores OTN é realizado pela seguinte action:
```bash
request terminal-device logical-channels channel 1090900 otn action reset-performance-data type ALL
```

As opções ALL, FEC e OTN estão disponíveis como parâmetro, mas todos eles realizam o mesmo reset no TM1200G, pois não há distinção de tipo de reset OTN implementado no set de comandos da placa.

#### Reset dos PORTS
Esta action está disponível somente para as portas do lado rede, ou seja, **port0_1_9** e **port0_1_10**. Ela executa um reboot na porta rede escolhida.

```bash
request components component port0_1_9 port action port-reset
```

## Notifications
A subscrição em canais de notificação netconf segue o mesmo padrão do apresentado na seção 'Netconf Notifications' documento USER_GUIDE_W1.md.

#### Métricas
As métricas são conjuntos de valores da placa que são atualizadas a cada 15 minutos. O formato das notificações é:

```xml
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2021-01-30T14:31:32+00:00</eventTime>
  <espvl-metrics xmlns="http://padtec.com.br/yang/padtec-netconf-notifications">
    <chassis-id>0</chassis-id>
    <slot-id>1</slot-id>
    <metrics>
      <metric>
        <timestamp>1612016637320</timestamp>
        <path>/get/qsfp/client_2/qsfp_operational_temperature</path>
        <value>'NaN'</value>
        <opcode>9298</opcode>
      </metric>
    </metrics>
  </espvl-metrics>
</notification>
```

O campo `path` da notificação não aponta diretamente para o caminho no modelo yang, e ainda faz referência ao ppm3. É possível converter o path da notificação de ppm3 para o caminho de dados do modelo yang usando a tabela abaixo:

| Metric path | OpenConfig |
| ----------- | ---------- |
| `/get/qsfp/<interface>/qsfp_operational_temperature` | /components/component{TRANSCEIVER}/state/temperature |
| `/get/port/<interface>/port_operational_output_power` | /components/component{OPTICALCHANNEL}/optical-channel/state/output-power/instant |
| `/get/port/<interface>/port_operational_rx_channel_power` | /components/component{OPTICALCHANNEL}/optical-channel/state/input-power/instant |
| `/get/port/<interface>/port_current_osnr` | /components/component{OPTICALCHANNEL}/optical-channel/state/osnr/avg |
| `/get/port/<interface>/port_current_q` | /components/component{OPTICALCHANNEL}/optical-channel/state/q-value/avg |
| `/get/port/<interface>/port_current_chromatic_dispersion` | /components/component{OPTICALCHANNEL}/optical-channel/state/chromatic-dispersion/avg/ |
| `/get/port/<interface>/port_current_carrier_frequency_offset` | /components/component{OPTICALCHANNEL}/optical-channel/state/carrier-frequency-offset/avg/ |
| `/get/port/<interface>/port_current_pdl` | /components/component{OPTICALCHANNEL}/optical-channel/state/polarization-dependent-loss/avg |
| `/get/port/<interface>/port_current_dgd` | /components/component{OPTICALCHANNEL}/optical-channel/state/differential-group-delay/avg |
| `/get/port/<interface>/port_current_sopmd` | /components/component{OPTICALCHANNEL}/optical-channel/state/second-order-polarization-mode-dispersion/avg |
| `/get/port/<interface>/port_current_sop` | /components/component{OPTICALCHANNEL}/optical-channel/state/sop-change-rate/avg |
| `/get/port/<interface>/port_operational_rx_channel_power` | /components/component{OPTICALCHANNEL}/optical-channel/state/input-power/instant |
| `/get/port/<interface>/port_operational_output_power` | /components/component{OPTICALCHANNEL}/optical-channel/state/output-power/instant |
| `/get/otn/<interface>/otujk_ho_feccorr` | /terminal-device/logical-channels/channel{LOGICALCHANNEL}/otn/state/fec-corrected-bits |
| `/get/otn/<interface>/otujk_ho_fecuncorr` | /terminal-device/logical-channels/channel{LOGICALCHANNEL}/otn/state/fec-uncorrectable-blocks |
| `/get/otn/<interface>/otujk_ho_ber/ber_ave` | /terminal-device/logical-channels/channel{LOGICALCHANNEL}/otn/state/pre-fec-ber/avg |
| `/get/otn/<interface>/otuk_tt_sk_mi_pn_ebc` | /terminal-device/logical-channels/channel{LOGICALCHANNEL}/otn/state/pn-ebc |
| `/get/otn/<interface>/otuk_tt_sk_mi_pf_ebc` | /terminal-device/logical-channels/channel{LOGICALCHANNEL}/otn/state/pf-ebc |
| `/get/otn/<interface>/otuk_tt_sk_mi_pn_ds` | /terminal-device/logical-channels/channel{LOGICALCHANNEL}/otn/state/pn-ds |
| `/get/otn/<interface>/otuk_tt_sk_mi_pf_ds` | /terminal-device/logical-channels/channel{LOGICALCHANNEL}/otn/state/pf-ds |
| `/get/core/sys/ac1200_temperature/asic_line` | devices device linecard* terminal-device logical-channels channel * otn state q-value instant |

#### PPM3
Formato das notificações de [trap](https://) ppm3:
```xml
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2021-01-30T13:57:00+00:00</eventTime>
  <espvl-ppm3-alarm xmlns="http://padtec.com.br/yang/padtec-netconf-notifications">
    <chassis-id>0</chassis-id>
    <slot-id>1</slot-id>
    <alarm-key>trap_otuk_tt_sk_mi_cssf@net_1_1@alarm_cleared</alarm-key>
    <alarm-opcode>22211</alarm-opcode>
    <alarm-name>trap_otuk_tt_sk_mi_cssf</alarm-name>
    <alarm-interface>net_1_1</alarm-interface>
    <alarm-timestamp>1612015020877</alarm-timestamp>
    <alarm-type>alarm_cleared</alarm-type>
  </espvl-ppm3-alarm>
</notification>
```

Formato das notificações de flags ppm3:
```xml
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2021-01-30T13:57:02+00:00</eventTime>
  <espvl-ppm3-alarm xmlns="http://padtec.com.br/yang/padtec-netconf-notifications">
    <chassis-id>0</chassis-id>
    <slot-id>1</slot-id>
    <alarm-key>flag_port_administrative_operation_mode@net_1@alarm_flag</alarm-key>
    <alarm-opcode>13891</alarm-opcode>
    <alarm-name>flag_port_administrative_operation_mode</alarm-name>
    <alarm-interface>net_1</alarm-interface>
    <alarm-timestamp>1612015022279</alarm-timestamp>
    <alarm-type>alarm_flag</alarm-type>
    <flag-value>[ /get/port/net_1/port_administrative_operation_mode/chromatic_dispertion_control[=0]                                             /get/port/net_1/port_administrative_operation_mode/high_search[=3000]                                             /get/port/net_1/port_administrative_operation_mode/low_search[=-3000]                                             /get/port/net_1/port_administrative_operation_mode/phase_encoding[=0]                                             /get/port/net_1/port_administrative_operation_mode/port_operation_mode[=3] ]
    </flag-value>
  </espvl-ppm3-alarm>
</notification>
```

#### Transações (beta)
Para habilitar ou desabilitar essa funcionalidade, primeiramente é necessário parar a execução das aplicações. Isso pode ser feito dentro da placa através do script `tm1200g-ctl` da seguinte forma:
```bash
tm1200g-ctl stop
```

Antes de subir aplicação novamente, é necessário executar os seguintes comandos para habilitar ou desabilitar:
- Para habilitar:```export ESPVL_INTENDED_TRANSACTION_NOTIF= ```
- Para desabilitar: ```unset -v ESPVL_INTENDED_TRANSACTION_NOTIF```

Após fazer o export ou unset da flag, suba novamente as aplicações usando o script `tm1200g-ctl`.
```bash
tm1200g-ctl start
```

**Nota**: Essa é uma feature beta e deve ser usada somente em testes ou debugs. Depois de utilizá-la, é recomendável sempre desativá-la.

O formato das notificações é:
```xml
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2020-09-21T11:41:46+00:00</eventTime>
  <espvl-intended-result xmlns="http://padtec.com.br/yang/padtec-netconf-notifications">
    <chassis-id>0</chassis-id>
    <slot-id>2</slot-id>
    <txid>1</txid>
    <status>COMPLETED</status>
    <size>1</size>
    <changes>
      <change>
        <id>15</id>
        <path>/devices/device{linecard0_2}/terminal-device/logical-channels/channel{201}/config/trib-protocol</path>
        <value>pad-opt-types:PROT_NONE</value>
        <status>APPLIED</status>
        <index>1</index>
      </change>
    </changes>
  </espvl-intended-result>
</notification>
```

## Recomendações e Troubleshooting

### Atualização manual da aplicação `superviser`
Em alguns casos, pode ser desejável que somente a app `superviser` seja atualizada com alguma versão específica. Isso pode poupar tempo, por exemplo, em casos onde foram feitas alterações somente na aplicação ou em modelos Yang quando a imagem base não foi alterada. Através do link http://esbuild01/artifactory/build/sandbox.erlang.superviser/ é possível acessar uma página onde todas as builds disponíveis estão listadas. Para fazer o download do artefato, clique no número da build desejada, e em seguida clique novamente no arquivo com o formato de nome superviser-\*.tar.gz, como exemplificado na imagem abaixo:

![](https://i.imgur.com/d1wdPt9.png)

Depois de obter o arquivo tar.gz da aplicação `superviser`, execute os passos abaixo:

**Nota**: O nome <superviser.tar.gz> é um exemplo, é necessário substituí-lo pelo nome exato do arquivo que foi baixado no passo anterior.

1. Copiar aplicação para o TM1200G:
```bash
scp <superviser.tar.gz> root@<IP_TM1200G>:/home/root
```

2. Acessar o TM1200G:
```bash
ssh root@<IP_TM1200G>
```

3. A partir do TM1200G, parar as aplicações:
```bash
tm1200g-ctl stop
```

4. Executar:
```bash
cd /opt/padtec/pkgs/sandbox.erlang.superviser && rm -rf ./*
tar -xzvf /home/root/<superviser.tar.gz>
```

5. Iniciar novamente as aplicações:
```bash
tm1200g-ctl start
```

### Logs da aplicação superviser
Os logs da aplicação `superviser` foram modificados na Wave 3. Eles continuam sendo salvos no diretório `/opt/padtec/pkgs/sandbox.erlang.superviser/log`, porém os arquivos de registro dos logs foram nomeados como `superviser.debug.log` e `superviser.errors.log`.

O logger_level inicial da aplicação foi alterada para `error`, ou seja, inicialmente ela só irá escrever nos arquivos mensagens com level igual ou menor que error. Os levels estão presentes na tabela abaixo:

**Nota**: Quanto menor o Integer do level, maior a sua prioridade, ou seja, os logs de emergency são os mais prioritários e importantes, e de debug os menos prioritários.
| Level | Integer | Description |
| -------- | -------- | -------- |
| emergency | 0 | system is unusable |
| alert | 1 | action must be taken immediately |
| critical | 2 | critical conditions |
| error | 3 | error conditions |
| warning | 4 | warning conditions |
| notice | 5 | normal but significant conditions |
| info | 6 | informational messages |
| debug | 7 | debug-level messages |

Caso algum teste ou debug demande a captura de logs mais completos, é possível alterar o level dos logs para debug. Para alterar o level, o usuário deve estar logado na placa e a aplicação `superviser` deve estar sendo executada para que se execute um attach a ela. Ao executar o `superviser-ctl attach`, o usuário estará logado na cli da aplicação `superviser`, conforme mostrado no exemplo abaixo:
```bash
# superviser-ctl attach
Attaching to /tmp/erl_pipes/superviser@127.0.0.1/erlang.pipe.1 (^D to exit)

(superviser@127.0.0.1)2>
```

Após executar o attach e logar na cli da aplicação `superviser`, para mudar o level dos logs para debug execute o comando mostrado abaixo:

**Obs**.: O ponto ao fim da linha é necessário.
```bash
(superviser@127.0.0.1)1> padlog:app_debug(all).
[ok,ok,ok,ok,ok,ok]
```

É possível usar os seguintes comandos na cli da app superviser para alterar o level:
`app_debug(all).` : Altera a prioridade para debug.
`app_emergency(all).` : Altera a prioridade para emergency.
`app_error(all).` : Altera a prioridade para error.
`app_info(all).`: Altera a prioridade para info.
`app_warning(all).` : Altera a prioridade para warning.

Como citado anteriormente, existem os arquivos `superviser.debug.log` e `superviser.errors.log`, a distinção entre eles é a seguinte:
- `superviser.debug.log`: Registra todas as mensagens de log que estejam dentro da criticidade do level configurado no momento da captura, por exemplo, se o level for configurado para `debug`, todas as outras mensagens serão registradas nele, pois `debug` é o level mais abrangente.
- `superviser.debug.log`: Indepente do level configurado no momento da captura, só mensagens de `error` ou mais críticas serão registradas nele.


### Dados de Config Inconsistentes
Alguns casos de uso podem colocar o sistema num estado inconsistente de configuração, que não reflete a configuração da linecard.

Alguns elementos de configuração não são validados até serem processados pela linecard. Nesses casos, a linecard pode não aplicar o `Commit` do usuário (porque o valor é inválido ou por algum erro interno) tornando a config inconsistente. Essa discrepância pode ser identificada quando o `state` difere da `config`.

`Commit`: é a `Intenção de Modificação` validada e persistida no CDB do ConfD. A operação de commit para o `low-level` (formato e protocolo das linecards) é assíncrona.

#### Recomendação para config de valores não validados por modelo

É recomendado que o manual da placa seja consultado para saber quais são os valores válidos, a fim de evitar inconsistências entre a `config` (config desejada) e o `state` (estado operacional).

A maioria dos elementos de config não são validados por modelo e só serão validados na linecard. Se um valor inválido é configurado, mas rejeitado pela placa, o usuário pode a qualquer momento reconfigurar com um valor válido.

**Exemplo.** Usuário configura um modo de operação inválido. O modo de operação não é validado na aplicação, somente na linecard.

A config inicial é:
```bash
> show components component opticalchannel0_1_9 optical-channel state operational-mode 
optical-channel state operational-mode 3
```

O comando abaixo tentará plicar o valor 20:
```bash
% set components component opticalchannel0_1_9 optical-channel config operational-mode 20
% commit
Commit complete. <<---- a intenção foi aceita, pois o valor só será validado na linecard

A config agora:
```bash
> show configuration components component opticalchannel0_1_9 optical-channel config operational-mode
operational-mode 20;
```

Mas o state diverge, pois o equipamento rejeitou o valor 20:
```bash
> show components component opticalchannel0_1_9 optical-channel state operational-mode       
optical-channel state operational-mode 3
```

Como a aplicação não interfere na config do usuário, o valor da config permanece 20. Para restaurar, o usuário deverá editar o valor em novo commit. Consulte a seção sobre **Dados de Config Inconsistentes.**

### Restaurar a configuração default dos equipamentos

**Atenção:** este procedimento desprovisiona os serviços de transporte, cessando o tráfego.

A aplicação superviser não instrumenta o reset de configuração para default, pois o set de comandos do TM1200G não implementa tal funcionalidade, sendo assim, a restauração deve ser feita manualmente seguindo os passos listados abaixo:
1. Faça login na placa e apague o arquivo de configuração da placa:
```bash
rm /data/dao.json
```
2. Execute o reboot da placa:
```bash
reboot
```

Após o processo de boot, a placa estará novamente com as configurações default.

## Documentação Complementar e Referências

[Documentação do Projeto no Confluence](http://confluence.padtec.com.br:8090/pages/viewpage.action?pageId=165517538)

[ONF - Informational Reference Design for Open Disaggregated Transport Network](https://www.opennetworking.org/wp-content/uploads/2019/04/ONF-Info-1002-ODTN-032919.pdf)

[Treinamento SDN](\\terra\tecnologia\TREINAMENTOS\SDN)

## Anexo I - Configuração Default do TM1200G
