Channels
Create and manage the channels that events are published to, and the apps they belong to.
A channel is the destination for events. Channels live inside an app, and every
events.publish call names one by UUID.
Create a channel
A channel needs an app to live in, so create the app first if you do not have one:
from axonpush import AxonPush
with AxonPush() as client:
app = client.apps.create(name="research-service")
channel = client.channels.create("events", app.id)
print(channel.id, channel.name, channel.app_id)channels.create(name, app_id) takes both arguments positionally. The
returned Channel carries id and channel_id (the same UUID),
app_id, org_id, name, created_at, and, when the backend included
it, the parent app.
Read
channels = client.channels.list(app.id) # every channel in one app
channel = client.channels.get(channel_id) # one channel by UUIDlist takes the app UUID, not a channel UUID.
Update and delete
client.channels.update(channel_id) # re-validate; no body
client.channels.delete(channel_id) # soft deleteupdate() does not rename a channel. The backend exposes
PUT /channel/:id without a body, so the method takes only the channel UUID
and returns an acknowledgement. There is no name= keyword.
delete() is a soft delete, the channel’s events stay queryable.
Async
Every method has an async sibling with the same signature:
from axonpush import AsyncAxonPush
async with AsyncAxonPush() as client:
channel = await client.channels.create("events", app_id)
channels = await client.channels.list(app_id)
await client.channels.delete(channel.id)Apps
Apps are managed the same way, one level up:
apps = client.apps.list()
app = client.apps.get(app_id)
app = client.apps.create(name="research-service")
client.apps.update(app_id, name="research-service-v2")
client.apps.delete(app_id)update takes the app UUID positionally and name by keyword.
Environments
Environments are org-level, not per-app, and are addressed by their own UUID:
envs = client.environments.list()
env = client.environments.create("Staging", slug="staging")
client.environments.promote_to_default(env.environment_id)create accepts slug, color, is_production, is_default and
clone_from_env_id as keywords. Pass the slug, not the UUID, to
environment= on a client or a publish.