Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

View check run for this annotation

Azure Pipelines / Swagger PrettierCheck

specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/ListSessions_Get.json#L1

specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/ListSessions_Get.json(1,1): error : Code style issues found, please run prettier. > npm install > npx prettier --write specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/ListSessions_Get.json
"title": "ListSessions_Get",
"operationId": "ListSessions_Get",
"parameters": {
"api-version": "2024-10-02-preview"
},
"responses": {
"200": {
"body": {
"sessions": [
{
"identifier": "testid1",
Copy link
Member

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 ?

     "body": {
        "createdAt": "2025-01-05T22:18:41.585Z",
        "lastAccessedAt": "2025-01-05T22:18:41.585Z",
        "expireAt": "2025-01-05T22:18:41.585Z",
        "etag": "123456789"
      }
      ```

"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

View check run for this annotation

Azure Pipelines / Swagger PrettierCheck

specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/SessionManagement_Delete.json#L1

specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/SessionManagement_Delete.json(1,1): error : Code style issues found, please run prettier. > npm install > npx prettier --write specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/SessionManagement_Delete.json
"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

View check run for this annotation

Azure Pipelines / Swagger PrettierCheck

specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/SessionManagement_Get.json#L1

specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/SessionManagement_Get.json(1,1): error : Code style issues found, please run prettier. > npm install > npx prettier --write specification/app/Microsoft.App.DynamicSessions/examples/2024-10-02-preview/SessionManagement_Get.json
"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"
Copy link
Member

Choose a reason for hiding this comment

The 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",
Copy link
Member

Choose a reason for hiding this comment

The 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 {
Copy link
Member

Choose a reason for hiding this comment

The 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;
}
34 changes: 34 additions & 0 deletions specification/app/Microsoft.App.DynamicSessions/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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."
Copy link
Member

Choose a reason for hiding this comment

The 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>;
}
Loading
Loading