Member since
04-10-2019
10
Posts
1
Kudos Received
0
Solutions
07-17-2019
06:05 AM
@ Justen Do you use slack? Leave your email address and I invite you to my channel, we discuss there.
... View more
06-19-2019
08:45 AM
import sys import the 'sys' module
... View more
06-19-2019
07:10 AM
bucket = nipyapi.versioning.get_registry_bucket(identifier=bucket_name, identifier_type='name')
# from: I should add some verification here
if bucket is None:
print(f"ERROR: bucket is None which means {bucket_name} not exists")
sys.exit(-1)
# end
flow = nipyapi.versioning.get_flow_in_bucket(bucket_id=bucket.identifier, identifier=flow_name, identifier_type='name') Nothing fatal, just check the "bucket" whether it exists or not.
... View more
06-04-2019
12:33 PM
Hi @ Justen Check this out. import nipyapi
nipyapi.config.registry_config.host = 'https://localhost:18443/nifi-registry-api'
# additional code for SSL(HTTPS)
nipyapi.security.set_service_ssl_context(service='registry',
ca_file='G:/TEMP/ssl/localhost.cer',
client_cert_file='G:/TEMP/ssl/sys_admin.cer',
client_key_file='G:/TEMP/ssl/sys_admin.key',
client_key_password=None) And it should works like this So, we should know somethings like: 1. HTTPS: HTTP + SSL(TLS is deprecated) 2. SSL: Know about Certificate. https://www.websecurity.symantec.com/security-topics/what-is-ssl-tls-https 3. asymmetric public-private key cryptosystem: common use case is `ssh-keygen`. https://en.wikipedia.org/wiki/RSA_(cryptosystem) 4. CA(certificate authority): Everyone can create a Certificate but whose Certificate is safe or 'legal'? So CA is here. https://www.google.com/search?q=ca+certificate 5. (optional) To setup a nifi-registry in HTTPS: https://www.youtube.com/watch?v=qD03ao3R-a4 To learn that, just google it. In HTTPS-nifi-registry case, use this method to add certificate to access HTTPS. https://nipyapi.readthedocs.io/en/latest/nipyapi-docs/nipyapi.html#module-nipyapi.security I setup a nifi-registry followed by the youtube video above. Use tools - https://keystore-explorer.org/ - and the certificates should look like this Parameters: 1. client_cert_file: the certificate use to access nifi-registry, like 'username' 2. client_key_file: a private key for `client_cert_file`, 'password' 3. client_key_password: the password for private key - `client_key_file`, private key can be encrypted by a password or not be encrypted. In this case, the private key isn't encrypted so set to None. 4. ca_file: The CA who sign the `client_cert_file`. In this case, the CA file is created by ourselves too which is the 'localhost' certificate. You can have all those files by asking your admin guy. I hope I explain clearly 🙂
... View more
06-04-2019
06:43 AM
Oh, Is it your NiFi-Registry using HTTPS instead of HTTP? I'm going to try nipyapi on HTTPS too 🙂
... View more
05-30-2019
04:10 AM
Hi I tried but I can't reproduce it: # 1. set identifier to None
nipyapi.versioning.get_registry_bucket(identifier=None, identifier_type='name')
# return: TypeError: 'in <string>' requires string as left operand, not NoneType
# 2. empty all bucket in nifi-registry and try to get bucket
nipyapi.versioning.get_registry_bucket(identifier='test', identifier_type='name')
# return: None I can't reach the code in quote: 1. If nifi-registry has buckets, each bucket's name will set to this 'name' parameter and can not be None at all. 2. If nifi-registry is empty(no bucket), the code won't be executed (because return a empty list) My suggestions: 1. check `nipyapi.config.registry_config.host = 'http://your-server:18080/nifi-registry-api'` 2. try to use a new nifi-registry and run the code again to find out whether the error occurs. (I recommand using docker: https://hub.docker.com/r/apache/nifi-registry ) 3. it seems python version is not the problem here.
... View more
05-14-2019
02:22 PM
Glad it works. I just wrote the nifi template and the python script inside it. Thanks to the `nipyapi` module.
... View more
05-13-2019
04:18 PM
1 Kudo
https://raw.githubusercontent.com/archongum/NiFi-templates/master/VersioningUpdateFlowVer.xml Apply "change version" of all process groups which share the same version-control flow(bucket/flow) Some input attributes: process group id, a parent group which contains all process groups which share the same version-control flow. Set to 'root' to loop all process groups but cost more time. bucket name flow name target version This template based on https://github.com/Chaffelson/nipyapi
... View more
05-10-2019
04:43 AM
It seems no such function yet. I currently move all my stuff in a 'root' group and version control it. For example, let's assume there are two environments - dev and prod. And I just import the same version-controlled 'root' group twice and named them 'dev' and 'prod'. When 'root' group version changed, all processes and groups inside - including version-controlled groups - changed too. dev has 2 version-controlled groups inside and prod has 1 currently change prod version to 7 to sync
... View more
04-10-2019
05:43 PM
If "/api/swagger" not working, try "/swagger" instead.
... View more