WardrikRest. Call
(wardrik_rest v0.1.0-rc.1)
Copy Markdown
Makes one call to an operation for an agent.
- The credentials of the operation's first scheme alternative the API has sources for go in
as its description says, with the API's
:headersand the header arguments given. - A
401tells the agent'sWardrikCore.Credentialsthe token was refused, then the call is made once more with a fresh one. - A
429, a5xxor no answer raisesWardrikRest.Unavailable, so the tool runner retries. - Any other status is an error naming it, with the API's message.
- An answer longer than the API's
:max_result_bytesis cut, as JSON text.
Summary
Functions
Calls operation of api with the tool's args, as whoever context acts for.
Types
@type t() :: %WardrikRest.Call{ api: WardrikRest.API.t(), args: %{required(String.t()) => term()}, context: WardrikCore.Context.t(), operation: WardrikRest.Operation.t() }
One call: the operation of an API, its arguments, and the turn it's made in.
Functions
@spec run( WardrikRest.API.t(), WardrikRest.Operation.t(), map(), WardrikCore.Context.t() ) :: {:ok, term()} | {:error, String.t()} | {:park, WardrikCore.Authorization.t()}
Calls operation of api with the tool's args, as whoever context acts for.