Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

updating oozie-site.xml via REST api

avatar
Contributor

Can I update oozie-site.xml using REST api?

 

We added our own external function to oozie.

After each installation we need to go manually and change things in oozie via the CM web interface:

  • Oozie Server Configuration Safety Valve for oozie-site.xml - add two properties
  • oozie.service.ActionService.executor.ext.classes - add additional value
  • oozie SchemaService Workflow Extension Schemas - add additional value

i'd like to be able to do this via scripting of any kind.

 

So far i could not find such an option - neither in CM REST API (http://cloudera.github.io/cm_api/apidocs/v10/index.html) nor OOZIE REST API (http://archive.cloudera.com/cdh4/cdh/4/oozie/WebServicesAPI.html)

 

Thanks

Doron

1 ACCEPTED SOLUTION

avatar
Hi Doron,

All configuration properties are in the CM REST API.

See the tutorials about using our rest API here:
http://cloudera.github.io/cm_api/

These include tutorials about how to read and set config, such as:
http://cloudera.github.io/cm_api/docs/python-client/#configuring-services-and-roles

Using the rest endpoint for configs directly is documented on the page you linked. There's a different endpoint for each concept (host, service, role config group, role, etc). The one you'd want for Oozie Server role config group is:
http://cloudera.github.io/cm_api/apidocs/v10/path__clusters_-clusterName-_services_-serviceName-_rol...

Theses configs have the keys oozie_config_safety_valve, oozie_executor_extension_classes, and oozie_workflow_extension_schemas.

The most reliable way to identify config keys is to query your live CM via the API, using the option ?view=FULL, as described in the first link above. Documentation for config values is also available here (assuming CDH5.4, you can click other links for other versions):
http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/cm_props_cdh540_oozie.h...

Thanks,
Darren

View solution in original post

3 REPLIES 3

avatar
Hi Doron,

All configuration properties are in the CM REST API.

See the tutorials about using our rest API here:
http://cloudera.github.io/cm_api/

These include tutorials about how to read and set config, such as:
http://cloudera.github.io/cm_api/docs/python-client/#configuring-services-and-roles

Using the rest endpoint for configs directly is documented on the page you linked. There's a different endpoint for each concept (host, service, role config group, role, etc). The one you'd want for Oozie Server role config group is:
http://cloudera.github.io/cm_api/apidocs/v10/path__clusters_-clusterName-_services_-serviceName-_rol...

Theses configs have the keys oozie_config_safety_valve, oozie_executor_extension_classes, and oozie_workflow_extension_schemas.

The most reliable way to identify config keys is to query your live CM via the API, using the option ?view=FULL, as described in the first link above. Documentation for config values is also available here (assuming CDH5.4, you can click other links for other versions):
http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/cm_props_cdh540_oozie.h...

Thanks,
Darren

avatar
Contributor
Hi Darren,
just now got to check it and It worked!
Thanks!!
Doron

avatar
Contributor

I manage to create python script to change the configuration.

here is an example:

https://linuxlabrat.wordpress.com/2015/05/26/updating-cdh-configuration-using-python-and-rest-apis/