add continuous query/subscription methods to meta client

pull/5428/head
Cory LaNou 2016-01-05 16:41:39 -06:00 committed by David Norton
parent 7c41c0e02f
commit a41222befb
1 changed files with 29 additions and 4 deletions

View File

@ -596,19 +596,44 @@ func (c *Client) DeleteMetaNode(id uint64) error {
}
func (c *Client) CreateContinuousQuery(database, name, query string) error {
return nil
return c.retryUntilExec(internal.Command_CreateContinuousQueryCommand, internal.E_CreateContinuousQueryCommand_Command,
&internal.CreateContinuousQueryCommand{
Database: proto.String(database),
Name: proto.String(name),
Query: proto.String(query),
},
)
}
func (c *Client) DropContinuousQuery(database, name string) error {
return nil
return c.retryUntilExec(internal.Command_DropContinuousQueryCommand, internal.E_DropContinuousQueryCommand_Command,
&internal.DropContinuousQueryCommand{
Database: proto.String(database),
Name: proto.String(name),
},
)
}
func (c *Client) CreateSubscription(database, rp, name, mode string, destinations []string) error {
return nil
return c.retryUntilExec(internal.Command_CreateSubscriptionCommand, internal.E_CreateSubscriptionCommand_Command,
&internal.CreateSubscriptionCommand{
Database: proto.String(database),
RetentionPolicy: proto.String(rp),
Name: proto.String(name),
Mode: proto.String(mode),
Destinations: destinations,
},
)
}
func (c *Client) DropSubscription(database, rp, name string) error {
return nil
return c.retryUntilExec(internal.Command_DropSubscriptionCommand, internal.E_DropSubscriptionCommand_Command,
&internal.DropSubscriptionCommand{
Database: proto.String(database),
RetentionPolicy: proto.String(rp),
Name: proto.String(name),
},
)
}
func (c *Client) ExecuteStatement(stmt influxql.Statement) *influxql.Result {