Struct influx_db_client::InfluxdbClient
[−]
[src]
pub struct InfluxdbClient<'a> { /* fields omitted */ }
Methods
impl<'a> InfluxdbClient<'a>
[src]
fn new(
host: &'a str,
db: &'a str,
username: &'a str,
passwd: &'a str
) -> InfluxdbClient<'a>
host: &'a str,
db: &'a str,
username: &'a str,
passwd: &'a str
) -> InfluxdbClient<'a>
Create a new influxdb client
fn set_read_timeout(&mut self, timeout: u64)
Set the read timeout value
fn set_write_timeout(&mut self, timeout: u64)
Set the write timeout value
fn swith_database(&mut self, database: &'a str)
Change the client's database
fn swith_user(&mut self, user: &'a str, passwd: &'a str)
Change the client's user
Trait Implementations
impl<'a> Debug for InfluxdbClient<'a>
[src]
impl<'a> InfluxClient for InfluxdbClient<'a>
[src]
fn ping(&self) -> bool
Query whether the corresponding database exists, return bool
fn get_version(&self) -> Option<String>
Query the version of the database and return the version number
fn write_point(
&self,
point: Point,
precision: Option<Precision>,
rp: Option<&str>
) -> Result<bool, Error>
&self,
point: Point,
precision: Option<Precision>,
rp: Option<&str>
) -> Result<bool, Error>
Write a point to the database
fn write_points(
&self,
points: Points,
precision: Option<Precision>,
rp: Option<&str>
) -> Result<bool, Error>
&self,
points: Points,
precision: Option<Precision>,
rp: Option<&str>
) -> Result<bool, Error>
Write multiple points to the database
fn query(&self, q: &str, epoch: Option<Precision>) -> Result<Vec<Value>, Error>
Query and return data, the data type is Vec<serde_json::Value>
fn drop_measurement(&self, measurement: &str) -> Result<(), Error>
fn create_database(&self, dbname: &str) -> Result<(), Error>
Create a new database in InfluxDB.
fn drop_database(&self, dbname: &str) -> Result<(), Error>
Drop a database from InfluxDB.
fn create_user(
&self,
user: &str,
passwd: &str,
admin: bool
) -> Result<(), Error>
&self,
user: &str,
passwd: &str,
admin: bool
) -> Result<(), Error>
Create a new user in InfluxDB.
fn drop_user(&self, user: &str) -> Result<(), Error>
Drop a user from InfluxDB.
fn set_user_password(&self, user: &str, passwd: &str) -> Result<(), Error>
Change the password of an existing user.
fn grant_admin_privileges(&self, user: &str) -> Result<(), Error>
Grant cluster administration privileges to a user.
fn revoke_admin_privileges(&self, user: &str) -> Result<(), Error>
Revoke cluster administration privileges from a user.
fn grant_privilege(
&self,
user: &str,
db: &str,
privilege: &str
) -> Result<(), Error>
&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
fn revoke_privilege(
&self,
user: &str,
db: &str,
privilege: &str
) -> Result<(), Error>
&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
fn create_retention_policy(
&self,
name: &str,
duration: &str,
replication: &str,
default: bool,
db: Option<&str>
) -> Result<(), Error>
&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.
fn drop_retention_policy(
&self,
name: &str,
db: Option<&str>
) -> Result<(), Error>
&self,
name: &str,
db: Option<&str>
) -> Result<(), Error>
Drop an existing retention policy for a database.