Skip to content

Commit

Permalink
feat: Update from Netbox 3.4 swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
smutel committed Jun 6, 2023
1 parent e3e9d60 commit ec98310
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
38 changes: 38 additions & 0 deletions patchs/swagger-v3.4.10-available-ip.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
--- swagger-v3.3.10.json.ori 2023-01-09 09:09:15.547864594 +0100
+++ swagger-v3.3.10.json 2023-01-09 09:12:53.698816281 +0100
@@ -60861,7 +60861,10 @@
"in" : "body",
"name" : "data",
"required" : true,
- "schema" : { "$ref" : "#/definitions/WritableAvailableIP" }
+ "schema" : {
+ "items" : { "$ref" : "#/definitions/WritableAvailableIP" },
+ "type" : "array"
+ }
} ],
"responses" : { "201" : {
"description" : "",
@@ -62988,7 +62991,10 @@
"in" : "body",
"name" : "data",
"required" : true,
- "schema" : { "$ref" : "#/definitions/WritableAvailableIP" }
+ "schema" : {
+ "items" : { "$ref" : "#/definitions/WritableAvailableIP" },
+ "type" : "array"
+ }
} ],
"responses" : { "201" : {
"description" : "",
@@ -63028,7 +63034,10 @@
"in" : "body",
"name" : "data",
"required" : true,
- "schema" : { "$ref" : "#/definitions/PrefixLength" }
+ "schema" : {
+ "items" : { "$ref" : "#/definitions/PrefixLength" },
+ "type" : "array"
+ }
} ],
"responses" : { "201" : {
"description" : "",
11 changes: 7 additions & 4 deletions utils/netbox_generate_client
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -xeu
set -eu

PROJECT_ROOT=${PROJECT_ROOT:-"$(dirname $GITHUB_WORKSPACE)/src/github.com/smutel/go-netbox"}

Expand Down Expand Up @@ -45,7 +45,7 @@ export VERSION=${LAST_NETBOX_VERSION}
echo "Purge old lib generated ..."
rm -rf "${PROJECT_ROOT}/netbox" && mkdir "${PROJECT_ROOT}/netbox" && touch "${PROJECT_ROOT}/netbox/.gitkeep"

if [ ! "${PROJECT_ROOT}/swagger/swagger-${VERSION}.json" ]; then
if [ ! -f "${PROJECT_ROOT}/swagger/swagger-${VERSION}.json" ]; then
echo "Get github project netbox-docker ..."
rm -rf netbox-docker
git clone https://github.com/netbox-community/netbox-docker.git -q
Expand All @@ -56,7 +56,10 @@ if [ ! "${PROJECT_ROOT}/swagger/swagger-${VERSION}.json" ]; then
sed -i 's/netbox-media-files/gonetbox-media-files/g' docker-compose.yml
sed -i 's/netbox-postgres-data/gonetbox-postgres-data/g' docker-compose.yml
sed -i 's/netbox-redis-data/gonetbox-redis-data/g' docker-compose.yml
docker-compose up -d --quiet-pull
sed -i 's/netbox-redis-cache-data/gonetbox-redis-cache-data/g' docker-compose.yml
sed -i 's/start_period: 60s/start_period: 600s/g' docker-compose.yml
docker compose down -v
docker compose up -d --quiet-pull
cd ..

echo "Get swagger from netbox docker ..."
Expand Down Expand Up @@ -85,7 +88,7 @@ jsonlint "${PROJECT_ROOT}/netbox/swagger-${VERSION}.json"
if [ -d netbox-docker ]; then
echo "Destroy docker containers ..."
cd netbox-docker
docker-compose down -v
docker compose down -v
cd ..
fi

Expand Down
2 changes: 1 addition & 1 deletion utils/netbox_major_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.3
v3.4

0 comments on commit ec98310

Please sign in to comment.