ExRabbitMQAdmin.Policy (ex_rabbitmq_admin v0.3.0)

Copy Markdown View Source

This module contains functions for interacting with RabbitMQ policies.

Summary

Functions

Get an individual policy.

Get a list of all policies.

Get a list of policies in a virtual host.

Create or update a policy.

Functions

delete_policy(client, vhost, name)

@spec delete_policy(
  client :: Tesla.Client.t(),
  vhost :: String.t(),
  name :: String.t()
) ::
  {:ok, Tesla.Env.t()} | {:error, term()}

Delete a policy.

get_policy(client, vhost, name)

@spec get_policy(client :: Tesla.Client.t(), vhost :: String.t(), name :: String.t()) ::
  {:ok, Tesla.Env.t()} | {:error, term()}

Get an individual policy.

list_policies(client)

@spec list_policies(client :: Tesla.Client.t()) ::
  {:ok, Tesla.Env.t()} | {:error, term()}

Get a list of all policies.

list_vhost_policies(client, vhost)

@spec list_vhost_policies(client :: Tesla.Client.t(), vhost :: String.t()) ::
  {:ok, Tesla.Env.t()} | {:error, term()}

Get a list of policies in a virtual host.

put_policy(client, vhost, name, opts \\ [])

@spec put_policy(
  client :: Tesla.Client.t(),
  vhost :: String.t(),
  name :: String.t(),
  opts :: Keyword.t()
) :: {:ok, Tesla.Env.t()} | no_return()

Create or update a policy.

  • :pattern (String.t/0) - Required. A regular expression matching resource names to apply the policy to.

  • :definition (map of String.t/0 keys and term/0 values) - Required. The policy definition as a map of policy keys and values.

  • :priority (non_neg_integer/0) - Policy priority. Higher value means higher priority. The default value is 0.

  • :apply_to - What type of resources the policy applies to. The default value is :all.