hermannpencole / nifi-config

Automatically deploy and configure Template on Nifi
Apache License 2.0
55 stars 39 forks source link

Does not parse Controller Services #6

Closed Chaffelson closed 7 years ago

Chaffelson commented 7 years ago

Templates with bound controller services, such as when using ExecuteSql processors, are exported with the Controller Services defined in the xml, but are not parsed by the nifi-config library.

Is there a plan to add this feature in the future?

hermannpencole commented 7 years ago

Thanks, you are right controllers are not parsed by nifi-config. I will try to add this features this week (Otherwise it will be around 20 August)

hermannpencole commented 7 years ago

Release 1.1.5 is created and have the correction (It is necessary to wait that oss.sonatype.org deploy the release on maven central). If the correction is ok for you, close the issue. If not say what is wrong. thank you for your collaboration

Chaffelson commented 7 years ago

Firstly, thank you for addressing this request so quickly.

I have just tested it, and it is throwing an error as the Controller Service is not disabled:

2017-07-28 17:02:21 | INFO  | [main] c.g.h.n.c.Main:79 - Starting config_nifi 1.1.5 on mode updateConfig
2017-07-28 17:02:21 | INFO  | [main] c.g.h.n.c.Main:99 - Communicate with nifi 1.2.0.3.0.0.0-453
2017-07-28 17:02:21 | INFO  | [main] c.g.h.n.c.s.UpdateProcessorService:62 - Processing : config.json
2017-07-28 17:02:22 | INFO  | [main] c.g.h.n.c.s.UpdateProcessorService:71 - [root, LocalMySql] is stopped
2017-07-28 17:02:22 | INFO  | [main] c.g.h.n.c.s.UpdateProcessorService:142 - Update processor : DistributedFetch
2017-07-28 17:02:22 | INFO  | [main] c.g.h.n.c.s.UpdateProcessorService:165 - Updated : DistributedFetch
2017-07-28 17:02:22 | INFO  | [main] c.g.h.n.c.s.UpdateProcessorService:142 - Update processor : ExecuteSql
2017-07-28 17:02:22 | INFO  | [main] c.g.h.n.c.s.UpdateProcessorService:165 - Updated : ExecuteSql
2017-07-28 17:02:22 | ERROR | [main] c.g.h.n.c.Main:122 - Conflict
com.github.hermannpencole.nifi.swagger.ApiException: Conflict
    at com.github.hermannpencole.nifi.swagger.ApiClient.handleResponse(ApiClient.java:1066)
    at com.github.hermannpencole.nifi.swagger.ApiClient.execute(ApiClient.java:989)
    at com.github.hermannpencole.nifi.swagger.client.ControllerServicesApi.updateControllerServiceWithHttpInfo(ControllerServicesApi.java:884)
    at com.github.hermannpencole.nifi.swagger.client.ControllerServicesApi.updateControllerService(ControllerServicesApi.java:869)
    at com.github.hermannpencole.nifi.config.service.UpdateProcessorService.updateControllers(UpdateProcessorService.java:111)
    at com.github.hermannpencole.nifi.config.service.UpdateProcessorService.updateByBranch(UpdateProcessorService.java:82)
    at com.github.hermannpencole.nifi.config.Main.main(Main.java:104)
Exception in thread "main" com.github.hermannpencole.nifi.config.model.ConfigException: Conflict: Node whoville.hortonworks.com:9090 is unable to fulfill this request due to: e49634e5-fbf3-35b0-9f29-fce4e83a06ac cannot be updated because it is not disabled
    at com.github.hermannpencole.nifi.config.Main.main(Main.java:123)
Caused by: com.github.hermannpencole.nifi.swagger.ApiException: Conflict
    at com.github.hermannpencole.nifi.swagger.ApiClient.handleResponse(ApiClient.java:1066)
    at com.github.hermannpencole.nifi.swagger.ApiClient.execute(ApiClient.java:989)
    at com.github.hermannpencole.nifi.swagger.client.ControllerServicesApi.updateControllerServiceWithHttpInfo(ControllerServicesApi.java:884)
    at com.github.hermannpencole.nifi.swagger.client.ControllerServicesApi.updateControllerService(ControllerServicesApi.java:869)
    at com.github.hermannpencole.nifi.config.service.UpdateProcessorService.updateControllers(UpdateProcessorService.java:111)
    at com.github.hermannpencole.nifi.config.service.UpdateProcessorService.updateByBranch(UpdateProcessorService.java:82)
    at com.github.hermannpencole.nifi.config.Main.main(Main.java:104)
hermannpencole commented 7 years ago

Sorry, I wanted to make corrections too fast

hermannpencole commented 7 years ago

Release 1.1.6 is created and have the correction. If the correction is ok for you, close the issue. If not say what is wrong. thanks a lot for your collaboration

hermannpencole commented 7 years ago

If the correction is ok for you, could you close the issue. If not could you say what is wrong.

Chaffelson commented 7 years ago

@hermannpencole Apologies for the delay, I have been out on summer holidays. This now tests well, thank you for making the changes!