1129
This commit is contained in:
@@ -173,7 +173,7 @@
|
|||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
set -e
|
set -e
|
||||||
curl -sS -L --request PATCH --post301 --post302 \
|
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 "Authorization: Bearer {{ cloud_api_bearer }}" \
|
||||||
--header "Content-Type: application/json" \
|
--header "Content-Type: application/json" \
|
||||||
--header "Accept: application/json" \
|
--header "Accept: application/json" \
|
||||||
|
|||||||
@@ -179,7 +179,7 @@
|
|||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
set -e
|
set -e
|
||||||
curl -sS -L --request PATCH --post301 --post302 \
|
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 "Authorization: Bearer {{ cloud_api_bearer }}" \
|
||||||
--header "Content-Type: application/json" \
|
--header "Content-Type: application/json" \
|
||||||
--header "Accept: application/json" \
|
--header "Accept: application/json" \
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ nb_sync_one_device.py
|
|||||||
Update a single NetBox device from Cloud by hostname — ONLY if device is online.
|
Update a single NetBox device from Cloud by hostname — ONLY if device is online.
|
||||||
|
|
||||||
Behavior
|
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:
|
- Updates NetBox fields from Cloud:
|
||||||
custom_fields.fw_version ← firmwareVersion
|
custom_fields.fw_version ← firmwareVersion
|
||||||
custom_fields.nodeName ← nodeName
|
custom_fields.nodeName ← nodeName
|
||||||
@@ -40,7 +40,7 @@ from urllib3.util.retry import Retry
|
|||||||
# ------------ HARD-CODED CONFIG (per Pavel) ------------
|
# ------------ HARD-CODED CONFIG (per Pavel) ------------
|
||||||
NB_URL = "http://netbox.gt-tiso.ikeja.co.za"
|
NB_URL = "http://netbox.gt-tiso.ikeja.co.za"
|
||||||
NB_TOKEN = "7648e4f5ee370cda7834682e61b47c2ee8e95623"
|
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"
|
CLOUD_BEARER = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InBhdmVsLmxAOGRldmljZXMuY29tIiwic3ViIjoyMiwiaWF0IjoxNzg5MTk2NTQ2LCJleHAiOjE3OTE3ODg1NDZ9.fQlcMWTL4uTKewd-AjlaHOdXSMJ2JOw2RfnKKF3weWk"
|
||||||
|
|
||||||
REQ_TIMEOUT = 30
|
REQ_TIMEOUT = 30
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ nb_sync_one_device.py
|
|||||||
Update a single NetBox device from Cloud by hostname.
|
Update a single NetBox device from Cloud by hostname.
|
||||||
|
|
||||||
Behavior
|
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 online: keep ORIGINAL behavior (Cloud is SoT, including IP).
|
||||||
* If offline: query Subsystem for the device and use Subsystem IP as fallback,
|
* If offline: query Subsystem for the device and use Subsystem IP as fallback,
|
||||||
then continue with normal NetBox updates.
|
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_URL = "http://netbox.gt-tiso.ikeja.co.za"
|
||||||
NB_TOKEN = "7648e4f5ee370cda7834682e61b47c2ee8e95623"
|
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"
|
CLOUD_BEARER = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InBhdmVsLmxAOGRldmljZXMuY29tIiwic3ViIjoyMiwiaWF0IjoxNzg5MTk2NTQ2LCJleHAiOjE3OTE3ODg1NDZ9.fQlcMWTL4uTKewd-AjlaHOdXSMJ2JOw2RfnKKF3weWk"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user