Skip to content

Conversation

@PeterSuna
Copy link
Contributor

  • Fix the "router-id" to localhost, based on the request URL where lighty is running.
  • Remove unnecessary GET request body.
  • Fix "Connect peer" to POST type.

- Fix the "router-id" to localhost, based on the request URL
  where lighty is running.
- Remove unnecessary GET request body.
- Fix "Connect peer" to POST type.

Signed-off-by: Peter Suna <[email protected]>
@gemini-code-assist
Copy link

Summary of Changes

Hello @PeterSuna, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the lighty-bgp example Postman collection to enhance its accuracy and ease of use. The changes primarily involve standardizing the target host to localhost, correcting HTTP methods for BGP peer connections, and removing redundant request bodies. A new feature has also been introduced to simplify the process of connecting multiple BGP peers, making the example more robust and functional for local development and testing.

Highlights

  • Router ID Update: The BGP router-id in the configuration has been updated to '127.0.0.1' to align with localhost operations.
  • Postman Variable Removal: The 'lighty-host' Postman variable has been removed, and all request URLs are now hardcoded to '127.0.0.1:8888' for direct local execution.
  • Request Body Cleanup: Unnecessary raw request bodies have been removed from several GET requests, streamlining the collection.
  • Connect Peer Method Correction: The 'Connect peer' request method has been corrected from GET to POST, which is the appropriate HTTP verb for this operation.
  • New Multiple Peer Connection Request: A new 'Connect MULTIPLE peer' PUT request has been added, allowing for the configuration of several BGP neighbors (127.0.0.2 through 127.0.0.6) simultaneously.
  • BGP Peer Group Remote Port Adjustment: The remote-port for the 'external-neighbor' peer group has been changed from '179' to '17900'.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request updates the Lighty-BGP example Postman collection. Key changes include fixing the router-id to localhost, removing unnecessary GET request bodies, and correcting the 'Connect peer' request to use the POST method. While these changes align with the stated goals, the removal of the lighty-host variable and subsequent hardcoding of 127.0.0.1:8888 throughout the collection reduces its flexibility and reusability for different environments. Additionally, the removal of extensive <afi-safis> configurations in some requests simplifies the examples but might limit their comprehensiveness.

"raw": ""
},
"url": {
"raw": "{{lighty-host}}/restconf/data/network-topology:network-topology/topology=bgp-example-ipv4-topology",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would stay with parameter {lighty-host} - because my lighty is not running on localhost when I invoke the requests :)

"body": {
"mode": "raw",
"raw": "<topology xmlns=\"urn:TBD:params:xml:ns:yang:network-topology\">\n <topology-id>bgp-example-ipv4-topology</topology-id>\n <topology-types>\n <bgp-ipv4-reachability-topology xmlns=\"urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types\"></bgp-ipv4-reachability-topology>\n </topology-types>\n <rib-id xmlns=\"urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config\">bgp-example</rib-id>\n</topology>"
"raw": "<topology xmlns=\"urn:TBD:params:xml:ns:yang:network-topology\">\n <topology-id>bgp-topology-example</topology-id>\n <topology-types>\n <bgp-ipv4-reachability-topology xmlns=\"urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types\"></bgp-ipv4-reachability-topology>\n </topology-types>\n <rib-id xmlns=\"urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config\">bgp-example</rib-id>\n</topology>"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we change topology id/name?

"body": {
"mode": "raw",
"raw": "<protocol xmlns=\"http://openconfig.net/yang/network-instance\">\n <name>bgp-example</name>\n <identifier xmlns:x=\"http://openconfig.net/yang/policy-types\">x:BGP</identifier>\n <bgp xmlns=\"urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions\">\n <global>\n <config>\n <router-id>10.0.0.51</router-id>\n <as>64496</as>\n </config>\n <apply-policy>\n <config>\n <default-export-policy>REJECT-ROUTE</default-export-policy>\n <default-import-policy>REJECT-ROUTE</default-import-policy>\n <import-policy>default-odl-import-policy</import-policy>\n <export-policy>default-odl-export-policy</export-policy>\n </config>\n </apply-policy>\n <afi-safis>\n <afi-safi>\n <afi-safi-name xmlns:x=\"http://openconfig.net/yang/bgp-types\">x:IPV4-UNICAST</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name xmlns:x=\"http://openconfig.net/yang/bgp-types\">x:IPV6-UNICAST</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name xmlns:x=\"http://openconfig.net/yang/bgp-types\">x:IPV4-LABELLED-UNICAST</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name xmlns:x=\"http://openconfig.net/yang/bgp-types\">x:IPV6-LABELLED-UNICAST</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name xmlns:x=\"http://openconfig.net/yang/bgp-types\">x:L3VPN-IPV4-UNICAST</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name xmlns:x=\"http://openconfig.net/yang/bgp-types\">x:L3VPN-IPV6-UNICAST</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name xmlns:x=\"http://openconfig.net/yang/bgp-types\">x:L3VPN-IPV4-MULTICAST</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name xmlns:x=\"http://openconfig.net/yang/bgp-types\">x:L3VPN-IPV6-MULTICAST</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name xmlns:x=\"http://openconfig.net/yang/bgp-types\">x:L2VPN-EVPN</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name>LINKSTATE</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name>IPV4-FLOW</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name>IPV6-FLOW</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name>IPV4-MCAST-VPN</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name>IPV6-MCAST-VPN</afi-safi-name>\n </afi-safi>\n <afi-safi>\n <afi-safi-name>ROUTE-TARGET-CONSTRAIN</afi-safi-name>\n </afi-safi>\n </afi-safis>\n </global>\n </bgp>\n</protocol>",
"raw": "<protocol xmlns=\"http://openconfig.net/yang/network-instance\">\n <name>bgp-example</name>\n <identifier xmlns:x=\"http://openconfig.net/yang/policy-types\">x:BGP</identifier>\n <bgp xmlns=\"urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions\">\n <global>\n <config>\n <router-id>127.0.0.1</router-id>\n <as>64496</as>\n </config>\n <apply-policy>\n <config>\n <default-export-policy>REJECT-ROUTE</default-export-policy>\n <default-import-policy>REJECT-ROUTE</default-import-policy>\n <import-policy>default-odl-import-policy</import-policy>\n <export-policy>default-odl-export-policy</export-policy>\n </config>\n </apply-policy>\n </global>\n </bgp>\n</protocol>",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suddenly we have lost an half of body - can you provide the reason for it?

"response": []
},
{
"name": "Connect MULTIPLE peer",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document that we have a new request in collection - commit message or new commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants