netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.88k stars 2.55k forks source link

GraphQL Tunnel termination - Get interface data #16348

Open antoinekh opened 4 months ago

antoinekh commented 4 months ago

NetBox version

v4.0.3

Feature type

Data model extension

Proposed functionality

(related to https://github.com/netbox-community/netbox/issues/15731)

With graphql we can have vpn terminaison data like outside IP BUT NOT interface data.

It will be nice to be able to query interface data relation to VPNterminaison.

For example to be able to do My current request:

query Gettunnels {
  tunnel_list (filters: {status:"active"}){
    name
    description
    custom_fields
    terminations (filters: {role:"peer"}){
    id
       outside_ip {
         address
      }
     interface {
       address
      }
    }
  }
}

Use case

My use case is to get the information from the view below (terminaiton interface and IP address)

image

My current request:

query Gettunnels {
  tunnel_list (filters: {status:"active"}){
    name
    description
    custom_fields
    terminations (filters: {role:"peer"}){
            id
      outside_ip {
        address
      }

    }
  }
}

Right now my solution is to get all the terminaison id and to do a get http://127.0.0.1:8000/api/vpn/tunnel-terminations/id to get the interface data, and then another request to get the IP.

Database changes

No response

External dependencies

No response

github-actions[bot] commented 4 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.