nautobot / nautobot-app-circuit-maintenance

Circuit Maintenance App for Nautobot
https://docs.nautobot.com/projects/circuit-maintenance/en/latest/
Apache License 2.0
31 stars 8 forks source link

GraphQL Filter Maintenances by Site or Device #252

Open nlgotz opened 1 year ago

nlgotz commented 1 year ago

Environment

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

glennmatthews commented 1 year ago

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