Sending a request to a node
The provided request examples work correctly only with Docker image nodes. To request a model node, install Triton Client
Requests to the node can be submitted by users and service accounts with the minimum project role of datasphere.community-projects.developer. The service account must reside in the same folder as the node.
Send a test request to a node from the DataSphere interface:
-
Select the project in your community or on the DataSphere home page
in the Recent projects tab. - Under Project resources, select Node.
- Select the node to send the 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 examples of requests to a node for cURL and gRPCurl.
The Server response section provides sample code and node response descriptions.
grpcurl \
--header "x-node-id: <node_ID>" \
--header "Authorization: Bearer <IAM_token>" \
--header "x-folder-id: <folder_ID>" \
--data '<input_variables>' \
node-api.datasphere.yandexcloud.net:443
Where:
<node_ID: Node ID.<IAM_token>: IAM token used for authentication.<folder_ID>: ID of the folder where the project and node were created.<input_variables>: Object in{"a":2,"b":3}format where keys match input variables.
The successful response will return an object:
{
"output": {
<output_variables>
}
}
Where <output_variables> is the object where keys match output variables.
You can use cURL
curl \
--header "x-node-id: <node_ID>" \
--header "Authorization: Bearer <IAM_token>" \
--header "x-folder-id: <folder_ID>" \
--request <method> \
--data '<input_variables>' \
https://node-api.datasphere.yandexcloud.net/
Where:
<node_ID>: Node ID.<IAM_token>: IAM token used for authentication.<folder_ID>: ID of the folder where the project and node were created.<request_type>: Type of HTTP request.<input_variables>: Object in{"a":2,"b":3}format where keys match input variables.
The response returns a JSON object with output variables.