Skip to content

Extend GraphQL FHRPGroupType with ip_addresses #14832

@Leo1003

Description

@Leo1003

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

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions