Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend GraphQL FHRPGroupType with ip_addresses #14832

Closed
Leo1003 opened this issue Jan 17, 2024 · 0 comments · Fixed by #15337
Closed

Extend GraphQL FHRPGroupType with ip_addresses #14832

Leo1003 opened this issue Jan 17, 2024 · 0 comments · Fixed by #15337
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@Leo1003
Copy link
Contributor

Leo1003 commented Jan 17, 2024

NetBox version

v3.5.9

Feature type

Change to existing functionality

Proposed functionality

There is no way to get IP addresses directly in FHRPGroupType (even in the latest version). I have to make another query to get the information.

query {
  fhrp_ips: ip_address_list(fhrpgroup_id: "1234") {
    address
  }
}

However, the underlying model has the ip_addresses field which is its relation to IPAddress and the REST API can retrieve this field.

I think FHRPGroupType is just missing IPAddressesMixin ?

Use case

With this feature, one can use simple GraphQL query to get IP addresses bind to a FHRPGroup

query {
  fhrp_group(id: 1234) {
    ip_addresses {
      address
    }
  }
}

Or, directly access in the response

query {
  fhrp_group_assignment_list(device_id: "123") {
    group {
      id
      ip_addresses {
        address
      }
    }
  }
}

Database changes

No. The FHRPGroup model already has ip_addresses relation.

External dependencies

No response

@Leo1003 Leo1003 added the type: feature Introduction of new functionality to the application label Jan 17, 2024
Leo1003 added a commit to Leo1003/netbox that referenced this issue Mar 4, 2024
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Mar 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants