Change a recipes engine using the API

Solved!
NN
Change a recipes engine using the API

Hi Everyone,
I know we can get the selected engine details of a recipe using the API.
but is there a way to change the engine of the recipe as well using the API ?

Any suggestions are welcome ๐Ÿ™‚ 
Thanks..

0 Kudos
1 Solution
MikeG
Dataiker

Hi @NN ,

It is possible to change the engine used by a recipe by changing the value of `engineType` in that recipe's settings.

Here's an example (assume the `engineType` is 'DSS' and I want to change it to 'SQL' via the API):

 

import dataikuapi

host = DSS_HOST
apiKey = DSS_API_KEY
client = dataikuapi.DSSClient(host, apiKey)

proj = client.get_project("COMMUNITY_24974")
recipe = proj.get_recipe("compute_orders_copy_filtered")

settings = recipe.get_settings()
settings.raw_params['engineType']='SQL'
settings.save()

 

Note: a recipe may be able to use only a subset of engines. To determine which engines are eligible to be used by a recipe check the output of `recipe.get_status().get_engines_details()`.  If an engine has `'isSelectable': True` then that engine can be used for that recipe.

 

Thank you,
Mike

View solution in original post

0 Kudos
2 Replies
MikeG
Dataiker

Hi @NN ,

It is possible to change the engine used by a recipe by changing the value of `engineType` in that recipe's settings.

Here's an example (assume the `engineType` is 'DSS' and I want to change it to 'SQL' via the API):

 

import dataikuapi

host = DSS_HOST
apiKey = DSS_API_KEY
client = dataikuapi.DSSClient(host, apiKey)

proj = client.get_project("COMMUNITY_24974")
recipe = proj.get_recipe("compute_orders_copy_filtered")

settings = recipe.get_settings()
settings.raw_params['engineType']='SQL'
settings.save()

 

Note: a recipe may be able to use only a subset of engines. To determine which engines are eligible to be used by a recipe check the output of `recipe.get_status().get_engines_details()`.  If an engine has `'isSelectable': True` then that engine can be used for that recipe.

 

Thank you,
Mike

0 Kudos
NN
Author

Thanks @MikeG  That works.. 

0 Kudos