networktocode.nautobot.gql_inventory (5.1.1) — inventory

Nautobot inventory source using GraphQL capability

Authors: Network to Code (@networktocode), Armen Martirosyan (@armartirosyan)

Install collection

Install with ansible-galaxy collection install networktocode.nautobot:==5.1.1


Add to requirements.yml

  collections:
    - name: networktocode.nautobot
      version: 5.1.1

Description

Get inventory hosts from Nautobot using GraphQL queries


Requirements

Inputs

    
query:
    default: {}
    description:
    - GraphQL query parameters or filters to send to Nautobot to obtain desired data
    required: false
    suboptions:
      devices:
        description:
        - Additional query parameters or filters for devices
        required: false
        type: dict
      virtual_machines:
        description:
        - Additional query parameters or filters for VMs
        required: false
        type: dict
    type: dict

token:
    description:
    - Nautobot API token to be able to read against Nautobot.
    - This may not be required depending on the Nautobot setup.
    env:
    - name: NAUTOBOT_TOKEN
    required: true

plugin:
    choices:
    - networktocode.nautobot.gql_inventory
    description: Setting that ensures this is a source file for the 'networktocode.nautobot'
      plugin.
    required: true

timeout:
    default: 60
    description: Timeout for Nautobot requests in seconds
    type: int

group_by:
    default: []
    description:
    - List of dot-sparated paths to index graphql query results (e.g. `platform.display`)
    - The final value returned by each path is used to derive group names and then group
      the devices into these groups.
    - Valid group names must be string, so indexing the dotted path should return a string
      (i.e. `platform.display` instead of `platform`)
    - 'If value returned by the defined path is a dictionary, an attempt will first be
      made to access the `name` field, and then the `display` field. (i.e. `platform`
      would attempt to lookup `platform.name`, and if that data was not returned, it would
      then try `platform.display`)

      '
    elements: str
    required: false
    type: list

api_endpoint:
    description: Endpoint of the Nautobot API
    env:
    - name: NAUTOBOT_URL
    required: true

validate_certs:
    default: true
    description:
    - Allows connection when SSL certificates are not valid. Set to C(false) when certificates
      are not trusted.
    type: boolean

group_names_raw:
    default: false
    description: Will not add the group_by choice name to the group names
    type: boolean
    version_added: 4.6.0
    version_added_collection: networktocode.nautobot

follow_redirects:
    choices:
    - urllib2
    - all
    - 'yes'
    - safe
    - none
    default: urllib2
    description:
    - Determine how redirects are followed.
    - By default, I(follow_redirects) is set to uses urllib2 default behavior.

Outputs

_list:
  description:
  - list of composed dictionaries with key and value
  type: list