Struct influx_db_client::client::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
The client to influxdb
Methods
impl Client
[src]
pub fn new<T>(host: T, db: T) -> Self where
T: ToString,
[src]
T: ToString,
Create a new influxdb client with http
pub fn new_with_option<T: ToString>(
host: T,
db: T,
tls_option: Option<TLSOption>
) -> Self
[src]
host: T,
db: T,
tls_option: Option<TLSOption>
) -> Self
Create a new influxdb client with https
pub fn set_read_timeout(&mut self, timeout: u64)
[src]
Set the read timeout value, unit "s"
pub fn set_write_timeout(&mut self, timeout: u64)
[src]
Set the write timeout value, unit "s"
pub fn switch_database<T>(&mut self, database: T) where
T: ToString,
[src]
T: ToString,
Change the client's database
pub fn set_authentication<T>(self, user: T, passwd: T) -> Self where
T: Into<String>,
[src]
T: Into<String>,
Change the client's user
pub fn set_tls(self, connector: Option<TLSOption>) -> Self
[src]
Change http to https, but don't leave the read write timeout setting
pub fn get_db(&self) -> String
[src]
View the current db name
pub fn ping(&self) -> bool
[src]
Query whether the corresponding database exists, return bool
pub fn get_version(&self) -> Option<String>
[src]
Query the version of the database and return the version number
pub fn write_point(
&self,
point: Point,
precision: Option<Precision>,
rp: Option<&str>
) -> Result<(), Error>
[src]
&self,
point: Point,
precision: Option<Precision>,
rp: Option<&str>
) -> Result<(), Error>
Write a point to the database
pub fn write_points<T: Iterator<Item = Point>>(
&self,
points: T,
precision: Option<Precision>,
rp: Option<&str>
) -> Result<(), Error>
[src]
&self,
points: T,
precision: Option<Precision>,
rp: Option<&str>
) -> Result<(), Error>
Write multiple points to the database
pub fn query(
&self,
q: &str,
epoch: Option<Precision>
) -> Result<Option<Vec<Node>>, Error>
[src]
&self,
q: &str,
epoch: Option<Precision>
) -> Result<Option<Vec<Node>>, Error>
Query and return data, the data type is Option<Vec<Node>>
pub fn drop_measurement(&self, measurement: &str) -> Result<(), Error>
[src]
Drop measurement
pub fn create_database(&self, dbname: &str) -> Result<(), Error>
[src]
Create a new database in InfluxDB.
pub fn drop_database(&self, dbname: &str) -> Result<(), Error>
[src]
Drop a database from InfluxDB.
pub fn create_user(
&self,
user: &str,
passwd: &str,
admin: bool
) -> Result<(), Error>
[src]
&self,
user: &str,
passwd: &str,
admin: bool
) -> Result<(), Error>
Create a new user in InfluxDB.
pub fn drop_user(&self, user: &str) -> Result<(), Error>
[src]
Drop a user from InfluxDB.
pub fn set_user_password(&self, user: &str, passwd: &str) -> Result<(), Error>
[src]
Change the password of an existing user.
pub fn grant_admin_privileges(&self, user: &str) -> Result<(), Error>
[src]
Grant cluster administration privileges to a user.
pub fn revoke_admin_privileges(&self, user: &str) -> Result<(), Error>
[src]
Revoke cluster administration privileges from a user.
pub fn grant_privilege(
&self,
user: &str,
db: &str,
privilege: &str
) -> Result<(), Error>
[src]
&self,
user: &str,
db: &str,
privilege: &str
) -> Result<(), Error>
Grant a privilege on a database to a user. :param privilege: the privilege to grant, one of 'read', 'write' or 'all'. The string is case-insensitive
pub fn revoke_privilege(
&self,
user: &str,
db: &str,
privilege: &str
) -> Result<(), Error>
[src]
&self,
user: &str,
db: &str,
privilege: &str
) -> Result<(), Error>
Revoke a privilege on a database from a user. :param privilege: the privilege to grant, one of 'read', 'write' or 'all'. The string is case-insensitive
pub fn create_retention_policy(
&self,
name: &str,
duration: &str,
replication: &str,
default: bool,
db: Option<&str>
) -> Result<(), Error>
[src]
&self,
name: &str,
duration: &str,
replication: &str,
default: bool,
db: Option<&str>
) -> Result<(), Error>
Create a retention policy for a database. :param duration: the duration of the new retention policy. Durations such as 1h, 90m, 12h, 7d, and 4w, are all supported and mean 1 hour, 90 minutes, 12 hours, 7 day, and 4 weeks, respectively. For infinite retention – meaning the data will never be deleted – use 'INF' for duration. The minimum retention period is 1 hour.
pub fn drop_retention_policy(
&self,
name: &str,
db: Option<&str>
) -> Result<(), Error>
[src]
&self,
name: &str,
db: Option<&str>
) -> Result<(), Error>
Drop an existing retention policy for a database.
Trait Implementations
impl Debug for Client
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more