ExBifrost.Api.CircuitBreaker (ex_bifrost v0.1.0)

Copy Markdown View Source

API calls for all endpoints tagged CircuitBreaker.

Summary

Functions

Create circuit breaker policy Creates a new circuit breaker policy and immediately activates it in the running gateway. Returns 409 if a policy with the same name already exists.

Delete circuit breaker policy Deletes a circuit breaker policy by name and removes it from the running gateway. Any open circuits for this policy are discarded immediately.

Get circuit breaker state Returns a snapshot of all currently-open circuits. Main circuits are keyed by policy name. Per-key sub-circuits are keyed by "<policy_name>\x00<key_id>". Circuits not present in the map are closed.

List circuit breaker policies Returns all circuit breaker policies defined in this workspace.

Update circuit breaker policy Replaces a circuit breaker policy by name. The name field in the request body must match the URL parameter or be omitted. Changes take effect immediately in the running gateway.

Functions

create_circuit_breaker_policy(connection, list_circuit_breaker_policies200_response_policies_inner, opts \\ [])

Create circuit breaker policy Creates a new circuit breaker policy and immediately activates it in the running gateway. Returns 409 if a policy with the same name already exists.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • list_circuit_breaker_policies200_response_policies_inner (ListCircuitBreakerPolicies200ResponsePoliciesInner):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.ListCircuitBreakerPolicies200ResponsePoliciesInner.t} on success
  • {:error, Tesla.Env.t} on failure

delete_circuit_breaker_policy(connection, name, opts \\ [])

@spec delete_circuit_breaker_policy(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, ExBifrost.Model.Logout200Response.t()}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

Delete circuit breaker policy Deletes a circuit breaker policy by name and removes it from the running gateway. Any open circuits for this policy are discarded immediately.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • name (String.t): Name of the policy to delete.
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.Logout200Response.t} on success
  • {:error, Tesla.Env.t} on failure

get_circuit_breaker_state(connection, opts \\ [])

@spec get_circuit_breaker_state(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, ExBifrost.Model.GetCircuitBreakerState200Response.t()}
  | {:error, Tesla.Env.t()}

Get circuit breaker state Returns a snapshot of all currently-open circuits. Main circuits are keyed by policy name. Per-key sub-circuits are keyed by "<policy_name>\x00<key_id>". Circuits not present in the map are closed.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.GetCircuitBreakerState200Response.t} on success
  • {:error, Tesla.Env.t} on failure

list_circuit_breaker_policies(connection, opts \\ [])

@spec list_circuit_breaker_policies(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExBifrost.Model.ListCircuitBreakerPolicies200Response.t()}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

List circuit breaker policies Returns all circuit breaker policies defined in this workspace.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.ListCircuitBreakerPolicies200Response.t} on success
  • {:error, Tesla.Env.t} on failure

update_circuit_breaker_policy(connection, name, list_circuit_breaker_policies200_response_policies_inner, opts \\ [])

Update circuit breaker policy Replaces a circuit breaker policy by name. The name field in the request body must match the URL parameter or be omitted. Changes take effect immediately in the running gateway.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • name (String.t): Name of the policy to update.
  • list_circuit_breaker_policies200_response_policies_inner (ListCircuitBreakerPolicies200ResponsePoliciesInner):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.ListCircuitBreakerPolicies200ResponsePoliciesInner.t} on success
  • {:error, Tesla.Env.t} on failure