AdysTech.InfluxDB.Client.Net.InfluxDBClient.DropContinuousQueryAsync C# (CSharp) Method

DropContinuousQueryAsync() public method

public DropContinuousQueryAsync ( IInfluxContinuousQuery cq ) : Task
cq IInfluxContinuousQuery
return Task
        public async Task<bool> DropContinuousQueryAsync (IInfluxContinuousQuery cq)
        {
            if (!cq.Saved)
                throw new ArgumentException ("Continuous Query is not saved");
            var query = (cq as InfluxContinuousQuery).GetDropSyntax ();
            if (query != null)
            {
                var response = await GetAsync (new Dictionary<string, string> () { { "q", query } });
                if (response.StatusCode == HttpStatusCode.OK)
                {
                    (cq as InfluxContinuousQuery).Saved = false;
                    (cq as InfluxContinuousQuery).Deleted = true;
                    return true;
                }
            }
            return false;
        }