title | description |
---|---|
How to send a request to a node in {{ ml-platform-full-name }} |
Follow this guide to send a request to a node. |
Send a test request to a node from the {{ ml-platform-name }} interface:
- {% include find project %}
- Under {{ ui-key.yc-ui-datasphere.project-page.project-resources }}, select {{ ui-key.yc-ui-datasphere.resources.node }}.
- Select the node to send a request to.
- Go to the {{ ui-key.yc-ui-datasphere.node-page.tab.request }} tab.
- Under {{ ui-key.yc-ui-datasphere.node-page.request.create-test-request }}, in the {{ ui-key.yc-ui-datasphere.common.input }} field, enter the request input variables in
{"a":2,"b":3}
format and click {{ ui-key.yc-ui-datasphere.common.execute }}. - View the request processing results under {{ ui-key.yc-ui-datasphere.common.response }}.
{% note info %}
The {{ ui-key.yc-ui-datasphere.node-page.request.curl }} section contains sample requests to a node for the cURL and gRPCurl utilities.
The {{ ui-key.yc-ui-datasphere.node-page.request.server-response }} section provides sample code and node response descriptions.
{% endnote %}
To send requests to nodes, you must have the {{ roles-datasphere-user }}
or {{ roles-datasphere-admin }}
role for the folder where the project and node were created.
grpcurl \
-H "Authorization: Bearer <IAM_token>" \
-d '{
"folder_id": "<folder_ID>",
"node_id": "<node_ID>",
"input": { <input_variables> } \
}' \
datasphere.{{ api-host }}:443
yandex.cloud.datasphere.v1.NodeService/Execute
Where:
<IAM_token>
: IAM token used for authentication.<folder_ID>
: ID of the folder the project and node are created in.<node_ID>
: Node ID.<input_variables>
: Object where keys match input variables.
In a successful response, the object is returned:
{
"output": {
<output_variables>
}
}
Where <output_variables>
is the object in which keys match output variables.
You can use the cURL utility to send REST requests.
curl https://datasphere.{{ api-host }}/datasphere/v1/nodes/<node_ID>:execute \
--request POST \
--header "Authorization: Bearer <IAM_token>"
--data '{
"folder_id": "<folder_ID>",
"node_id": "<node_ID>",
"input": { <input_variables> }
}'
Where:
<IAM_token>
: IAM token used for authentication.<folder_ID>
: ID of the folder the project and node are created in.<node_ID>
: Node ID.<input_variables>
: Object where keys match input variables.
The response returns a JSON object with output variables.