Sending requests to nodes
Written by
Updated at October 28, 2024
Send a test request to a node from the DataSphere interface:
-
Select the relevant project in your community or on the DataSphere homepage
in the Recent projects tab. - Under Project resources, select Node.
- Select the node to send a request to.
- Go to the Request tab.
- Under Create test request, in the Input field, enter the request input variables in
{"a":2,"b":3}
format and click Execute. - View the request processing results under Response.
Note
The cURL section contains sample requests to a node for the cURL and gRPCurl utilities.
The Server response section provides sample code and node response descriptions.
To send requests to nodes, you must have the datasphere.user
or datasphere.admin
role for the folder where the project and node were created.
Sample gRPC API call
grpcurl \
-H "Authorization: Bearer <IAM_token>" \
-d '{
"folder_id": "<folder_ID>",
"node_id": "<node_ID>",
"input": { <input_variables> } \
}' \
datasphere.api.cloud.yandex.net: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.
Sample REST API request
You can use the cURL
curl https://datasphere.api.cloud.yandex.net/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.