Chaffelson / nipyapi

A convenient Python wrapper for Apache NiFi
Other
245 stars 76 forks source link

Property Display Names in UI differ from addressable Names in API #320

Closed Chaffelson closed 11 months ago

Chaffelson commented 1 year ago

Per discussion in NiFi Slack. Properties in Processors may have Display Names that differ from the addressable name in the API, for example the GetSQS Processor has Access Key ID as the display name in the UI, but if you want to change it via the API the field name is Access Key - this information can be found in the property descriptors if you fetch the Processor but you have to know that.

It would potentially be helpful to users to create a function like nipyapi.canvas.prepare_properties_for_update which takes a dict(string:string) of properties and a Processor identity and resolves any Property Display Names to the actual Property Names in a return dict(string:string).

ottobackwards commented 1 year ago

The dream would be to get a 'default' configuration dto for a processor / controller service of type, even if it is just the property descriptions

Chaffelson commented 1 year ago

We've got nipyapi.canvas.get_processor_type which contains this information. We could either extend this function to return a property summary, or have a separate method to return the necessary properties and their descriptors?

ottobackwards commented 1 year ago

I think that, and possibly a CLI script where you can ask and get to std out the json?

ottobackwards commented 1 year ago

Like, for any configurable component output the default configuration or whatever

Chaffelson commented 1 year ago

I'm not sure what you mean by a CLI script for it, but if you want to mock it up I'd be happy to review. An extractor of default Properties for the obvious objects could be quite useful.

ottobackwards commented 1 year ago
$>nipyapi-get-default-component-config.sh --byName UpdateAttribute >> ua_defaults.json
Chaffelson commented 1 year ago

We don't do any other wrapper scripts in NiPy at the moment, I'm hesitant to introduce a new mode of usage unless it is really needed.

ottobackwards commented 1 year ago

ok, if the nice api appears, maybe I'll do something on the side

Kapkiai commented 1 year ago

Hello, I see recent nifi version have the API name (the name to configure processors/controller services properties) in documentation. There is a new column in the documentation called "API Name". Example for ConsumeKafka_2_6 processor: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-2-6-nar/1.19.1/org.apache.nifi.processors.kafka.pubsub.ConsumeKafka_2_6/index.html

Chaffelson commented 11 months ago

Closing as this is solved in documentation per @Kapkiai 's notes