Struct metabase::Client [−][src]
pub struct Client {
pub(crate) inner: Client,
pub(crate) url: Url,
pub(crate) session_id: Option<String>,
}
Expand description
A Metabase API client.
Fields
inner: Client
url: Url
session_id: Option<String>
Implementations
Constructs a new Client
that will target a Metabase instance at url
.
url
must not contain a path nor be a cannot-be-a-base URL.
Sets the session ID to include in future requests made by this client.
Fetches public, global properties.
The underlying API call is GET /api/session/properties
.
Requests a session ID for the username and password named in request
.
Note that usernames are typically email addresses. To authenticate
future requests with the returned session ID, call set_session_id
.
The underlying API call is POST /api/session
.
Creates a user and database connection if the Metabase instance has not yet been set up.
The request must include the setup_token
from a
SessionPropertiesResponse
. If the setup token returned by
Client::session_properties
is None
, the cluster is already set up,
and this request will fail.
The underlying API call is POST /api/setup
.
Fetches the list of databases known to Metabase.
The underlying API call is GET /database
.
Fetches metadata about a particular database.
The underlying API call is GET /database/:id/metadata
.
pub(crate) async fn send_request<T>(
&self,
req: RequestBuilder
) -> Result<T, Error> where
T: DeserializeOwned,
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more