set_policy
Create or update RabbitMQ policies with dry-run preview and automatic undo to ensure reversible changes.
Instructions
[WRITE][risk=medium] Create/update a rabbitmq policy; reversible.
Reads the policy first: the recorded undo restores the prior policy fields, or deletes the policy when it is newly created. Pass dry_run=True to preview.
Args: vhost: The policy's vhost (the default vhost is '/'). name: Policy name. pattern: Regex the policy matches queue/exchange names against. definition: Policy definition object (e.g. {'max-length': 100000}). priority: Policy priority (higher wins; default 0). apply_to: 'queues', 'exchanges', or 'all' (default). dry_run: If True, preview without changing. target: rabbitmq target name from config; omit for the default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| vhost | Yes | ||
| target | No | ||
| dry_run | No | ||
| pattern | Yes | ||
| apply_to | No | all | |
| priority | No | ||
| definition | Yes |