Using Hue scripts

Hue scripts help you to share workflows, set up default editors, change ownership of documents, and test the backend processes using cURL commands. The Hue scripts are included with CDP.

Sharing workflows with users and groups

Use the following command to share workflows with users and groups:
./build/env/bin/hue share_all_workflows --owner [***OWNER-NAME***] --sharegroups [***GROUP1/USER1***],[***GROUP2/USER2***] --permissions read,write

To share users, use the --shareusers option instead of the --sharegroups option.

Changing the document owner

Use the following command to change the owner of the Hue documents:
./build/env/bin/hue change_owner_of_docs --olduser [***OLD-USER-NAME***] --newuser [***NEW-USER-NAME***]

Testing the backend using cURL

Use the following command to get the syntax for the backend cURL commands or to test the endpoints:
./build/env/bin/hue get_backend_curl --showcurl --testname [***SERVICE-NAME-WHERE-TEST-NEEDS-TO-BE-PERFORMED***] --service [***COMMA-SEPARATED-SERVICES-TO-TEST]

Replace [***SERVICE-NAME***] with the name of the service where you want to perform the test. Replace [***COMMA-SEPARATED-SERVICES-TO-TEST***] with options or services such as all, httpfs, solr, oozie, rm, jhs, sparkhs, and so on.

Setting the default editor in Hue

Use the following command to set the default editor in Hue:
./build/env/bin/hue set_default_editor --hive/impala --username [***USERNAME***]

The default value for the username is all.