diff --git a/patchs/swagger-v3.4.10-available-ip.patch b/patchs/swagger-v3.4.10-available-ip.patch new file mode 100644 index 00000000..cddc6204 --- /dev/null +++ b/patchs/swagger-v3.4.10-available-ip.patch @@ -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" : "", diff --git a/utils/netbox_generate_client b/utils/netbox_generate_client index 5e59871a..2a15e457 100755 --- a/utils/netbox_generate_client +++ b/utils/netbox_generate_client @@ -1,6 +1,6 @@ #!/bin/bash -set -xeu +set -eu PROJECT_ROOT=${PROJECT_ROOT:-"$(dirname $GITHUB_WORKSPACE)/src/github.com/smutel/go-netbox"} @@ -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 @@ -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 ..." @@ -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 diff --git a/utils/netbox_major_version b/utils/netbox_major_version index a6c62602..79450835 100644 --- a/utils/netbox_major_version +++ b/utils/netbox_major_version @@ -1 +1 @@ -v3.3 +v3.4