netbox-optics


Namenetbox-optics JSON
Version 0.4.1 PyPI version JSON
download
home_pageNone
SummaryNetBox plugin for modeling Wavelength Division Multiplexing optical connections
upload_time2025-10-25 08:08:31
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords netbox plugin optics wdm wavelength dwdm cwdm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # NetBox Optics Plugin

NetBox plugin for modeling Wavelength Division Multiplexing optical connections.

## Features

- **Optical Grid Types**: Define wavelength grid templates (DWDM, CWDM, FlexGrid)
- **Optical Grid Instances**: Create grid instances from templates
- **Wavelength Management**: Track individual wavelengths with their availability status
- **Optical Spans**: Model optical fiber connections between sites
- **Optical Connections**: Map interfaces to wavelengths on spans
- **Mux Device Support**: Map wavelengths to multiplexer ports
- **Validation**: Comprehensive validation of wavelength reservations and device assignments
- **REST API**: Full API support for automation

## Requirements

- Python 3.10 or higher
- NetBox 3.7.8 or later
- Django 4.2 or later

## Installation

### From PyPI 

```bash
pip install netbox-optics
```

### From Source

```bash
# Build the package
pip install build
python -m build

# Install the wheel
pip install dist/netbox_optics-0.3.0-py3-none-any.whl
```

### From Git Repository

```bash
pip install git+https://github.com/dropbox/netbox-optics.git #todo url
```

### Configuration

Add to your NetBox `configuration.py`:

```python
PLUGINS = ['netbox_optics']

PLUGINS_CONFIG = {
    'netbox_optics': {}
}
```

Run database migrations:

```bash
python manage.py migrate netbox_optics
```

Restart NetBox services:

```bash
sudo systemctl restart netbox
```

## Usage

### Quick Start

1. **Define an Optical Grid Type** – Create a template with wavelength spacing (e.g., DWDM 50GHz, CWDM)
   - Navigate to: Plugins → Optical Grid Types → Add
   - Set spacing and add wavelengths

2. **Create an Optical Grid** – Instantiate a grid from a template
   - Navigate to: Plugins → Optical Grids → Add
   - Select a grid type

3. **Create an Optical Span** – Define fiber connection between sites
   - Navigate to: Plugins → Optical Spans → Add
   - Select sites A and B, assign a grid, set vendor circuit ID

4. **Create Optical Connections** – Link interfaces through wavelengths
   - Navigate to: Plugins → Optical Connections → Add
   - Select span, wavelength, and interfaces

5. **Optional: Map Mux Devices** – Assign wavelengths to multiplexer ports
   - Navigate to: Plugins → Mux Wavelength Maps → Add
   - Select mux device, port, and wavelength

### API Usage

```python
import requests

# Get all optical spans
response = requests.get(
    'https://netbox.example.com/api/plugins/optics/optical-spans/',
    headers={'Authorization': 'Token YOUR_TOKEN'}
)

# Create an optical connection
response = requests.post(
    'https://netbox.example.com/api/plugins/optics/optical-connections/',
    headers={'Authorization': 'Token YOUR_TOKEN'},
    json={
        'span': 1,
        'wavelength': 1000.00,
        'interface_a': 100,
        'interface_z': 200,
        'tx_power': 10
    }
)
```

## Development

### Setup

```bash
# Clone the repository
git clone https://github.com/dropbox/netbox-optics.git #todo url
cd netbox-optics

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install in development mode with dev dependencies
pip install -e ".[dev]"
```

### NetBox Development Environment

```bash
# Clone NetBox (if not already available)
git clone https://github.com/netbox-community/netbox.git
cd netbox

# Install NetBox dependencies
pip install -r requirements.txt

# Install the plugin
pip install -e /path/to/netbox-optics

# Add to configuration.py
echo "PLUGINS = ['netbox_optics']" >> netbox/netbox/configuration.py

# Run migrations
python manage.py migrate netbox_optics

# Start development server
python manage.py runserver
```

### Code Quality

```bash
# Lint the code
flake8 netbox_optics/

# Format code
black netbox_optics/
```

### Testing

```bash
# Install test dependencies
pip install -e ".[dev]"

# Run tests with NetBox API token
export netbox_token=your_token_here
pytest tests/e2e_tests/ -v -s

# Run specific test file
pytest tests/e2e_tests/test_crud.py -v
```

### Building

```bash
# Install build tool
pip install build

# Build distribution packages
python -m build

# Output: dist/netbox_optics-0.3.0.tar.gz and dist/netbox_optics-0.3.0-py3-none-any.whl
```

## Documentation

- **API Documentation**: Available at `/api/plugins/optics/` on your NetBox instance

## Support

- **Issues**: Report bugs or request features on [GitHub Issues](https://github.com/dropbox/netbox-optics/issues) # todo url

## Acknowledgments

Thanks to Dropbox for supporting open source development!

## License

```
Copyright (c) 2025 Dropbox, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

See [LICENSE](LICENSE) file for full license text.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "netbox-optics",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "netbox, plugin, optics, wdm, wavelength, dwdm, cwdm",
    "author": null,
    "author_email": "Konstantin Kudryavtsev <kkudryavtsev@dropbox.com>",
    "download_url": null,
    "platform": null,
    "description": "# NetBox Optics Plugin\n\nNetBox plugin for modeling Wavelength Division Multiplexing optical connections.\n\n## Features\n\n- **Optical Grid Types**: Define wavelength grid templates (DWDM, CWDM, FlexGrid)\n- **Optical Grid Instances**: Create grid instances from templates\n- **Wavelength Management**: Track individual wavelengths with their availability status\n- **Optical Spans**: Model optical fiber connections between sites\n- **Optical Connections**: Map interfaces to wavelengths on spans\n- **Mux Device Support**: Map wavelengths to multiplexer ports\n- **Validation**: Comprehensive validation of wavelength reservations and device assignments\n- **REST API**: Full API support for automation\n\n## Requirements\n\n- Python 3.10 or higher\n- NetBox 3.7.8 or later\n- Django 4.2 or later\n\n## Installation\n\n### From PyPI \n\n```bash\npip install netbox-optics\n```\n\n### From Source\n\n```bash\n# Build the package\npip install build\npython -m build\n\n# Install the wheel\npip install dist/netbox_optics-0.3.0-py3-none-any.whl\n```\n\n### From Git Repository\n\n```bash\npip install git+https://github.com/dropbox/netbox-optics.git #todo url\n```\n\n### Configuration\n\nAdd to your NetBox `configuration.py`:\n\n```python\nPLUGINS = ['netbox_optics']\n\nPLUGINS_CONFIG = {\n    'netbox_optics': {}\n}\n```\n\nRun database migrations:\n\n```bash\npython manage.py migrate netbox_optics\n```\n\nRestart NetBox services:\n\n```bash\nsudo systemctl restart netbox\n```\n\n## Usage\n\n### Quick Start\n\n1. **Define an Optical Grid Type** \u2013 Create a template with wavelength spacing (e.g., DWDM 50GHz, CWDM)\n   - Navigate to: Plugins \u2192 Optical Grid Types \u2192 Add\n   - Set spacing and add wavelengths\n\n2. **Create an Optical Grid** \u2013 Instantiate a grid from a template\n   - Navigate to: Plugins \u2192 Optical Grids \u2192 Add\n   - Select a grid type\n\n3. **Create an Optical Span** \u2013 Define fiber connection between sites\n   - Navigate to: Plugins \u2192 Optical Spans \u2192 Add\n   - Select sites A and B, assign a grid, set vendor circuit ID\n\n4. **Create Optical Connections** \u2013 Link interfaces through wavelengths\n   - Navigate to: Plugins \u2192 Optical Connections \u2192 Add\n   - Select span, wavelength, and interfaces\n\n5. **Optional: Map Mux Devices** \u2013 Assign wavelengths to multiplexer ports\n   - Navigate to: Plugins \u2192 Mux Wavelength Maps \u2192 Add\n   - Select mux device, port, and wavelength\n\n### API Usage\n\n```python\nimport requests\n\n# Get all optical spans\nresponse = requests.get(\n    'https://netbox.example.com/api/plugins/optics/optical-spans/',\n    headers={'Authorization': 'Token YOUR_TOKEN'}\n)\n\n# Create an optical connection\nresponse = requests.post(\n    'https://netbox.example.com/api/plugins/optics/optical-connections/',\n    headers={'Authorization': 'Token YOUR_TOKEN'},\n    json={\n        'span': 1,\n        'wavelength': 1000.00,\n        'interface_a': 100,\n        'interface_z': 200,\n        'tx_power': 10\n    }\n)\n```\n\n## Development\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/dropbox/netbox-optics.git #todo url\ncd netbox-optics\n\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate\n\n# Install in development mode with dev dependencies\npip install -e \".[dev]\"\n```\n\n### NetBox Development Environment\n\n```bash\n# Clone NetBox (if not already available)\ngit clone https://github.com/netbox-community/netbox.git\ncd netbox\n\n# Install NetBox dependencies\npip install -r requirements.txt\n\n# Install the plugin\npip install -e /path/to/netbox-optics\n\n# Add to configuration.py\necho \"PLUGINS = ['netbox_optics']\" >> netbox/netbox/configuration.py\n\n# Run migrations\npython manage.py migrate netbox_optics\n\n# Start development server\npython manage.py runserver\n```\n\n### Code Quality\n\n```bash\n# Lint the code\nflake8 netbox_optics/\n\n# Format code\nblack netbox_optics/\n```\n\n### Testing\n\n```bash\n# Install test dependencies\npip install -e \".[dev]\"\n\n# Run tests with NetBox API token\nexport netbox_token=your_token_here\npytest tests/e2e_tests/ -v -s\n\n# Run specific test file\npytest tests/e2e_tests/test_crud.py -v\n```\n\n### Building\n\n```bash\n# Install build tool\npip install build\n\n# Build distribution packages\npython -m build\n\n# Output: dist/netbox_optics-0.3.0.tar.gz and dist/netbox_optics-0.3.0-py3-none-any.whl\n```\n\n## Documentation\n\n- **API Documentation**: Available at `/api/plugins/optics/` on your NetBox instance\n\n## Support\n\n- **Issues**: Report bugs or request features on [GitHub Issues](https://github.com/dropbox/netbox-optics/issues) # todo url\n\n## Acknowledgments\n\nThanks to Dropbox for supporting open source development!\n\n## License\n\n```\nCopyright (c) 2025 Dropbox, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\nSee [LICENSE](LICENSE) file for full license text.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "NetBox plugin for modeling Wavelength Division Multiplexing optical connections",
    "version": "0.4.1",
    "project_urls": null,
    "split_keywords": [
        "netbox",
        " plugin",
        " optics",
        " wdm",
        " wavelength",
        " dwdm",
        " cwdm"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5dda74c40082ce97d169a8b9fa7757880728da2e07a9084bba2aa911dcccdb6c",
                "md5": "7d043dc24a583b14da35822051e4091d",
                "sha256": "b8135243953b90df0de4b1e2a5c32ba72c0bd1fffe75c929fb0bd86b52494e12"
            },
            "downloads": -1,
            "filename": "netbox_optics-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7d043dc24a583b14da35822051e4091d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 46481,
            "upload_time": "2025-10-25T08:08:31",
            "upload_time_iso_8601": "2025-10-25T08:08:31.874600Z",
            "url": "https://files.pythonhosted.org/packages/5d/da/74c40082ce97d169a8b9fa7757880728da2e07a9084bba2aa911dcccdb6c/netbox_optics-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-25 08:08:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "netbox-optics"
}
        
Elapsed time: 0.89428s