From c7a30199aec7b55e0322fcfd42ab2e99324036b8 Mon Sep 17 00:00:00 2001 From: pavel Date: Fri, 25 Sep 2026 11:29:42 +0300 Subject: [PATCH] 1129 --- files/ansible-playbooks/afterupgrade_check.yml | 2 +- files/ansible-playbooks/afterupgrade_withcurl.yml | 2 +- files/nb_onedevice_update-old.py | 4 ++-- files/nb_onedevice_update.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/files/ansible-playbooks/afterupgrade_check.yml b/files/ansible-playbooks/afterupgrade_check.yml index 8cba00e..4e3cf4d 100644 --- a/files/ansible-playbooks/afterupgrade_check.yml +++ b/files/ansible-playbooks/afterupgrade_check.yml @@ -173,7 +173,7 @@ ansible.builtin.shell: | set -e curl -sS -L --request PATCH --post301 --post302 \ - "https://cloud.ikeja.co.za/v1/external/devices/{{ enc_mac }}/bandwidth-control" \ + "https://cloud.ikeja.co.za/v2/external/devices/{{ enc_mac }}/bandwidth-control" \ --header "Authorization: Bearer {{ cloud_api_bearer }}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ diff --git a/files/ansible-playbooks/afterupgrade_withcurl.yml b/files/ansible-playbooks/afterupgrade_withcurl.yml index 5beb430..bb67091 100644 --- a/files/ansible-playbooks/afterupgrade_withcurl.yml +++ b/files/ansible-playbooks/afterupgrade_withcurl.yml @@ -179,7 +179,7 @@ ansible.builtin.shell: | set -e curl -sS -L --request PATCH --post301 --post302 \ - "https://cloud.ikeja.co.za/v1/external/devices/{{ enc_mac }}/bandwidth-control" \ + "https://cloud.ikeja.co.za/v2/external/devices/{{ enc_mac }}/bandwidth-control" \ --header "Authorization: Bearer {{ cloud_api_bearer }}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ diff --git a/files/nb_onedevice_update-old.py b/files/nb_onedevice_update-old.py index f44f15d..5b6f853 100644 --- a/files/nb_onedevice_update-old.py +++ b/files/nb_onedevice_update-old.py @@ -5,7 +5,7 @@ nb_sync_one_device.py Update a single NetBox device from Cloud by hostname — ONLY if device is online. Behavior -- Liveness gate via /v1/devices/{cloud_id}/liveness (no changes if offline). +- Liveness gate via /v2/devices/{cloud_id}/liveness (no changes if offline). - Updates NetBox fields from Cloud: custom_fields.fw_version ← firmwareVersion custom_fields.nodeName ← nodeName @@ -40,7 +40,7 @@ from urllib3.util.retry import Retry # ------------ HARD-CODED CONFIG (per Pavel) ------------ NB_URL = "http://netbox.gt-tiso.ikeja.co.za" NB_TOKEN = "7648e4f5ee370cda7834682e61b47c2ee8e95623" -CLOUD_API_BASE = "https://cloud.ikeja.co.za/v1/devices" +CLOUD_API_BASE = "https://cloud.ikeja.co.za/v2/devices" CLOUD_BEARER = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InBhdmVsLmxAOGRldmljZXMuY29tIiwic3ViIjoyMiwiaWF0IjoxNzg5MTk2NTQ2LCJleHAiOjE3OTE3ODg1NDZ9.fQlcMWTL4uTKewd-AjlaHOdXSMJ2JOw2RfnKKF3weWk" REQ_TIMEOUT = 30 diff --git a/files/nb_onedevice_update.py b/files/nb_onedevice_update.py index f917824..1418063 100644 --- a/files/nb_onedevice_update.py +++ b/files/nb_onedevice_update.py @@ -5,7 +5,7 @@ nb_sync_one_device.py Update a single NetBox device from Cloud by hostname. Behavior -- Liveness gate via /v1/devices/{cloud_id}/liveness. +- Liveness gate via /v2/devices/{cloud_id}/liveness. * If online: keep ORIGINAL behavior (Cloud is SoT, including IP). * If offline: query Subsystem for the device and use Subsystem IP as fallback, then continue with normal NetBox updates. @@ -44,7 +44,7 @@ from urllib3.util.retry import Retry NB_URL = "http://netbox.gt-tiso.ikeja.co.za" NB_TOKEN = "7648e4f5ee370cda7834682e61b47c2ee8e95623" -CLOUD_API_BASE = "https://cloud.ikeja.co.za/v1/devices" +CLOUD_API_BASE = "https://cloud.ikeja.co.za/v2/devices" CLOUD_BEARER = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InBhdmVsLmxAOGRldmljZXMuY29tIiwic3ViIjoyMiwiaWF0IjoxNzg5MTk2NTQ2LCJleHAiOjE3OTE3ODg1NDZ9.fQlcMWTL4uTKewd-AjlaHOdXSMJ2JOw2RfnKKF3weWk"