nautobot/nautobot-app-circuit-maintenance

GraphQL Filter Maintenances by Site or Device

nlgotz opened this issue · 1 comments

Environment

  • Nautobot version: 1.5.16
  • nautobot-circuit-maintenance version: 0.6.2

Proposed Functionality

I'm looking to run a GraphQL query for all circuit maintenances affecting a specific site or device.

Presently, when running a GraphQL query for Circuit Maintenances affecting a site, I have to get all of the circuit maintenances and then do local filtering.

It would be nice to be able to query by site/location and/or device.

{
  circuit_maintenances(site: "ABC01") {
    id
    name
    status
    description
    start_time
    end_time
    circuitimpact_set {
      impact
      circuit {
        id
        cid
        terminations {
          site {
            slug
          }
        }
      }
    }
  }
}

or

{
  circuit_maintenances(device: "ABC01-RTR-01") {
    id
    name
    status
    description
    start_time
    end_time
    circuitimpact_set {
      impact
      circuit {
        id
        cid
        terminations {
          site {
            slug
          }
        }
      }
    }
  }
}

Use Case

  • Use in Grafana dashboards to get just the selected site or device planned circuit maintenances. This will make it easier for operators to quickly determine if the issues they're seeing are due to planned maintenance activities.

Thanks! Should be a pretty straightforward addition to CircuitMaintenanceFilterSet, I think.