Skip to content

Commit 5bbb162

Browse files
authored
[Azure Container Apps] Use OK response for code execution (#35488)
* Use response status code 200 for sync code execution * Format * fix example * fix example * fix example * fix example * fix example recompile * test * test * test * restore * test * restore * Test * Test * Test * Test * Test * restore * fix * restore * restore * use 200 for all * style * fix examples
1 parent fb6e96b commit 5bbb162

15 files changed

+28
-31
lines changed

specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/CodeExecution_Execute_Async_Completed.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
},
1515
"responses": {
16-
"202": {
16+
"200": {
1717
"headers": {
1818
"operation-id": "testExecutionId",
1919
"Operation-Location": "operation-location-uri"

specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/CodeExecution_Execute_Async_Running.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
},
1515
"responses": {
16-
"202": {
16+
"200": {
1717
"headers": {
1818
"operation-id": "testExecutionId",
1919
"Operation-Location": "operation-location-uri"

specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/CodeExecution_Execute_Sync.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
}
1313
},
1414
"responses": {
15-
"202": {
15+
"200": {
1616
"headers": {
1717
"operation-id": "testExecutionId",
1818
"Operation-Location": "operation-location-uri"
1919
},
2020
"body": {
2121
"id": "testExecutionId",
2222
"identifier": "testSessionIdentifier",
23-
"executionType": "Asynchronous",
23+
"executionType": "Synchronous",
2424
"status": "Succeeded",
2525
"result": {
2626
"stdout": "63/n",

specification/app/Microsoft.App.DynamicSessions/examples/2025-02-02-preview/CodeExecution_Execute_Async_Completed.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
},
1515
"responses": {
16-
"202": {
16+
"200": {
1717
"headers": {
1818
"operation-id": "testExecutionId",
1919
"Operation-Location": "operation-location-uri"

specification/app/Microsoft.App.DynamicSessions/examples/2025-02-02-preview/CodeExecution_Execute_Async_Running.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
},
1515
"responses": {
16-
"202": {
16+
"200": {
1717
"headers": {
1818
"operation-id": "testExecutionId",
1919
"Operation-Location": "operation-location-uri"

specification/app/Microsoft.App.DynamicSessions/examples/2025-02-02-preview/CodeExecution_Execute_Sync.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
}
1313
},
1414
"responses": {
15-
"202": {
15+
"200": {
1616
"headers": {
1717
"operation-id": "testExecutionId",
1818
"Operation-Location": "operation-location-uri"
1919
},
2020
"body": {
2121
"id": "testExecutionId",
2222
"identifier": "testSessionIdentifier",
23-
"executionType": "Asynchronous",
23+
"executionType": "Synchronous",
2424
"status": "Succeeded",
2525
"result": {
2626
"stdout": "63/n",

specification/app/Microsoft.App.DynamicSessions/routes.tsp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,20 @@ alias CodeExecutionTraits = BaseOperationTraits &
2525
alias CodeExecutionOperations = Azure.Core.ResourceOperations<CodeExecutionTraits>;
2626

2727
interface CodeExecution {
28-
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "No suitable standard operation found."
2928
@doc("Execute code in a session.")
3029
@route("/executions")
31-
@pollingOperation(CodeExecution.get)
32-
execute is Foundations.Operation<
30+
execute is RpcOperation<
3331
{
34-
...SessionIdentifier;
3532
...ExecutionOperationIdHeader;
3633

3734
@doc("The request to execute code.")
3835
@body
3936
codeExecutionRequest: SessionCodeExecutionRequest;
4037
},
41-
AcceptedResponse &
42-
SessionCodeExecutionResource &
38+
SessionCodeExecutionResource &
4339
ExecutionOperationIdHeader &
44-
Foundations.LongRunningStatusLocation
40+
Foundations.LongRunningStatusLocation,
41+
CodeExecutionTraits
4542
>;
4643

4744
@doc("Get the code execution result.")

specification/app/data-plane/Microsoft.App.DynamicSessions/preview/2024-10-02-preview/DynamicSessions.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@
6161
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
6262
},
6363
{
64-
"$ref": "#/parameters/SessionIdentifier"
64+
"$ref": "#/parameters/ExecutionOperationIdHeader"
6565
},
6666
{
67-
"$ref": "#/parameters/ExecutionOperationIdHeader"
67+
"$ref": "#/parameters/SessionIdentifier"
6868
},
6969
{
7070
"name": "codeExecutionRequest",
@@ -77,8 +77,8 @@
7777
}
7878
],
7979
"responses": {
80-
"202": {
81-
"description": "The request has been accepted for processing, but processing has not yet completed.",
80+
"200": {
81+
"description": "The request has succeeded.",
8282
"schema": {
8383
"$ref": "#/definitions/SessionCodeExecutionResource"
8484
},

specification/app/data-plane/Microsoft.App.DynamicSessions/preview/2024-10-02-preview/examples/CodeExecution_Execute_Async_Completed.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
},
1515
"responses": {
16-
"202": {
16+
"200": {
1717
"headers": {
1818
"operation-id": "testExecutionId",
1919
"Operation-Location": "operation-location-uri"

specification/app/data-plane/Microsoft.App.DynamicSessions/preview/2024-10-02-preview/examples/CodeExecution_Execute_Async_Running.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
},
1515
"responses": {
16-
"202": {
16+
"200": {
1717
"headers": {
1818
"operation-id": "testExecutionId",
1919
"Operation-Location": "operation-location-uri"

0 commit comments

Comments
 (0)