Skip to content

Conversation

@cpaillet
Copy link
Collaborator

@cpaillet cpaillet commented Jun 18, 2024

As OpenConfig doesn't have SNMP configuration, we use the IETF YANG model defined in RFC 7407: https://datatracker.ietf.org/doc/rfc7407/

This review includes:

  • An ingestor from the NetBox-Network-CMDB SNMP API endpoint.
    netbox endpoint:
{
            "device": {
                "id": 60335,
                "name": "ra19.05.jp2.pnet.crto.io"
            },
            "community_list": [
                {
                    "name": "global_ro",
                    "community": "mufdqsdfqsdf",
                    "type": "readonly"
                },
                {
                    "name": "globalrw",
                    "community": "qsdfqsfqsfqsdfdqsdf",
                    "type": "readwrite"
                }
            ],
            "location": "loc1",
            "contact": "cc2"
}
  • Generate IETF Go code from the YANG model.
  • A converter to map NetBox-Network-CMDB to the YANG model.
  • Create new endpoints:
    • /v1/devices/:hostname/ietfconfig
{
   "snmp":{
      "community":[
         {
            "index":"global_ro",
            "security-name":"readonly",
            "text-name":"mufdqsdfqsdf"
         },
         {
            "index":"globalrw",
            "security-name":"readwrite",
            "text-name":"qsdfqsfqsfqsdfdqsdf"
         }
      ]
   },
   "system":{
      "contact":"cc2",
      "location":"loc1"
   }
}
  • /v1/devices/:hostname/config
  {
   "ietf":{
      "snmp":{
         "community":[
            {
               "index":"global_ro",
               "security-name":"readonly",
               "text-name":"mufdqsdfqsdf"
            },
            {
               "index":"globalrw",
               "security-name":"readwrite",
               "text-name":"qsdfqsfqsfqsdfdqsdf"
            }
         ]
      },
      "system":{
         "contact":"cc2",
         "location":"loc1"
      }
   },
   "openconfig":{ <..curent openconfig..>

@cpaillet cpaillet requested a review from a team June 19, 2024 14:06
As OpenConfig doesn't have SNMP configuration, we use the IETF YANG model defined in
RFC 7407: https://datatracker.ietf.org/doc/rfc7407/

This review includes:
- An ingestor from the NetBox-Network-CMDB SNMP API endpoint.
- Generate IETF Go code from the YANG model.
- A converter to map NetBox-Network-CMDB to the YANG model.
- Create new endpoints:
  - /v1/devices/:hostname/ietfconfig
  - /v1/devices/:hostname/config
@cpaillet cpaillet merged commit 45d4207 into criteo:main Jul 1, 2024
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