// CreateProcessor creates a new LSQL processor.
CreateProcessor creates a new LSQL processor.
// CreateProcessor creates a new LSQL processor .
func (c *Client) CreateProcessor(name string, sql string, runners int, clusterName, namespace, pipeline string, processorID string) error {
	if name == "" {
		return errRequired("name")
	}
	if sql == "" {
		return errRequired("sql")
	}
	if runners <= 0 {
		runners = 1
	}
	var payload = CreateProcessorRequestPayload{
		Name:        name,
		SQL:         sql,
		Runners:     runners,
		ClusterName: clusterName,
		Namespace:   namespace,
		Pipeline:    pipeline,
		AppID:       processorID,
	}
	send, err := json.Marshal(payload)
	if err != nil {
		return err
	}
	resp, err := c.Do(http.MethodPost, processorsPath, contentTypeJSON, send)
	if err != nil {
		return err
	}
	return resp.Body.Close()
}
func ( c * Client ) CreateProcessor ( name string , sql string , runners int , clusterName , namespace , pipeline string , processorID string ) error { if name == " " { return errRequired ( " " ) } if sql == " " { return errRequired ( " " ) } if runners <= 0 { runners = 1 } var payload = CreateProcessorRequestPayload { Name : name , SQL : sql , Runners : runners , ClusterName : clusterName , Namespace : namespace , Pipeline : pipeline , AppID : processorID , } send , err := json . Marshal ( payload ) if err != nil { return err } resp , err := c . Do ( http . MethodPost , processorsPath , contentTypeJSON , send ) if err != nil { return err } return resp . Body . Close ( ) }
CreateProcessor creates a new LSQL processor.
CreateProcessor creates a new LSQL processor .