ibm-early-programs / node-red-contrib-watson-machine-learning

Apache License 2.0
2 stars 9 forks source link

Node appears broken. Parameters required by v4 API are not passed in the calls #23

Open tim-minter opened 3 years ago

tim-minter commented 3 years ago

One or both of space_id or project_id are required by most (maybe all) API calls but these are not obtained or sent. For example, testing the ML API via curl reveals that

curl -H "Authorization: Bearer $IAM_TOKEN" -X GET 'https://eu-gb.ml.cloud.ibm.com/ml/v4/models?space_id=xyz&version=2020-09-01'

where xyz is the Space GUID (available in the Manage tab of the relevant Space page in the ML web UI) works. If we issue

curl -H "Authorization: Bearer $IAM_TOKEN" -X GET 'https://eu-gb.ml.cloud.ibm.com/ml/v4/models?version=2020-09-01'

(which is effectively what the node is doing) we get...

{ "trace": "af172ae8e21839617a32563760e8aff5", "errors": [{ "code": "missing_one_of_query_parameter", "message": "Mandatory query parameter not found when expecting one (and only one) of space_id, project_id", "target": { "type": "parameter", "name": "One of space_id, project_id" }, "more_info": "https://cloud.ibm.com/apidocs/machine-learning" }], "status_code": "400"

chughts commented 3 years ago

This is going to require an overall of the node, along with removal of the V3 API calls.

I will be happy to accept a pull request with the changes.