Skip to content

Add methods for endpoints missing from AYON server 1.16.8 - #368

Open
iLLiCiTiT wants to merge 9 commits into
developfrom
enhancement/missing-server-endpoints
Open

iLLiCiTiT wants to merge 9 commits into
developfrom
enhancement/missing-server-endpoints

Conversation

@iLLiCiTiT

@iLLiCiTiT iLLiCiTiT commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

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 ServerAPI and automated_api.py): UsersAPI, ServicesAPI, SystemAPI, ReviewablesAPI.

  • Users: create, update, delete and rename user, password, user access groups, sessions, api keys, permissions. Access groups CRUD and set_projects_access. Teams and team members. Project users.
  • Addon settings: set_addon_settings, get_addon_overrides, modify_addon_overrides, delete_addon_overrides, get_addon_raw_overrides, set_addon_raw_overrides (call the studio or project specific method, e.g. set_addon_studio_settings or set_addon_project_settings, based on project_name), set_addon_site_settings, migrate_addon_settings, migrate_settings_by_bundle. get_addon_settings_schema takes optional variant and site_id.
  • Projects: anatomy presets (save, rename, delete, set and unset primary), anatomy schema, get and set project anatomy, 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.
  • Folders: search_folders, get_entity_groups.
  • Services and system: services (list, spawn, update, delete), hosts, sites (list, delete), restart required (get, set), server config schema, update_server_config (PATCH), enums.
  • Events: delete_events through eventops. An empty filter deletes all events on the server side.
  • Review and tasks: reviewables for entities (list, sort, update label), assign_users_to_task, entity list materialize and items order, entity and project thumbnail upload, get_project_thumbnail.

_api.py and __init__.py were regenerated with automated_api.py. The _api.py diff only adds lines; plain git diff shows 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 UnsupportedServerVersion on older servers:

  • 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 of the entity reviewables getters
  • 1.16.7: error argument of update_service
  • 1.16.8: migrate_addon_settings

On servers older than 1.15.0, rename_user uses the deprecated PATCH endpoint instead of failing. The registryAuth service 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_URL and AYON_API_KEY of 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.py
  • tests/test_server_version_validation.py checks the version validation and needs no server.
  1. Set AYON_SERVER_URL and AYON_API_KEY.
  2. Run 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

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>
@iLLiCiTiT iLLiCiTiT added the type: enhancement New feature or request label Oct 15, 2026
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>
@iLLiCiTiT iLLiCiTiT self-assigned this Oct 15, 2026
@iLLiCiTiT
iLLiCiTiT requested a review from BigRoy October 15, 2026 09:29
Comment thread ayon_api/_api_helpers/thumbnails.py Outdated
iLLiCiTiT and others added 2 commits October 15, 2026 11:42
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>
@BigRoy
BigRoy requested a review from tadeas-hejnic October 15, 2026 12:37
@BigRoy

BigRoy commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

@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?

@BigRoy
BigRoy requested a review from MustafaJafar October 15, 2026 12:37
Comment thread ayon_api/_api_helpers/thumbnails.py Outdated
In future more entity types might support thumbnails using the same endpoint format. It is also private method there is no reason validate it.
@MustafaJafar

Copy link
Copy Markdown
Member

@MustafaJafar any question on some of these from docs standpoint?

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).

@iLLiCiTiT

Copy link
Copy Markdown
Member Author

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.

@iLLiCiTiT
iLLiCiTiT marked this pull request as ready for review October 15, 2026 13:24
iLLiCiTiT and others added 2 commits October 19, 2026 10:59
Replace pairs of studio and project methods with single methods that
take optional 'project_name', like 'get_addon_settings':
- set_addon_settings
- get_addon_overrides
- modify_addon_overrides
- delete_addon_overrides
- get_addon_raw_overrides
- set_addon_raw_overrides

Passing 'site_id' without 'project_name' raises 'ValueError', as studio
settings do not have site overrides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore studio and project specific methods and make the merged
methods call them based on 'project_name', same as 'get_addon_settings'
calls 'get_addon_studio_settings' or 'get_addon_project_settings'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines +450 to +465
def test_set_addon_settings_studio_explicit_pin(
settings_addon, studio_variant
):
"""Unchanged value is stored when pinned with '__pinned_fields__'."""
name = settings_addon["name"]
version = settings_addon["version"]
path = settings_addon["path"]

settings = get_addon_studio_settings(name, version, variant=studio_variant)
value = _get_value(settings, path)
payload = copy.deepcopy(settings)
payload["__pinned_fields__"] = [path]
set_addon_settings(name, version, payload, variant=studio_variant)

raw = get_addon_raw_overrides(name, version, variant=studio_variant)
assert _get_value(raw, path) is value

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is failing on my side, because raw = {}, so the assert can't be passed.

But it's probably backend issue, because extract_overrides() can't go deeper in recursion for explicit_pins - https://github.com/ynput/ayon-backend/blob/develop/ayon_server/settings/overrides.py#L212-L231

There should be probably added something like:

def has_pin_below(path):
    return any(
        pin[:len(path)] == path
        for pin in explicit_pins
    )

to the condition before the recursive call.

@iLLiCiTiT @martastain

@tadeas-hejnic tadeas-hejnic Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on my side with this change and at least this test has passed and looks like it didn't break anything.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will probably remove the test. It is kinda pointless. This does test if pinning works but without a known addon you can't test it reliable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe just fix it in server? Made a PR ynput/ayon-backend#1208 with that we can keep the test.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say bug on server should not block this PR. If yes, then I'll remove the test...

Comment thread tests/test_projects_api.py Outdated
Comment thread tests/test_projects_api.py Outdated
iLLiCiTiT and others added 2 commits October 20, 2026 11:24
Entity type of 'set_entity_thumbnail' is no longer validated on client
side, setting thumbnail on product fails on server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task search matches also folder path of the task, so folder name finds
the folder through its task.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants