Skip to content

Public api: Create link has 'data' argument#308

Open
iLLiCiTiT wants to merge 1 commit intodevelopfrom
bugfix/create-link-public-api
Open

Public api: Create link has 'data' argument#308
iLLiCiTiT wants to merge 1 commit intodevelopfrom
bugfix/create-link-public-api

Conversation

@iLLiCiTiT
Copy link
Member

Changelog Description

Public api function create_link does have data argument now.

Additional review information

Without this PR it is not possible to pass data to public function create_link instead developer has to get the connection object and call it on that.

Testing notes:

  1. It is possible to pass data to public create_link function.

@iLLiCiTiT iLLiCiTiT added the type: bug Something isn't working label Feb 25, 2026
@iLLiCiTiT iLLiCiTiT self-assigned this Feb 25, 2026
@iLLiCiTiT iLLiCiTiT requested a review from BigRoy February 25, 2026 15:59
Copy link
Contributor

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

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

I don't get the data returned from the link:

import ayon_api
import os

os.environ["AYON_SERVER_URL"] = "http://localhost:5000"
os.environ["AYON_API_KEY"] = "54f2c159eedc4b5fa10447571161e978"

project_name = "test"
folder_a = ayon_api.get_folder_by_path("test", "/apps/blender")
folder_b = ayon_api.get_folder_by_path("test", "/apps/maya")
link_type_name = "breakdown"

ayon_api.create_link(
    project_name=project_name,
    link_type_name=link_type_name,
    input_id=folder_a["id"],
    input_type="folder",
    output_id=folder_b["id"],
    output_type="folder",
    link_name="MyLink",
    data={"foo": "bar", "hello": "world"},
)

print(ayon_api.get_folder_links(
    project_name,
    folder_b["id"],
    link_types=[link_type_name])
)
# This fails to work.
[{'direction': 'in', 'linkType': 'breakdown', 'name': 'MyLink', 'description': 'breakdown link with input folder and output folder', 'entityType': 'folder', 'author': 'deadline', 'projectName': 'test', 'id': '64df3768129911f19082ee69ed383011', 'entityId': '0867b2404af211f0985a3b9388bc26af'}, {'direction': 'in', 'linkType': 'breakdown', 'name': 'MyLink', 'description': 'breakdown link with input folder and output folder', 'entityType': 'folder', 'author': 'deadline', 'projectName': 'test', 'id': 'ab7d5fec129911f19082ee69ed383011', 'entityId': '0867b2404af211f0985a3b9388bc26af'}, {'direction': 'in', 'linkType': 'breakdown', 'name': 'MyLink', 'description': 'breakdown link with input folder and output folder', 'entityType': 'folder', 'author': 'deadline', 'projectName': 'test', 'id': 'b2508236129911f19082ee69ed383011', 'entityId': '0867b2404af211f0985a3b9388bc26af'}, {'direction': 'in', 'linkType': 'breakdown', 'name': 'MyLink', 'description': 'breakdown link with input folder and output folder', 'entityType': 'folder', 'author': 'deadline', 'projectName': 'test', 'id': 'd5131b80129911f19082ee69ed383011', 'entityId': '0867b2404af211f0985a3b9388bc26af'}, {'direction': 'in', 'linkType': 'breakdown', 'name': 'MyLink', 'description': 'breakdown link with input folder and output folder', 'entityType': 'folder', 'author': 'deadline', 'projectName': 'test', 'id': 'dcfa442c129911f19082ee69ed383011', 'entityId': '0867b2404af211f0985a3b9388bc26af'}]

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

Labels

type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants