No description
  • Go 93.5%
  • Makefile 5.6%
  • Shell 0.5%
  • Dockerfile 0.4%
Find a file
jozef.tarkanic@t-systems.com a40ebb117a Merge branch 'feature/create-cable' into 'main'
Feature/create cable

See merge request cas-devs/osc/onmetal/gonetbox!46
2025-03-26 10:11:04 +00:00
.linter-config change golangci-lint version 2025-03-18 07:51:04 +00:00
dcimapiservice Fix/get dev by serial 2025-03-24 14:35:00 +00:00
docs/images update diagram 2024-10-28 11:23:30 +01:00
ipamapiservice fix too long lines 2025-02-17 10:11:09 +00:00
nbxclient Fix/get dev by serial 2025-03-24 14:35:00 +00:00
nbxtool Feature/create cable 2025-03-26 10:11:04 +00:00
sysinfo create interfaces in nbx for device 2024-11-23 10:39:45 +00:00
.gitignore small fixes 2024-02-22 07:57:57 +01:00
.gitlab-ci.yml update image in ci pipeline 2025-03-18 07:35:45 +00:00
.pre-commit-config.yaml add linter to precommit hook 2024-04-22 15:15:08 +02:00
Dockerfile remove lldp, fixes #10 2025-02-24 09:29:26 +01:00
go.mod update golangci lint 2025-03-17 10:29:49 +00:00
go.sum update golangci lint 2025-03-17 10:29:49 +00:00
gonetbox-delay.sh exit with return code 2025-03-05 14:45:26 +00:00
main.go better loging 2025-03-21 09:01:44 +00:00
Makefile change golangci-lint version 2025-03-18 07:51:04 +00:00
netbox.yaml Revert "remove netbox.yaml" 2024-02-23 07:31:59 +00:00
README.md Update README.md 2024-09-17 14:55:14 +00:00

gonetbox

Client to create device in netbox server. To create new device name and ids of site, device role and device type are needed.

How to use

Options

Option Description Type Default Required?
--show-device Print device info bool false No
--interfaces Create or update interfaces in netbox bool false No
--ips Create or update ips for interfaces in netbox bool false No
--connections Create or update connections between interfaces in netbox bool false No

Hostname exaple: mdb1-prt-cp2

mdb1 prt cp2
site part dev role part

site part

Get site from hostname

1:1(mdb1:mdb1) match
if ffm*(ffm1:ntt) match ntt site
else match undefined site

Sites in netbox.onmetal.sk
lab
mdb1
mdb2
mdb3
ntt
undefined

device role part

Get device role from hostname

Possible roles in devicename from hardware list
- [X] COMP -> Compute
- [X] EDGE1/2 -> Networking
- [X] MGMT0 -> Partition
- [X] ZERO -> Partition
- [X] OOB -> Networking
- [X] PART1/2/3 -> Partition
- [X] REGN1/2 -> Region
- [X] ROUTER1/2 -> Router
- [X] SPINE1/2 -> Networking
- [X] STOR -> Storage
- [X] SONIC1/2/3 -> Netwoking
Device roles in netbox.onmetal.sk
Compute
Networking
Partition
Region
Router
Storage
undefined

Development

Copy repo:

git clone https://gitlab.devops.telekom.de/cas-devs/osc/onmetal/gonetbox.git

Create new branch, make changes, and push to remote repo. Tagging commit will trigger pipeline. Pipeline will build and push new container image to mtr repo in image format: gonetbox:<tag>

Local build

Help:

make help

Build binary:

make build-amd
make build-arm

Image

Prerequisites:

docker

install for macos:

brew install --cast docker

Log in to mtr.devops.telekom.de

docker login -u="<username>" -p="<password>" mtr.devops.telekom.de

Build image:

make image-build

Push image:

make image-push

gonetbox overview diagram

gonetbox-diagram