Skip to content

publish_entity

Part of Reusable workflows in the Python API reference.

Related guidance: shipped-tooling.

Runnable examples: publish_entity.py.

from picogrid_ecn_client.workflows import publish_entity

Construct and publish one typed public entity.

async def publish_entity(
client: ECNClient,
*,
entity_id: UUID,
category: EntityCategory,
entity_type: str,
name: str | None = None,
display_name: str | None = None,
recorded_at: datetime | None = None,
) -> PublishEntityResult
NameTypeDefaultDescription
clientECNClientConfigured SDK client used for publication.
entity_idUUIDCanonical identity of the entity to publish.
categoryEntityCategoryPublic category assigned to the entity.
entity_typestrDeployment-defined type assigned to the entity.
namestr | NoneNoneOptional entity name.
display_namestr | NoneNoneOptional operator-facing display label.
recorded_atdatetime | NoneNoneOptional observation time; current UTC time when omitted.
TypeDescription
PublishEntityResultThe published entity and its broker acknowledgement.
ExceptionDescription
ECNClientErrorIf validation, connection, or publication fails.

Source · workflows/publish.py

Version 0.2.0 · branch main