Subscriptions¶
cdse.subscriptions ¶
The Subscriptions API.
A subscription is a standing query that notifies you when products matching a filter are created, modified, or deleted. Two delivery modes exist:
pull: notifications are queued and you poll them with :meth:readand confirm them with :meth:acknowledge.push: notifications are posted to anotification_endpointyou provide.
The service enforces account limits (at most two running and ten total subscriptions). All requests use the standard bearer token.
Subscription ¶
Bases: BaseModel
A subscription entity.
Notification ¶
Bases: BaseModel
A single notification delivered to a pull subscription queue.
SubscriptionsResource ¶
SubscriptionsResource(transport: Transport, base_url: str)
Create, manage, and poll subscriptions.
create ¶
create(
filter_param: str | FilterBuilder | None = None,
*,
subscription_type: SubscriptionType = "pull",
events: Sequence[SubscriptionEvent] = ("created",),
status: SubscriptionStatus = "running",
stage_order: bool = True,
priority: int = 1,
notification_endpoint: str | None = None,
notification_epsg: int | None = None,
) -> Subscription
Create a subscription and return it.
For a push subscription, notification_endpoint is required.
read ¶
read(
subscription_id: str, *, top: int = 1
) -> builtins.list[Notification]
Read pending notifications from a pull subscription's queue.
The server returns at most twenty notifications per call.
acknowledge ¶
acknowledge(subscription_id: str, ack_id: str) -> None
Acknowledge a notification and all preceding ones in the queue.
The documentation does not publish the exact acknowledgement endpoint,
so the CSC standard Ack action is used; confirm against the live API.
set_status ¶
set_status(
subscription_id: str, status: SubscriptionStatus
) -> Subscription
Change a subscription's status (running, paused, or cancelled).