[−][src]Struct extrahop::Client
A client for making authenticated requests to the ExtraHop REST API.
The client encapsulates the host name and API key needed to make calls to the appliance.
Methods
impl Client
[src]
pub fn new<IS: Into<String>>(host: IS, api_key: ApiKey) -> Self
[src]
Creates a new client which connects to the specified host using the provided key.
pub fn danger_new_unverified<IS: Into<String>>(
host: IS,
api_key: ApiKey
) -> Result<Self>
[src]
host: IS,
api_key: ApiKey
) -> Result<Self>
Creates a new client with certificate verification disabled. This should only be used
when a human has passed an --insecure
flag or the like.
pub fn host(&self) -> &str
[src]
Gets the appliance's host string.
pub fn get(&self, path: &str) -> RequestBuilder
[src]
Creates a GET request builder for the provided relative path with the
Authorization
header included.
The path should not include the /api/v1
prefix.
let client = Client::new("extrahop.i.northwind.com", ApiKey::new("key")); client.get("/whitelist/devices").send().unwrap();
pub fn post(&self, path: &str) -> RequestBuilder
[src]
Creates a POST request builder for the provided relative path with the
Authorization
header included.
The path should not include the /api/v1
prefix.
pub fn patch(&self, path: &str) -> RequestBuilder
[src]
Creates a PATCH request builder for the provided relative path with the
Authorization
header included.
The path should not include the /api/v1
prefix.
pub fn put(&self, path: &str) -> RequestBuilder
[src]
Creates a PUT request builder for the provided relative path with the
Authorization
header included.
The path should not include the /api/v1
prefix.
pub fn delete(&self, path: &str) -> RequestBuilder
[src]
Creates a DELETE request builder for the provided relative path with the
Authorization
header included.
The path should not include the /api/v1/
prefix.
pub fn request(&self, method: Method, path: &str) -> RequestBuilder
[src]
Creates a request builder for the provided relative path with the
Authorization
header included.
The path should not include the /api/v1
prefix.
use reqwest::Method; let client = Client::new("extrahop", ApiKey::new("key".to_string())); client.request(Method::Get, "/whitelist/devices").send().unwrap();
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,