From ffdc14ebdde6ae9b8e86fad4da94a4d086be1a82 Mon Sep 17 00:00:00 2001 From: Jade McGough Date: Thu, 23 Mar 2017 06:21:19 -0700 Subject: [PATCH] add options to alter rp --- influx/databases.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/influx/databases.go b/influx/databases.go index 84ac06439..0e74b7b84 100644 --- a/influx/databases.go +++ b/influx/databases.go @@ -73,7 +73,16 @@ func (c *Client) UpdateRP(ctx context.Context, database string, name string, rp var buffer bytes.Buffer buffer.WriteString("ALTER RETENTION POLICY") if (len(rp.Duration) > 0) { - buffer.WriteString("DURATION " + rp.Duration) + buffer.WriteString(" DURATION " + rp.Duration) + } + if (rp.Replication > 0) { + buffer.WriteString(" REPLICATION " + fmt.Sprint(rp.Replication)) + } + if (len(rp.ShardDuration) > 0) { + buffer.WriteString(" SHARD DURATION " + rp.ShardDuration) + } + if (rp.Default == true) { + buffer.WriteString(" DEFAULT") } _, err := c.Query(ctx, chronograf.Query{