-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting error Invalid value for state
(RUN_ONCE), must be one of ['RUNNING', 'STOPPED', 'DISABLED']
#362
Comments
The version of NIFI is important here, and missing. Please include the version of NIFI you are talking to. |
Check and see if it is this issue: #309 |
Oh sorry. i use NIfi version 1.27.0. |
Yes. It's similar but I would like to use update_run_status_with_http_info this function to call this api>>> api_client.call_api('/processors/{id}/run-status', 'PUT', from this file https://github.com/Chaffelson/nipyapi/blob/main/nipyapi/nifi/apis/processors_api.py |
I cannot see how this can be happening with the versions that you are reporting. The nipyapi model processor runtime status entity has RUN_ONECE, and the nifi processor runtime entity has it as well ( from my PR ). |
|
update_run_status takes a ProcessorRunStatusEntity object not just the string "RUN_ONCE", are you passing that? |
I suspect you are right @ottobackwards - possibly we should add a check in the mustache templates that we are getting the expected object and not a plain String, as that comes up a lot. If @poopae8055 can share their sample code of how they're making the call we could confirm if this is what is happening here. |
Maybe real type hints would help? |
First of all, thank you for your suggestion and your time. I'm just starting to learn to code, so I may make some mistakes. processor_id='9b78c4dc-cb4b-3f04-2bc3-6761487ee6ee'
|
I would expect this to work. You are correct that update_run_status is a separate call to update_processor which doesn't have a convenience method in canvas.py at this time. |
ok i gonna try. and will update the result. thank you so much. |
after i update to
|
Hey @poopae8055 - maybe give this a try: proc_id = "your_nifi_processor_id"
out = nipyapi.nifi.ProcessorsApi().get_processor(proc_id) # return the ProcessorEntity object
# create the ProcessorRunStatusEntity object, grabbing the disconnected_node_acknowledged and revision details from the returned ProcessorEntity object
update_status = nipyapi.nifi.models.ProcessorRunStatusEntity(disconnected_node_acknowledged = out.disconnected_node_acknowledged,
state = 'RUN_ONCE', # set state to RUN_ONCE
revision = out.revision)
# execute update_run_status
out = nipyapi.nifi.ProcessorsApi().update_run_status(proc_id, update_status) This works for me! Originally, I tried to modify the ProcessorEntity status field directly so I could reuse the output in the update call, and that's when I also got the error that |
Description
because PUT/processors/{id}/run-statusUpdates the run state of a processor api of nifi allow the four value states: RUNNING, STOPPED, DISABLED, RUN_ONCE
https://nifi.apache.org/docs/nifi-docs/rest-api/index.html#:~:text=about%20a%20processor-,PUT,Updates%20run%20status%20of%20a%20processor,-GET
but after I use i got error Invalid value for
state
(RUN_ONCE), must be one of ['RUNNING', 'STOPPED', 'DISABLED']nipyapi.nifi.apis.processors_api.ProcessorsApi(
api_client=nipyapi.config.nifi_config.api_client).update_run_status(
id=processor_id,
body=data
)
So pls help allow RUN_ONCE state for update_run_status function as well.
Thank you in advance.
Urgency: Medium
The text was updated successfully, but these errors were encountered: