Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Merge requests
!77
Netbox integration including intial CLI for populating base data and ...
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Netbox integration including intial CLI for populating base data and ...
netbox-integration
into
develop
Overview
0
Commits
21
Pipelines
4
Changes
13
Merged
Neda Moeini
requested to merge
netbox-integration
into
develop
1 year ago
Overview
0
Commits
21
Pipelines
4
Changes
13
Expand
Netbox integration.
0
0
Merge request reports
Compare
develop
version 3
8c8e4ce4
1 year ago
version 2
f5cb3dda
1 year ago
version 1
895e02bf
1 year ago
develop (base)
and
latest version
latest version
9df4b4c9
21 commits,
1 year ago
version 3
8c8e4ce4
22 commits,
1 year ago
version 2
f5cb3dda
21 commits,
1 year ago
version 1
895e02bf
20 commits,
1 year ago
13 files
+
497
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
13
Search (e.g. *.vue) (Ctrl+P)
gso/cli/netbox.py
0 → 100644
+
36
−
0
Options
import
typer
from
pynetbox
import
RequestError
from
gso.services.netbox_client
import
NetBoxClient
app
:
typer
.
Typer
=
typer
.
Typer
()
@app.command
()
def
netbox_initial_setup
()
->
None
:
"""
Set up NetBox for the first time.
It includes:
- Creating a default site (GEANT)
- Creating device roles (Router)
"""
typer
.
echo
(
"
Initial setup of NetBox ...
"
)
typer
.
echo
(
"
Connecting to NetBox ...
"
)
nbclient
=
NetBoxClient
()
typer
.
echo
(
"
Creating GEANT site ...
"
)
try
:
nbclient
.
create_device_site
(
"
GEANT
"
,
"
geant
"
)
typer
.
echo
(
"
Site created successfully.
"
)
except
RequestError
as
e
:
typer
.
echo
(
f
"
Error creating site:
{
e
}
"
)
typer
.
echo
(
"
Creating Router device role ...
"
)
try
:
nbclient
.
create_device_role
(
"
router
"
,
"
router
"
)
typer
.
echo
(
"
Device role created successfully.
"
)
except
RequestError
as
e
:
typer
.
echo
(
f
"
Error creating device role:
{
e
}
"
)
typer
.
echo
(
"
NetBox initial setup completed successfully.
"
)
Loading