import requests base_url = "http://localhost:8000" # Authenticate auth_response = requests.post( f"{base_url}/api/v1/auth/login", json={"username": "admin", "password": "admin123"} ) token = auth_response.json().get("access_token") headers = { "Content-Type": "application/json", "Authorization": f"Bearer {token}" } # Get full config config_response = requests.get( f"{base_url}/api/v1/configuration/export", headers=headers ) if config_response.status_code == 200: data = config_response.json() # Get the last node nodes = data.get("nodes", []) if nodes: last_node = nodes[-1] print(f"Last node in configuration:") print(f" Type: {last_node.get('node_type')}") print(f" Name: {last_node.get('name', 'N/A')}") print(f" Value: {last_node.get('value', 'N/A')}") print(f" Offset: {last_node.get('start_offset')} - {last_node.get('end_offset')}") print(f" File size: {data.get('file_size')} bytes") print(f"\n Gap between last node end and file end: {data.get('file_size') - last_node.get('end_offset')} bytes") # Look at the last few nodes to understand structure print(f"\nLast 5 nodes:") for node in nodes[-5:]: print(f" [{node.get('start_offset'):6d}-{node.get('end_offset'):6d}] {node.get('node_type'):10s} {node.get('name', '')[:50]}") else: print(f"Error: {config_response.status_code}")