-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding new ACA Session Data Plane APIs #31996
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
Check failure on line 1 in specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/ListSessions_Get.json Azure Pipelines / Swagger PrettierCheckspecification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/ListSessions_Get.json#L1
|
||
"title": "ListSessions_Get", | ||
"operationId": "ListSessions_Get", | ||
"parameters": { | ||
"api-version": "2024-10-02-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"sessions": [ | ||
{ | ||
"identifier": "testid1", | ||
"expireAt": "2025-01-05T22:18:41.752Z" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
Check failure on line 1 in specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/SessionManagement_Delete.json Azure Pipelines / Swagger PrettierCheckspecification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/SessionManagement_Delete.json#L1
|
||
"title": "SessionManagement_Delete", | ||
"operationId": "SessionManagement_Delete", | ||
"parameters": { | ||
"api-version": "2024-10-02-preview", | ||
"identifier": "testSessionIdentifier" | ||
}, | ||
"responses": { | ||
"204": {} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
Check failure on line 1 in specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/SessionManagement_Get.json Azure Pipelines / Swagger PrettierCheckspecification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/SessionManagement_Get.json#L1
|
||
"title": "SessionManagement_Get", | ||
"operationId": "SessionManagement_Get", | ||
"parameters": { | ||
"api-version": "2024-10-02-preview", | ||
"identifier": "testSessionIdentifier" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"createdAt": "2025-01-05T22:18:41.585Z", | ||
"lastAccessedAt": "2025-01-05T22:18:41.585Z", | ||
"expireAt": "2025-01-05T22:18:41.585Z", | ||
"etag": "123456789" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of this, can you add some real etag example value ? |
||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"title": "SessionPoolMetadata_Get", | ||
"operationId": "SessionPoolMetadata_Get", | ||
"parameters": { | ||
"api-version": "2024-10-02-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"runtimes": [ | ||
{ | ||
"name": "node", | ||
"version": "20.2.4" | ||
} | ||
], | ||
"preInstalledPackages": [ | ||
{ | ||
"name": "axios", | ||
"version": "1.21.2" | ||
} | ||
], | ||
"createdAt": "2025-01-05T22:18:41.495Z", | ||
"lastUpdatedAt": "2025-01-05T22:18:41.495Z", | ||
"jupyterKernel": { | ||
"name": "deno", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: IJavaScript |
||
"version": "5.2.1", | ||
"projectUrl": "https://github.com/n-riesco/ijavascript", | ||
"description": "Provides sync and async kernel for javascript code executions" | ||
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import "./common.tsp"; | ||
using Azure.Core; | ||
using TypeSpec.Http; | ||
using TypeSpec.Rest; | ||
|
||
namespace Microsoft.App.DynamicSessions; | ||
|
||
@doc("The session resource.") | ||
model Session { | ||
@doc("The date and time when the session was created.") | ||
createdAt: utcDateTime; | ||
|
||
@doc("The date and time when the session was last accessed.") | ||
lastAccessedAt: utcDateTime; | ||
|
||
@doc("The date and time when the session will expire.") | ||
expireAt: utcDateTime; | ||
|
||
@doc("The ETag of the session, representing the underlying container ID.") | ||
etag: string; | ||
} | ||
|
||
@doc("The sessions list response.") | ||
model SessionsListResponse { | ||
@doc("The list of sessions.") | ||
sessions: SessionsListResponseEntry[]; | ||
} | ||
|
||
@doc("The sessions list response entry.") | ||
model SessionsListResponseEntry { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why it is different from GET ? |
||
@doc("The identifier of the session.") | ||
identifier: string; | ||
|
||
@doc("The date and time when the session will expire.") | ||
expireAt: utcDateTime; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import "./common.tsp"; | ||
using Azure.Core; | ||
using TypeSpec.Http; | ||
using TypeSpec.Rest; | ||
|
||
namespace Microsoft.App.DynamicSessions; | ||
|
||
@doc("SessionPool Metadata.") | ||
model SessionPoolMetadataResponse { | ||
@doc("List of runtimes.") | ||
runtimes: Runtime[]; | ||
|
||
@doc("List of pre-installed packages.") | ||
preInstalledPackages: Package[]; | ||
|
||
@doc("Creation date in RFC3339 format.") | ||
createdAt: utcDateTime; | ||
|
||
@doc("Last updated date in RFC3339 format.") | ||
lastUpdatedAt: utcDateTime; | ||
|
||
@doc("Jupyter kernel information.") | ||
jupyterKernel: JupyterKernel; | ||
} | ||
|
||
@doc("Runtime information.") | ||
model Runtime { | ||
@doc("Name of the runtime.") | ||
name: string; | ||
|
||
@doc("Version of the runtime.") | ||
version: string; | ||
} | ||
|
||
@doc("Package information.") | ||
model Package { | ||
@doc("Name of the package.") | ||
name: string; | ||
|
||
@doc("Version of the package.") | ||
version: string; | ||
} | ||
|
||
@doc("Jupyter kernel information.") | ||
model JupyterKernel { | ||
@doc("Name of the kernel.") | ||
name: string; | ||
|
||
@doc("Version of the kernel.") | ||
version: string; | ||
|
||
@doc("Project URL of the kernel.") | ||
projectUrl: string; | ||
|
||
@doc("Description of the kernel.") | ||
description: string; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,9 @@ import "@azure-tools/typespec-azure-core"; | |
import "./main.tsp"; | ||
import "./models/code-execution.tsp"; | ||
import "./models/code-execution-file.tsp"; | ||
import "./models/session.tsp"; | ||
import "./models/common.tsp"; | ||
import "./models/sessionpool-metadata.tsp"; | ||
|
||
using TypeSpec.Http; | ||
using TypeSpec.Rest; | ||
|
@@ -92,3 +94,35 @@ interface SessionResourceFiles { | |
} | ||
>; | ||
} | ||
|
||
@route("/session") | ||
interface SessionManagement { | ||
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "No suitable standard operation found." | ||
@doc("Get the session.") | ||
@get | ||
get is Foundations.Operation<SessionIdentifier, Session>; | ||
|
||
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "No suitable standard operation found." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't we avoid these suppression as it means they are not following standard pattern ? |
||
@doc("Delete the session.") | ||
@delete | ||
delete is Foundations.Operation< | ||
SessionIdentifier, | ||
TypeSpec.Http.NoContentResponse | ||
>; | ||
} | ||
|
||
@route("/sessions") | ||
interface ListSessions { | ||
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "No suitable standard operation found." | ||
@doc("List the sessions.") | ||
@get | ||
get is Foundations.Operation<{}, SessionsListResponse>; | ||
} | ||
|
||
interface SessionPoolMetadata { | ||
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "No suitable standard operation found." | ||
@doc("Get the metadata information.") | ||
@route("/metadata") | ||
@get | ||
get is Foundations.Operation<{}, SessionPoolMetadataResponse>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why response body don't have other properties like GET resource object ?