Running deployed API's test queries without the API Deployer

Sunny
Level 2
Running deployed API's test queries without the API Deployer

Hi, 

 

Is there a way to run all the test queries of the deployed API's using python script.

0 Kudos
1 Reply
JordanB
Dataiker

Hi @Sunny,

Unfortunately, that functionality is not included in DSS Python API's natively. You would need to create a python script with the entry point to the API node and define your test queries there (ref: https://doc.dataiku.com/dss/latest/apinode/api/user-api.html#dataikuapi.APINodeClient

 

import dataikuapi

client = dataikuapi.APINodeClient("http:<uri>", "<service-id>")

record_to_predict = {
    "item1": "example",
    "item2": 415,
}
prediction = client.predict_record("<endpoint-id>", record_to_predict)
print(prediction["result"])

 

 

Let me know if you have any questions.

Thanks!

Jordan

0 Kudos

Labels

?
Labels (3)

Setup info

?
A banner prompting to get Dataiku