import requests import json # Base URL base_url = "http://localhost:8000" # Authenticate auth_url = f"{base_url}/api/v1/auth/login" auth_payload = { "username": "admin", "password": "admin123" } auth_response = requests.post(auth_url, json=auth_payload) token = auth_response.json().get("access_token") headers = { "Content-Type": "application/json", "Authorization": f"Bearer {token}" } # Read all mappings read_url = f"{base_url}/api/v1/configuration/action-mappings/export" read_response = requests.get(read_url, headers=headers) if read_response.status_code == 200: data = read_response.json() print(f"Total mappings: {data.get('total_mappings', 0)}") print(f"Mappings with parameters: {data.get('mappings_with_parameters', 0)}") print("\nAll mapping names:") for idx, mapping in enumerate(data.get("mappings", []), 1): name = mapping.get("name", "") output_count = len(mapping.get("output_actions", [])) print(f"{idx}. '{name}' ({output_count} actions)") # Check for our test mappings test_names = ["CRUD Test Mapping", "Test Action Mapping"] print("\n\nLooking for test mappings:") for test_name in test_names: found = False for mapping in data.get("mappings", []): if test_name in mapping.get("name", ""): print(f"FOUND: {mapping.get('name')}") found = True break if not found: print(f"NOT FOUND: {test_name}") else: print(f"Error: {read_response.status_code} - {read_response.text}")