feat: apply source registry changes
This commit is contained in:
@@ -79,3 +79,9 @@ class RpcSourceRegistryClientMixin:
|
||||
"workflow.admin.source_registry.remove",
|
||||
{"source_id": source_id},
|
||||
)
|
||||
|
||||
async def apply_registry_changes(self) -> dict[str, Any]:
|
||||
return await self._call(
|
||||
"workflow.admin.source_registry.apply",
|
||||
{},
|
||||
)
|
||||
|
||||
@@ -10,6 +10,7 @@ from wf_server import WorkflowServer
|
||||
from .errors import WorkflowRpcError, raise_workflow_rpc_error
|
||||
from .models import (
|
||||
AddRegistryEntryParams,
|
||||
ApplyRegistryChangesParams,
|
||||
InspectRegistryEntryParams,
|
||||
ListRegistryEntriesParams,
|
||||
RegistryEntryIdParams,
|
||||
@@ -149,3 +150,16 @@ def register_methods(
|
||||
)
|
||||
except (ValueError, KeyError, LookupError, FileNotFoundError) as exc:
|
||||
raise_workflow_rpc_error(exc)
|
||||
|
||||
@entrypoint.method(
|
||||
name="workflow.admin.source_registry.apply",
|
||||
errors=[WorkflowRpcError],
|
||||
)
|
||||
async def workflow_admin_source_registry_apply(
|
||||
params: ApplyRegistryChangesParams = RpcParams(),
|
||||
) -> dict[str, Any]:
|
||||
admin = _require_source_registry_admin(server, operation="apply")
|
||||
try:
|
||||
return await admin.apply_registry_changes()
|
||||
except (ValueError, KeyError, LookupError, FileNotFoundError, RuntimeError) as exc:
|
||||
raise_workflow_rpc_error(exc)
|
||||
|
||||
@@ -201,3 +201,7 @@ class UpdateRegistryEntryParams(RpcParamsModel):
|
||||
|
||||
class RegistryEntryIdParams(RpcParamsModel):
|
||||
source_id: str = Field(min_length=1)
|
||||
|
||||
|
||||
class ApplyRegistryChangesParams(RpcParamsModel):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user