add options to alter rp

pull/1022/head
Jade McGough 2017-03-23 06:21:19 -07:00
parent e58a846f7b
commit ffdc14ebdd
1 changed files with 10 additions and 1 deletions

View File

@ -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{