NbTree

class nbforager.nb_tree.NbTree(*, circuits: ~nbforager.nb_tree.CircuitsM = <CircuitsM: >, core: ~nbforager.nb_tree.CoreM = <CoreM: >, dcim: ~nbforager.nb_tree.DcimM = <DcimM: >, extras: ~nbforager.nb_tree.ExtrasM = <ExtrasM: >, ipam: ~nbforager.nb_tree.IpamM = <IpamM: >, tenancy: ~nbforager.nb_tree.TenancyM = <TenancyM: >, users: ~nbforager.nb_tree.UsersM = <UsersM: >, virtualization: ~nbforager.nb_tree.VirtualizationM = <VirtualizationM: >, vpn: ~nbforager.nb_tree.VpnM = <VpnM: >, wireless: ~nbforager.nb_tree.WirelessM = <WirelessM: >)

Structure that holds Netbox objects as dictionaries.

Model: NbTree.{app}.{model}[id] = data.

  • {app} - Attribute representing application name.

  • {model} - Attribute representing model name.

  • id - Unique identifier of Netbox object.

  • data - Netbox object data as a dictionary.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

apps() List[str]

Get all application names.

Returns:

Application names.

Example:

NbTree().apps() -> [“circuit_terminations”, “circuit_types”, …]

clear() None

Clear all data in all models.

count() int

Count the number of Netbox objects for all models.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].