Skip to content

Cani alpha add connections

cani alpha add connections

Add cable connections from a YAML connection map or CSV file.

Synopsis

Add cable connections from a declarative YAML file or a CSV file. The CSV format is auto-detected from the header row:

Human CSV (one row per cable): a_device,a_port,b_device,b_port[,type,label,color,length,length_unit,status] Use a_device="_defaults" row for cable defaults (type, color, status, length_unit).

Nautobot interfaces CSV (exported from Nautobot, paired by UUID): name,device__name,id,cable_peer[,cable__pk,type,status__name,label]

YAML (.yaml, .yml): A connection map with brace-expansion patterns.

Use the 'generate' subcommand to create a connection map from a topology pattern (star, leaf-spine, ring) without writing YAML by hand.

Examples: cani alpha add connections topology.yaml cani alpha add connections topology.yaml --dry-run cani alpha add connections interfaces.csv --dry-run cani alpha add connections cables.csv --dry-run cani alpha add connections generate star --hub switch-01 --spokes "node-{01..48}"

cani alpha add connections [flags]

Options

      --dry-run                Show what would be created without modifying the inventory

Options inherited from parent commands

  -a, --auto                   Automatically recommend values for parent hardware
  -y, --accept                 Automatically accept recommended values.
  -L, --list-supported-types   List supported hardware types.
  -q, --qty int                Quantity of items to add. (default 1)
  -p, --parent string          Parent item UUID. (default "00000000-0000-0000-0000-000000000000")
      --prefix string          Name prefix for sequential naming (used with --qty).
      --start int              Starting number for sequential names (used with --prefix). (default 1)
      --pad-width int          Zero-pad width for sequential names (0 = auto).
      --tag stringArray        Tag(s) to apply to the item (repeatable)
      --metadata stringArray   Provider metadata key=value pairs (repeatable)
      --status string          Status (Active, Available, Connected, Decommissioned, Decommissioning, Deprecated, Deprovisioning, Down, End-of-Life, Extended Support, Failed, Inventory, Maintenance, Offline, Planned, Primary, Provisioning, Reserved, Retired, Secondary, Staging, or any custom status)
      --serial string          Serial number
      --config string          config file (default "/home/runner/.cani/cani.yml")
      --debug                  enable debug mode
      --datastore string       datastore type (json, postgres) (default "json")
      --datastore-path string  override path to the datastore file (for testing)
      --types-dirs stringSlice local directories with additional hardware types
      --types-repos stringSlice git repo URLs with additional hardware types
      --types-repo-clone       clone types repos that are not yet cached locally
      --types-repo-pull        pull latest changes from types repos on startup
      --strict                 require a resolved device type (slug) for all devices (default true)

SEE ALSO