pub struct Transport { /* private fields */ }Implementations§
Source§impl Transport
impl Transport
pub fn new(profile: &Profile) -> Result<Transport>
Sourcepub fn with_debug(profile: &Profile, debug: bool) -> Result<Transport>
pub fn with_debug(profile: &Profile, debug: bool) -> Result<Transport>
Build a transport with HTTP request logging enabled or disabled.
Keeping debug as a bool prevents CLI clap types entering -core.
Sourcepub fn space_path(space: &str, path: &str) -> String
pub fn space_path(space: &str, path: &str) -> String
Prefix non-default spaces with /s/<name>.
Kibana serves the default space at the bare path.
Sourcepub fn kibana_url(&self) -> &str
pub fn kibana_url(&self) -> &str
The Kibana URL this transport targets, exactly as configured.
Sourcepub fn has_es_url(&self) -> bool
pub fn has_es_url(&self) -> bool
Whether the profile configured an explicit es_url. When it did not,
every *_absolute_es call silently falls back to the Kibana host —
callers that need to distinguish “no Elasticsearch host configured”
from “the real Elasticsearch host answered” read this.
Sourcepub async fn capabilities(&self) -> Result<&Capabilities>
pub async fn capabilities(&self) -> Result<&Capabilities>
Probe deployment capabilities once for this transport.
Sourcepub async fn require_feature(&self, feature: Feature) -> Result<()>
pub async fn require_feature(&self, feature: Feature) -> Result<()>
Refuse an unverified feature before its public route is called.
pub async fn get(&self, path: &str) -> Result<Value>
Sourcepub async fn get_internal(&self, path: &str) -> Result<Value>
pub async fn get_internal(&self, path: &str) -> Result<Value>
GET a Kibana internal route. Internal routes sit outside the public
API’s versioning contract: Kibana requires x-elastic-internal-origin
on them (without it the route family answers 400 “exists but is not
available”), and elastic-api-version: 2023-10-31 names a public-API
version internal routes do not serve, so it is omitted.
Sourcepub async fn post_internal(&self, path: &str, body: &Value) -> Result<Value>
pub async fn post_internal(&self, path: &str, body: &Value) -> Result<Value>
POST a Kibana internal route with a JSON body. Mirrors
get_internal’s reasoning (same x-elastic-internal-origin
requirement, elastic-api-version still omitted), plus kbn-xsrf:
Kibana rejects any state-changing request without it, same as every
other non-GET call send makes.
Its only caller today is xtask’s profile-activation login
(POST /internal/security/login) — not reachable from
elasticctl-api or elasticctl-cli.
Sourcepub async fn get_with_headers(&self, path: &str) -> Result<Responded>
pub async fn get_with_headers(&self, path: &str) -> Result<Responded>
GET a body with its captured headers.
This is separate from get because only the capability probe needs
headers.
pub async fn post(&self, path: &str, body: Option<&Value>) -> Result<Value>
pub async fn put(&self, path: &str, body: &Value) -> Result<Value>
pub async fn patch(&self, path: &str, body: &Value) -> Result<Value>
pub async fn delete(&self, path: &str) -> Result<Value>
Sourcepub async fn get_absolute_es(&self, path: &str) -> Result<Value>
pub async fn get_absolute_es(&self, path: &str) -> Result<Value>
GET Elasticsearch without a Kibana space prefix.
Cloud deployments use a different Elasticsearch host.
Sourcepub async fn post_absolute_es(&self, path: &str, body: &Value) -> Result<Value>
pub async fn post_absolute_es(&self, path: &str, body: &Value) -> Result<Value>
POST JSON to Elasticsearch without a Kibana space prefix or kbn-xsrf
header.
Sourcepub async fn delete_absolute_es(&self, path: &str) -> Result<Value>
pub async fn delete_absolute_es(&self, path: &str) -> Result<Value>
DELETE from Elasticsearch.
The fixture recorder uses this to remove its scratch index.
Sourcepub async fn delete_absolute_es_json(
&self,
path: &str,
body: &Value,
) -> Result<Value>
pub async fn delete_absolute_es_json( &self, path: &str, body: &Value, ) -> Result<Value>
DELETE from Elasticsearch with a JSON body. The PIT close needs one;
the plain delete_absolute_es sends no body.