Description | : Execute code in a session. |
Reference | : Link ¶ |
⚶ Changes
{ "#id": "CodeExecution_Execute", "$responses": { "@added_7555ec733b134098a837d8d9e041a6db": { "#status": "200", "$headers": [ { "#name": "operation-location", "Description": "The location for monitoring the operation state.", "Type": "string" }, { "#name": "operation-id", "Description": "The id of this execution operation.", "Type": "string" }, { "#name": "x-ms-error-code", "Description": "String error code indicating what went wrong.", "Type": "string" } ], "$schema": { "Description": "The session code execution resource.", "Type": "object", "$properties": [ { "#name": "id", "Description": "Session code execution id.", "Required": true, "Type": "string" }, { "#name": "identifier", "Description": "The identifier of the session.", "Required": true, "Type": "string" }, { "#name": "executionType", "Description": "The execution type of the code execution request.", "Enum": [ [ "Synchronous", "Synchronous" ], [ "Asynchronous", "Asynchronous" ] ], "Required": true, "Type": "string" }, { "#name": "status", "Description": "The status of the code execution operation, indicates whether succeeded or not.", "Enum": [ [ "NotStarted", "The operation has not started." ], [ "Running", "The operation is in progress." ], [ "Succeeded", "The operation has completed successfully." ], [ "Failed", "The operation has failed." ], [ "Canceled", "The operation has been canceled by the user." ] ], "Required": true, "Type": "string" }, { "#name": "error", "Description": "The error of this code execution if failed.", "Required": false, "Type": "object", "$properties": [ { "#name": "error", "Description": "The error object.", "Required": true, "Type": "object", "$properties": [ { "#name": "code", "Description": "One of a server-defined set of error codes.", "Required": true, "Type": "string" }, { "#name": "message", "Description": "A human-readable representation of the error.", "Required": true, "Type": "string" }, { "#name": "target", "Description": "The target of the error.", "Required": false, "Type": "string" }, { "#name": "details", "Description": "An array of details about specific errors that led to this reported error.", "Required": false, "Type": "array", "$items": { "Type": "string" } }, { "#name": "innererror", "Description": "An object containing more specific information than the current object about the error.", "Required": false, "Type": "object", "$properties": [ { "#name": "code", "Description": "One of a server-defined set of error codes.", "Required": false, "Type": "string" }, { "#name": "innererror", "Required": false, "Type": "string" } ] } ] } ] }, { "#name": "result", "Description": "The result of this code execution operation.", "Required": false, "Type": "object", "$properties": [ { "#name": "stdout", "Description": "The standard output of the code execution.", "Required": false, "Type": "string" }, { "#name": "stderr", "Description": "The standard error of the code execution.", "Required": false, "Type": "string" }, { "#name": "executionResult", "Description": "The result of the code execution. The type of this field is same as the type of actual result of the code execution after being Json serialized.", "Required": false, "Type": "string" }, { "#name": "executionTimeInMilliseconds", "Description": "The execution time of the code in milliseconds.", "Format": "int64", "Required": false, "Type": "integer" } ] } ] } }, "@removed_80ffcfc156b4492a887688a07f47b493": { "#status": "202", "$headers": [ { "#name": "operation-location", "Description": "The location for monitoring the operation state.", "Type": "string" }, { "#name": "operation-id", "Description": "The id of this execution operation.", "Type": "string" }, { "#name": "x-ms-error-code", "Description": "String error code indicating what went wrong.", "Type": "string" } ], "$schema": { "Description": "The session code execution resource.", "Type": "object", "$properties": [ { "#name": "id", "Description": "Session code execution id.", "Required": true, "Type": "string" }, { "#name": "identifier", "Description": "The identifier of the session.", "Required": true, "Type": "string" }, { "#name": "executionType", "Description": "The execution type of the code execution request.", "Enum": [ [ "Synchronous", "Synchronous" ], [ "Asynchronous", "Asynchronous" ] ], "Required": true, "Type": "string" }, { "#name": "status", "Description": "The status of the code execution operation, indicates whether succeeded or not.", "Enum": [ [ "NotStarted", "The operation has not started." ], [ "Running", "The operation is in progress." ], [ "Succeeded", "The operation has completed successfully." ], [ "Failed", "The operation has failed." ], [ "Canceled", "The operation has been canceled by the user." ] ], "Required": true, "Type": "string" }, { "#name": "error", "Description": "The error of this code execution if failed.", "Required": false, "Type": "object", "$properties": [ { "#name": "error", "Description": "The error object.", "Required": true, "Type": "object", "$properties": [ { "#name": "code", "Description": "One of a server-defined set of error codes.", "Required": true, "Type": "string" }, { "#name": "message", "Description": "A human-readable representation of the error.", "Required": true, "Type": "string" }, { "#name": "target", "Description": "The target of the error.", "Required": false, "Type": "string" }, { "#name": "details", "Description": "An array of details about specific errors that led to this reported error.", "Required": false, "Type": "array", "$items": { "Type": "string" } }, { "#name": "innererror", "Description": "An object containing more specific information than the current object about the error.", "Required": false, "Type": "object", "$properties": [ { "#name": "code", "Description": "One of a server-defined set of error codes.", "Required": false, "Type": "string" }, { "#name": "innererror", "Required": false, "Type": "string" } ] } ] } ] }, { "#name": "result", "Description": "The result of this code execution operation.", "Required": false, "Type": "object", "$properties": [ { "#name": "stdout", "Description": "The standard output of the code execution.", "Required": false, "Type": "string" }, { "#name": "stderr", "Description": "The standard error of the code execution.", "Required": false, "Type": "string" }, { "#name": "executionResult", "Description": "The result of the code execution. The type of this field is same as the type of actual result of the code execution after being Json serialized.", "Required": false, "Type": "string" }, { "#name": "executionTimeInMilliseconds", "Description": "The execution time of the code in milliseconds.", "Format": "int64", "Required": false, "Type": "integer" } ] } ] } } } }
⚼ Request
POST:
/executions
{
api-version:
string
,
operation-id:
string
,
identifier:
string
,
codeExecutionRequest:
}
{
,
codeInputType:
enum
,
executionType:
enum
,
code:
string
,
timeoutInSeconds:
integer
,
}
⚐ Response (200)
{
$headers:
{
,
operation-location:
string
,
operation-id:
string
,
x-ms-error-code:
string
,
}
$schema:
}
{
,
id:
string
,
identifier:
string
,
executionType:
enum
,
status:
enum
,
error:
{
,
error:
}
{
,
code:
string
,
message:
string
,
target:
string
,
details:
[
,
string
,
]
innererror:
}
{
,
code:
string
,
innererror:
string
,
}
result:
}
{
,
stdout:
string
,
stderr:
string
,
executionResult:
string
,
executionTimeInMilliseconds:
integer
,
}
⚐ Response (default)
{
$headers:
{
,
x-ms-error-code:
string
,
}
$schema:
}
{
,
error:
}
{
,
code:
string
,
message:
string
,
target:
string
,
details:
[
,
string
,
]
innererror:
}
{
,
code:
string
,
innererror:
string
,
}