{"id":19825245,"url":"https://github.com/tes3awy/register-fabric-nodes","last_synced_at":"2026-06-11T11:31:09.493Z","repository":{"id":37851592,"uuid":"499948017","full_name":"Tes3awy/register-fabric-nodes","owner":"Tes3awy","description":"Register Nodes to the ACI Fabric","archived":false,"fork":false,"pushed_at":"2023-05-23T06:17:11.000Z","size":280,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T20:45:51.141Z","etag":null,"topics":["apic","cisco-aci","cobra","datacenter","datacenter-automation","fabric-api","network-automation","python","requests","rest-api"],"latest_commit_sha":null,"homepage":"https://developer.cisco.com/codeexchange/github/repo/Tes3awy/register-fabric-nodes","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tes3awy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-04T22:18:02.000Z","updated_at":"2023-02-24T13:03:56.000Z","dependencies_parsed_at":"2025-01-11T08:51:22.391Z","dependency_job_id":"b2f0b8fa-101c-4095-95d3-187f0ba3f102","html_url":"https://github.com/Tes3awy/register-fabric-nodes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Tes3awy/register-fabric-nodes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tes3awy%2Fregister-fabric-nodes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tes3awy%2Fregister-fabric-nodes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tes3awy%2Fregister-fabric-nodes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tes3awy%2Fregister-fabric-nodes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tes3awy","download_url":"https://codeload.github.com/Tes3awy/register-fabric-nodes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tes3awy%2Fregister-fabric-nodes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34197393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apic","cisco-aci","cobra","datacenter","datacenter-automation","fabric-api","network-automation","python","requests","rest-api"],"created_at":"2024-11-12T11:07:06.432Z","updated_at":"2026-06-11T11:31:09.472Z","avatar_url":"https://github.com/Tes3awy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![published](https://static.production.devnetcloud.com/codeexchange/assets/images/devnet-published.svg)](https://developer.cisco.com/codeexchange/github/repo/Tes3awy/register-fabric-nodes)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat-square\u0026labelColor=ef8336)](https://pycqa.github.io/isort/)\n![LICENSE](https://img.shields.io/github/license/Tes3awy/register-fabric-nodes?color=purple\u0026style=flat-square\u0026label=LICENSE)\n![Commit Activity](https://img.shields.io/github/commit-activity/m/Tes3awy/register-fabric-nodes/main?logo=github\u0026style=flat-square)\n\n# Register Nodes to ACI Fabric\n\n\u003e When you run the application, the system determines if the node exists and, if not, adds it. If the node exists, the system registers it.\n\n\u003e The application uses the `APIC-Challenge token` for a stronger API session security. To learn more about the challenge token, see [Requiring a Challenge Token for an API Session](https://www.cisco.com/c/en/us/td/docs/switches/datacenter/aci/apic/sw/2-x/rest_cfg/2_1_x/b_Cisco_APIC_REST_API_Configuration_Guide/b_Cisco_APIC_REST_API_Configuration_Guide_chapter_01.html#ariaid-title33).\n\n## Table of Contents\n\n1. [Directory Structure](#directory-structure)\n2. [Overview](#overview)\n3. [Fabric Node Discovery Statuses](#fabric-node-discovery-statuses)\n4. [Installation](#installation)\n5. [Register Fabric Nodes](#register-fabric-nodes)\n6. [Bonus (Cobra SDK)](#bonus)\n\n## Directory Structure\n\nThe directory contains the following files:\n\n```\n│   main.py\n│   apic.py\n│   nodes.py\n│   apic_cobra.py\n│   Fabric-Nodes.xlsx\n|   requirements.txt\n│   README.md\n│   LICENSE\n│   .gitignore\n├───assets\n│       apic_nodes.jpg\n│       registered_nodes.jpg\n└───\n```\n\n1. `apic.py` module contains the APIC functions to connect and have access to the APIC Controller.\n2. `nodes.py` module contains the functions to read nodes to be registered and register those nodes.\n3. `main.py` module contains the main function to run the application.\n4. `Fabric-Nodes.xlsx` is an MS Excel spreadsheet with four nodes to be registered _(All Columns are validated using [Excel data validation](https://support.microsoft.com/en-us/office/apply-data-validation-to-cells-29fecbcc-d1b9-42c1-9d76-eff3ce5f7249) feature to restrict duplicate or invalid data and to show an error alert even before registering the nodes)_.\n5. For `apic_cobra.py` module, check [Bonus](#bonus) section.\n\n## Overview\n\nAfter a switch/node is registered with the APIC, the switch is a part of the APIC-managed fabric inventory. With the\nACI fabric, the APIC is the single point of provisioning, management, and monitoring for switches in the infrastructure.\n\nSwitches in the `Nodes Pending Registration` tab table can have the following conditions:\n\n- A newly discovered but unregistered node has a node ID of 0 and has no assigned IP address.\n- A manually entered (in APIC) but unregistered switch has an original status of `Undiscovered` until it is physically connected to the network. Once connected, the status changes to `Discovered`.\n\n![APIC Nodes](assets/apic_nodes.jpg)\n\n**Note:** After the node ID is assigned, it cannot be updated/edited.\n\n## Fabric Node Discovery Statuses\n\n| Status       | Description                                             |\n| ------------ | ------------------------------------------------------- |\n| Unknown      | Node is discovered but no Node ID policy is configured. |\n| Undiscovered | Node ID configured but is not yet discovered.           |\n| Discovering  | Node is discovered but IP is not yet assigned.          |\n| Unsupported  | Node is not a supported model.                          |\n| Disabled     | Node has been decommissioned.                           |\n| Inactive     | No IP connectivity.                                     |\n| Active       | Node is active.                                         |\n\n## Installation\n\n### Option A\n\n1. Download the repo from GitHub using `Code` button.\n2. Unzip the repo.\n3. Create a Python virtual environment and activate it.\n4. Install requirements.\n\n```powershell\nregister-fabric-nodes-main\u003e python -m venv .venv --upgrade-deps\nregister-fabric-nodes-main\u003e .\\.venv\\Scripts\\Activate.ps1\nregister-fabric-nodes-main\u003e python -m pip install wheel\nregister-fabric-nodes-main\u003e python -m pip install -r requirements.txt\n```\n\n### Option B\n\n1. Clone the repo from GitHub.\n2. Create a Python virtual environment and activate it.\n3. Install requirements.\n\n```bash\n$ git clone https://github.com/Tes3awy/register-fabric-nodes.git\n$ cd register-fabric-nodes\n$ python3 -m venv .venv --upgrade-deps\n$ source .venv/bin/activate\n$ python3 -m pip install wheel\n$ python3 -m pip install -r requirements.txt\n```\n\n## Register Fabric Nodes\n\n\u003e An Excel file is already attached in the repo and is prepopulated with two leafs and two spines from [Getting Started with Cisco ACI 5.2 v1](https://dcloud2-lon.cisco.com/content/demo/505213?returnPathTitleKey=content-view) from Cisco dCloud.\n\n\u003e **For non Cisco partners, you can use the application with the [ACI Simulator 5.2](https://devnetsandbox.cisco.com/RM/Diagram/Index/740f912b-e9c8-4c7b-a1d7-691649dfa0dd) from Cisco DevNet Sandbox. (Requires reservation)**\n\nAdd your ACI fabric nodes to `Fabric-Nodes.xlsx`.\n\nIn `Node Type` column (Column A), you can select only one of the following _four_ valid node types:\n\n1. `unspecified`\n2. `tier-2-leaf`\n3. `remote-wan-leaf`\n4. `virtual`\n\n\u003e If you don't know which value to select from the `Node Type` column, choose `unspecified`.\n\nIn `Node Role` column (Column B), you can select only one of the following _three_ valid node roles:\n\n1. `spine`\n2. `leaf`\n3. `unspecified`\n\nAfter filling out all columns in `Fabric-Nodes.xlsx`, double check your entries, save the Excel file, and exit MS Excel.\n\n![Registered Nodes](assets/registered_nodes.jpg)\n\nFinally, run the application.\n\n**Windows**\n\n```powershell\n\u003e py main.py\n# or\n\u003e py -m main\n```\n\n**Nix or macOS**\n\n```bash\n$ python3 main.py\n# or\n$ python3 -m main\n```\n\nYou will be prompted to enter Excel file, APIC URL, username, and password.\n\nExample:\n\n```bash\nNodes Excel file: Fabric-Nodes.xlsx\nAPIC IP Address: sandboxapicdc.cisco.com\nUsername: admin\nPassword:\n```\n\n\u003e **Note:** After a successful run, the node is removed from the `Nodes Pending Registration` tab table to `Registered Nodes` tab table and you cannot by any means update/edit neither the `node type` nor the `node id`.\n\n---\n\n## Bonus\n\nIf you have downloaded and installed the Cobra SDK _(i.e., `acicobra` and `acimodel` wheel files)_, you can run the application using `apic_cobra.py`. It's faster than the regular application (Around 1.8x faster).\n\n```bash\n$ python apic_cobra.py\n# or\n$ python -m apic_cobra\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftes3awy%2Fregister-fabric-nodes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftes3awy%2Fregister-fabric-nodes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftes3awy%2Fregister-fabric-nodes/lists"}