Example #1
0
#pragma warning restore 1998
        /// <summary>
        ///     Execute a query agains a database.
        /// </summary>
        /// <param name="database">the name of the database</param>
        /// <param name="query">
        ///     the query to execute, for language specification please see
        ///     <a href="http://influxdb.org/docs/query_language">http://influxdb.org/docs/query_language</a>
        /// </param>
        /// <param name="precision">the precision used for the values.</param>
        /// <returns>A list of Series which matched the query.</returns>
        public async Task <List <Serie> > QueryAsync(string database, string query, TimeUnit precision)
        {
            InfluxDbApiResponse response =
                await _influxDbClient.Query(NoErrorHandlers, database, query, ToTimePrecision(precision));

            return(response.ReadAs <List <Serie> >());
        }
Example #2
0
        /// <summary>
        ///     Ping this InfluxDB
        /// </summary>
        /// <returns>The response of the ping execution.</returns>
        public async Task <Pong> PingAsync()
        {
            Stopwatch watch = Stopwatch.StartNew();

            InfluxDbApiResponse response = await _influxDbClient.Ping(NoErrorHandlers);

            watch.Stop();
            var pong = response.ReadAs <Pong>();

            pong.ResponseTime = watch.ElapsedMilliseconds;

            return(pong);
        }
Example #3
0
        /// <summary>
        ///     Describe all existing shardspaces.
        /// </summary>
        /// <returns>A list of all <see cref="ShardSpace"></see>'s.</returns>
        public async Task <List <ShardSpace> > GetShardSpacesAsync()
        {
            InfluxDbApiResponse response = await _influxDbClient.GetShardSpaces(NoErrorHandlers);

            return(response.ReadAs <List <ShardSpace> >());
        }
Example #4
0
        public async Task <Shards> GetShardsAsync()
        {
            InfluxDbApiResponse response = await _influxDbClient.GetShards(NoErrorHandlers);

            return(response.ReadAs <Shards>());
        }
Example #5
0
        /// <summary>
        ///     List all servers which are member of the cluster.
        /// </summary>
        /// <returns>A list of all influxdb servers.</returns>
        public async Task <List <Server> > ListServersAsync()
        {
            InfluxDbApiResponse response = await _influxDbClient.ListServers(NoErrorHandlers);

            return(response.ReadAs <List <Server> >());
        }
Example #6
0
        /// <summary>
        ///     Sync the database to the filesystem.
        /// </summary>
        /// <returns>true|false if successful.</returns>
        public async Task <bool> SyncAsync()
        {
            InfluxDbApiResponse response = await _influxDbClient.Sync(NoErrorHandlers);

            return(response.ReadAs <bool>());
        }
Example #7
0
        /// <summary>
        ///     List all interfaces influxDB is listening.
        /// </summary>
        /// <returns>A list of interface names.</returns>
        public async Task <List <string> > InterfacesAsync()
        {
            InfluxDbApiResponse response = await _influxDbClient.Interfaces(NoErrorHandlers);

            return(response.ReadAs <List <string> >());
        }
Example #8
0
        /// <summary>
        ///     Describe all contious queries in a database.
        /// </summary>
        /// <param name="database">The name of the database for which all continuous queries should be described.</param>
        /// <returns>A list of all contious queries.</returns>
        public async Task <List <ContinuousQuery> > DescribeContinuousQueriesAsync(string database)
        {
            InfluxDbApiResponse response = await _influxDbClient.GetContinuousQueries(NoErrorHandlers, database);

            return(response.ReadAs <List <ContinuousQuery> >());
        }
Example #9
0
        /// <summary>
        ///     Describe all database users allowed to acces the given database.
        /// </summary>
        /// <param name="database">The name of the database for which all users should be described.</param>
        /// <returns>A list of all users.</returns>
        public async Task <List <User> > DescribeDatabaseUsersAsync(string database)
        {
            InfluxDbApiResponse response = await _influxDbClient.DescribeDatabaseUsers(NoErrorHandlers, database);

            return(response.ReadAs <List <User> >());
        }
Example #10
0
        /// <summary>
        ///     Describe all cluster admins.
        /// </summary>
        /// <returns>A list of all admins.</returns>
        public async Task <List <User> > DescribeClusterAdminsAsync()
        {
            InfluxDbApiResponse response = await _influxDbClient.DescribeClusterAdmins(NoErrorHandlers);

            return(response.ReadAs <List <User> >());
        }
Example #11
0
        /// <summary>
        ///     Describe all available databases.
        /// </summary>
        /// <returns>A list of all Databases</returns>
        public async Task <List <Database> > DescribeDatabasesAsync()
        {
            InfluxDbApiResponse response = await _influxDbClient.DescribeDatabases(NoErrorHandlers);

            return(response.ReadAs <List <Database> >());
        }