리그캣의 개발놀이터

[streamsets] api parameter / binary data 받기 본문

인프라/ETL

[streamsets] api parameter / binary data 받기

리그캣 2020. 7. 3. 19:18

https://ask.streamsets.com/question/1165/runtime-parameters-with-rest-api/

 

Runtime parameters with REST API - Ask StreamSets

Runtime parameters with REST API edit I am trying to use a parameter tablename to dynamically pipe data to a MapR cluster. I have tested with success using the GUI of StreamSets, while cannot get around with REST API. Is there any document for this usage o

ask.streamsets.com


해당 내용에 내가 남긴 내용이다.

 

streamsets 파라미터 받기를 위해서는 다음과 같이 파이프라인 rest api 를 사용하게 된다.

 

example

```

$curl 'http://{stremasetsurl}:18630/rest/v1/pipeline/{pipelineid}?rev=0' --user 'admin:
{adminpassword}' -H 'X-Requested-By:user' -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"TABLE": "topic"}'
```

위와 같이 TABLE이라는 파라미터를 넘기게 되는데 

streamsets에서는 아래와 같이 받을 수 있다.

먼저 맨 상단 pipeline 에서 parameter tab을 선택한다.

TABEL이라는 변수를 만들고 꼭 $ {TABLE} < - 처럼 $ 와 {} 사이에 공백이 들어가야 한다.

 

이제 사용할 변수를 입력해주는데 이때는 공배를 빼주면된다

 

Comments