Site agent events
Mastermind tells site agents about changes they must act on by publishing STOMP messages. This page lists every message, its fields and the code that sends it. The same contracts are published as an AsyncAPI 3.0.0 document, contracts/asyncapi.yaml in the waldur-mastermind repository, which standard AsyncAPI tooling can validate and generate code from.
- Contracts version:
1.0.0. Its major part changes on every breaking change. - Minimum site agent version:
1.0.2.
Transport
Messages are JSON objects sent over RabbitMQ Web-STOMP. Each registered event consumer has one queue, consumer_<consumer UUID>, in the vhost named by its owner's user UUID. The agent subscribes to /amq/queue/<queue> with client-individual acknowledgment, so a message it does not acknowledge is delivered again. Delivery is at-least-once and unordered across events: use emitted_at to discard an update older than one already applied.
A consumer receives the messages that its scope bindings and object types admit. Several messages share an object type, so tell them apart by action or by the fields present.
Site agents before 1.0.7 subscribe through the deprecated per-subscription topics instead. Those carry each message's own fields plus offering_uuid only: no object_type, schema_version or emitted_at, and none of the context fields marked optional below that the payload enrichers add.
Envelope
The dispatcher adds these fields to every message.
| Field | Type | Required | Description |
|---|---|---|---|
object_type |
string | yes | ObservableObjectType of the event |
schema_version |
integer | yes | Version of the envelope format |
emitted_at |
string | yes | ISO 8601 time the event was emitted, for discarding stale updates |
event_type |
string | no | Event type, when the event comes from the event log |
offering_uuid |
string | no | UUID of the offering; added to every offering-scoped event |
Messages
Object type order
OrderMessage
Sent on every state transition of an order.
Sent by:
marketplace/handlers.py:send_order_state_change_to_message_queue
| Field | Type | Required | Description |
|---|---|---|---|
order_uuid |
string | yes | UUID of the order |
order_state |
string | yes | Display name of the order state |
order_type |
string | no | Order type |
resource_uuid |
string | no | UUID of the resource |
resource_backend_id |
string | no | Backend identifier of the resource |
resource_name |
string | no | Name of the resource |
project_uuid |
string | no | UUID of the project |
project_name |
string | no | Name of the project |
attributes |
object | no | Order attributes with secrets removed |
limits |
object | no | Resource limits |
plan_uuid |
string | no | UUID of the resource's plan, when it has one |
PendingOrderMessage
Periodic resend of pending orders (hourly task).
Sent by:
marketplace_site_agent/tasks.py:send_messages_about_pending_orders
| Field | Type | Required | Description |
|---|---|---|---|
order_uuid |
string | yes | UUID of the order |
order_state |
string | yes | Display name of the order state |
sequence_number |
integer | yes | Incremental message sequence number |
order_type |
string | no | Order type |
resource_uuid |
string | no | UUID of the resource |
resource_backend_id |
string | no | Backend identifier of the resource |
resource_name |
string | no | Name of the resource |
project_uuid |
string | no | UUID of the project |
project_name |
string | no | Name of the project |
attributes |
object | no | Order attributes with secrets removed |
limits |
object | no | Resource limits |
plan_uuid |
string | no | UUID of the resource's plan, when it has one |
OrderInfoMessage
Sent when the provider or the consumer sets order information for the other side.
Sent by:
marketplace/tasks.py:notify_consumer_about_provider_infomarketplace/tasks.py:notify_provider_about_consumer_info
| Field | Type | Required | Description |
|---|---|---|---|
order_uuid |
string | yes | UUID of the order |
action |
string: provider_info_set, consumer_info_set |
yes | Action: 'provider_info_set' or 'consumer_info_set' |
order_type |
string | no | Order type |
resource_uuid |
string | no | UUID of the resource |
resource_backend_id |
string | no | Backend identifier of the resource |
resource_name |
string | no | Name of the resource |
project_uuid |
string | no | UUID of the project |
project_name |
string | no | Name of the project |
attributes |
object | no | Order attributes with secrets removed |
limits |
object | no | Resource limits |
plan_uuid |
string | no | UUID of the resource's plan, when it has one |
Object type resource
ResourceUpdateMessage
Sent when resource downscale, access restriction, or pause state changes.
Sent by:
marketplace_site_agent/utils.py:push_resource_update_message
| Field | Type | Required | Description |
|---|---|---|---|
resource_uuid |
string | yes | UUID of the resource |
resource_backend_id |
string | yes | Backend identifier of the resource |
downscaled |
boolean | yes | Whether the resource is downscaled |
restrict_member_access |
boolean | yes | Whether member access is restricted |
paused |
boolean | yes | Whether the resource is paused |
sequence_number |
integer | yes | Incremental message sequence number |
resource_name |
string | no | Name of the resource |
resource_state |
string | no | Display name of the resource state |
project_uuid |
string | no | UUID of the project |
project_name |
string | no | Name of the project |
limits |
object | no | Resource limits |
ResourceStateMessage
Sent when a resource is created and on every state transition.
Sent by:
marketplace/handlers.py:send_resource_state_change_to_message_queue
| Field | Type | Required | Description |
|---|---|---|---|
resource_uuid |
string | yes | UUID of the resource |
resource_backend_id |
string | yes | Backend identifier of the resource |
resource_name |
string | no | Name of the resource |
resource_state |
string | no | Display name of the resource state |
project_uuid |
string | no | UUID of the project |
project_name |
string | no | Name of the project |
limits |
object | no | Resource limits |
Object type offering_user
OfferingUserMessage
Sent when an offering user's username is set or changed.
Sent by:
marketplace_site_agent/handlers.py:send_offering_user_username_message
| Field | Type | Required | Description |
|---|---|---|---|
offering_user_uuid |
string | yes | UUID of the offering user |
user_uuid |
string | yes | UUID of the Waldur user |
username |
string | yes | Username of the offering user |
state |
integer | yes | State of the offering user, as its raw value |
action |
string: username_set |
yes | Action type: username_set |
resource_backend_ids |
array of string | yes | Backend IDs of associated resources |
OfferingUserCreatedMessage
Sent when an offering user is created.
Sent by:
marketplace/handlers.py:send_offering_user_created_message
| Field | Type | Required | Description |
|---|---|---|---|
offering_user_uuid |
string | yes | UUID of the offering user |
user_uuid |
string | yes | UUID of the Waldur user |
username |
string | yes | Username of the offering user |
state |
string | yes | Display name of the offering user state |
runtime_state |
string | yes | Runtime state reported by the backend |
action |
string: create |
yes | Action type: create |
attributes |
object | yes | User profile attributes exposed to the offering |
OfferingUserUpdatedMessage
Sent when tracked fields of an offering user change.
Sent by:
marketplace/handlers.py:send_offering_user_updated_message
| Field | Type | Required | Description |
|---|---|---|---|
offering_user_uuid |
string | yes | UUID of the offering user |
user_uuid |
string | yes | UUID of the Waldur user |
username |
string | yes | Username of the offering user |
state |
string | yes | Display name of the offering user state |
runtime_state |
string | yes | Runtime state reported by the backend |
changed_fields |
array of string | yes | Fields that changed |
action |
string: update |
yes | Action type: update |
OfferingUserDeletedMessage
Sent when an offering user is deleted.
Sent by:
marketplace/handlers.py:send_offering_user_deleted_message
| Field | Type | Required | Description |
|---|---|---|---|
offering_user_uuid |
string | yes | UUID of the offering user |
user_uuid |
string | yes | UUID of the Waldur user |
username |
string | yes | Username of the offering user |
action |
string: delete |
yes | Action type: delete |
OfferingUserAttributeUpdateMessage
Sent for each offering of a user when profile attributes exposed to that offering change.
Sent by:
marketplace/handlers.py:send_user_attribute_update_message
| Field | Type | Required | Description |
|---|---|---|---|
offering_user_uuid |
string | yes | UUID of the offering user |
user_uuid |
string | yes | UUID of the Waldur user |
username |
string | yes | Username of the offering user |
action |
string: attribute_update |
yes | Action type: attribute_update |
changed_attributes |
array of string | yes | Exposed profile fields that changed |
attributes |
object | yes | User profile attributes exposed to the offering |
OfferingUserAccountStatusUpdateMessage
Sent for each offering of a user when the user's Waldur account is activated or deactivated.
Sent by:
marketplace/handlers.py:send_user_account_status_message
| Field | Type | Required | Description |
|---|---|---|---|
offering_user_uuid |
string | yes | UUID of the offering user |
user_uuid |
string | yes | UUID of the Waldur user |
username |
string | yes | Username of the offering user |
action |
string: account_status_update |
yes | Action type: account_status_update |
user_is_active |
boolean | yes | Whether the Waldur user account is active |
Object type user_role
UserRoleMessage
Sent when a user role is granted or revoked in a project.
Sent by:
marketplace_site_agent/handlers.py:process_role_changed
| Field | Type | Required | Description |
|---|---|---|---|
user_uuid |
string | yes | UUID of the user |
user_username |
string | yes | Username of the user |
project_uuid |
string | yes | UUID of the project |
project_name |
string | yes | Name of the project |
role_name |
string | yes | Name of the role |
granted |
boolean | yes | True if granted, False if revoked |
user_email |
string | no | Email of the user |
user_full_name |
string | no | Full name of the user |
UserRoleSyncMessage
Sent to trigger a user-role sync for a project, or for one resource when resource_uuid is present.
Sent by:
marketplace_site_agent/utils.py:push_user_role_sync_messagemarketplace_site_agent/utils.py:push_resource_user_role_sync_message
| Field | Type | Required | Description |
|---|---|---|---|
project_uuid |
string | yes | UUID of the project |
project_name |
string | yes | Name of the project |
resource_uuid |
string | no | UUID of the resource to re-sync; absent for a project-wide sync |
Object type service_account, course_account
AccountMessage
Sent when a service or course account is created or deleted.
Sent by:
marketplace_site_agent/handlers.py:send_account_message
| Field | Type | Required | Description |
|---|---|---|---|
account_uuid |
string | yes | UUID of the account |
account_username |
string | yes | Username of the account |
scope_type |
string: project |
yes | Scope type (always 'project') |
project_uuid |
string | yes | UUID of the project |
project_name |
string | yes | Name of the project |
action |
string: create, delete |
yes | Action: 'create' or 'delete' |
Object type resource_periodic_limits
PeriodicLimitsMessage
Sent when SLURM policy periodic settings need to be applied.
Sent by:
policy/models.py:SlurmPeriodicUsagePolicy._send_settings_to_site_agent
| Field | Type | Required | Description |
|---|---|---|---|
resource_uuid |
string | yes | UUID of the resource |
backend_id |
string | yes | Backend resource identifier (SLURM account name) |
offering_uuid |
string | yes | UUID of the offering |
policy_uuid |
string | yes | UUID of the policy |
action |
string: apply_periodic_settings |
yes | Action: 'apply_periodic_settings' |
settings |
object | yes | SLURM settings dict (fairshare, limits, thresholds) |
timestamp |
string | yes | ISO 8601 timestamp for the current period |
Object type importable_resources
BackendResourceRequestMessage
Asks the agent to list the backend resources that can be imported into the offering.
Sent by:
marketplace/utils.py:publish_backend_resource_request
| Field | Type | Required | Description |
|---|---|---|---|
backend_resource_request_uuid |
string | yes | UUID of the backend resource request to fulfill |
Object type offering_resources_sync
OfferingResourcesSyncMessage
Asks the agent to reconcile every resource of the offering.
Sent by:
marketplace/utils.py:publish_offering_resources_sync_request
| Field | Type | Required | Description |
|---|---|---|---|
requested_by_user_uuid |
string | yes | UUID of the user who requested the synchronization |
Object type resource_api_key_rotation
ApiKeyCommandMessage
A command on one of a resource's API keys: create, rotate, pause, resume, update or delete. Carried on the resource_api_key_rotation observable type, which is named for the first command and kept so subscriptions do not change.
Sent by:
marketplace/utils.py:publish_api_key_event
| Field | Type | Required | Description |
|---|---|---|---|
action |
string: create, rotate, pause, resume, delete, update |
yes | One of ResourceApiKeyActions |
resource_uuid |
string | yes | UUID of the resource |
resource_backend_id |
string | yes | Backend identifier of the resource |
api_key_uuid |
string | yes | UUID of the API key |
client_id |
string | yes | Backend client id of the key; blank on a key being created |
limits |
object or null | no | Monthly limits per component, null when the key has none; only on commands that carry the key's settings |
spending_limits |
object or null | no | Spending limits for every period, null when the key has none; only on commands that carry the key's settings |
allowed_models |
array of string | no | Models the key may call ([''] for all, [] for none): the key's own list narrowed by its resource's model selection. Only on commands that carry the key's settings; absent from Waldur versions older than [''], where absence allows every model |
Object type service_provider_project_group
ProjectGroupMessage
A provider project group was created, updated or deleted, or project groups were switched on or off for the provider.
Sent by:
marketplace/handlers.py:send_project_group_saved_messagemarketplace/handlers.py:send_project_group_deleted_messagemarketplace/handlers.py:send_project_groups_switch_messagemarketplace/project_groups.py:allocate_gid
| Field | Type | Required | Description |
|---|---|---|---|
action |
string: create, update, delete, switch |
yes | Action: 'create' (the group got its first GID), 'update' (its name or GID changed), 'delete', or 'switch' (project groups switched on or off for the provider) |
service_provider_uuid |
string | yes | UUID of the service provider |
customer_uuid |
string | yes | UUID of the provider's organization |
project_group_uuid |
string | no | UUID of the group; absent on 'switch' |
project_uuid |
string or null | no | UUID of the group's project if it still exists; absent on 'switch' |
name |
string | no | Group name; absent on 'switch' |
gid |
integer or null | no | Group GID; absent on 'switch' |
changed_fields |
array of string | no | Fields that changed; only on 'update' |
project_groups_enabled |
boolean | no | The new setting; only on 'switch' |
Event types not delivered to site agents
The same event stream carries these types for other consumers.
| Object type | Consumer |
|---|---|
resource_end_date_change_request |
Read by an external approval system, which answers through the request's approve/reject actions. |
user_profile |
User-centric event for global IdM/IGA consumers. |
user_ssh_key |
User-centric event for global IdM/IGA consumers. |
user_lifecycle |
User-centric event for global IdM/IGA consumers. |
service_provider_account |
Provider-scoped account event for consumers other than the agent; the agent follows offering_user, which is still emitted alongside it. |
call |
Proposal-domain event for consumers bound to a call. |
proposal |
Proposal-domain event for consumers bound to a call or proposal. |