Repository navigation
Conversation
Cover REST endpoints of server 1.16.8 that had no wrapper: - Users: create/update/delete/rename user, password, access groups, sessions, api keys, permissions; access groups; teams; project users. - Addon settings: set studio/project settings, studio/project overrides and raw overrides, site settings, settings migration. - Projects: anatomy presets management, project anatomy, rename, stats, tags, project bundle, root overrides, entity URIs, URI resolve, project file info; folder search and entity grouping. - Services, hosts, sites, restart required, server config schema and patch, enums, bulk event delete. - Reviewables listing/sorting/update, task assignment, entity list materialize/order, entity and project thumbnails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Raise 'UnsupportedServerVersion' when a method uses an endpoint or argument that is not available on the connected server: - 1.15.0: rename_project, get_project_thumbnail, set_project_thumbnail, set_project_thumbnail_from_stream - 1.15.4: 'search' argument of search_folders - 1.15.9: update_server_config, set_entity_list_items_order - 1.16.4: get_enums, get_reviewables, 'latest' and 'latest_done' arguments of entity reviewables getters - 1.16.7: 'error' argument of update_service - 1.16.8: migrate_addon_settings rename_user uses the deprecated PATCH endpoint on servers older than 1.15.0 instead of failing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests for users, access groups, teams, addon settings, projects, anatomy presets, folders search, thumbnails, services, sites, system, events deletion, reviewables, task assignment and entity lists run against a real AYON server, like the other server tests. Server version validation is tested without a server. Fixes found while writing the tests: - 'delete_events' refuses a filter without conditions, which would delete all events. - Settings, overrides, anatomy, roots, access group and server config payloads are sent as JSON body instead of keyword arguments, so any key name works. - 'set_project_thumbnail' and 'set_project_thumbnail_from_stream' return thumbnail id like entity thumbnail setters. - Docstrings of 'set_project_root_overrides' and 'get_version_reviewables'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@tadeas-hejnic can you test this - and review this if the code and API makes sense to you? @MustafaJafar any question on some of these from docs standpoint? |
In future more entity types might support thumbnails using the same endpoint format. It is also private method there is no reason validate it.
Not at all, thank you for the heads up. fyi, the python api docs are simply generated and deployed on release. Also, I'm considering visiting the docs generation setup for this repo to make it on par with the other docs (either switch to mk docs, or simply keep the current while updating the theme). |
I did this #367 because poetry was broken in some of the newer PRs. |
Changelog Description
Added methods for AYON server 1.16.8 REST endpoints that had no wrapper in the python api.
Additional info
Every route in server 1.16.8 was compared with the endpoints the api calls. Payloads and query params were checked against the server request models.
New helper classes (added to
ServerAPIandautomated_api.py):UsersAPI,ServicesAPI,SystemAPI,ReviewablesAPI.set_projects_access. Teams and team members. Project users.migrate_addon_settings,migrate_settings_by_bundle.get_addon_settings_schematakes optionalvariantandsite_id.rename_project, project stats and tags, project bundle (get, set, unset),set_project_root_overrides,get_project_entity_uris,resolve_uris,get_project_file_info.search_folders,get_entity_groups.update_server_config(PATCH), enums.delete_eventsthrougheventops. An empty filter deletes all events on the server side.assign_users_to_task, entity list materialize and items order, entity and project thumbnail upload,get_project_thumbnail._api.pyand__init__.pywere regenerated withautomated_api.py. The_api.pydiff only adds lines; plaingit diffshows it as moved because of the diff algorithm.Not added on purpose: endpoints used only by the web UI (onboarding, Ynput Cloud connect, metrics, csv import and export, avatars, password reset, views, frontend preferences, market) and deprecated routes.
Server version requirements
Endpoints and arguments were compared between server 1.14.5 (the last 1.14.x) and 1.16.8. The ones added later raise
UnsupportedServerVersionon older servers:rename_project,get_project_thumbnail,set_project_thumbnail,set_project_thumbnail_from_streamsearchargument ofsearch_foldersupdate_server_config,set_entity_list_items_orderget_enums,get_reviewables,latestandlatest_doneof the entity reviewables getterserrorargument ofupdate_servicemigrate_addon_settingsOn servers older than 1.15.0,
rename_useruses the deprecated PATCH endpoint instead of failing. TheregistryAuthservice config key (1.16.7) is only documented, because older servers ignore unknown config keys.Testing notes:
New tests run against a real AYON server, like the other server tests (
AYON_SERVER_URLandAYON_API_KEYof an admin user). They create only temporary users, access groups, projects, sites and events, and remove them afterwards. Studio-level addon settings are written to a temporary settings variant.tests/test_users_api.py,tests/test_addon_settings_api.py,tests/test_projects_api.py,tests/test_system_api.py,tests/test_review_tasks_lists_api.pytests/test_server_version_validation.pychecks the version validation and needs no server.AYON_SERVER_URLandAYON_API_KEY.pytest tests/test_users_api.py tests/test_addon_settings_api.py tests/test_projects_api.py tests/test_system_api.py tests/test_review_tasks_lists_api.py tests/test_server_version_validation.py.🤖 Generated with Claude Code