Skip to content

Commit

Permalink
Feat(eos_cli_config_gen): Add knob to define port in GNMI transport g…
Browse files Browse the repository at this point in the history
…rpc (#3245)

Co-authored-by: Guillaume Mulocher <[email protected]>
Co-authored-by: Claus Holbech <[email protected]>
  • Loading branch information
3 people authored Oct 19, 2023
1 parent 232ca91 commit ae7c25e
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ interface Management1

#### Management API gNMI Summary

| Transport | SSL Profile | VRF | Notification Timestamp | ACL |
| --------- | ----------- | --- | ---------------------- | --- |
| MGMT | gnmi | MGMT | send-time | acl1 |
| mytransport | - | - | send-time | acl1 |
| Transport | SSL Profile | VRF | Notification Timestamp | ACL | Port |
| --------- | ----------- | --- | ---------------------- | --- | ---- |
| MGMT | gnmi | MGMT | send-time | acl1 | 6030 |
| mytransport | - | - | send-time | acl1 | 6032 |

Provider eos-native is configured.

Expand All @@ -56,6 +56,7 @@ management api gnmi
ip access-group acl1
notification timestamp send-time
transport grpc mytransport
port 6032
ip access-group acl1
notification timestamp send-time
provider eos-native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ interface Management1

#### Management API gNMI Summary

| Transport | SSL Profile | VRF | Notification Timestamp | ACL |
| --------- | ----------- | --- | ---------------------- | --- |
| MGMT | - | MGMT | last-change-time | ACL-GNMI |
| MONITORING | - | MONITORING | last-change-time | - |
| Transport | SSL Profile | VRF | Notification Timestamp | ACL | Port |
| --------- | ----------- | --- | ---------------------- | --- | ---- |
| MGMT | - | MGMT | last-change-time | ACL-GNMI | 6030 |
| MONITORING | - | MONITORING | last-change-time | - | 6031 |

Provider eos-native is configured.

Expand All @@ -54,6 +54,7 @@ management api gnmi
vrf MGMT
ip access-group ACL-GNMI
transport grpc MONITORING
port 6031
vrf MONITORING
provider eos-native
```
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ management api gnmi
ip access-group acl1
notification timestamp send-time
transport grpc mytransport
port 6032
ip access-group acl1
notification timestamp send-time
provider eos-native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ management api gnmi
vrf MGMT
ip access-group ACL-GNMI
transport grpc MONITORING
port 6031
vrf MONITORING
provider eos-native
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ management_api_gnmi:
- name: mytransport
notification_timestamp: "send-time"
ip_access_group: acl1
port: "6032"
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ management_api_gnmi:
ip_access_group: ACL-GNMI
- name: MONITORING
vrf: MONITORING
port: 6031
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vrf</samp>](## "management_api_gnmi.transport.grpc.[].vrf") | String | | | | VRF name is optional |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;notification_timestamp</samp>](## "management_api_gnmi.transport.grpc.[].notification_timestamp") | String | | | Valid Values:<br>- send-time<br>- last-change-time | Per the gNMI specification, the default timestamp field of a notification message is set to be<br>the time at which the value of the underlying data source changes or when the reported event takes place.<br>In order to facilitate integration in legacy environments oriented around polling style operations,<br>an option to support overriding the timestamp field to the send-time is available from EOS 4.27.0F.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ip_access_group</samp>](## "management_api_gnmi.transport.grpc.[].ip_access_group") | String | | | | ACL name |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;port</samp>](## "management_api_gnmi.transport.grpc.[].port") | Integer | | | | GNMI port.<br>Make sure to update the control-plane ACL accordingly in order for the service to be reachable by external applications.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;grpc_tunnels</samp>](## "management_api_gnmi.transport.grpc_tunnels") | List, items: Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- name</samp>](## "management_api_gnmi.transport.grpc_tunnels.[].name") | String | Required, Unique | | | Transport name |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shutdown</samp>](## "management_api_gnmi.transport.grpc_tunnels.[].shutdown") | Boolean | | | | Operational status of the gRPC tunnel |
Expand Down Expand Up @@ -49,6 +50,7 @@
vrf: <str>
notification_timestamp: <str>
ip_access_group: <str>
port: <int>
grpc_tunnels:
- name: <str>
shutdown: <bool>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7868,6 +7868,11 @@
"type": "string",
"description": "ACL name",
"title": "IP Access Group"
},
"port": {
"type": "integer",
"description": "GNMI port.\nMake sure to update the control-plane ACL accordingly in order for the service to be reachable by external applications.\n",
"title": "Port"
}
},
"additionalProperties": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4717,6 +4717,16 @@ keys:
ip_access_group:
type: str
description: ACL name
port:
type: int
description: 'GNMI port.
Make sure to update the control-plane ACL accordingly in order
for the service to be reachable by external applications.
'
convert_types:
- str
grpc_tunnels:
type: list
primary_key: name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ keys:
ip_access_group:
type: str
description: ACL name
port:
type: int
description: |
GNMI port.
Make sure to update the control-plane ACL accordingly in order for the service to be reachable by external applications.
convert_types:
- str
grpc_tunnels:
type: list
primary_key: name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@
{# new table view using the new flags #}
{% if management_api_gnmi.transport.grpc is arista.avd.defined %}

| Transport | SSL Profile | VRF | Notification Timestamp | ACL |
| --------- | ----------- | --- | ---------------------- | --- |
| Transport | SSL Profile | VRF | Notification Timestamp | ACL | Port |
| --------- | ----------- | --- | ---------------------- | --- | ---- |
{% for transport in management_api_gnmi.transport.grpc %}
{% if transport.name is arista.avd.defined %}
{% set transport_name = transport.name %}
{% set ssl_profile = transport.ssl_profile | arista.avd.default('-') %}
{% set vrf = transport.vrf | arista.avd.default('-') %}
{% set notif = transport.notification_timestamp | arista.avd.default('last-change-time') %}
{% set acl = transport.ip_access_group | arista.avd.default('-') %}
| {{ transport_name }} | {{ ssl_profile }} | {{ vrf }} | {{ notif }} | {{ acl }} |
{% set port = transport.port | arista.avd.default('6030') %}
| {{ transport_name }} | {{ ssl_profile }} | {{ vrf }} | {{ notif }} | {{ acl }} | {{ port }} |
{% endif %}
{% endfor %}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ management api gnmi
{% if transport.ssl_profile is arista.avd.defined %}
ssl profile {{ transport.ssl_profile }}
{% endif %}
{% if transport.port is arista.avd.defined %}
port {{ transport.port }}
{% endif %}
{% if transport.vrf is arista.avd.defined %}
vrf {{ transport.vrf }}
{% endif %}
Expand Down

0 comments on commit ae7c25e

Please sign in to comment.